This repository has been archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add option definitions and validation to Graph3d #3099
Merged
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0a33741
Proof of concept with copied options + handling from network
wimrijnders e07d68f
Added unit test for Graph3d, for checking default syntax; completed d…
wimrijnders 95ef79b
Fixes for options in playground example
wimrijnders 8df2388
Added onclick options to graph3d documentation
wimrijnders 80a3a09
Fixes in graph3d examples
wimrijnders 6aa3492
Final fixes for option definitions in Graph3d
wimrijnders 24bef83
Merge branch 'develop' into optionsGraph3d
wimrijnders 49c4476
Fixed handling of 'undefined' in options, enhanced graph3d unit test
wimrijnders cd1c203
Disabled console output in graph3d unit test
wimrijnders 1c33c15
merge with develop, fix conflict
wimrijnders 59a045a
Merge branch 'develop' into optionsGraph3d
wimrijnders be90cea
Merge branch 'develop' into optionsGraph3d
wimrijnders 3de1985
Merge branch 'develop' into optionsGraph3d
wimrijnders 7b8489b
Fix conflicts
wimrijnders ef2b339
Upgrade webpack module
wimrijnders cc22771
Merge branch 'optionsGraph3d' of github.com:wimrijnders/vis into opti…
wimrijnders 39639d2
Fixed conflicts
wimrijnders 830c199
Merge branch 'develop' into optionsGraph3d
yotamberk 46286ed
Merge branch 'develop' into optionsGraph3d
wimrijnders fe0b276
Merge branch 'develop' into optionsGraph3d
yotamberk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/** | ||
* This object contains all possible options. It will check if the types are correct, if required if the option is one | ||
* of the allowed values. | ||
* | ||
* __any__ means that the name of the property does not matter. | ||
* __type__ is a required field for all objects and contains the allowed types of all objects | ||
*/ | ||
let string = 'string'; | ||
let bool = 'boolean'; | ||
let number = 'number'; | ||
let object = 'object'; // should only be in a __type__ property | ||
// Following not used here, but useful for reference | ||
//let array = 'array'; | ||
//let dom = 'dom'; | ||
//let any = 'any'; | ||
|
||
|
||
let colorOptions = { | ||
fill : { string }, | ||
stroke : { string }, | ||
strokeWidth: { number }, | ||
__type__ : { string, object, 'undefined': 'undefined' } | ||
}; | ||
|
||
|
||
/** | ||
* Order attempted to be alphabetical. | ||
* - x/y/z-prefixes ignored in sorting | ||
* - __type__ always at end | ||
* - globals at end | ||
*/ | ||
let allOptions = { | ||
animationAutoStart: { boolean: bool, 'undefined': 'undefined' }, | ||
animationInterval : { number }, | ||
animationPreload : { boolean: bool }, | ||
axisColor : { string }, | ||
backgroundColor : colorOptions, | ||
xBarWidth : { number, 'undefined': 'undefined' }, | ||
yBarWidth : { number, 'undefined': 'undefined' }, | ||
cameraPosition : { | ||
distance : { number }, | ||
horizontal: { number }, | ||
vertical : { number }, | ||
__type__ : { object } | ||
}, | ||
xCenter : { string }, | ||
yCenter : { string }, | ||
dataColor : colorOptions, | ||
dotSizeMinFraction: { number }, | ||
dotSizeMaxFraction: { number }, | ||
dotSizeRatio : { number }, | ||
filterLabel : { string }, | ||
gridColor : { string }, | ||
onclick : { 'function': 'function' }, | ||
keepAspectRatio : { boolean: bool }, | ||
xLabel : { string }, | ||
yLabel : { string }, | ||
zLabel : { string }, | ||
legendLabel : { string }, | ||
xMin : { number, 'undefined': 'undefined' }, | ||
yMin : { number, 'undefined': 'undefined' }, | ||
zMin : { number, 'undefined': 'undefined' }, | ||
xMax : { number, 'undefined': 'undefined' }, | ||
yMax : { number, 'undefined': 'undefined' }, | ||
zMax : { number, 'undefined': 'undefined' }, | ||
showAnimationControls: { boolean: bool, 'undefined': 'undefined' }, | ||
showGrid : { boolean: bool }, | ||
showLegend : { boolean: bool, 'undefined': 'undefined' }, | ||
showPerspective : { boolean: bool }, | ||
showShadow : { boolean: bool }, | ||
showXAxis : { boolean: bool }, | ||
showYAxis : { boolean: bool }, | ||
showZAxis : { boolean: bool }, | ||
xStep : { number, 'undefined': 'undefined' }, | ||
yStep : { number, 'undefined': 'undefined' }, | ||
zStep : { number, 'undefined': 'undefined' }, | ||
style: { | ||
number, // TODO: either Graph3d.DEFAULT has string, or number allowed in documentation | ||
string: [ | ||
'bar', | ||
'bar-color', | ||
'bar-size', | ||
'dot', | ||
'dot-line', | ||
'dot-color', | ||
'dot-size', | ||
'line', | ||
'grid', | ||
'surface' | ||
] | ||
}, | ||
tooltip : { boolean: bool, 'function': 'function' }, | ||
tooltipStyle : { | ||
content: { | ||
color : { string }, | ||
background : { string }, | ||
border : { string }, | ||
borderRadius: { string }, | ||
boxShadow : { string }, | ||
padding : { string }, | ||
__type__ : { object } | ||
}, | ||
line: { | ||
borderLeft: { string }, | ||
height : { string }, | ||
width : { string }, | ||
__type__ : { object } | ||
}, | ||
dot: { | ||
border : { string }, | ||
borderRadius: { string }, | ||
height : { string }, | ||
width : { string }, | ||
__type__ : { object}, | ||
}, | ||
__type__: { object} | ||
}, | ||
xValueLabel : { 'function': 'function' }, | ||
yValueLabel : { 'function': 'function' }, | ||
zValueLabel : { 'function': 'function' }, | ||
valueMax : { number, 'undefined': 'undefined' }, | ||
valueMin : { number, 'undefined': 'undefined' }, | ||
verticalRatio : { number }, | ||
|
||
//globals : | ||
height: { string }, | ||
width: { string }, | ||
__type__: { object } | ||
}; | ||
|
||
|
||
export {allOptions}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you want this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for now.
console
is used in the running code to output warning messages.But this is from a practical viewpoint. I would be happiest if as many checks as possible are enabled for
eslint
. It's just thatconsole
is used a bit too often to casually fix this.