* Docs : fixes and enhancements for the documentation template.
This is an evolutionary update for the `jsdoc` document generation.
- Added functionality to retrieval of data comments
- Added partial for generating documentation in the method tables.
- Moved commenting to source for `Network#clusterOutliers`. This was used as a case example.
- Adjustment to CSS to get the decription text margins same as original
- Added step to generate documentation to release checklist
- Fixed some commenting which `jsdoc` couldn't handle
* Fixes for linting
* Moved navbar elements in all html documentation files to partial
This consolidates the common menu elements in all documentation files to a partial.
* Moved test-exclamation mark
* Added partial, tested with some pages
* Docs: Moved end block in all html documentation files to partiel
This rcConsolidatersd common footer in all documentation files to a partial.
I'm hoping this serves as an example for others to isolate more common blocks (the menu would be the perfect candidate). It's straightforward work.
* Network: force array order when sorting hierarchical levels
Fixes #340r34.
If coordinates are not available to sort within a hierarchical level, sort to array order instead.
The previous fix on this issue was not good enough to circumvent this quirk in the chromium sorting. This should bury it.
* Added TimSort for sorting in DirectionStrategy
* Added TimSort to LayoutEngine
* Fixed typo
* Add template for document generation with 'jsdoc'.
In essence, it defines the subdirectory `docs` as a `jsdoc` template. Benefits:
- allows the usage of partials, in order to DRY common parts of the html files.
- makes available the jsdoc-comments, for addition into the documentation.
- enables extraction of data from the source code. For example, the list of edge endpoints `['arrow', 'bar', 'circle']` can now be extracted from the source and inserted into the documentation on generation.
In this initial version, the only file that has been changed is `docs/data/dataset.html`.
In here, partials have been added to illustrate how common page elements can be DRY'd.
The template has been set up in such a way, that resource files will be copied and that html files can pass through unchanged if no special template tags (`<?js...?>`) are used. This allows for a gradual transition of the html files to templates.
**Usage:** `gulp docs`
- The result files are placed in subdirectory `gen/docs/`.
**NOTE:** The release procedure will have to be adjusted by adding this gulp command.
The docs-files will then have to be taken from `gen/docs`.
* Edits to docs/README
* Adjusted layout of README.md
* Further edits to README.md
* Removed pre tags again in README.md - don't work in code block
* Linted the gulpfile
* Added proof of concept for docs generation from source
* Move majorLables to 1st week in the month, for 'week' scale
* next() always adds 1 week to current date
* show 1st week in the month as majorLabel
* Add 'week' to auto-scale
* Update week scale example
* Revert "Move majorLables to 1st week in the month, for 'week' scale"
This reverts commit 52df3c3ac5.
* Correct value of week's minimumStep
* Network: DRY code in Label for parsing markup
This gets rid of a major eyesore for me. The accumulator object was identical for HTML and Markdown.
In addition, the parsing has been refactored. Common elements have been DRY'd and the logic of the parsing has been made more comprehensible.
* Added suggestion @mbroad wrt regexp precompile
* Fixed linting
* Adds code coverage report the output of `npm test` and adds detailed html code coverage report using the command `npm run-script test-cov`
* Switch over to using functions in lib/ rather than dist/, so that code coverage stats are complete.
* Import vis at the top level to keep ItemSet passing
* Remove requirement for dist/vis in TimelineItemSet
* Network: preload images in options for all shape types
Fixes#3532
If the images option is set, preload it, even if the node shape is not `image` or `circularImage`.
This needs to be done because the user can switch to an image shape later, as is happening in the issue.
Option `image` is only mandatory for the image shapes.
There is no unit test for this, because it would need a mock object for Image and I didn't succeed in creating/finding one.
* Network: Handle null data gracefully
During testing I discovered that passing `null` for network data leads to a thrown error.
This adds a guard to prevent it, plus unit tests for regression.
Fixes#3532
If the images option is set, preload it, even if the node shape is not `image` or `circularImage`.
This needs to be done because the user can switch to an image shape later, as is happening in the issue.
Option `image` is only mandatory for the image shapes.
There is no unit test for this, because it would need a mock object for Image and I didn't succeed in creating/finding one.
* Use mock canvas object replacing `canvas`
Fixes#3515.
A mock canvas object is added to the unit tests, which makes usage of module `canvas` voluntary.
The issue with `canvas` is that it requires an external dependency to `cairo`. This complicates setting up a develop environment for `vis.js`
- Removed `canvas` from `package.json`
- Added section to README.md with instructions on how to install `canvas` instead.
* Removed debugger statements
* Updates for review
* Fixes for review
* Network: Prevent crash when dataChanged is triggered during initial setting of options
Fixes#3562.
Options `hidden` and `physics` can emit a `_dataChanged` event within `setOptions()`.
If this happens when setting options during the initialization of the `Network` instance, this leads
to an error thrown, because there is no DataSet instance connected yet to the instance.
This bug was introduced in `v4.21.0`. Unit tests have been added for this case.
* Edited comment
Previous condition was too strict: if *any* node for the cluster was already clustered, the clustering would abort.
Current fix scans for already clustered nodes and proceeds with what is left.
* Network: Retain constraint values in label font handling
Fixes#3517.
Due to changed logic in the label font handling, the option values for `widthConstraint` and `heightConstraint` were overwritten.
The fix is in effect a reversal of two code lines: parsing constraint options should come *after* parsing (multi)font options.
Further changes:
- Additional 1-liner fix: constraint values were not copied for edge-instance specific options.
- Small refactoriing of `Label#constrain()` in order to separate concerns
- Added unit test for regression testing of this issue.
This leads to the curious observation that, while the actual change is two lines of source code, this resulted in a +-150 line regression test.
* Made unit test more linear, removed tabs
* Made 'enhanced subset' of unit test
* Removed TODO from comment
* Culled redundant nodes from unit test
Some browsers cannot handle very large DIVs so by default range DIVs
can be truncated outside the visible area. This change allows the use
of a new `limitSize` item option which disables this functionality,
allowing the creation of full-width DIVs.
I don’t see an existing test spec that covers RageItem.js so I’m
submitting without tests. However we’ve using Timeline in production on
a fairly large project with these changes in place for several months
and it works fine.
* Fixing a bug with the call to `repositionX`. The `items` collection is an object, not an array, so it cannot be iterated over using a normal for loop. Not repositioning the items causes the vertical stacking to jump around sporatically while scrolling.
* Update Group.js
* Network: Add extra check on null value during label handling
This fixes an oversight in #3486. Unit tests added, not only for null labels, but for all weird label values I could thing of.
* Enhanced unit tests, adjusted label check
* - Added support for vertical scrolling while the timeline is focusing on an element, both for animated and non-animated calls of focus
* - Adjusted item offset calculations to use the item parent
- Turned on animation for the focus in the example
- Updated function documentation
* - Fixing lint issues
* - Added documentation for the new 'frameCallback' parameter of 'setRange'
- Fixed the documentation on 'setRange' for the 'callback' parameter
- Fixed code not meeting style guidelines
* - Updated the example for "setSelection" to be more clear about what the example buttons do. Focus the language to be more consistent with that fact that the demo uses "setSelection"
* - Added support for stacking items within individual subgroups while subgroupStack is on
* - Adjusted location of visibility check to cover subgroup stacking
* - Fixing linting issues
* - Updated subgroup stacking to optionally take a 'subgroupStack' parameter of "true", which enables stacking in all subgroups
- Fixed code to meet style guidelines
- Updated documentation
* Small refactoring in Label._drawBackground()
* Added size calculation to Label, basic framework for detecting click on label.
* First fully working version of label click.
* Put in extra checks, refactored visibility of labels for more general usage.
* Final fixes to code; added to example and in docs
* Adressed review comments
* Add next attempt to fix Travis unit test bug
* Addressed review issues
* Network: Adjust documentation for arrows.middle.scaleFactor
Addendum to #3474.
Updated the documentation, so that users can know about flipping the middle arrow with a negative scale factor.
* Adjusted text for review
Fixes#3483.
If `shape: 'image'` is defined as option, this was used for initializing hidden cluster nodes during layout initialization.
However, because no image is being passed, this led to an exception.
This fix prevens shape `image` from being used for hidden cluster nodes. In addition, some extra fields for these nodes are
now overridden for some performance improvament.
* The next fix on Travis unit test failure
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
* Preliminary refactoring in utils.js
* Added unit tests for extend routines, commenting and small fixes
* More unit tests for extend routines
* - Completed unit tests for extend routines in
- Small fixes and cleanup in `util.js`
- Removed `util.protoExtend()`, not used anywhere
* Added unit tests for known font options
* Interim save before trying out another proto chain strategy
* Fixed problem in first example #3408
* Removed silly file that shouldn't be there
* Added unit test for multi-fonts
* Comment edits
* Verufy unit tests, small adjustments for groups
* Further work on getting unit tests to work. PARTS NEED TO BE CLEANED UP!
* Further tweaks to get unit tests working
* All unit tests passing
* Fixes due to linting
* Small edits
* Removed prototype handling from font pile
* Fixes during testing examples of #3408
* Added unit test for edge labels, small fixes
* Added unit tests for shorthand string fonts; some tests still failing
* All unit tests pass
* Removed Label.parseOptions()
* Completed shorthand font tests, code cleanup, fixed choosify for edges
* Addressed review comments
* Addressed review comments, cleanup