From 901442a98fb0a3fec326f87cd6b665c9a138c9c4 Mon Sep 17 00:00:00 2001 From: Tomina Date: Sat, 12 Sep 2020 21:19:10 +0200 Subject: [PATCH] style: use shared ESLint config (#1042) * style: use shared ESLint config * docs: fix HTML errors * style: reformat * style: manual fixes Co-authored-by: Vis Bot --- .circleci/config.yml | 1 + .eslintignore | 23 +- .eslintrc.js | 119 +- .prettierignore | 1 + .releaserc.yml | 8 +- CODE-OF-CONDUCT.md | 22 +- CONTRIBUTING.md | 17 +- HISTORY.md | 121 +- README.md | 99 +- babel.config.js | 2 +- cypress/fixtures/example.json | 2 +- cypress/integration/functional/clicks.spec.ts | 24 +- .../directed-hierarchical-layout.spec.ts | 68 +- cypress/integration/functional/drags.spec.ts | 64 +- .../functional/manipulation.spec.ts | 13 +- .../integration/functional/pollution.spec.ts | 2 +- cypress/integration/helpers/common.ts | 2 +- cypress/integration/helpers/trees.ts | 6 +- .../visual/label-rendering.spec.ts | 36 +- .../integration/visual/node-shapes.spec.ts | 16 +- cypress/pages/events-target.html | 2 +- cypress/pages/pollution-detector.ts | 15 +- cypress/pages/pollution.html | 16 +- cypress/pages/standard-cytest-script.ts | 16 +- cypress/pages/universal.html | 5 +- cypress/support/commands/types.ts | 2 +- cypress/support/commands/vis-check-ids.ts | 4 +- .../commands/vis-click-betweek-points.ts | 2 - cypress/support/commands/vis-click-edge.ts | 2 - cypress/support/commands/vis-click-node.ts | 2 - cypress/support/commands/vis-click-point.ts | 2 - cypress/support/commands/vis-connect-nodes.ts | 8 +- .../support/commands/vis-delete-selected.ts | 2 - cypress/support/commands/vis-drag.ts | 8 +- cypress/support/commands/vis-edit-selected.ts | 2 - cypress/support/commands/vis-place-node.ts | 2 - .../support/commands/vis-run-with-window.ts | 4 +- cypress/support/commands/vis-run.ts | 4 +- .../commands/vis-simple-canvas-snapshot.ts | 2 - .../commands/vis-snapshot-opened-page.ts | 2 - .../support/commands/vis-stabilize-and-fit.ts | 10 +- .../commands/vis-stabilize-fit-and-run.ts | 6 +- .../support/commands/vis-visit-universal.ts | 8 +- .../plugins/cypress-visual-regression.ts | 1 - docs-kr/index.html | 19 +- docs-kr/network/configure.html | 322 +- docs-kr/network/edges.html | 1855 +- docs-kr/network/groups.html | 294 +- docs-kr/network/index.html | 3711 +- docs-kr/network/interaction.html | 450 +- docs-kr/network/layout.html | 468 +- docs-kr/network/manipulation.html | 405 +- docs-kr/network/nodes.html | 1936 +- docs-kr/network/physics.html | 731 +- docs/index.html | 19 +- docs/network/configure.html | 335 +- docs/network/edges.html | 1951 +- docs/network/groups.html | 306 +- docs/network/index.html | 3866 +- docs/network/interaction.html | 458 +- docs/network/layout.html | 482 +- docs/network/manipulation.html | 425 +- docs/network/nodes.html | 2128 +- docs/network/physics.html | 795 +- examples/network/basicUsage.html | 104 +- examples/network/basic_usage/esnext.html | 12 +- examples/network/basic_usage/legacy.html | 14 +- examples/network/basic_usage/peer.html | 14 +- examples/network/basic_usage/standalone.html | 14 +- examples/network/data/datasets.html | 209 +- .../data/dotLanguage/dotEdgeStyles.html | 480 +- .../network/data/dotLanguage/dotLanguage.html | 31 +- .../data/dotLanguage/dotPlayground.html | 422 +- examples/network/data/dynamicData.html | 435 +- examples/network/data/dynamicFiltering.html | 356 +- examples/network/data/importingFromGephi.html | 356 +- examples/network/data/scalingCustom.html | 156 +- examples/network/data/scalingNodesEdges.html | 144 +- .../network/data/scalingNodesEdgesLabels.html | 156 +- examples/network/datasources/WorldCup2014.js | 25953 +++-- .../network/datasources/WorldCup2014.json | 91495 +++++++++++++++- .../datasources/largeHierarchicalDataset.js | 701 +- .../network/edgeStyles/arrowAlignment.html | 37 +- examples/network/edgeStyles/arrowTypes.html | 154 +- examples/network/edgeStyles/arrows.html | 109 +- examples/network/edgeStyles/background.html | 122 +- examples/network/edgeStyles/colors.html | 142 +- examples/network/edgeStyles/dashes.html | 106 +- .../network/edgeStyles/endPointOffsets.html | 39 +- .../network/edgeStyles/imageArrowHeads.html | 14 +- .../network/edgeStyles/selfReference.html | 265 +- examples/network/edgeStyles/smooth.html | 141 +- .../network/edgeStyles/smoothWorldCup.html | 176 +- .../network/events/interactionEvents.html | 251 +- examples/network/events/physicsEvents.html | 129 +- examples/network/events/renderEvents.html | 183 +- .../disassemblerExample.html | 47 +- .../disassemblerExample.js | 213 +- .../exampleApplications/lesMiserables.html | 761 +- .../exampleApplications/loadingBar.html | 990 +- .../neighbourhoodHighlight.html | 310 +- .../exampleApplications/nodeLegend.html | 446 +- .../worldCupPerformance.html | 165 +- examples/network/exampleUtil.js | 44 +- .../network/imageSelected/imageSelected.html | 150 +- examples/network/labels/labelAlignment.html | 132 +- examples/network/labels/labelBackground.html | 111 +- .../network/labels/labelColorAndSize.html | 122 +- examples/network/labels/labelMargins.html | 127 +- examples/network/labels/labelMultifont.html | 278 +- examples/network/labels/labelStroke.html | 116 +- examples/network/labels/multilineText.html | 105 +- .../network/layout/hierarchicalLayout.html | 179 +- .../hierarchicalLayoutBigUserDefined.html | 70 +- .../hierarchicalLayoutDynamicChanges.html | 20 +- .../layout/hierarchicalLayoutMethods.html | 18 +- .../hierarchicalLayoutOverlapAvoidance.html | 20 +- .../layout/hierarchicalLayoutUserdefined.html | 252 +- .../hierarchicalLayoutWithoutPhysics.html | 146 +- examples/network/layout/randomSeed.html | 114 +- examples/network/nodeStyles/HTMLInNodes.html | 129 +- .../network/nodeStyles/circularImages.html | 198 +- examples/network/nodeStyles/colors.html | 138 +- examples/network/nodeStyles/customGroups.html | 232 +- examples/network/nodeStyles/groups.html | 206 +- examples/network/nodeStyles/icons.html | 102 +- examples/network/nodeStyles/images.html | 196 +- .../network/nodeStyles/imagesWithBorders.html | 204 +- .../imagesWithBordersAndPadding.html | 254 +- .../imagesWithCoordinateOrigin.html | 227 +- .../network/nodeStyles/imagesWithOpacity.html | 222 +- .../network/nodeStyles/overwriteGroups.html | 18 +- examples/network/nodeStyles/shadows.html | 206 +- examples/network/nodeStyles/shapes.html | 463 +- .../nodeStyles/shapesWithDashedBorders.html | 204 +- examples/network/nodeStyles/widthHeight.html | 326 +- examples/network/other/animationShowcase.html | 568 +- .../other/changingClusteredEdgesNodes.html | 203 +- examples/network/other/chosen.html | 1654 +- examples/network/other/clustering.html | 279 +- examples/network/other/clusteringByZoom.html | 270 +- .../network/other/clustersOfclusters.html | 116 +- examples/network/other/configuration.html | 157 +- examples/network/other/cursorChange.html | 270 +- examples/network/other/manipulation.html | 409 +- .../other/manipulationEditEdgeNoDrag.html | 488 +- examples/network/other/navigation.html | 272 +- examples/network/other/onLoadAnimation.html | 171 +- examples/network/other/performance.html | 164 +- examples/network/other/saveAndLoad.html | 383 +- .../network/physics/physicsConfiguration.html | 152 +- examples/network/physics/wind.html | 106 +- examples/network/tests/hidden_edge_test.html | 190 +- .../manipulationEditEdgeNoDrag.html | 20 +- examples/network/version_migration/index.html | 44 +- index.html | 4 +- launch.json | 40 +- package-lock.json | 585 +- package.json | 30 +- renovate.json | 4 +- rollup.build.js | 4 +- rollup.config.js | 208 +- test/Configurator.test.js | 123 +- test/Label.test.js | 2682 +- test/Network.test.js | 2173 +- test/NodesHandler.test.ts | 130 +- test/canvas-mock.js | 108 +- test/configure-options.test.ts | 4 +- .../data/cellular_automata.dot-to-graph.json | 460 +- .../data/cellular_automata.parse-dot.json | 462 +- .../data/computer_network.dot-to-graph.json | 330 +- .../data/computer_network.parse-dot.json | 320 +- test/dot-parser/data/fsm.dot-to-graph.json | 270 +- test/dot-parser/data/fsm.parse-dot.json | 350 +- test/dot-parser/data/hello.dot-to-graph.json | 38 +- test/dot-parser/data/hello.parse-dot.json | 38 +- .../dot-parser/data/process.dot-to-graph.json | 196 +- test/dot-parser/data/process.parse-dot.json | 230 +- .../data/siblings.dot-to-graph.json | 8054 +- test/dot-parser/data/siblings.parse-dot.json | 7026 +- test/dot-parser/data/simple.dot-to-graph.json | 340 +- test/dot-parser/data/simple.parse-dot.json | 322 +- .../data/softmaint.dot-to-graph.json | 6738 +- test/dot-parser/data/softmaint.parse-dot.json | 7060 +- .../data/traffic_lights.dot-to-graph.json | 344 +- .../data/traffic_lights.parse-dot.json | 412 +- .../data/transparency.dot-to-graph.json | 1712 +- .../data/transparency.parse-dot.json | 2214 +- test/dot-parser/data/twopi2.dot-to-graph.json | 48820 ++++----- test/dot-parser/data/twopi2.parse-dot.json | 60500 +++++----- test/dot-parser/data/unix.dot-to-graph.json | 1158 +- test/dot-parser/data/unix.parse-dot.json | 1096 +- test/dot-parser/data/world.dot-to-graph.json | 1086 +- test/dot-parser/data/world.parse-dot.json | 1414 +- test/dot-parser/dot-parser.test.ts | 10 +- test/dotparser.test.js | 354 +- test/edge-color.test.ts | 52 +- test/edges/bezier-edge-dynamic.test.ts | 110 +- test/edges/bezier-edge-static.test.ts | 86 +- test/edges/cubic-bezier-edge.test.ts | 270 +- test/edges/edge-base.test.ts | 40 +- test/edges/end-points.test.ts | 74 +- test/edges/helpers.ts | 32 +- test/edges/straight-edge.test.ts | 70 +- test/gephi-parser.test.ts | 318 +- test/layout-engine.test.ts | 96 +- test/locale-utils.test.ts | 4 +- test/network/basicUsage.js | 34 +- test/network/maximumWidthEdgeCase.html | 116 +- test/network/textMeasurementOnHoverTest.html | 275 +- test/networkTest.html | 102 +- test/network_unittests.html | 484 +- test/node-shapes.test.ts | 186 +- test/package.test.ts | 4 +- test/physics/wind.test.ts | 14 +- test/snapshots.test.ts | 62 +- tsconfig.code.json | 10 +- tsconfig.declarations.json | 18 +- tsconfig.json | 30 +- tsconfig.lint.json | 4 +- tsconfig.types.json | 18 +- 221 files changed, 212963 insertions(+), 105821 deletions(-) create mode 120000 .prettierignore diff --git a/.circleci/config.yml b/.circleci/config.yml index 9b0a25e279..1f6b7e349f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -137,6 +137,7 @@ jobs: - attach_workspace: at: .. + - run: npm run style - run: npm run lint test_unit: diff --git a/.eslintignore b/.eslintignore index 55d9b972ef..bbd8efe0c8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,15 +1,28 @@ +/* + +!/*?.?* +!/.?*.?* + +!/docs +!/docs-kr +!/src +!/test + +!/cypress /cypress/fixtures/**/*.js /cypress/fixtures/**/*.js.map /cypress/integration/**/*.js /cypress/integration/**/*.js.map /cypress/pages/**/*.js /cypress/pages/**/*.js.map -/cypress/screenshots/ -/cypress/snapshots/ +/cypress/screenshots +/cypress/snapshots /cypress/support/**/*.js /cypress/support/**/*.js.map -/cypress/videos/ +/cypress/videos + +!/examples /examples/examples.css /examples/index.html -/examples/static/ -/examples/thumbnails/ +/examples/static +/examples/thumbnails diff --git a/.eslintrc.js b/.eslintrc.js index 93bf6d024a..ca4113bdfd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,120 +1,3 @@ module.exports = { - env: { - "cypress/globals": true, - browser: true, - es6: true, - node: true, - mocha: true - }, - - parser: '@typescript-eslint/parser', - parserOptions: { - sourceType: "module", - ecmaVersion: 2020, - project: 'tsconfig.lint.json', - extraFileExtensions: [".json"], - }, - - plugins: ["prettier", "@typescript-eslint", "cypress"], - - extends: ['eslint:recommended', 'prettier'], - - // For the full list of rules, see: http://eslint.org/docs/rules/ - rules: { - 'prettier/prettier': ['off'], - 'no-trailing-spaces': 'error', - - complexity: ['error', 55], - "max-statements": ['error', 115], - "no-unreachable": 'warn', - "no-useless-escape": 'off', - - "no-console": 'off', - // To flag presence of console.log without breaking linting: - //"no-console": ["warn", { allow: ["warn", "error"] }], - - "require-jsdoc": ["error", { - require: { - FunctionDeclaration: true, - MethodDefinition: true, - ClassDeclaration: true, - ArrowFunctionExpression: false - } - }], - "valid-jsdoc": ['error', { - requireReturnDescription: false, - requireReturn: false, - requireParamDescription: false, - requireReturnType: true - }], - "guard-for-in": 'warn', - - "no-var": "error", - "prefer-const": "error", - }, - overrides: [ - { - files: ['**/*.ts', '**/*.d.ts'], - rules: { - // @TODO: Seems to mostly work just fine but I'm not 100 % sure. - // @TODO: Deprecated, anything like this for tsdoc? - "valid-jsdoc": [ - "error", - { - prefer: { - arg: "param", - argument: "param", - return: "returns" - }, - requireParamDescription: true, - requireParamType: false, - requireReturn: false, // Requires return for void functions. - requireReturnDescription: true, - requireReturnType: false - } - ], - - // Class related. - "@typescript-eslint/naming-convention": [ - "error", - { - selector: "memberLike", - modifiers: ["private", "protected"], - format: null, - leadingUnderscore: "require" - }, - { - selector: "memberLike", - modifiers: ["public"], - format: null, - leadingUnderscore: "forbid" - } - ], - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-useless-constructor": "error", - "@typescript-eslint/prefer-readonly": "error", - - // Other. - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-regexp-exec": "error", - // @TODO: Seems like a good thing, not yet on npm though. - // "@typescript-eslint/require-await": "error", - - // These are hoisted, I have no idea why it reports them by default. - "@typescript-eslint/no-use-before-define": [ - "error", - { functions: false, classes: false, typedefs: false } - ], - // False positives for overloading, also tsc compiles with errors anyway. - "no-dupe-class-members": "off", - // Blocks typesafe exhaustive switch (switch (x) { … default: const never: never = x }). - "no-case-declarations": "off", - // Reports used types. - "no-unused-vars": "off", - // Reports typeof bigint as an error, tsc validates this anyway so no problem turning this off. - "valid-typeof": "off" - } - }, - ] + extends: [require.resolve("vis-dev-utils/eslint-shareable-config")], }; diff --git a/.prettierignore b/.prettierignore new file mode 120000 index 0000000000..f62e2b436d --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.eslintignore \ No newline at end of file diff --git a/.releaserc.yml b/.releaserc.yml index 194091923b..ef75de372d 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -1,6 +1,6 @@ branch: master plugins: - - '@semantic-release/commit-analyzer' - - '@semantic-release/release-notes-generator' - - '@semantic-release/npm' - - '@semantic-release/github' + - "@semantic-release/commit-analyzer" + - "@semantic-release/release-notes-generator" + - "@semantic-release/npm" + - "@semantic-release/github" diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md index 94ff4fc241..90874c50b2 100644 --- a/CODE-OF-CONDUCT.md +++ b/CODE-OF-CONDUCT.md @@ -14,19 +14,19 @@ orientation. Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities @@ -68,4 +68,4 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef4c9839f2..6a595d7764 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,16 +3,19 @@ [Contributions](//github.com/visjs/vis-charts/blob/master/misc/how_to_help.md) to the vis.js library are very welcome! [We can't do this alone](//github.com/visjs/vis-charts/blob/master/misc/we_need_help.md). ### Questions -If you have any *general question* on how to use the vis.js library in your own project please check out [stackoverflow](http://stackoverflow.com/questions/tagged/vis.js) for things like that. **This is NOT a JavaScript help forum!** + +If you have any _general question_ on how to use the vis.js library in your own project please check out [stackoverflow](http://stackoverflow.com/questions/tagged/vis.js) for things like that. **This is NOT a JavaScript help forum!** ### Bugs, Problems and Feature-Requests + If you really want to open a new issue: -* Please use the [search functionality](//github.com/visjs/vis-charts/issues) to make sure that there is not already an issue concerning the same topic. -* Please make sure to **mention which module** of vis.js (network, timeline, graph3d, ...) your are referring to. -* Note that development happens on the `develop` git branch. Be sure to submit PRs against this branch. -* If you think you found a bug please **provide a simple example** (e.g. on [jsbin](jsbin.com)) that demonstrates the problem. -* If you want to propose a feature-request please **describe what you are looking for in detail**, ideally providing a screenshot, drawing or something similar. -* **Close the issue later**, when the issue is no longer needed. + +- Please use the [search functionality](//github.com/visjs/vis-charts/issues) to make sure that there is not already an issue concerning the same topic. +- Please make sure to **mention which module** of vis.js (network, timeline, graph3d, ...) your are referring to. +- Note that development happens on the `develop` git branch. Be sure to submit PRs against this branch. +- If you think you found a bug please **provide a simple example** (e.g. on [jsbin](jsbin.com)) that demonstrates the problem. +- If you want to propose a feature-request please **describe what you are looking for in detail**, ideally providing a screenshot, drawing or something similar. +- **Close the issue later**, when the issue is no longer needed. ## Financial contributions diff --git a/HISTORY.md b/HISTORY.md index c3e5a1a37e..de8bb6f5b2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -84,6 +84,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was ## 2017-10-12, version 4.21.0 ### General + - Added #3394: Adds unit tests for add, setOptions and on/off DataSet - FIX #3406: Eliminate possibility of 'window is undefined' during travis test - Added #3402: added @macleodbroad-wf to the support team @@ -98,9 +99,10 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Added #3295: Update the webpack example ### Network + - FIX #3554: Relax clustering condition for adding already clustered nodes to cluster - FIX #3517: Retain constraint values in label font handling -- REFA #3507: Cleanup and refactoring PhysicsEngine +- REFA #3507: Cleanup and refactoring PhysicsEngine - FIX #3500: re-adds edges if they are now connected and add does not add invalid edges - FIX #3486: Add extra check on null value during label handling - FEAT #824: Network detect clicks on labels @@ -109,9 +111,9 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #3408, #2677: Fix handling of multi-fonts - FIX #3425: IE performance improvements - FIX #3356 and #3297: IE11 svg image fixes -- FIX #3474: Make negative scaleFactor reverse middle arrow correctly +- FIX #3474: Make negative scaleFactor reverse middle arrow correctly - FIX #3464: Fix handling of space before huge word in label text -- FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototype +- FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototype - FEAT #3412: Add endpoint 'bar' to Network - FIX #3403: Fixes sorting on Layout, refactoring - FIX #3421: Added default sizes for nodes without labels @@ -123,8 +125,8 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FEAT #3348: Add edge styles support for DOT lib - FIX #2839: Re-words documentation to reflect symmetrical input/output of get() when passed multiple ids - FIX #3316: Updates network documentation to account for edge -- FIX #1218, #1291, #1315: Dynamically adjust clustering when data changes -- FIX #2311: Block recalculation of level in LayoutEngine._determineLevelsDirected() +- FIX #1218, #1291, #1315: Dynamically adjust clustering when data changes +- FIX #2311: Block recalculation of level in LayoutEngine.\_determineLevelsDirected() - FIX #3280: Cleanup mergeOptions() and fix missing ref on globalOptions in mergeOptions() - FEAT #3131: Added dragStart event for adding edges - FIX #3171 and #3185: Fix infinite loop on drawing of large labels @@ -138,9 +140,11 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #2856: Fix manipulation examples for Network ### Graph2D + - FIX #1852: Correct documentation for graph2d’s moveTo function ### Graph3D + - FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototypes - FEAT #3099: Add option definitions and validation to Graph3d - REFA #3159: move Filter into DataGroup @@ -149,6 +153,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #3255: Fix missing reference to Graph3D instance in DataGroup ### Timeline + - FEAT #3529: On timeline loaded - FEAT #3505: Drag object in to item - FEAT #3050: Allow disabling of RangeItem limitSize @@ -157,7 +162,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #3509: Added describe sections to PointItem unit tests - FIX #2851: Vertical focus - FEAT #620: Subgroup stacking -- FIX #3475: Improve Item redraw and initial draw performance +- FIX #3475: Improve Item redraw and initial draw performance - FIX #3409: Group redraw performance - FEAT #3428: Adds locale for Chinese (cn) - FIX #3405: fix orientation option @@ -171,19 +176,20 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #3249: Only draw non-visible items once when they are loaded, instead of continuously every frame - FEAT #3162: Bidirectional scrolling in timeline - make horizontalScroll and verticalScroll work together - ## 2017-07-01, version 4.20.1 ### General -- Added Release checklist + +- Added Release checklist - Added collapsible items for objects in graph3d doc ### Network + - FIX #3203: Set dimensions properly of images on initialization -- FIX #3170: Refactoring of Node Drawing +- FIX #3170: Refactoring of Node Drawing - FIX #3108: Reverse nodes returned with 'from' and 'to' directions - FIX #3122: Refactored line drawing for Bezier edges -- FIX #3121: Refactoring of `BezierEdgeStatic._getViaCoordinates()` +- FIX #3121: Refactoring of `BezierEdgeStatic._getViaCoordinates()` - FIX #3088: Consolidate code for determining the pixel ratio - FIX #3036: Smooth type 'dynamic' adjusted for node-specific option in hierarchical - FIX #1105: Fix usage of clustering with hierarchical networks @@ -195,13 +201,15 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #2990: Edge labels turn bold on select and hover - FIX #2959: Changed order of (de)select events for network - FIX #3091: Added param 'direction' to Network.getConnectedNodes() -- FIX #3085: Add prefix to cancelAnimationFrame() +- FIX #3085: Add prefix to cancelAnimationFrame() ### Graph3D + - FIX #3198: Small fix on ref usage in DataGroup - FIX #2804: Add data group class to Graph3d ### Timeline + - FIX #3172: Fix stacking when setting option - FIX #3183: Fixes a race condition that set an item's group to be set to undefined - FEAT #3154: Caching to Range getMillisecondsPerPixel function @@ -269,19 +277,17 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FEAT: Configurable minimum and maximum sizes for dot-size graphs (#2849) - ## 2017-03-19, version 4.19.1 ### General -* FIX: #2685 Fixed babel dependencies (#2875) +- FIX: #2685 Fixed babel dependencies (#2875) ### Timeline / Graph2D -* FIX #2809: Fix docs typo in "showNested" (#2879) -* FIX #2594: Fixes for removing and adding items to subgroups (#2821) -* FIX: Allow nested groups to be removed (#2852) - +- FIX #2809: Fix docs typo in "showNested" (#2879) +- FIX #2594: Fixes for removing and adding items to subgroups (#2821) +- FIX: Allow nested groups to be removed (#2852) ## 2017-03-18, version 4.19.0 @@ -341,7 +347,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #2536: 3d bar graph data array unsorted (#2803) - FEAT: Added showX(YZ)Axis options to Graph3d (#2686) - ## 2017-01-29, version 4.18.1 ### General @@ -367,8 +372,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX: Minor cleanups in Timeline Range. (#2633) - FIX #2458: Allow graph2D options to be undefined (#2634) - FIX: Fix typo (#2622) -- FIX #2585: Fixed React example (#2587) - +- FIX #2585: Fixed React example (#2587) ## 2017-01-15, version 4.18.0 @@ -455,7 +459,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - FIX #2274: Graph3d disappears when setSize is called (#2293) - FIX: Fixed typo in index.html of Graph3D (#2286) - ## 2016-11-05, version 4.17.0 ### General @@ -535,7 +538,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Improvements for graph3d legend support (#1940) - Advanced Tooltips (#1884) - ## 2016-04-18, version 4.16.1 ### Timeline @@ -543,7 +545,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #1786: Timeline having zero height on Internet Explorer, regression introduced after fixing #1697. - ## 2016-04-07, version 4.16.0 ### Timeline @@ -557,7 +558,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Created bundles for individual visualizations: `vis-graph3d.min.js`, `vis-network.min.js`, and `vis-timeline-graph2d.min.js`. - ## 2016-03-08, version 4.15.1 ## General @@ -576,7 +576,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was when using left or right align. - Fixed #1697: Timeline not drawn when used within the Angular.js directive. - ## 2016-02-23, version 4.15.0 ### Timeline @@ -605,7 +604,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #1677: updating groups through manipulation now works as it should. - Fixed #1672: Implemented stepped scaling for nice interpolation of images. - ## 2016-02-04, version 4.14.0 ### Timeline @@ -622,7 +620,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #1615: implemented new option `dotSizeRatio`. - ## 2016-02-01, version 4.13.0 ### Network @@ -661,7 +658,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #1541: Timeline and Graph2d did not load synchronously anymore. - Fixed a performance regression - ## 2016-01-08, version 4.12.0 ### Timeline @@ -672,7 +668,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was ### Network -- Fixed #1531, #1335: border distances for arrow positioning +- Fixed #1531, #1335: border distances for arrow positioning - Fixed findNode method. It now does not return internal objects anymore. - Fixed #1529, clustering and declustering now respects the original settings of the edges for physics and hidden. - Fixed #1406, control nodes are now drawn immediately without a second redraw. @@ -683,7 +679,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Accepted pull request #1544, thanks @felixhayashi! - Fixed documented bug in #1544. - ## 2015-12-18, version 4.11.0 ### Network @@ -710,11 +705,12 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Performance updates and fixes ### DataSet + - Fixed #1487: DataSet cannot remove an item with id `0` correctly. ### DataView -- Added the map() function from DataSet. +- Added the map() function from DataSet. ## 2015-11-27, version 4.10.0 @@ -757,7 +753,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Performance improvements (see #1381). Thanks @phimimms. - ## 2015-10-01, version 4.9.0 ### Network @@ -775,7 +770,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #1249: option `hiddenDates` not accepting a single hidden date. - Fixed a bug when pinching and using hidden dates. Thanks @lauzierj. - ## 2015-09-14, version 4.8.2 ### Network @@ -787,7 +781,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed arrows with some shapes when they are selected. #1292 - Fixed deletion of options by settings them to null. - ## 2015-09-07, version 4.8.1 ### Network @@ -802,7 +795,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #1215: inconsistent types of properties `start` and `end` in callback functions `onMove`, `onMoving`, `onAdd`. - ## 2015-08-28, version 4.8.0 ### Timeline @@ -833,7 +825,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Implemented configuration option `excludeFromLegend`. Thanks @Bernd0. - ## 2015-07-27, version 4.7.0 ### Timeline @@ -848,7 +839,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Added moveNode method. - Added cubic Bezier curves. - ## 2015-07-22, version 4.6.0 ### Timeline @@ -874,7 +864,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed disabling hierarchical layout. - Fixed delete button when using multiple selected items in manipulation system. - ## 2015-07-17, version 4.5.0 ### General @@ -885,7 +874,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Added shapeProperties, thanks @zukomgwili! - Added configChange event. -- Properly fixed the _lockedRedraw method. +- Properly fixed the \_lockedRedraw method. - Fixed node resizing on dragging. - Fixed missing edges during clustering. - Fixed missing refresh of node data when changing hierarchical layout on the fly. @@ -908,7 +897,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #239: Do not zoom/move the window when the mouse is on the left panel with group labels. - ## 2015-07-03, version 4.4.0 ### General @@ -953,7 +941,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed cleaning up of items in subgroups, thanks @ChenMachluf! - Improved error notification with groups, thanks @skinkie! - ## 2015-06-16, version 4.3.0 ### General @@ -1037,7 +1024,6 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was - Fixed #869: Add className with id to custom time bars - Fixed #877: Added support for metaKey to select multiple items. - ## 2015-05-22, version 4.0.0 ### General @@ -1079,6 +1065,7 @@ In version 5.0.0 the original [vis library](https://github.com/almende/vis) was The network has been completely rewritten. The new modular setup using ES6 classes makes it future proof for maintainability, extendability and clarity. A summary of new features: + - New examples, categorized by topic. - New docs. - New option structure, adhering to the modular setup on the backend. @@ -1099,14 +1086,12 @@ it future proof for maintainability, extendability and clarity. A summary of new - New avoidOverlap option for physics. - Many, many bugfixes. - ### DataSet - Dropped support for Google visualization DataTable. - Dropped support for appending data returned by `DataSet.get()` to an existing Array or DataTable. - ## 2015-04-07, version 3.12.0 ### Network @@ -1124,7 +1109,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed #708: detecting wrong group when page is scrolled. - Fixed #733: background items being selected on shift+click. - ## 2015-03-05, version 3.11.0 ### Network @@ -1169,8 +1153,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Implemented support for mapping field names. Thanks @spatialillusions. - Fixed #670: DataView not passing a data property on update events (see #670) - - ## 2015-02-11, version 3.10.0 ### Network @@ -1210,7 +1192,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed a bug in the `DataSet` returning an empty object instead of `null` when no item was found when using both a filter and specifying fields. - ## 2015-01-16, version 3.9.1 ### General @@ -1226,7 +1207,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Decoupled animation from physics simulation. - Fixed scroll being blocked if zoomable is false. - ## 2015-01-16, version 3.9.0 ### Network @@ -1251,7 +1231,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Added byUser flag to options of the rangechange and rangechanged event. - ## 2015-01-09, version 3.8.0 ### General @@ -1302,7 +1281,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed mouse coordinates for tooltips. - ## 2014-12-09, version 3.7.2 ### Timeline @@ -1345,7 +1323,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - dragEnd event now does not give the selected nodes if only the viewport has been dragged #453 - merged high DPI fix by @crubier, thanks! - ## 2014-11-14, version 3.7.0 ### Graph2D @@ -1359,7 +1336,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Added pointer properties to the click and the doubleClick events containing the XY coordinates in DOM and canvas space. - Removed IDs from navigation so multiple networks can be shown on the same page. (#438) - ### Timeline - Added a finishedRedraw event. @@ -1398,7 +1374,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - A precision option to manually set the amount of decimals. - Two new examples showing the new features. - ## 2014-10-28, version 3.6.3 ### Timeline @@ -1416,12 +1391,10 @@ it future proof for maintainability, extendability and clarity. A summary of new - Support for queueing of changes, and flushing them at once. - Implemented `DataSet.setOptions`. Only applicable for the `queue` options. - ## 2014-10-24, version 3.6.2 - Vis.js is now dual licensed under both Apache 2.0 and MIT. - ## 2014-10-22, version 3.6.1 ### Timeline @@ -1430,7 +1403,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed multiple bugs with regards to hidden dates. - Fixed subgroups and added subgroup sorting. Subgroup labels will be in future releases. - ## 2014-10-21, version 3.6.0 ### Network @@ -1469,7 +1441,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Implemented options `xValueLabel`, `yValueLabel` and `zValueLabel` for custom labels along the x, y, z axis. Thanks @fabriziofortino. - ## 2014-09-16, version 3.5.0 ### Network @@ -1482,7 +1453,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed dataAxis not showing large numbers correctly. - ## 2014-09-12, version 3.4.2 ### Network @@ -1493,7 +1463,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed minor bug in positioning of fontFill of nodes with certain shapes. - Added startStabilization event. - ## 2014-09-11, version 3.4.1 ### Network @@ -1506,7 +1475,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed a bug in IE freezing when margin.item and margin.axis where both 0. - ## 2014-09-10, version 3.4.0 ### Graph2d @@ -1544,7 +1512,6 @@ it future proof for maintainability, extendability and clarity. A summary of new respectively `BoxItem`, `RangeItem`, and `PointItem`. - Fixed an error thrown when calling `destroy()`. - ## 2014-08-29, version 3.3.0 ### Timeline @@ -1594,7 +1561,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed bugs. - Added groups.visibility functionality and an example showing how it works. - ## 2014-08-14, version 3.2.0 ### General @@ -1625,7 +1591,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Removed onclick and onrelease for navigation and switched to Hammer.js (fixing touchscreen interaction with navigation). - Fixed error on adding an edge without having created the nodes it should be connected to (in the case of dynamic smooth curves). - ## 2014-07-22, version 3.1.0 ### General @@ -1637,7 +1602,7 @@ it future proof for maintainability, extendability and clarity. A summary of new - Implemented function `getVisibleItems()`, which returns the items visible in the current window. -- Added options `margin.item.horizontal` and `margin.item.vertical`, which +- Added options `margin.item.horizontal` and `margin.item.vertical`, which allows to specify different margins horizontally/vertically. - Removed check for number of arguments in callbacks `onAdd`, `onUpdate`, `onRemove`, and `onMove`. @@ -1672,8 +1637,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Added .get() returnType option to return as JSON object, Array or Google DataTable. - - ## 2014-07-07, version 3.0.0 ### Timeline @@ -1687,6 +1650,7 @@ it future proof for maintainability, extendability and clarity. A summary of new .vis.timeline .item.range .content { overflow: visible; } + - Fixed the height of background and foreground panels of groups. - Fixed ranges in the Timeline sometimes overlapping when dragging the Timeline. - Fixed `DataView` not working in Timeline. @@ -1713,7 +1677,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Now throws an error when constructing without new keyword. - ## 2014-06-19, version 2.0.0 ### Timeline @@ -1737,7 +1700,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Renamed option `convert` to `type`. - ## 2014-06-06, version 1.1.0 ### Timeline @@ -1760,7 +1722,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Ported Graph3D from Chap Links Library. - ## 2014-05-28, version 1.0.2 ### Timeline @@ -1783,7 +1744,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Changes setOptions to avoid resetting view. - Interchanged canvasToDOM and DOMtoCanvas to correspond with the docs. - ## 2014-05-09, version 1.0.1 ### Timeline @@ -1798,7 +1758,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed bug where hierarchical physics properties were not handled. - Added events for change of view and zooming. - ## 2014-05-02, version 1.0.0 ### Timeline @@ -1834,7 +1793,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - A DataSet can now be constructed with initial data, like `new DataSet(data, options)`. - ## 2014-04-18, version 0.7.4 ### Graph @@ -1843,7 +1801,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Style fixes. - Minor bug fixes. - ## 2014-04-16, version 0.7.3 ### Graph @@ -1852,7 +1809,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Added pull requests from kannonboy and vierja: tooltip styling, label fill color. - ## 2014-04-09, version 0.7.2 ### Graph @@ -1860,7 +1816,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed edge select bug. - Fixed zoom bug on empty initialization. - ## 2014-03-27, version 0.7.1 ### Graph @@ -1874,7 +1829,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Added freezeForStabilization option to improve stabilization with cached positions. - ## 2014-03-07, version 0.7.0 ### Graph @@ -1887,7 +1841,6 @@ it future proof for maintainability, extendability and clarity. A summary of new storePosition(). - Added color options for the edges. - ## 2014-03-06, version 0.6.1 ### Graph @@ -1903,7 +1856,6 @@ it future proof for maintainability, extendability and clarity. A summary of new setting them to zero. - Some clarifications in the documentation. - ## 2014-03-05, version 0.6.0 ### Graph @@ -1915,12 +1867,10 @@ it future proof for maintainability, extendability and clarity. A summary of new - Directions for Hierarchical layout. - Refactoring and bugfixes. - ## 2014-02-20, version 0.5.1 - Fixed broken bower module. - ## 2014-02-20, version 0.5.0 ### Timeline @@ -1948,7 +1898,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Renamed functions `subscribe` and `unsubscribe` to `on` and `off` respectively. - ## 2014-01-31, version 0.4.0 ### Timeline @@ -1977,7 +1926,6 @@ it future proof for maintainability, extendability and clarity. A summary of new - Implemented functions `on` and `off` to create event listeners for event `select`. - ## 2014-01-14, version 0.3.0 - Moved the generated library to folder `./dist` @@ -1987,14 +1935,12 @@ it future proof for maintainability, extendability and clarity. A summary of new - Fixed broken Timeline options `min` and `max`. - Fixed not being able to load vis.js in node.js. - ## 2013-09-20, version 0.2.0 - Implemented full touch support for Graph. - Fixed initial empty range in the Timeline in case of a single item. - Fixed field `className` not working for items. - ## 2013-06-20, version 0.1.0 - Added support for DataSet to Graph. Graph now uses an id based set of nodes @@ -2009,31 +1955,26 @@ it future proof for maintainability, extendability and clarity. A summary of new - Renamed DataSet option `fieldTypes` to `convert`. - Renamed function `vis.util.cast` to `vis.util.convert`. - ## 2013-06-07, version 0.0.9 - First working version of the Graph imported from the old library. - Documentation added for both Timeline and Graph. - ## 2013-05-03, version 0.0.8 - Performance improvements: only visible items are rendered. - Minor bug fixes and improvements. - ## 2013-04-25, version 0.0.7 - Sanitized the published packages on npm and bower. - ## 2013-04-25, version 0.0.6 - Css is now packaged in the javascript file, and automatically loaded. - The library uses node style dependency management for modules now, used with Browserify. - ## 2013-04-16, version 0.0.5 - First working version of the Timeline. diff --git a/README.md b/README.md index 5ad59ea8e8..553f8ee873 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Network is a visualization to display networks and networks consisting of nodes [![GitHub contributors](https://img.shields.io/github/contributors/visjs/vis-network.svg)](https://github.com/visjs/vis-network/graphs/contributors) [![Backers on Open Collective](https://opencollective.com/visjs/backers/badge.svg)](#backers) -[![Sponsors on Open Collective](https://opencollective.com/visjs/sponsors/badge.svg)](#sponsors) +[![Sponsors on Open Collective](https://opencollective.com/visjs/sponsors/badge.svg)](#sponsors) ## Install @@ -31,50 +31,53 @@ found in the [examples directory](https://github.com/visjs/vis-network/tree/mast of the project. ```html - + - - Network - - - - -
- - + + Network + + + + +
+ + ``` @@ -136,12 +139,12 @@ Copyright (C) 2010-2018 Almende B.V. and Contributors Vis.js is dual licensed under both - * The Apache 2.0 License - http://www.apache.org/licenses/LICENSE-2.0 +- The Apache 2.0 License + http://www.apache.org/licenses/LICENSE-2.0 and - * The MIT License - http://opensource.org/licenses/MIT +- The MIT License + http://opensource.org/licenses/MIT Vis.js may be distributed under either license. diff --git a/babel.config.js b/babel.config.js index 9446ed74b4..22e2dded14 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ module.exports = { exclude: require("vis-dev-utils").BABEL_IGNORE_RE, - presets: [["vis-dev-utils/babel-preset", { css: true, ts: true }]] + presets: [["vis-dev-utils/babel-preset", { css: true, ts: true }]], }; diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json index da18d9352a..02e4254378 100644 --- a/cypress/fixtures/example.json +++ b/cypress/fixtures/example.json @@ -2,4 +2,4 @@ "name": "Using fixtures to represent data", "email": "hello@cypress.io", "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file +} diff --git a/cypress/integration/functional/clicks.spec.ts b/cypress/integration/functional/clicks.spec.ts index c4a479a26e..b1d0203f56 100644 --- a/cypress/integration/functional/clicks.spec.ts +++ b/cypress/integration/functional/clicks.spec.ts @@ -65,7 +65,7 @@ context("Clicks", (): void => { { x: 275, y: 250, shouldTrigger: true, name: "TQ" }, // top, quarter from the left { x: 275, y: 275, shouldTrigger: true, name: "QQ" }, // quarter from the top, quarter from the left { x: 350, y: 250, shouldTrigger: true, name: "TR" }, // top, right - { x: 350, y: 350, shouldTrigger: true, name: "BR" } // bottom, right + { x: 350, y: 350, shouldTrigger: true, name: "BR" }, // bottom, right ]; /* @@ -79,18 +79,18 @@ context("Clicks", (): void => { [ { name: "TL", position: { x: 0, y: 0 } }, { name: "TQ", position: { x: 0.25, y: 0.5 } }, - { name: "TR", position: { x: 1, y: 1 } } + { name: "TR", position: { x: 1, y: 1 } }, ], [ { name: "TL", position: { x: 0, y: 0 } }, { name: "QL", position: { x: 0.5, y: 0.25 } }, - { name: "BL", position: { x: 1, y: 1 } } + { name: "BL", position: { x: 1, y: 1 } }, ], [ { name: "TL", position: { x: 0, y: 0 } }, { name: "QQ", position: { x: 0.25, y: 0.25 } }, - { name: "BR", position: { x: 1, y: 1 } } - ] + { name: "BR", position: { x: 1, y: 1 } }, + ], ]; const allEvents: VisEvent[] = []; @@ -106,9 +106,9 @@ context("Clicks", (): void => { }); }); - describe("Clicks", function(): void { + describe("Clicks", function (): void { clicks.forEach(({ name, shouldTrigger, x, y }): void => { - describe(`At ${x}x${y} ${name || ""}`, function(): void { + describe(`At ${x}x${y} ${name || ""}`, function (): void { const events: VisEvent[] = []; it("Triggering and capturing", (): void => { @@ -127,7 +127,7 @@ context("Clicks", (): void => { }); }); - it("Correct number of events", function(): void { + it("Correct number of events", function (): void { if (shouldTrigger) { expect(events).to.to.have.lengthOf(1); } else { @@ -136,7 +136,7 @@ context("Clicks", (): void => { }); if (shouldTrigger) { - it("Correct DOM coordinates", function(): void { + it("Correct DOM coordinates", function (): void { expect(events[0]).to.have.ownProperty("pointer"); expect(events[0].pointer).to.have.ownProperty("DOM"); expect(events[0].pointer.DOM).to.have.ownProperty("x"); @@ -158,13 +158,13 @@ context("Clicks", (): void => { }); }); - describe("Relative event positions in canvas coordinetes", function(): void { + describe("Relative event positions in canvas coordinetes", function (): void { canvasCoordinatesTests.forEach((config): void => { const name = config.map(({ name }): string => name).join(", "); - describe(name, function(): void { + describe(name, function (): void { ["x" as const, "y" as const].forEach((axis): void => { - it(axis, function(): void { + it(axis, function (): void { const axis0 = namedEvents.get( config.find(({ position }): boolean => position[axis] === 0)!.name ).pointer.canvas[axis]; diff --git a/cypress/integration/functional/directed-hierarchical-layout.spec.ts b/cypress/integration/functional/directed-hierarchical-layout.spec.ts index 60fdad17cd..319869095a 100644 --- a/cypress/integration/functional/directed-hierarchical-layout.spec.ts +++ b/cypress/integration/functional/directed-hierarchical-layout.spec.ts @@ -3,7 +3,7 @@ import { Point, TestData, addMoreEdges, - generateMaryTree + generateMaryTree, } from "../helpers"; /** @@ -51,7 +51,7 @@ describe("Directed hierarchical layout", (): void => { name: "Binary tree", data: generateMaryTree(63, 2), clusterConfigs: [{ nodes: nodeIdRange(3, 6), swallowsEdges: 2 }], - cyclic: false + cyclic: false, }, { name: "5-ary tree", @@ -61,12 +61,12 @@ describe("Directed hierarchical layout", (): void => { nodes: [ ...nodeIdRange(2, 3), ...nodeIdRange(11, 20), - ...nodeIdRange(56, 105) + ...nodeIdRange(56, 105), ], - swallowsEdges: 61 - } + swallowsEdges: 61, + }, ], - cyclic: false + cyclic: false, }, { name: "Acyclic graph", @@ -76,26 +76,26 @@ describe("Directed hierarchical layout", (): void => { nodes: [ ...nodeIdRange(2, 3), ...nodeIdRange(11, 20), - ...nodeIdRange(56, 62) + ...nodeIdRange(56, 62), ], - swallowsEdges: 31 - } + swallowsEdges: 31, + }, ], - cyclic: false + cyclic: false, }, { name: "Cyclic graph (2 nodes)", data: { nodes: [ { id: "node0", label: "Node #0" }, - { id: "node1", label: "Node #1" } + { id: "node1", label: "Node #1" }, ], edges: [ { id: "edge_node0-node1", from: "node0", to: "node1" }, - { id: "edge_node1-node0", from: "node1", to: "node0" } - ] + { id: "edge_node1-node0", from: "node1", to: "node0" }, + ], }, - cyclic: true + cyclic: true, }, { name: "Cyclic graph (10 nodes)", @@ -110,7 +110,7 @@ describe("Directed hierarchical layout", (): void => { { id: "node6", label: "Node #6" }, { id: "node7", label: "Node #7" }, { id: "node8", label: "Node #8" }, - { id: "node9", label: "Node #9" } + { id: "node9", label: "Node #9" }, ], edges: [ { id: "edge_node1-node0", from: "node1", to: "node0" }, @@ -122,10 +122,10 @@ describe("Directed hierarchical layout", (): void => { { id: "edge_node5-node6", from: "node5", to: "node6" }, { id: "edge_node6-node7", from: "node6", to: "node7" }, { id: "edge_node7-node8", from: "node7", to: "node8" }, - { id: "edge_node8-node9", from: "node8", to: "node9" } - ] + { id: "edge_node8-node9", from: "node8", to: "node9" }, + ], }, - cyclic: true + cyclic: true, }, { name: "Linear", @@ -140,7 +140,7 @@ describe("Directed hierarchical layout", (): void => { { id: "node6", label: "Node #6" }, { id: "node7", label: "Node #7" }, { id: "node8", label: "Node #8" }, - { id: "node9", label: "Node #9" } + { id: "node9", label: "Node #9" }, ], edges: [ { id: "edge_node0-node1", from: "node0", to: "node1" }, @@ -151,22 +151,22 @@ describe("Directed hierarchical layout", (): void => { { id: "edge_node5-node6", from: "node5", to: "node6" }, { id: "edge_node6-node7", from: "node6", to: "node7" }, { id: "edge_node7-node8", from: "node7", to: "node8" }, - { id: "edge_node8-node9", from: "node8", to: "node9" } - ] + { id: "edge_node8-node9", from: "node8", to: "node9" }, + ], }, clusterConfigs: [ { nodes: ["node1"], swallowsEdges: 0 }, { nodes: ["node2", "node3"], swallowsEdges: 1 }, - { nodes: ["node6", "node7", "node8"], swallowsEdges: 2 } + { nodes: ["node6", "node7", "node8"], swallowsEdges: 2 }, ], - cyclic: false - } + cyclic: false, + }, ]; configs.forEach(({ clusterConfigs, cyclic, data, name }): void => { const configs = [ { nodes: [], swallowsEdges: 0 }, - ...(clusterConfigs || []) + ...(clusterConfigs || []), ].map(({ nodes }, i, arr): { expectedVisibleEdges: number; nodesToCluster: Set; @@ -176,7 +176,7 @@ describe("Directed hierarchical layout", (): void => { arr .slice(0, i + 1) .reduce((acc, { swallowsEdges }): number => acc + swallowsEdges, 0), - nodesToCluster: new Set(nodes) + nodesToCluster: new Set(nodes), })); describe(name, (): void => { @@ -187,15 +187,15 @@ describe("Directed hierarchical layout", (): void => { network.setOptions({ edges: { arrows: { - to: true - } + to: true, + }, }, layout: { hierarchical: { enabled: true, - sortMethod: "directed" - } - } + sortMethod: "directed", + }, + }, }); nodes.add(data.nodes); @@ -213,9 +213,9 @@ describe("Directed hierarchical layout", (): void => { cy.visRun(({ network }): void => { network.cluster({ clusterNodeProperties: { - label: `Cluster #${cid}` + label: `Cluster #${cid}`, }, - joinCondition: ({ id }): boolean => nodesToCluster.has(id) + joinCondition: ({ id }): boolean => nodesToCluster.has(id), }); }); }); @@ -264,7 +264,7 @@ describe("Directed hierarchical layout", (): void => { fromId, fromPosition: network.getPositions([fromId])[fromId], toId, - toPosition: network.getPositions([toId])[toId] + toPosition: network.getPositions([toId])[toId], })) .filter(({ fromPosition, toPosition }): boolean => { return !(fromPosition.y < toPosition.y); diff --git a/cypress/integration/functional/drags.spec.ts b/cypress/integration/functional/drags.spec.ts index 4d30e02921..a2b8601df2 100644 --- a/cypress/integration/functional/drags.spec.ts +++ b/cypress/integration/functional/drags.spec.ts @@ -39,10 +39,10 @@ context("Drags", (): void => { /* * The canvas starts at 200x200 and ends at 400x400. */ - describe("Inside → Inside → Inside", function(): void { + describe("Inside → Inside → Inside", function (): void { let events: ReturnType; - it("Run", function(): void { + it("Run", function (): void { cy.visit("http://localhost:58253/cypress/pages/events-target.html"); events = drag([ @@ -54,28 +54,26 @@ context("Drags", (): void => { { name: "pointermove", x: 300, y: 320 }, { name: "pointermove", x: 320, y: 345 }, { name: "pointermove", x: 340, y: 370 }, - { name: "pointerup", x: 360, y: 395 } + { name: "pointerup", x: 360, y: 395 }, ]); }); - it("Number of events", function(): void { - expect(events) - .to.be.an("array") - .that.has.lengthOf(6); + it("Number of events", function (): void { + expect(events).to.be.an("array").that.has.lengthOf(6); }); - it("Types", function(): void { + it("Types", function (): void { expect(events.map(({ name }): string => name)).to.deep.equal([ "dragStart", "dragging", "dragging", "dragging", "dragging", - "dragEnd" + "dragEnd", ]); }); - it("Coordinates", function(): void { + it("Coordinates", function (): void { expect(events.map(({ event }): Point => event.pointer.DOM)).to.deep.equal( [ { x: 40, y: 45 }, @@ -83,16 +81,16 @@ context("Drags", (): void => { { x: 100, y: 120 }, { x: 120, y: 145 }, { x: 140, y: 170 }, - { x: 160, y: 195 } + { x: 160, y: 195 }, ] ); }); }); - describe("Inside → Inside → Outside", function(): void { + describe("Inside → Inside → Outside", function (): void { let events: ReturnType; - it("Run", function(): void { + it("Run", function (): void { cy.visit("http://localhost:58253/cypress/pages/events-target.html"); events = drag([ @@ -104,28 +102,26 @@ context("Drags", (): void => { { name: "pointermove", x: 300, y: 400 }, { name: "pointermove", x: 320, y: 450 }, { name: "pointermove", x: 340, y: 500 }, - { name: "pointerup", x: 360, y: 500 } + { name: "pointerup", x: 360, y: 500 }, ]); }); - it("Number of events", function(): void { - expect(events) - .to.be.an("array") - .that.has.lengthOf(6); + it("Number of events", function (): void { + expect(events).to.be.an("array").that.has.lengthOf(6); }); - it("Types", function(): void { + it("Types", function (): void { expect(events.map(({ name }): string => name)).to.deep.equal([ "dragStart", "dragging", "dragging", "dragging", "dragging", - "dragEnd" + "dragEnd", ]); }); - it("Coordinates", function(): void { + it("Coordinates", function (): void { expect(events.map(({ event }): Point => event.pointer.DOM)).to.deep.equal( [ { x: 40, y: 50 }, @@ -133,7 +129,7 @@ context("Drags", (): void => { { x: 100, y: 200 }, { x: 120, y: 250 }, { x: 140, y: 300 }, - { x: 160, y: 300 } + { x: 160, y: 300 }, ] ); }); @@ -151,8 +147,8 @@ context("Drags", (): void => { { name: "pointermove", x: 100, y: 320 }, { name: "pointermove", x: 120, y: 345 }, { name: "pointermove", x: 140, y: 370 }, - { name: "pointerup", x: 160, y: 395 } - ] + { name: "pointerup", x: 160, y: 395 }, + ], }, { name: "Outside → Inside → Inside", @@ -164,8 +160,8 @@ context("Drags", (): void => { { name: "pointermove", x: 300, y: 250 }, { name: "pointermove", x: 300, y: 300 }, { name: "pointermove", x: 300, y: 350 }, - { name: "pointerup", x: 300, y: 350 } - ] + { name: "pointerup", x: 300, y: 350 }, + ], }, { name: "Outside → Inside → Outside", @@ -178,25 +174,23 @@ context("Drags", (): void => { { name: "pointermove", x: 300, y: 350 }, { name: "pointermove", x: 300, y: 400 }, { name: "pointermove", x: 300, y: 450 }, - { name: "pointerup", x: 300, y: 450 } - ] - } + { name: "pointerup", x: 300, y: 450 }, + ], + }, ]; configs.forEach(({ name, coords }): void => { - describe(name, function(): void { + describe(name, function (): void { let events: ReturnType; - it("Run", function(): void { + it("Run", function (): void { cy.visit("http://localhost:58253/cypress/pages/events-target.html"); events = drag(coords); }); - it("No events", function(): void { - expect(events) - .to.be.an("array") - .that.has.lengthOf(0); + it("No events", function (): void { + expect(events).to.be.an("array").that.has.lengthOf(0); }); }); }); diff --git a/cypress/integration/functional/manipulation.spec.ts b/cypress/integration/functional/manipulation.spec.ts index 72c0da949b..e9c2cf5270 100644 --- a/cypress/integration/functional/manipulation.spec.ts +++ b/cypress/integration/functional/manipulation.spec.ts @@ -1,6 +1,5 @@ import { IdType, Point } from "../helpers"; -// eslint-disable-next-line require-jsdoc function selectEditAndCheck( before: number, after: number, @@ -12,9 +11,7 @@ function selectEditAndCheck( cy.visClickBetweenPoints(a, b); cy.visRun(({ edges, lastEvents: { click } }): void => { - expect(click.edges) - .to.be.an("array") - .and.have.length(1); + expect(click.edges).to.be.an("array").and.have.length(1); id = click.edges[0]; @@ -42,16 +39,12 @@ function selectEditAndCheck( cy.visClickPoint(a); cy.visRun(({ nodes, lastEvents: { click } }): void => { - expect(click.nodes) - .to.be.an("array") - .and.have.length(1); + expect(click.nodes).to.be.an("array").and.have.length(1); id = click.nodes[0]; if (before === 0) { - expect(nodes.get(id)) - .to.have.own.property("label") - .that.equals("new"); + expect(nodes.get(id)).to.have.own.property("label").that.equals("new"); } else { expect(nodes.get(id)) .to.have.own.property("label") diff --git a/cypress/integration/functional/pollution.spec.ts b/cypress/integration/functional/pollution.spec.ts index 8144cd8952..a28f3f3029 100644 --- a/cypress/integration/functional/pollution.spec.ts +++ b/cypress/integration/functional/pollution.spec.ts @@ -2,7 +2,7 @@ context("Pollution", (): void => { const resultContainerIds = [ "results-before-loading", "results-after-loading", - "results-after-rendering" + "results-after-rendering", ] as const; it("Visit", (): void => { diff --git a/cypress/integration/helpers/common.ts b/cypress/integration/helpers/common.ts index f3f6ef90b9..17eaeb9e42 100644 --- a/cypress/integration/helpers/common.ts +++ b/cypress/integration/helpers/common.ts @@ -36,7 +36,7 @@ export function createGridPoints( return Object.freeze({ x: (row / perRowOrCol) * size - offset, - y: (col / perRowOrCol) * size - offset + y: (col / perRowOrCol) * size - offset, }); } ) diff --git a/cypress/integration/helpers/trees.ts b/cypress/integration/helpers/trees.ts index d49b36c511..567099c4ed 100644 --- a/cypress/integration/helpers/trees.ts +++ b/cypress/integration/helpers/trees.ts @@ -11,7 +11,7 @@ import { Edge, Node, TestData } from "./common"; * * @returns Nodes and edges that can be directly supplied to Vis Network. */ -export function generateMaryTree(amount: number = 63, m: number = 2): TestData { +export function generateMaryTree(amount = 63, m = 2): TestData { const nodes: Node[] = []; const edges: Edge[] = []; @@ -29,7 +29,7 @@ export function generateMaryTree(amount: number = 63, m: number = 2): TestData { id: `edge_${parentId}-${id}`, label: `${parentId} - ${id}`, from: parentId, - to: id + to: id, }); } @@ -58,7 +58,7 @@ export function addMoreEdges(data: TestData): TestData { id: `edge2_${parentId}-${id}`, label: `${parentId} - ${id}`, from: parentId, - to: id + to: id, }); } } diff --git a/cypress/integration/visual/label-rendering.spec.ts b/cypress/integration/visual/label-rendering.spec.ts index 5f257b29a5..40002cb539 100644 --- a/cypress/integration/visual/label-rendering.spec.ts +++ b/cypress/integration/visual/label-rendering.spec.ts @@ -1,6 +1,6 @@ context("Label rendering", (): void => { for (const multi of [false, true, "md", "html"]) { - describe(`Multi: ${multi}`, function(): void { + describe(`Multi: ${multi}`, function (): void { for (const { variantName, color, background, size } of [ { variantName: "defaults" }, { @@ -18,26 +18,26 @@ context("Label rendering", (): void => { bold: { color: "#FF0000", size: 40, - vadjust: 20 + vadjust: 20, }, boldital: { color: "#FFFF00", size: 30, - vadjust: 5 + vadjust: 5, }, ital: { color: "#00FF00", size: 20, - vadjust: -10 + vadjust: -10, }, mono: { color: "#0000FF", size: 10, - vadjust: -20 - } - } + vadjust: -20, + }, + }, ]) { - describe(`Variant: ${variantName}`, function(): void { + describe(`Variant: ${variantName}`, function (): void { for (const [labelName, label] of [ // ASCII, single line ["ASCII", "test"], @@ -58,7 +58,7 @@ context("Label rendering", (): void => { ",\n" + "-*bóld+ítálícs*-" + ", " + - "*-ítálícs+bóld-*." + "*-ítálícs+bóld-*.", ], // HTML [ @@ -75,8 +75,8 @@ context("Label rendering", (): void => { ",\n" + "bóld+ítálícs" + ", " + - "ítálícs+bóld." - ] + "ítálícs+bóld.", + ], ]) { it( JSON.stringify( @@ -93,7 +93,7 @@ context("Label rendering", (): void => { x: -50, y: -300, shape: "box", - label + label, }, { id: 3, @@ -101,18 +101,18 @@ context("Label rendering", (): void => { x: 50, y: 300, shape: "square", - label - } + label, + }, ], edges: [{ id: 2, from: 1, to: 3, label }], options: { nodes: { - font: { background, color, multi, size } + font: { background, color, multi, size }, }, edges: { - font: { background, color, multi, size } - } - } + font: { background, color, multi, size }, + }, + }, } ); } diff --git a/cypress/integration/visual/node-shapes.spec.ts b/cypress/integration/visual/node-shapes.spec.ts index f90c2de2ac..88e863fb0c 100644 --- a/cypress/integration/visual/node-shapes.spec.ts +++ b/cypress/integration/visual/node-shapes.spec.ts @@ -14,22 +14,22 @@ const shapes = [ "star", "text", "triangle", - "triangleDown" + "triangleDown", ] as const; const variantGroups: any[][] = [ [ { shapeProperties: { borderDashes: true } }, - { shapeProperties: { borderDashes: [1, 2, 5, 9, 4, 6, 3, 7, 8] } } + { shapeProperties: { borderDashes: [1, 2, 5, 9, 4, 6, 3, 7, 8] } }, ], [ { shapeProperties: { borderRadius: 0 } }, - { shapeProperties: { borderRadius: 12 } } + { shapeProperties: { borderRadius: 12 } }, ], [{ borderWidth: 1 }, { borderWidth: 7 }], [ { color: "#ACDC00" }, - { color: { border: "#00AA00", background: "#00AAAA" } } + { color: { border: "#00AA00", background: "#00AAAA" } }, ], [{ font: { size: 17 } }, { font: { size: 31 } }], [{ icon: { code: "\uDB81\uDF85", face: '"Material Design Icons"' } }], @@ -37,9 +37,9 @@ const variantGroups: any[][] = [ [{ opacity: 0.6 }, { opacity: 0.8 }], [ { shadow: true }, - { shadow: { color: "rgba(0,200,200,0.3)", size: 17, x: 7, y: -11 } } + { shadow: { color: "rgba(0,200,200,0.3)", size: 17, x: 7, y: -11 } }, ], - [{ size: 13 }, { size: 43 }] + [{ size: 13 }, { size: 43 }], ]; const configs: any[] = []; @@ -77,9 +77,9 @@ context("Node shapes", (): void => { shape, id, fixed: true, - ...points[id] + ...points[id], })), - edges: [] + edges: [], }); }); }); diff --git a/cypress/pages/events-target.html b/cypress/pages/events-target.html index 9e5d20a938..dc8b8aeff8 100644 --- a/cypress/pages/events-target.html +++ b/cypress/pages/events-target.html @@ -51,7 +51,7 @@ const edges = new vis.DataSet(); const data = { nodes, edges }; const options = { - physics: false + physics: false, }; const network = new vis.Network(container, data, options); diff --git a/cypress/pages/pollution-detector.ts b/cypress/pages/pollution-detector.ts index e5924ea7c0..9144957a06 100644 --- a/cypress/pages/pollution-detector.ts +++ b/cypress/pages/pollution-detector.ts @@ -54,13 +54,20 @@ export class PollutionDetector { /** * Traverses the provided object ommiting whitelisted paths, getters and * ignoring exceptions. + * + * @param root0 + * @param root0.callback + * @param root0.done + * @param root0.prefix + * @param root0.root + * @param root0.whitelist */ private async _traverse({ callback, done, prefix, root, - whitelist + whitelist, }: TraverseParameters): Promise { if (done.has(root)) { return; @@ -91,7 +98,7 @@ export class PollutionDetector { done, prefix: path, root: value, - whitelist + whitelist, }); } } catch (_error) { @@ -129,7 +136,7 @@ export class PollutionDetector { this._originalValues.set(path, { path, root, value }); saved.add(path); return true; - } + }, }); return saved; } @@ -176,7 +183,7 @@ export class PollutionDetector { done: new Set(), prefix, root, - whitelist + whitelist, }); } diff --git a/cypress/pages/pollution.html b/cypress/pages/pollution.html index 37b7829887..1d1f722063 100644 --- a/cypress/pages/pollution.html +++ b/cypress/pages/pollution.html @@ -36,7 +36,7 @@ + diff --git a/cypress/support/commands/types.ts b/cypress/support/commands/types.ts index 54de06a96a..4a580cb7e4 100644 --- a/cypress/support/commands/types.ts +++ b/cypress/support/commands/types.ts @@ -2,7 +2,7 @@ import { DataSetEdges, DataSetNodes, Network, - Options + Options, } from "../../../declarations/entry-standalone"; // TODO: Convert this to type only export when ESLint and Prettier support the diff --git a/cypress/support/commands/vis-check-ids.ts b/cypress/support/commands/vis-check-ids.ts index 2ca92772b3..00f35c5659 100644 --- a/cypress/support/commands/vis-check-ids.ts +++ b/cypress/support/commands/vis-check-ids.ts @@ -1,7 +1,6 @@ import { IdType } from "./types"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -29,7 +28,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visCheckIds( before: () => void, between: () => void, @@ -84,7 +82,7 @@ export function visCheckIds( oldEdgeIds, oldNodeIds, removedEdgeIds, - removedNodeIds + removedNodeIds, }); }); }); diff --git a/cypress/support/commands/vis-click-betweek-points.ts b/cypress/support/commands/vis-click-betweek-points.ts index 28405a338e..26d209d86d 100644 --- a/cypress/support/commands/vis-click-betweek-points.ts +++ b/cypress/support/commands/vis-click-betweek-points.ts @@ -1,7 +1,6 @@ import { Point } from "./types"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -15,7 +14,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visClickBetweenPoints(a: Point, b: Point): void { const middle = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }; diff --git a/cypress/support/commands/vis-click-edge.ts b/cypress/support/commands/vis-click-edge.ts index 377f943deb..da5de6570f 100644 --- a/cypress/support/commands/vis-click-edge.ts +++ b/cypress/support/commands/vis-click-edge.ts @@ -1,7 +1,6 @@ import { IdType } from "./types"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -15,7 +14,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visClickEdge(id: IdType): void { cy.visRun(({ network }): void => { const [fromId, toId] = network.getConnectedNodes(id) as [IdType, IdType]; diff --git a/cypress/support/commands/vis-click-node.ts b/cypress/support/commands/vis-click-node.ts index 9ae1d13ae0..2324e77316 100644 --- a/cypress/support/commands/vis-click-node.ts +++ b/cypress/support/commands/vis-click-node.ts @@ -1,7 +1,6 @@ import { IdType } from "./types"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -15,7 +14,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visClickNode(id: IdType): void { cy.visRun(({ network }): void => { const { x, y } = network.canvasToDOM(network.getPositions([id])[id]); diff --git a/cypress/support/commands/vis-click-point.ts b/cypress/support/commands/vis-click-point.ts index f0dbad9c5f..34d82b71f2 100644 --- a/cypress/support/commands/vis-click-point.ts +++ b/cypress/support/commands/vis-click-point.ts @@ -1,7 +1,6 @@ import { Point } from "./types"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -14,7 +13,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visClickPoint(a: Point): void { cy.get("#mynetwork canvas").click(a.x, a.y); } diff --git a/cypress/support/commands/vis-connect-nodes.ts b/cypress/support/commands/vis-connect-nodes.ts index 960581e356..47e7a7dfc5 100644 --- a/cypress/support/commands/vis-connect-nodes.ts +++ b/cypress/support/commands/vis-connect-nodes.ts @@ -2,7 +2,6 @@ import { Point } from "./types"; import { visCheckIds } from "./vis-check-ids"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -16,7 +15,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visConnectNodes(from: Point, to: Point): void { const middle = { x: (from.x + to.x) / 2, y: (from.y + to.y) / 2 }; @@ -28,13 +26,13 @@ export function visConnectNodes(from: Point, to: Point): void { // Drag the edge between the nodes. cy.get("#mynetwork").trigger("pointerdown", from.x, from.y, { - button: 0 + button: 0, }); cy.get("#mynetwork").trigger("pointermove", middle.x, middle.y, { - button: 0 + button: 0, }); cy.get("#mynetwork").trigger("pointerup", to.x, to.y, { - button: 0 + button: 0, }); }, ({ addedEdgeIds, removedEdgeIds }): void => { diff --git a/cypress/support/commands/vis-delete-selected.ts b/cypress/support/commands/vis-delete-selected.ts index 155a211608..5d639f7ce3 100644 --- a/cypress/support/commands/vis-delete-selected.ts +++ b/cypress/support/commands/vis-delete-selected.ts @@ -1,5 +1,4 @@ declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -10,7 +9,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visDeleteSelected(): void { // Delete selected nodes and edges. cy.get(".vis-button.vis-delete").click(); diff --git a/cypress/support/commands/vis-drag.ts b/cypress/support/commands/vis-drag.ts index 4a0cd897ac..c5dbc54490 100644 --- a/cypress/support/commands/vis-drag.ts +++ b/cypress/support/commands/vis-drag.ts @@ -1,7 +1,6 @@ import { DragPath } from "./types"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -14,12 +13,11 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visDrag(paths: readonly DragPath[]): void { for (const { button, from, shiftKey, to } of paths) { cy.get("#mynetwork canvas").trigger("pointerdown", from.x, from.y, { button, - shiftKey + shiftKey, }); for (const relativeDistance of new Array(10).fill(null).map( (_v, i, array): number => @@ -32,13 +30,13 @@ export function visDrag(paths: readonly DragPath[]): void { from.y + to.y * relativeDistance, { button, - shiftKey + shiftKey, } ); } cy.get("#mynetwork canvas").trigger("pointerup", to.x, to.y, { button, - shiftKey + shiftKey, }); } } diff --git a/cypress/support/commands/vis-edit-selected.ts b/cypress/support/commands/vis-edit-selected.ts index 9d14b918b8..82b199870b 100644 --- a/cypress/support/commands/vis-edit-selected.ts +++ b/cypress/support/commands/vis-edit-selected.ts @@ -1,5 +1,4 @@ declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -10,7 +9,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visEditSelected(): void { // Enter edit mode cy.get(".vis-manipulation .vis-button.vis-edit").click(); diff --git a/cypress/support/commands/vis-place-node.ts b/cypress/support/commands/vis-place-node.ts index 7fd5082a22..e341bc2240 100644 --- a/cypress/support/commands/vis-place-node.ts +++ b/cypress/support/commands/vis-place-node.ts @@ -1,7 +1,6 @@ import { visCheckIds } from "./vis-check-ids"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -15,7 +14,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visPlaceNode(x: number, y: number): void { visCheckIds( (): void => {}, diff --git a/cypress/support/commands/vis-run-with-window.ts b/cypress/support/commands/vis-run-with-window.ts index 58ab1347f9..d536f64b43 100644 --- a/cypress/support/commands/vis-run-with-window.ts +++ b/cypress/support/commands/vis-run-with-window.ts @@ -9,7 +9,6 @@ export interface VisRunWithWindowOptions { export const VIS_DEFAULT_RUN_WITH_WINDOW_TIMEOUT = 4000; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -27,11 +26,10 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visRunWithWindow( callback: (props: VisGlobals) => void, { - timeout = VIS_DEFAULT_RUN_WITH_WINDOW_TIMEOUT + timeout = VIS_DEFAULT_RUN_WITH_WINDOW_TIMEOUT, }: VisRunWithWindowOptions = {} ): void { cy.window().then({ timeout }, (window: any): void => { diff --git a/cypress/support/commands/vis-run.ts b/cypress/support/commands/vis-run.ts index 9d6f5d5578..ce0aab4419 100644 --- a/cypress/support/commands/vis-run.ts +++ b/cypress/support/commands/vis-run.ts @@ -9,7 +9,6 @@ export interface VisRunOptions { export const VIS_DEFAULT_RUN_TIMEOUT = 4000; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -27,7 +26,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visRun( callback: (props: VisGlobals) => void, { timeout = VIS_DEFAULT_RUN_TIMEOUT }: VisRunOptions = {} @@ -38,7 +36,7 @@ export function visRun( visEdges: edges, visLastEvents: lastEvents, visNetwork: network, - visNodes: nodes + visNodes: nodes, }: any): void => { if (edges && lastEvents && network && nodes) { callback({ edges, lastEvents, network, nodes }); diff --git a/cypress/support/commands/vis-simple-canvas-snapshot.ts b/cypress/support/commands/vis-simple-canvas-snapshot.ts index 578dd44a19..aad561fcbf 100644 --- a/cypress/support/commands/vis-simple-canvas-snapshot.ts +++ b/cypress/support/commands/vis-simple-canvas-snapshot.ts @@ -2,7 +2,6 @@ import { UniversalNetworkConfig } from "./types"; import { VisSnapshotOpenedPageOptions } from "./vis-snapshot-opened-page"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -23,7 +22,6 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visSimpleCanvasSnapshot( label: number | string, config: UniversalNetworkConfig = {}, diff --git a/cypress/support/commands/vis-snapshot-opened-page.ts b/cypress/support/commands/vis-snapshot-opened-page.ts index 6d2891ff8b..4187e777e4 100644 --- a/cypress/support/commands/vis-snapshot-opened-page.ts +++ b/cypress/support/commands/vis-snapshot-opened-page.ts @@ -3,7 +3,6 @@ import { deepObjectAssign } from "vis-util"; import { VisVisitPageOptions } from "./vis-visit-universal"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -27,7 +26,6 @@ export interface VisSnapshotOpenedPageOptions extends VisVisitPageOptions { }; } -// eslint-disable-next-line require-jsdoc export function visSnapshotOpenedPage( label: number | string, options: VisSnapshotOpenedPageOptions = {} diff --git a/cypress/support/commands/vis-stabilize-and-fit.ts b/cypress/support/commands/vis-stabilize-and-fit.ts index 27baacf617..6be59f96c1 100644 --- a/cypress/support/commands/vis-stabilize-and-fit.ts +++ b/cypress/support/commands/vis-stabilize-and-fit.ts @@ -7,7 +7,6 @@ export interface VisStabilizeAndFitOptions { export const VIS_DEFAULT_STABILIZE_AND_FIT_TIMEOUT = 30000; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -20,9 +19,8 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visStabilizeAndFit({ - timeout = VIS_DEFAULT_STABILIZE_AND_FIT_TIMEOUT + timeout = VIS_DEFAULT_STABILIZE_AND_FIT_TIMEOUT, }: VisStabilizeAndFitOptions = {}): void { cy.visRun( async ({ network }): Promise => { @@ -46,15 +44,15 @@ export function visStabilizeAndFit({ network.fit({ animation: { duration: 100, - easingFunction: "linear" - } + easingFunction: "linear", + }, }); }); }, { // Stabilization can take really long time depenging on the CPU power // available and the amount of nodes and edges used. - timeout + timeout, } ); diff --git a/cypress/support/commands/vis-stabilize-fit-and-run.ts b/cypress/support/commands/vis-stabilize-fit-and-run.ts index 67777116db..db9ff02a22 100644 --- a/cypress/support/commands/vis-stabilize-fit-and-run.ts +++ b/cypress/support/commands/vis-stabilize-fit-and-run.ts @@ -15,7 +15,6 @@ import { VIS_DEFAULT_RUN_TIMEOUT } from "./vis-run"; import { VIS_DEFAULT_STABILIZE_AND_FIT_TIMEOUT } from "./vis-stabilize-and-fit"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -34,17 +33,16 @@ declare global { } } -// eslint-disable-next-line require-jsdoc export function visStabilizeFitAndRun( callback: (props: VisGlobals) => void, { stabilizationTimeout = VIS_DEFAULT_STABILIZE_AND_FIT_TIMEOUT, - runTimeout = VIS_DEFAULT_RUN_TIMEOUT + runTimeout = VIS_DEFAULT_RUN_TIMEOUT, }: VisStabilizeFitAndRunOptions = {} ): void { cy.visStabilizeAndFit({ timeout: stabilizationTimeout }); cy.visRun(callback, { - timeout: runTimeout + timeout: runTimeout, }); } Cypress.Commands.add("visStabilizeFitAndRun", visStabilizeFitAndRun); diff --git a/cypress/support/commands/vis-visit-universal.ts b/cypress/support/commands/vis-visit-universal.ts index 00892d92d2..da812cf343 100644 --- a/cypress/support/commands/vis-visit-universal.ts +++ b/cypress/support/commands/vis-visit-universal.ts @@ -2,7 +2,6 @@ import { UniversalConfig, UniversalNetworkConfig } from "./types"; import { compare } from "compare-versions"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface Chainable { /** @@ -44,11 +43,10 @@ function visitPage(config: UniversalConfig): void { encodeURIComponent(JSON.stringify(config)) ); cy.get("#status").contains("Ready", { - timeout: Cypress.config("pageLoadTimeout") + timeout: Cypress.config("pageLoadTimeout"), }); } -// eslint-disable-next-line require-jsdoc export function visVisitUniversal( config: UniversalNetworkConfig = {}, { requireNewerVersionThan }: VisVisitPageOptions = {} @@ -65,9 +63,7 @@ export function visVisitUniversal( // case. cy.request("GET", `https://unpkg.com/vis-network@${tag}/package.json`).then( (response): void => { - expect(response.body) - .to.have.property("version") - .that.is.a("string"); + expect(response.body).to.have.property("version").that.is.a("string"); const version = response.body.version; diff --git a/cypress/support/plugins/cypress-visual-regression.ts b/cypress/support/plugins/cypress-visual-regression.ts index 7b50636e0a..4c65215018 100644 --- a/cypress/support/plugins/cypress-visual-regression.ts +++ b/cypress/support/plugins/cypress-visual-regression.ts @@ -1,7 +1,6 @@ import compareSnapshotCommand from "cypress-visual-regression/dist/command"; declare global { - // eslint-disable-next-line no-redeclare namespace Cypress { interface CypressVisualRegressionCompareSnapshotOptions extends Cypress.Loggable, diff --git a/docs-kr/index.html b/docs-kr/index.html index 1c37f22c1a..885a6d79eb 100644 --- a/docs-kr/index.html +++ b/docs-kr/index.html @@ -1,11 +1,12 @@ - - - - Page Redirection - - - 자동으로 Page Redirection이 안됐다면 link를 눌러주세요! - - \ No newline at end of file + + + + Page Redirection + + + 자동으로 Page Redirection이 안됐다면 link를 + 눌러주세요! + + diff --git a/docs-kr/network/configure.html b/docs-kr/network/configure.html index fc68686d03..91242e20c1 100644 --- a/docs-kr/network/configure.html +++ b/docs-kr/network/configure.html @@ -1,97 +1,145 @@ - - - - - - - - + + + + + + + + vis.js - 환경 설정 문서. - + - - - - + + + - - - + + + - - + + - - -