diff --git a/.eslintrc b/.eslintrc index 47886fa1..99d79009 100644 --- a/.eslintrc +++ b/.eslintrc @@ -23,7 +23,7 @@ "require": { "FunctionDeclaration": true, "MethodDefinition": false, - "ClassDeclaration": false, + "ClassDeclaration": true, "ArrowFunctionExpression": false } }], diff --git a/lib/network/NetworkUtil.js b/lib/network/NetworkUtil.js index c83470fe..695cc84c 100644 --- a/lib/network/NetworkUtil.js +++ b/lib/network/NetworkUtil.js @@ -1,4 +1,8 @@ let util = require("../util"); + +/** + * @constructor NetworkUtil + */ class NetworkUtil { constructor() {} diff --git a/lib/network/modules/CanvasRenderer.js b/lib/network/modules/CanvasRenderer.js index cd11f6ee..de2f53b7 100644 --- a/lib/network/modules/CanvasRenderer.js +++ b/lib/network/modules/CanvasRenderer.js @@ -43,7 +43,12 @@ function _initRequestAnimationFrame() { let util = require('../../util'); - +/** + * + * @param {Object} body + * @param {Canvas} canvas + * @constructor CanvasRenderer + */ class CanvasRenderer { constructor(body, canvas) { _initRequestAnimationFrame(); diff --git a/lib/network/modules/Clustering.js b/lib/network/modules/Clustering.js index f0f036d8..2678bcee 100644 --- a/lib/network/modules/Clustering.js +++ b/lib/network/modules/Clustering.js @@ -98,6 +98,11 @@ var Cluster = require('./components/nodes/Cluster').default; var Edge = require('./components/Edge').default; // Only needed for check on type! var Node = require('./components/Node').default; // Only needed for check on type! +/** + * + * @param {Object} body + * @constructor ClusterEngine + */ class ClusterEngine { constructor(body) { this.body = body; diff --git a/lib/network/modules/EdgesHandler.js b/lib/network/modules/EdgesHandler.js index 40495e8b..2d5d4d32 100644 --- a/lib/network/modules/EdgesHandler.js +++ b/lib/network/modules/EdgesHandler.js @@ -5,6 +5,13 @@ var DataView = require('../../DataView'); var Edge = require("./components/Edge").default; var Label = require("./components/shared/Label").default; +/** + * + * @param {Object} body + * @param {Array} images + * @param {Array} groups + * @constructor EdgesHandler + */ class EdgesHandler { constructor(body, images, groups) { this.body = body; diff --git a/lib/network/modules/InteractionHandler.js b/lib/network/modules/InteractionHandler.js index bb9467a0..dd8fdde2 100644 --- a/lib/network/modules/InteractionHandler.js +++ b/lib/network/modules/InteractionHandler.js @@ -3,6 +3,13 @@ let util = require('../../util'); var NavigationHandler = require('./components/NavigationHandler').default; var Popup = require('./../../shared/Popup').default; +/** + * + * @param {Object} body + * @param {Canvas} canvas + * @param {SelectionHandler} selectionHandler + * @constructor InteractionHandler + */ class InteractionHandler { constructor(body, canvas, selectionHandler) { this.body = body; diff --git a/lib/network/modules/LayoutEngine.js b/lib/network/modules/LayoutEngine.js index d4e0a82b..96047adf 100644 --- a/lib/network/modules/LayoutEngine.js +++ b/lib/network/modules/LayoutEngine.js @@ -308,7 +308,11 @@ class HierarchicalStatus { } } - +/** + * + * @param {Object} body + * @constructor LayoutEngine + */ class LayoutEngine { constructor(body) { this.body = body; diff --git a/lib/network/modules/NodesHandler.js b/lib/network/modules/NodesHandler.js index ce597486..2b47f119 100644 --- a/lib/network/modules/NodesHandler.js +++ b/lib/network/modules/NodesHandler.js @@ -5,6 +5,14 @@ let DataView = require('../../DataView'); var Node = require("./components/Node").default; var Label = require("./components/shared/Label").default; +/** + * + * @param {Object} body + * @param {Array} images + * @param {Array} groups + * @param {LayoutEngine} layoutEngine + * @constructor NodesHandler + */ class NodesHandler { constructor(body, images, groups, layoutEngine) { this.body = body; diff --git a/lib/network/modules/PhysicsEngine.js b/lib/network/modules/PhysicsEngine.js index 77fee310..020d807e 100644 --- a/lib/network/modules/PhysicsEngine.js +++ b/lib/network/modules/PhysicsEngine.js @@ -10,6 +10,11 @@ var ForceAtlas2BasedCentralGravitySolver = require('./components/physics/FA2Base var util = require('../../util'); +/** + * + * @param {Object} body + * @constructor PhysicsEngine + */ class PhysicsEngine { constructor(body) { this.body = body; diff --git a/lib/network/modules/SelectionHandler.js b/lib/network/modules/SelectionHandler.js index c1b7e9db..7f79d49c 100644 --- a/lib/network/modules/SelectionHandler.js +++ b/lib/network/modules/SelectionHandler.js @@ -3,6 +3,12 @@ var Edge = require('./components/Edge').default; let util = require('../../util'); +/** + * + * @param {Object} body + * @param {Canvas} canvas + * @constructor SelectionHandler + */ class SelectionHandler { constructor(body, canvas) { this.body = body; diff --git a/lib/network/modules/View.js b/lib/network/modules/View.js index 388c50a8..e426617e 100644 --- a/lib/network/modules/View.js +++ b/lib/network/modules/View.js @@ -2,6 +2,12 @@ let util = require('../../util'); var NetworkUtil = require('../NetworkUtil').default; +/** + * + * @param {Object} body + * @param {Canvas} canvas + * @constructor View + */ class View { constructor(body, canvas) { this.body = body; diff --git a/lib/network/modules/components/NavigationHandler.js b/lib/network/modules/components/NavigationHandler.js index 67dcbb90..218a2130 100644 --- a/lib/network/modules/components/NavigationHandler.js +++ b/lib/network/modules/components/NavigationHandler.js @@ -2,6 +2,12 @@ var Hammer = require('../../../module/hammer'); var hammerUtil = require('../../../hammerUtil'); var keycharm = require('keycharm'); +/** + * + * @param {Object} body + * @param {Canvas} canvas + * @constructor NavigationHandler + */ class NavigationHandler { constructor(body, canvas) { this.body = body; diff --git a/lib/network/modules/components/algorithms/FloydWarshall.js b/lib/network/modules/components/algorithms/FloydWarshall.js index 42983755..4e4c2f43 100644 --- a/lib/network/modules/components/algorithms/FloydWarshall.js +++ b/lib/network/modules/components/algorithms/FloydWarshall.js @@ -1,8 +1,6 @@ /** - * Created by Alex on 10-Aug-15. + * @constructor FloydWarshall */ - - class FloydWarshall { constructor() { } diff --git a/lib/network/modules/components/edges/BezierEdgeDynamic.js b/lib/network/modules/components/edges/BezierEdgeDynamic.js index 6705ff0e..84a5748b 100644 --- a/lib/network/modules/components/edges/BezierEdgeDynamic.js +++ b/lib/network/modules/components/edges/BezierEdgeDynamic.js @@ -1,5 +1,16 @@ import BezierEdgeBase from './util/BezierEdgeBase' +/** + * A Dynamic Bezier Edge. Bezier curves are used to model smooth gradual + * curves in paths between nodes. The Dynamic piece refers to how the curve + * reacts to physics changes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor BezierEdgeDynamic + * @extends BezierEdgeBase + */ class BezierEdgeDynamic extends BezierEdgeBase { constructor(options, body, labelModule) { //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked. @@ -27,7 +38,7 @@ class BezierEdgeDynamic extends BezierEdgeBase { // when we change the physics state of the edge, we reposition the support node. if (physicsChange === true) { - this.via.setOptions({physics: this.options.physics}) + this.via.setOptions({physics: this.options.physics}); this.positionBezierNode(); } } diff --git a/lib/network/modules/components/edges/BezierEdgeStatic.js b/lib/network/modules/components/edges/BezierEdgeStatic.js index 82eb41bd..655f19bd 100644 --- a/lib/network/modules/components/edges/BezierEdgeStatic.js +++ b/lib/network/modules/components/edges/BezierEdgeStatic.js @@ -1,5 +1,15 @@ import BezierEdgeBase from './util/BezierEdgeBase' +/** + * A Static Bezier Edge. Bezier curves are used to model smooth gradual + * curves in paths between nodes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor BezierEdgeStatic + * @extends BezierEdgeBase + */ class BezierEdgeStatic extends BezierEdgeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/edges/CubicBezierEdge.js b/lib/network/modules/components/edges/CubicBezierEdge.js index 50f5c0e9..af2effa5 100644 --- a/lib/network/modules/components/edges/CubicBezierEdge.js +++ b/lib/network/modules/components/edges/CubicBezierEdge.js @@ -1,5 +1,15 @@ import CubicBezierEdgeBase from './util/CubicBezierEdgeBase' +/** + * A Cubic Bezier Edge. Bezier curves are used to model smooth gradual + * curves in paths between nodes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor CubicBezierEdge + * @extends CubicBezierEdgeBase + */ class CubicBezierEdge extends CubicBezierEdgeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/edges/StraightEdge.js b/lib/network/modules/components/edges/StraightEdge.js index a7befc46..e8633e15 100644 --- a/lib/network/modules/components/edges/StraightEdge.js +++ b/lib/network/modules/components/edges/StraightEdge.js @@ -1,5 +1,14 @@ import EdgeBase from './util/EdgeBase' +/** + * A Straight Edge. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor StraightEdge + * @extends EdgeBase + */ class StraightEdge extends EdgeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/edges/util/BezierEdgeBase.js b/lib/network/modules/components/edges/util/BezierEdgeBase.js index 6ee96eee..bb9ed4ab 100644 --- a/lib/network/modules/components/edges/util/BezierEdgeBase.js +++ b/lib/network/modules/components/edges/util/BezierEdgeBase.js @@ -1,5 +1,15 @@ import EdgeBase from './EdgeBase' +/** + * The Base Class for all Bezier edges. Bezier curves are used to model smooth + * gradual curves in paths between nodes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor BezierEdgeBase + * @extends EdgeBase + */ class BezierEdgeBase extends EdgeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/edges/util/CubicBezierEdgeBase.js b/lib/network/modules/components/edges/util/CubicBezierEdgeBase.js index 3ec204b6..e15a7ce1 100644 --- a/lib/network/modules/components/edges/util/CubicBezierEdgeBase.js +++ b/lib/network/modules/components/edges/util/CubicBezierEdgeBase.js @@ -1,5 +1,15 @@ import BezierEdgeBase from './BezierEdgeBase' +/** + * A Base Class for all Cubic Bezier Edges. Bezier curves are used to model + * smooth gradual curves in paths between nodes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor CubicBezierEdgeBase + * @extends BezierEdgeBase + */ class CubicBezierEdgeBase extends BezierEdgeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/edges/util/EdgeBase.js b/lib/network/modules/components/edges/util/EdgeBase.js index 063c0d1c..f74afffe 100644 --- a/lib/network/modules/components/edges/util/EdgeBase.js +++ b/lib/network/modules/components/edges/util/EdgeBase.js @@ -1,5 +1,13 @@ let util = require("../../../../../util"); +/** + * The Base Class for all edges. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor EdgeBase + */ class EdgeBase { constructor(options, body, labelModule) { this.body = body; diff --git a/lib/network/modules/components/nodes/Cluster.js b/lib/network/modules/components/nodes/Cluster.js index 2919c947..bacbe9b6 100644 --- a/lib/network/modules/components/nodes/Cluster.js +++ b/lib/network/modules/components/nodes/Cluster.js @@ -1,7 +1,16 @@ import Node from '../Node' /** + * A Cluster is a special Node that allows a group of Nodes positioned closely together + * to be represented by a single Cluster Node. * + * @param {Object} options + * @param {Object} body + * @param {Array}imagelist + * @param {Array} grouplist + * @param {Object} globalOptions + * @constructor Cluster + * @extends Node */ class Cluster extends Node { constructor(options, body, imagelist, grouplist, globalOptions) { diff --git a/lib/network/modules/components/nodes/shapes/Box.js b/lib/network/modules/components/nodes/shapes/Box.js index 3b6ff973..7eb4db61 100644 --- a/lib/network/modules/components/nodes/shapes/Box.js +++ b/lib/network/modules/components/nodes/shapes/Box.js @@ -2,6 +2,15 @@ import NodeBase from '../util/NodeBase' +/** + * A Box Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Box + * @extends NodeBase + */ class Box extends NodeBase { constructor (options, body, labelModule) { super(options,body,labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Circle.js b/lib/network/modules/components/nodes/shapes/Circle.js index 12529239..56d89f36 100644 --- a/lib/network/modules/components/nodes/shapes/Circle.js +++ b/lib/network/modules/components/nodes/shapes/Circle.js @@ -2,6 +2,15 @@ import CircleImageBase from '../util/CircleImageBase' +/** + * A Circle Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Circle + * @extends CircleImageBase + */ class Circle extends CircleImageBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/CircularImage.js b/lib/network/modules/components/nodes/shapes/CircularImage.js index 4c0a7071..517f2300 100644 --- a/lib/network/modules/components/nodes/shapes/CircularImage.js +++ b/lib/network/modules/components/nodes/shapes/CircularImage.js @@ -2,6 +2,15 @@ import CircleImageBase from '../util/CircleImageBase' +/** + * A CircularImage Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor CircularImage + * @extends CircleImageBase + */ class CircularImage extends CircleImageBase { constructor (options, body, labelModule, imageObj, imageObjAlt) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Database.js b/lib/network/modules/components/nodes/shapes/Database.js index 91843a7f..48614e44 100644 --- a/lib/network/modules/components/nodes/shapes/Database.js +++ b/lib/network/modules/components/nodes/shapes/Database.js @@ -2,6 +2,15 @@ import NodeBase from '../util/NodeBase' +/** + * A Database Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Database + * @extends NodeBase + */ class Database extends NodeBase { constructor (options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Diamond.js b/lib/network/modules/components/nodes/shapes/Diamond.js index 20a8f7db..ad396f83 100644 --- a/lib/network/modules/components/nodes/shapes/Diamond.js +++ b/lib/network/modules/components/nodes/shapes/Diamond.js @@ -2,6 +2,15 @@ import ShapeBase from '../util/ShapeBase' +/** + * A Diamond Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Diamond + * @extends ShapeBase + */ class Diamond extends ShapeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/nodes/shapes/Dot.js b/lib/network/modules/components/nodes/shapes/Dot.js index 73d3a305..355f45c5 100644 --- a/lib/network/modules/components/nodes/shapes/Dot.js +++ b/lib/network/modules/components/nodes/shapes/Dot.js @@ -2,6 +2,15 @@ import ShapeBase from '../util/ShapeBase' +/** + * A Dot Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Dot + * @extends ShapeBase + */ class Dot extends ShapeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/nodes/shapes/Ellipse.js b/lib/network/modules/components/nodes/shapes/Ellipse.js index d36b4b7b..7e06d809 100644 --- a/lib/network/modules/components/nodes/shapes/Ellipse.js +++ b/lib/network/modules/components/nodes/shapes/Ellipse.js @@ -2,6 +2,15 @@ import NodeBase from '../util/NodeBase' +/** + * Am Ellipse Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Ellipse + * @extends NodeBase + */ class Ellipse extends NodeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Icon.js b/lib/network/modules/components/nodes/shapes/Icon.js index f55080cc..e6dcfd45 100644 --- a/lib/network/modules/components/nodes/shapes/Icon.js +++ b/lib/network/modules/components/nodes/shapes/Icon.js @@ -2,6 +2,15 @@ import NodeBase from '../util/NodeBase' +/** + * An icon replacement for the default Node shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Icon + * @extends NodeBase + */ class Icon extends NodeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Image.js b/lib/network/modules/components/nodes/shapes/Image.js index 04b15e84..da1c5e56 100644 --- a/lib/network/modules/components/nodes/shapes/Image.js +++ b/lib/network/modules/components/nodes/shapes/Image.js @@ -2,6 +2,16 @@ import CircleImageBase from '../util/CircleImageBase' + +/** + * An image-based replacement for the default Node shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Image + * @extends CircleImageBase + */ class Image extends CircleImageBase { constructor (options, body, labelModule, imageObj, imageObjAlt) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Square.js b/lib/network/modules/components/nodes/shapes/Square.js index 3dba0807..8872d5c9 100644 --- a/lib/network/modules/components/nodes/shapes/Square.js +++ b/lib/network/modules/components/nodes/shapes/Square.js @@ -2,6 +2,15 @@ import ShapeBase from '../util/ShapeBase' +/** + * A Square Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Square + * @extends ShapeBase + */ class Square extends ShapeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/nodes/shapes/Star.js b/lib/network/modules/components/nodes/shapes/Star.js index 2b1437f8..91fdb1d5 100644 --- a/lib/network/modules/components/nodes/shapes/Star.js +++ b/lib/network/modules/components/nodes/shapes/Star.js @@ -2,6 +2,15 @@ import ShapeBase from '../util/ShapeBase' +/** + * A Star Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor TriangleDown + * @extends ShapeBase + */ class Star extends ShapeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/nodes/shapes/Text.js b/lib/network/modules/components/nodes/shapes/Text.js index 34483e45..73a5f554 100644 --- a/lib/network/modules/components/nodes/shapes/Text.js +++ b/lib/network/modules/components/nodes/shapes/Text.js @@ -2,6 +2,15 @@ import NodeBase from '../util/NodeBase' +/** + * A text-based replacement for the default Node shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Text + * @extends NodeBase + */ class Text extends NodeBase { constructor(options, body, labelModule) { super(options, body, labelModule); diff --git a/lib/network/modules/components/nodes/shapes/Triangle.js b/lib/network/modules/components/nodes/shapes/Triangle.js index 9b35304f..8aed1c15 100644 --- a/lib/network/modules/components/nodes/shapes/Triangle.js +++ b/lib/network/modules/components/nodes/shapes/Triangle.js @@ -2,6 +2,15 @@ import ShapeBase from '../util/ShapeBase' +/** + * A Triangle Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor Triangle + * @extends ShapeBase + */ class Triangle extends ShapeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/nodes/shapes/TriangleDown.js b/lib/network/modules/components/nodes/shapes/TriangleDown.js index 453056f3..2dfc7896 100644 --- a/lib/network/modules/components/nodes/shapes/TriangleDown.js +++ b/lib/network/modules/components/nodes/shapes/TriangleDown.js @@ -2,6 +2,15 @@ import ShapeBase from '../util/ShapeBase' +/** + * A downward facing Triangle Node/Cluster shape. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor TriangleDown + * @extends ShapeBase + */ class TriangleDown extends ShapeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/nodes/util/NodeBase.js b/lib/network/modules/components/nodes/util/NodeBase.js index bc067fbf..6094c45e 100644 --- a/lib/network/modules/components/nodes/util/NodeBase.js +++ b/lib/network/modules/components/nodes/util/NodeBase.js @@ -1,3 +1,11 @@ +/** + * The Base class for all Nodes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor NodeBase + */ class NodeBase { constructor(options, body, labelModule) { this.body = body; diff --git a/lib/network/modules/components/nodes/util/ShapeBase.js b/lib/network/modules/components/nodes/util/ShapeBase.js index 578c4c13..6200ec1e 100644 --- a/lib/network/modules/components/nodes/util/ShapeBase.js +++ b/lib/network/modules/components/nodes/util/ShapeBase.js @@ -1,5 +1,14 @@ import NodeBase from '../util/NodeBase' +/** + * Base class for constructing Node/Cluster Shapes. + * + * @param {Object} options + * @param {Object} body + * @param {Label} labelModule + * @constructor ShapeBase + * @extends NodeBase + */ class ShapeBase extends NodeBase { constructor(options, body, labelModule) { super(options, body, labelModule) diff --git a/lib/network/modules/components/physics/BarnesHutSolver.js b/lib/network/modules/components/physics/BarnesHutSolver.js index 25b72872..b6d098ac 100644 --- a/lib/network/modules/components/physics/BarnesHutSolver.js +++ b/lib/network/modules/components/physics/BarnesHutSolver.js @@ -1,3 +1,10 @@ +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor BarnesHutSolver + */ class BarnesHutSolver { constructor(body, physicsBody, options) { this.body = body; diff --git a/lib/network/modules/components/physics/CentralGravitySolver.js b/lib/network/modules/components/physics/CentralGravitySolver.js index 4030b256..62470657 100644 --- a/lib/network/modules/components/physics/CentralGravitySolver.js +++ b/lib/network/modules/components/physics/CentralGravitySolver.js @@ -1,3 +1,10 @@ +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor CentralGravitySolver + */ class CentralGravitySolver { constructor(body, physicsBody, options) { this.body = body; diff --git a/lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js b/lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js index d491a9bb..5c5a1397 100644 --- a/lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js +++ b/lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js @@ -1,5 +1,13 @@ import CentralGravitySolver from "./CentralGravitySolver" +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor ForceAtlas2BasedCentralGravitySolver + * @extends CentralGravitySolver + */ class ForceAtlas2BasedCentralGravitySolver extends CentralGravitySolver { constructor(body, physicsBody, options) { super(body, physicsBody, options); diff --git a/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js b/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js index 42ab1712..06a71dad 100644 --- a/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js +++ b/lib/network/modules/components/physics/FA2BasedRepulsionSolver.js @@ -1,5 +1,13 @@ import BarnesHutSolver from "./BarnesHutSolver" +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor ForceAtlas2BasedRepulsionSolver + * @extends BarnesHutSolver + */ class ForceAtlas2BasedRepulsionSolver extends BarnesHutSolver { constructor(body, physicsBody, options) { super(body, physicsBody, options); diff --git a/lib/network/modules/components/physics/HierarchicalRepulsionSolver.js b/lib/network/modules/components/physics/HierarchicalRepulsionSolver.js index b2c4e5ee..7ace01d8 100644 --- a/lib/network/modules/components/physics/HierarchicalRepulsionSolver.js +++ b/lib/network/modules/components/physics/HierarchicalRepulsionSolver.js @@ -1,3 +1,10 @@ +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor HierarchicalRepulsionSolver + */ class HierarchicalRepulsionSolver { constructor(body, physicsBody, options) { this.body = body; diff --git a/lib/network/modules/components/physics/HierarchicalSpringSolver.js b/lib/network/modules/components/physics/HierarchicalSpringSolver.js index ff26db12..ed1382af 100644 --- a/lib/network/modules/components/physics/HierarchicalSpringSolver.js +++ b/lib/network/modules/components/physics/HierarchicalSpringSolver.js @@ -1,3 +1,10 @@ +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor HierarchicalSpringSolver + */ class HierarchicalSpringSolver { constructor(body, physicsBody, options) { this.body = body; diff --git a/lib/network/modules/components/physics/RepulsionSolver.js b/lib/network/modules/components/physics/RepulsionSolver.js index ad7e776c..2596e648 100644 --- a/lib/network/modules/components/physics/RepulsionSolver.js +++ b/lib/network/modules/components/physics/RepulsionSolver.js @@ -1,3 +1,10 @@ +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor RepulsionSolver + */ class RepulsionSolver { constructor(body, physicsBody, options) { this.body = body; diff --git a/lib/network/modules/components/physics/SpringSolver.js b/lib/network/modules/components/physics/SpringSolver.js index 5d45d7a3..893f2b3f 100644 --- a/lib/network/modules/components/physics/SpringSolver.js +++ b/lib/network/modules/components/physics/SpringSolver.js @@ -1,3 +1,10 @@ +/** + * + * @param {Object} body + * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody + * @param {Object} options + * @constructor SpringSolver + */ class SpringSolver { constructor(body, physicsBody, options) { this.body = body; diff --git a/lib/network/modules/components/shared/Label.js b/lib/network/modules/components/shared/Label.js index 6d065349..97bf8ede 100644 --- a/lib/network/modules/components/shared/Label.js +++ b/lib/network/modules/components/shared/Label.js @@ -134,7 +134,14 @@ class LabelAccumulator { } } - +/** + * A Label to be used for Nodes or Edges. + * + * @param {Object} options + * @param {Object} body + * @param {boolean} [edgeLabel=false] + * @constructor Label + */ class Label { constructor(body, options, edgelabel = false) { this.body = body; diff --git a/lib/shared/ColorPicker.js b/lib/shared/ColorPicker.js index 6fb1da97..9b056438 100644 --- a/lib/shared/ColorPicker.js +++ b/lib/shared/ColorPicker.js @@ -2,6 +2,10 @@ let Hammer = require('../module/hammer'); let hammerUtil = require('../hammerUtil'); let util = require('../util'); +/** + * + * @param {Number} [pixelRatio=1] + */ class ColorPicker { constructor(pixelRatio = 1) { this.pixelRatio = pixelRatio;