* Network: Fixes sorting on Layout sorting, refactoring.
Fix for #3403
Chromium has divergent behaviour on sorting of `undefined` values, a check has been added for these.
The fix itself is small, it adds a check on `undefined` in the sorting function(s).
In addition:
- Fixed off-by-one error on tree index
- Refactored away checks on visibility by replacing `_isVisible()` with a Strategy pattern for direction
The latter removes a long-standing eyesore in `LayoutManager`; it's probably also faster.
There is some hope that these fixes will improve the hierarchical layout initialization, which has had
problems for quite a while.
* reformat code block
* Add next attempt to fix Travis unit test bug
* Fix unit test - timeout
* Adjustments for comment reviews
* Moved direction strategies to separate module; added fix for 'window is undefined'
This is the next escalation on the war against the Travis unit tests failing (which came into being by yours truly).
By accident, I could recreate the unit test failure on my development machine. This led to a more directed effort to
squash the bug.
The insight here is that test `(window === undefined)` fails, but `(typeof window === 'undefined`)` succeeds. This undoubtedly has to do with the special status `window` has as a global object.
Changes:
- Added check on presence of `window` in `Canvas._requestNextFrame()`, fixed local source errors.
- Added catch clause in `CanvasRendered._determinePixelRatio()`
- small fix: raised timeout for the network `worldCup2014` unit test
* Moved endpoint-specific code to module EndPoints
* Further decomposed functionality for endpoints
* Added commenting, notably for typedef's
* Add next attempt at fixing travis bug
* Added default sizes for nodes without labels
* Next attempt at fixing travis problem
* Fix on calculation of multifont labels - the height was calculated too large.
* added hexagon shape to the node.
* Updated function for hexagon shape.js
* Modifid the shape login for hexagon
* Remove this.translate from the Shape.js for hexagon
* updated hexagon draw logic
* Fixed code review comments and update the branch
* Updated changes in test.js
* Corrects usage of @static jsdoc annotation
* Correct unresolvable types
* Correct types in jsdoc and remove extraneous @class & @constructor jsdoc
* Remove incorrect @static jsdoc
* Adds missing jsdoc for param copyFromGlobals
* correct jsdoc in util
* Corrects casing on jsdocs
* Swaps @inheritDoc to @ignore for constructors where constructor args are documented in the class
* Instantiates Errors with `new`
* Addresses improperly defined @callback tags.
* Split callbacks out to separate jsdoc
* Moves constructor jsdocs back to constructor and drop @ignore.
* First fix for opening clusters, added unit tests
* Added opening of child cluster to parent cluster
* Added more tests for multi-level clusters
* Commenting fixes
* Added unit tests for option allowSingleNodeCluster, fixes due to that
* Added test for allowSingleNodeCluster with nested clusters
* Fixes due to linting
* Removed TODO from code
A recurring problem during travis tests is that global variable `window` can get reset while `Network` tests using a mock canvas object are running.
This issue has been adressed several times, but it still happens. This PR reduces the possibility of it happening again to a minimum.
PR's affected by this issue should be merged with this fix and re-submitted. At time of writing, these are:
- #3402
- #3405
- #3399
Chances are it will occur sporadically for other PR's as well.
Labelling this `High Priority` because it indrectly affects unrelated PR's.
Fix for #3367
Changes:
- Clustered nodes with shared connections are added to the same cluster
- joinCondition value `null` handled as `undefined`
- Fixed bug on adding clusters if joinCondition present and returns true
Unit tests have been added to `Network.test.js` for these changes.
* Added commenting for options, refactored choosify()
* Refactored updateLabelModule()
* added comment at node creation
* Completed fix for #3350
* parseOptions() different handling for bridged/extended; unit tests for reversal of options
* Fixes on linting and unit testing
* Enables require MethodDefinition for require-jsdoc lint rule and corrects 66% of missing Method Definitions
* Adds jsdoc for all remaining methods and corrects @class/@constructor documentation
* Define values more accurately
* Correct bugs that prevent jsdoc generation
* Add support for edge style
* Update for TODO: support of solid/dotted/dashed edges (attr = 'style')
* Edge styles are defined as var edgeStyles in parseAttributeList().
* Add example for edge styles
Add an editable example for playing DOT edge styles
* Correct typo and remove TODO description
* Correct typo of filename from 'dotEdgeSytles.html' to
'dotEdgeStyles.html'.
* Remove TODO description of the issue for edge style
* Enable unit testing for module Network
Adds mocks for certain components, in order to let module `Network` be run in unit tests.
Changes:
- Create a mock object for `hammer.js` when running browserless. The inspiration is taken from [here](https://github.com/uber/deck.gl/pull/658)
- Create a mock function for `window.requestAnimationFrame()` when running browserless in `network/modules/CanvasRenderer.js`
- Added unit test for `Network` to show that unit testing for it now works
- Fixed naming of container in `test/Graph3d.test.js`
Since `hammer.js` is also used in other modules, this fix is potentially an enabler for full-module unit tests for those as well.
* Cleanup unit test Network
* Fix for unit test
* Added example networks to unit test
* Fix error in loading disassemblerExample
* Network unit test final fixes
* Adjusted comments
* Fix sorting of nestedgroups when groups added after initial groups setting
* Fix nesteded groups logic when adding and removing
* Remove empty lines
* Fix comments from PR
* Remove spaces from empty line
* Fix PR review comments
* fixes showMajorLabel issue in #3246https://github.com/almende/vis/issues/3246
* fix at TimeStep level, for weekly mode, when showMajorLabels == false
* pass options in TimeStep construction
* Fixes Issue #3316 - Updates network documentation to account for edge-case of how clusterByConnection uses the joinCondition callback
* Move the text 'clusterByConnection will pass ... callback.' to under 'Optional for all but the cluster method'.
Make it clear that clusterByConnection is the only one that uses the second call.
Instead of bold, make it a distinct paragraph.
* First working version of updating clustered edge
* Added fix for #1315 as well
* Enable unit testing for module Network
Adds mocks for certain components, in order to let module `Network` be run in unit tests.
Changes:
- Create a mock object for `hammer.js` when running browserless. The inspiration is taken from [here](https://github.com/uber/deck.gl/pull/658)
- Create a mock function for `window.requestAnimationFrame()` when running browserless in `network/modules/CanvasRenderer.js`
- Added unit test for `Network` to show that unit testing for it now works
- Fixed naming of container in `test/Graph3d.test.js`
Since `hammer.js` is also used in other modules, this fix is potentially an enabler for full-module unit tests for those as well.
* Cleanup unit test Network
* Added unit test for fix issue #1218
* Adding test for #1315 - Interim save
* Completed unit test and fixes for #1315
* Added fixes for #1291
* Added unit test for #1219
* Added header comment for Clustering.js, small fixes
* Fix for unit test
* Added example networks to unit test
* Fix error in loading disassemblerExample
* Network unit test final fixes
* Fixes for linting
* Fixed essential typo
* Fixed linting error
* Fixed unit test
* Fixed unit test again
* Enable linting for Travis
Since all code has been linted (thanks **TODO**!), it is now safe to enable linting for Travis.
Some cleanup actions have been performed; notably the additional `gulp` tasks for modules has
been removed. Since all code has been fixed for linting, these are not useful any more.
* Force linting error to check travis working
* Travis works! Remove forced linting error
* Makes network eslint compliant
Unused variables in private functions, who were never called internally with those arguments were removed.
lint rule was disabled for public functions, and in private functions which were called internally with those unused arguments
* Disables linting for unused args passed into DataSet and DataView
* Levels of direct hierarchical network only incremented
* Cleaned up old code
* Quick fix on presence globaOptions in mergeOptions()
* Revert fix, doesn't work
* Network: Block recalculation of level in LayoutEngine._determineLevelsDirected()
Fix for #2311.
Nodes with bidirectional edges got their levels shifted due to the handling of both edge directions.
This fix adds a check on bidirectionality and blocks any subsequent level adjustment.
Pure tree layouts are unaffected by this change.