* 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.
* Proof of concept with copied options + handling from network
* Added unit test for Graph3d, for checking default syntax; completed def's of all options, autoByDefault not handled yet.
* Fixes for options in playground example
* Added onclick options to graph3d documentation
* Fixes in graph3d examples
* Final fixes for option definitions in Graph3d
* Fixed handling of 'undefined' in options, enhanced graph3d unit test
* Disabled console output in graph3d unit test
* Upgrade webpack module
* Graph3D: move Filter into DataGroup
The `Filter` instance within `Graph3d` is intimately connected to the graph data,
contained in a `DataGroup` instance. As such, it needs to be placed within `DataGroup`.
A consequence of this is that, in the final case of multiple graphs, each graph can be
animation separately. I regard this as an advantage, even though it will means more
initialization for the graphs (you have to initialize each separately for an animation.
An effort has been made to decouple `Graph3d` and `Filter` as much as possible. There
are still some relationships present, but it's more bother than it's worth to dissolve these.
In addition to moving the `Filter` instance, the following has been done:
- Added variable `style` to `DataGroup`
- Moved certain data-specific methods from `Graph3d` to `DataGroup`
- cleaned up some code and commenting
These changes have been tested with the following examples:
- `graph3d/10_styling`
- `graph3d/03_filter_data`
- `graph3d/04_animation`
* Add changes to filter
* Code cleanup, for better understanding
* Further refactoring; text processing to blocks in separate method
* Added unit test for labels - tests standard text and html tags
* Labels added unit tests for markdown
* Further refactoring; made multi and regular handling more congruent
* Interim save, not there yet
* Unit tests done, first working version
* Added test case with two big words
* Code cleanup
* Break up huge words into lines.
* Restore unrelated code change
* Update hierarchy when node level changes
Fix for #3220
On change of data of an existing node, the level is checked for changes.
If changed, for a recalculation of the hierarchical layout.
The fix does not explicitly check for hierarchical layout; this should not be a problem.
The added code can be used to add further node fields which may trigger recalculation of layout.
* Changes due to review
* First interim commit
* Fixes during testing
* Allow multiple edges to be hidden by a clustered edge.
Fix for #3245.
This fix adjusts the clustering edges so that theyi can refer to multiple edges instead of just one.
This API method is now insufficient, since multiple base edges can be returned.
- Added replacing method `clustering.getBaseEdges()`
- Adjusted example `changingClusteredEdgeNodes` for the new method. This is the *only* place where `getBaseEdge()` was used
- Adjusted documentation for new method and deprecation old method.
Method `getbaseEdge()` should now be considered `deprecated`, and in due time should be removed.
* Edits of method name in example
* Edits of method name in example
* adjusted deprecation method getBaseEdge() in docs
* Adjusted deprecation method for getBaseEdge() in docs
Fix for #1222.
This makes the passed data of events `hoverNode`, `hoverEdge`, `blurNode` and `blurEdge`
more conformant to the passed data of the click events. In particular, the following
fields are added to the event data:
```
event: [Object] original hover event,
pointer: {
DOM: {x:pointer_x, y:pointer_y},
canvas: {x:canvas_x, y:canvas_y}
}
```
The changes can be tested with example `network/events/InteractionEvents`.
* Added unit test for Validator, minimum viable version.
* Added test-console to package list
* Completed minimum viable unit test for Validator
* Added Validator unit test for explicit 'undefined'
* Add unit tests for Graph3D issue
This adds a unit test for PR #3255 which fixes#3251.
The unit test will fail without the PR merged.
**NOTE:** This also adds module `canvas`, required for the unit test. This module
proved to be quite fickly to install properly. During reviewing, please pay special
attention to the proper installation of this modul. I.e. do following to test:
```
> npm install # If no errors, continue
> npm test /tests/Graph3D.test.js # Run unit test isolated
```
* Fix for travis-cl
* Add giflib to travis test definition
* Add libgif to travis test definition - take 2
* Proper setup and teardown for jsdom-global
* Minor fixes and cleanup
Fix for #3164
- `network.clustering.cluster()` now handles all nodes, not just the visible ones
- Changing ivisibility of nodes now explicitly takes clustering into account, see `Network._updateVisibleIndices()`
- `network.clustering` does not change `hidden` status any more.
The important part of this PR is the realization that 'hidden' and 'clustered' are two distinct things and should be handled separately.
In particular, clustering should **not** change the `hidden` state in any way.
**Note:** This is a small fix and should be easy to review.
Second fix for #3251.
In method `DataGroup.initializeData()`, if the passed `rawData` is bad for some reason,
it was possible to lose the subscriptions due to early return from the method.
This fix changes the order in the method so that the guard clauses execute *before* the
subscription is changed.
**Note: ** This is a simple fix and should be easy to review.
Fix for #2579
- Adjusted node title definition in `options.js` to allow DOM elements
- Changed `BridgeObject()` in `util.js` so that DOM elements are *not* bridged.
Fix typo in #3262, ending `*/` of a block comment was missing.
Also disabled new item `no-useless-escape` for linting, because this triggers a bit too often for comfort.
* Bidirectional scrolling.
Make horizontalScroll and verticalScroll work together.
* Fix delta variable declaration
Using ?: operator
* Remove notice about vertical and horizontal scroll conflict
There is no sense considering #3162
Fix for #2856
- Toolbar gets reshown when cancelling edit node dialog
- No shadow displayed upon save in edit node dialog
The latter is actually a more general problem. Function `mergeOptions` in `util.js`
made an assumption as to the correct value of field `enabled`. It now takes the value
from `globalOptions`, if present.
* First working version of eslint enabled with gulp
* Tryout of eslint with graph3d files
* Cleanup of gulp and eslint files.
* Completed test by linting graph3d
* Disable travis linting for now
* Remove global cmd param from .travis.yml
* Fix missing reference to Graph3D instance in DataGroup
Fix for #3251
A reference was missed in DataGroup.reload() during refactoring.
Rather than fix this method, it has been removed and the logic moved to `Graph3d`.
This makes for somewhat cleaner code.
* Fixes due to review
* Add C++11 and canvas module for travis tests
* Added libgif, updated version gulp-clean-css
* Update version webpack
* Force versions minimatch, graceful-fs; fixes for upgraded webpack
* Force version minimatch through travis.yml
* Fix comma's in json
* Add extraneous modules to package.json; final attempt at forcing versions of minimatch and graceful-fs
* Final changes module versions
* Fix due to linting
* Fix typo in package.json
* Upgrade eslint
* Fix redraw order
* Fix error when option is not defined
* Allow template labels
* Add .travis.yml file
* Add experiment travis code
* Fix react example
* created a checklist for the release process
* unchecked everything
* added make github release
* Fix colliding subgroups when having same end-start times
* Remove npm-debug logs
* Fix redraw order
* Fix error when option is not defined
* Allow template labels
* Add .travis.yml file
* Add experiment travis code
* Fix react example
* created a checklist for the release process
* unchecked everything
* added make github release
* Remove npm-debug logs
* Fix setOptions restack when setting stack
* Remove extra line
* Fix comments from review
* Set dimensions properly of images on initialization.
Fix for #3203
Image nodes were assigned the default size on initialization, leading to very compressed images.
This fix adjusts the default size as soon as the images used have been loaded.
The approach for dealing with this has been adapted from `CircularImage`.
* Fixed tabs
The returned node id's were exactly the wrong way around;
'to' returned the parents, 'from' returned the children.
This fix swaps the tests for determining which to return.
Code in the `_line()` of the sibling Bezier edge types was either extremely similar or identical.
The Bezier drawing code has been consolidated in a single method in the parent class.
This method is needlessly complicated. Code has been adjusted to better show the intent.
In addition:
- reuse of variables already present, notably `dx` and `dy`
- put recurring code fragments into local variables
- removed second conditions in constructs of the form `if (condition) ... else if (!conditioni) ...`
The refactoring can be taken further, but it would change the conditional flow, which would complicate reviewing.
The current changes highlight the similarities between the code blocks.
* Consolidate code for determining the pixel ratio
* - Removed local param 'pixerRatio' from CanvasRenderer. Now only canvas.pixelRatio is used.
- consolidated ctx.transform() calls in Canvas
- Added/edited commenting (also TODO's)
- Added Canvas.getContext()
Fix for #3036
Option `smooth.type: dynamic` is not allowed for hierarchical layouts.
This was handled properly for the main options, but not for the node-specific options.
Options within node instances arei now checked for `smooth.type: dynamic` and replaced
by `horizontal` or `vertical`. The implementation adds listener `_adjustEdgesForHierarchicalLayout`
in `LayoutHandler`. This listener must be activated every time noder- specific options might change.
This happens in the logical places within `EdgeHandler`.
* Protect Network from zero and negative mass values
Fix for #3133
Option-field 'node.mass` must be >= 0.
Checks have been added at the nodes level, for both nodes-global and nodes specific options.
In addition, an internal check has been added for `NodeHandler.defaultOptions`.
The documentation has been adjusted for this change.
* Fix whitespace