├── .bowerrc ├── docs ├── src │ ├── joint │ │ └── api │ │ │ ├── dia │ │ │ ├── Element │ │ │ │ └── prototype │ │ │ │ │ ├── getPortIndex.html │ │ │ │ │ ├── unembed.html │ │ │ │ │ ├── getTransitions.html │ │ │ │ │ ├── hasPorts.md │ │ │ │ │ ├── hasPort.md │ │ │ │ │ ├── removePort.md │ │ │ │ │ ├── getPorts.md │ │ │ │ │ ├── scale.html │ │ │ │ │ ├── getPort.md │ │ │ │ │ ├── addPort.md │ │ │ │ │ ├── getAncestors.html │ │ │ │ │ ├── stopTransitions.html │ │ │ │ │ ├── addTo.html │ │ │ │ │ ├── addPorts.md │ │ │ │ │ ├── findView.html │ │ │ │ │ ├── isEmbeddedIn.html │ │ │ │ │ ├── toJSON.html │ │ │ │ │ ├── clone.html │ │ │ │ │ ├── getBBox.html │ │ │ │ │ ├── fitEmbeds.html │ │ │ │ │ ├── remove.html │ │ │ │ │ ├── toBack.html │ │ │ │ │ ├── rotate.html │ │ │ │ │ ├── isLink.html │ │ │ │ │ ├── isElement.html │ │ │ │ │ ├── prop.html │ │ │ │ │ ├── portProp.md │ │ │ │ │ ├── removeAttr.html │ │ │ │ │ ├── embed.html │ │ │ │ │ ├── getEmbeddedCells.html │ │ │ │ │ └── position.html │ │ │ ├── Paper │ │ │ │ ├── prototype │ │ │ │ │ ├── options │ │ │ │ │ │ ├── width.html │ │ │ │ │ │ ├── gridSize.html │ │ │ │ │ │ ├── height.html │ │ │ │ │ │ ├── model.html │ │ │ │ │ │ ├── el.html │ │ │ │ │ │ ├── origin.html │ │ │ │ │ │ ├── perpendicularLinks.html │ │ │ │ │ │ ├── multiLinks.html │ │ │ │ │ │ ├── defaultRouter.html │ │ │ │ │ │ ├── defaultConnector.html │ │ │ │ │ │ ├── snapLinks.html │ │ │ │ │ │ ├── validateMagnet.html │ │ │ │ │ │ ├── defaultLink.html │ │ │ │ │ │ ├── linkView.html │ │ │ │ │ │ ├── elementView.html │ │ │ │ │ │ ├── guard.html │ │ │ │ │ │ ├── linkPinning.html │ │ │ │ │ │ ├── validateEmbedding.html │ │ │ │ │ │ ├── validateConnection.html │ │ │ │ │ │ ├── markAvailable.html │ │ │ │ │ │ ├── interactive.html │ │ │ │ │ │ └── restrictTranslate.html │ │ │ │ │ ├── setGridSize.html │ │ │ │ │ ├── getContentBBox.html │ │ │ │ │ ├── pageOffset.html │ │ │ │ │ ├── clientOffset.html │ │ │ │ │ ├── setInteractivity.html │ │ │ │ │ ├── drawBackground.md │ │ │ │ │ ├── drawGrid.html │ │ │ │ │ ├── findViewByModel.html │ │ │ │ │ ├── setOrigin.html │ │ │ │ │ ├── setDimensions.html │ │ │ │ │ ├── findView.html │ │ │ │ │ ├── matrix.html │ │ │ │ │ ├── clientToLocalPoint.html │ │ │ │ │ ├── pageToLocalPoint.html │ │ │ │ │ ├── translate.html │ │ │ │ │ ├── findViewsInArea.html │ │ │ │ │ ├── paperToLocalPoint.html │ │ │ │ │ ├── paperToLocalRect.html │ │ │ │ │ ├── clientToLocalRect.html │ │ │ │ │ ├── localToPageRect.html │ │ │ │ │ ├── localToPaperRect.html │ │ │ │ │ ├── localToClientRect.html │ │ │ │ │ ├── scale.html │ │ │ │ │ ├── pageToLocalRect.html │ │ │ │ │ ├── localToPagePoint.html │ │ │ │ │ ├── properties.html │ │ │ │ │ ├── localToPaperPoint.html │ │ │ │ │ └── localToClientPoint.html │ │ │ │ └── constructor.html │ │ │ ├── Link │ │ │ │ ├── prototype │ │ │ │ │ ├── remove.html │ │ │ │ │ ├── clone.html │ │ │ │ │ ├── getTransitions.html │ │ │ │ │ ├── scale.html │ │ │ │ │ ├── getSourceElement.html │ │ │ │ │ ├── getTargetElement.html │ │ │ │ │ ├── getAncestors.html │ │ │ │ │ ├── stopTransitions.html │ │ │ │ │ ├── addTo.html │ │ │ │ │ ├── disconnect.html │ │ │ │ │ ├── toBack.html │ │ │ │ │ ├── toFront.html │ │ │ │ │ ├── toJSON.html │ │ │ │ │ ├── findView.html │ │ │ │ │ ├── isEmbeddedIn.html │ │ │ │ │ ├── translate.html │ │ │ │ │ ├── hasLoop.html │ │ │ │ │ ├── reparent.html │ │ │ │ │ ├── isElement.html │ │ │ │ │ ├── isLink.html │ │ │ │ │ ├── removeAttr.html │ │ │ │ │ ├── transition.html │ │ │ │ │ └── prop.html │ │ │ │ └── intro.html │ │ │ ├── Graph │ │ │ │ ├── prototype │ │ │ │ │ ├── getCells.html │ │ │ │ │ ├── getCell.html │ │ │ │ │ ├── getLinks.html │ │ │ │ │ ├── getElements.html │ │ │ │ │ ├── removeLinks.html │ │ │ │ │ ├── disconnectLinks.html │ │ │ │ │ ├── getSinks.html │ │ │ │ │ ├── getSources.html │ │ │ │ │ ├── isSuccessor.html │ │ │ │ │ ├── isPredecessor.html │ │ │ │ │ ├── removeCells.html │ │ │ │ │ ├── isSink.html │ │ │ │ │ ├── isSource.html │ │ │ │ │ ├── clear.html │ │ │ │ │ ├── getBBox.html │ │ │ │ │ ├── addCells.html │ │ │ │ │ ├── getFirstCell.html │ │ │ │ │ ├── getLastCell.html │ │ │ │ │ ├── toJSON.html │ │ │ │ │ ├── translate.html │ │ │ │ │ ├── findModelsInArea.html │ │ │ │ │ ├── findModelsFromPoint.html │ │ │ │ │ ├── search.html │ │ │ │ │ ├── getCommonAncestor.html │ │ │ │ │ ├── getConnectedLinks.html │ │ │ │ │ ├── resetCells.html │ │ │ │ │ ├── fromJSON.html │ │ │ │ │ ├── findModelsUnderElement.html │ │ │ │ │ ├── cloneSubgraph.html │ │ │ │ │ ├── addCell.html │ │ │ │ │ ├── getSuccessors.html │ │ │ │ │ ├── getPredecessors.html │ │ │ │ │ ├── isNeighbor.html │ │ │ │ │ └── getNeighbors.html │ │ │ │ └── events.html │ │ │ ├── LinkView │ │ │ │ └── prototype │ │ │ │ │ ├── getBBox.html │ │ │ │ │ ├── getConnectionLength.html │ │ │ │ │ └── sendToken.html │ │ │ ├── Cell │ │ │ │ └── intro.html │ │ │ ├── CellView │ │ │ │ ├── prototype │ │ │ │ │ ├── unhighlight.html │ │ │ │ │ └── highlight.html │ │ │ │ └── intro.html │ │ │ └── ElementView │ │ │ │ ├── intro.html │ │ │ │ └── prototype │ │ │ │ └── getBBox.html │ │ │ ├── specialAttributes │ │ │ ├── style.html │ │ │ ├── ref.html │ │ │ ├── x-alignment.html │ │ │ ├── y-alignment.html │ │ │ ├── ref-dx.html │ │ │ ├── ref-dy.html │ │ │ ├── magnet.html │ │ │ ├── stroke.html │ │ │ ├── text.html │ │ │ ├── port.html │ │ │ ├── ref-x.html │ │ │ ├── ref-y.html │ │ │ ├── textPath.html │ │ │ └── ref-height.html │ │ │ ├── util │ │ │ ├── guid.html │ │ │ ├── uuid.html │ │ │ ├── cancelFrame.html │ │ │ ├── getElementBBox.html │ │ │ ├── getByPath.html │ │ │ ├── unsetByPath.html │ │ │ ├── imageToDataUri.html │ │ │ ├── nextFrame.html │ │ │ ├── setByPath.html │ │ │ ├── sortElements.html │ │ │ ├── format │ │ │ │ └── number.html │ │ │ ├── shapePerimeterConnectionPoint.html │ │ │ └── flattenObject.html │ │ │ ├── highlighters │ │ │ ├── addClass.html │ │ │ ├── opacity.html │ │ │ └── stroke.html │ │ │ └── env │ │ │ ├── addTest.html │ │ │ └── test.html │ ├── geometry │ │ ├── api │ │ │ └── g │ │ │ │ ├── toDeg.html │ │ │ │ ├── line │ │ │ │ ├── prototype │ │ │ │ │ ├── length.html │ │ │ │ │ ├── clone.html │ │ │ │ │ ├── toString.html │ │ │ │ │ ├── midpoint.html │ │ │ │ │ ├── squaredLength.html │ │ │ │ │ ├── bearing.html │ │ │ │ │ ├── pointAt.html │ │ │ │ │ ├── intersect.html │ │ │ │ │ └── intersection.html │ │ │ │ └── constructor.html │ │ │ │ ├── rect │ │ │ │ ├── prototype │ │ │ │ │ ├── leftLine.html │ │ │ │ │ ├── topLine.html │ │ │ │ │ ├── bottomLine.html │ │ │ │ │ ├── rightLine.html │ │ │ │ │ ├── center.html │ │ │ │ │ ├── round.html │ │ │ │ │ ├── clone.html │ │ │ │ │ ├── origin.html │ │ │ │ │ ├── toString.html │ │ │ │ │ ├── union.html │ │ │ │ │ ├── corner.html │ │ │ │ │ ├── topMiddle.html │ │ │ │ │ ├── topRight.html │ │ │ │ │ ├── bottomLeft.html │ │ │ │ │ ├── leftMiddle.html │ │ │ │ │ ├── rightMiddle.html │ │ │ │ │ ├── bottomMiddle.html │ │ │ │ │ ├── pointNearestToPoint.html │ │ │ │ │ ├── toJSON.html │ │ │ │ │ ├── equals.html │ │ │ │ │ ├── containsPoint.html │ │ │ │ │ ├── containsRect.html │ │ │ │ │ ├── moveAndExpand.html │ │ │ │ │ ├── bbox.html │ │ │ │ │ ├── intersect.html │ │ │ │ │ ├── snapToGrid.html │ │ │ │ │ ├── sideNearestToPoint.html │ │ │ │ │ ├── normalize.html │ │ │ │ │ ├── inflate.html │ │ │ │ │ └── intersectionWithLineFromCenterToPoint.html │ │ │ │ ├── fromEllipse.html │ │ │ │ └── constructor.html │ │ │ │ ├── point │ │ │ │ ├── prototype │ │ │ │ │ ├── clone.html │ │ │ │ │ ├── round.html │ │ │ │ │ ├── toString.html │ │ │ │ │ ├── distance.html │ │ │ │ │ ├── rotate.html │ │ │ │ │ ├── scale.html │ │ │ │ │ ├── toJSON.html │ │ │ │ │ ├── theta.html │ │ │ │ │ ├── equals.html │ │ │ │ │ ├── magnitude.html │ │ │ │ │ ├── move.html │ │ │ │ │ ├── reflection.html │ │ │ │ │ ├── toPolar.html │ │ │ │ │ ├── update.html │ │ │ │ │ ├── adhereToRect.html │ │ │ │ │ ├── manhattanDistance.html │ │ │ │ │ ├── snapToGrid.html │ │ │ │ │ ├── bearing.html │ │ │ │ │ ├── changeInAngle.html │ │ │ │ │ ├── normalize.html │ │ │ │ │ ├── offset.html │ │ │ │ │ └── difference.html │ │ │ │ ├── random.html │ │ │ │ ├── fromPolar.html │ │ │ │ └── constructor.html │ │ │ │ ├── ellipse │ │ │ │ ├── prototype │ │ │ │ │ ├── toString.html │ │ │ │ │ ├── bbox.html │ │ │ │ │ ├── clone.html │ │ │ │ │ ├── equals.html │ │ │ │ │ ├── containsPoint.html │ │ │ │ │ ├── tangentTheta.html │ │ │ │ │ ├── inflate.html │ │ │ │ │ ├── normalizedDistance.html │ │ │ │ │ └── intersectionWithLineFromCenterToPoint.html │ │ │ │ ├── fromRect.html │ │ │ │ └── constructor.html │ │ │ │ ├── normalizeAngle.html │ │ │ │ ├── snapToGrid.html │ │ │ │ ├── toRad.html │ │ │ │ ├── bezier │ │ │ │ ├── getFirstControlPoints.html │ │ │ │ ├── getCurveDivider.html │ │ │ │ ├── curveThroughPoints.html │ │ │ │ ├── getCurveControlPoints.html │ │ │ │ └── getInversionSolver.html │ │ │ │ └── scale │ │ │ │ └── linear.html │ │ └── intro.md │ └── vectorizer │ │ ├── api │ │ ├── prototype │ │ │ ├── remove.html │ │ │ ├── empty.html │ │ │ ├── index.html │ │ │ ├── svg.html │ │ │ ├── find.html │ │ │ ├── clone.html │ │ │ ├── toLocalPoint.html │ │ │ ├── append.html │ │ │ ├── prepend.html │ │ │ ├── hasClass.html │ │ │ ├── scale.html │ │ │ ├── findOne.html │ │ │ ├── removeClass.html │ │ │ ├── addClass.html │ │ │ ├── toggleClass.html │ │ │ ├── translate.html │ │ │ ├── before.html │ │ │ ├── rotate.html │ │ │ ├── translateCenterToPoint.html │ │ │ ├── attr.html │ │ │ ├── defs.html │ │ │ ├── bbox.html │ │ │ ├── transform.html │ │ │ ├── convertToPath.html │ │ │ ├── convertToPathData.html │ │ │ ├── animateAlongPath.html │ │ │ ├── translateAndAutoOrient.html │ │ │ ├── findIntersection.html │ │ │ └── sample.html │ │ ├── V │ │ │ ├── isVElement.html │ │ │ ├── createSVGTransform.html │ │ │ ├── findAnnotationsAtIndex.html │ │ │ ├── createSVGPoint.html │ │ │ ├── shiftAnnotations.html │ │ │ ├── findAnnotationsBetweenIndexes.html │ │ │ ├── transformStringToMatrix.html │ │ │ ├── createSVGMatrix.html │ │ │ ├── decomposeMatrix.html │ │ │ ├── transformPoint.html │ │ │ ├── rectToPath.html │ │ │ └── transformRect.html │ │ └── constructor.html │ │ └── intro.html ├── images │ ├── clear.png │ ├── joint.dia.Graph.bfs.png │ ├── joint.dia.Graph.dfs.png │ ├── vertical_navigation_background.jpg │ ├── joint.util.shapePerimeterConnectionPoint.png │ └── anchor.svg ├── templates │ └── partials │ │ ├── navItems.html │ │ └── contentItems.html └── demo │ └── devs │ └── shapes.devs.html ├── wrappers ├── geometry.foot.js ├── vectorizer.foot.js ├── joint.foot.js ├── geometry.head.js └── vectorizer.head.js ├── demo ├── fsa │ ├── css │ │ └── fsa.css │ └── index.html ├── org │ ├── images │ │ ├── male.png │ │ └── female.png │ └── index.html ├── umlcd │ ├── css │ │ └── umlcd.css │ └── index.html ├── erd │ ├── css │ │ └── erd.css │ └── index.html ├── clipping.svg ├── routing │ └── css │ │ └── routing.css ├── requirejs │ └── index.html ├── common.css ├── links │ └── index.html ├── hull │ └── index.html ├── umlsc │ └── index.html ├── petri nets │ └── index.html ├── vectorizer.html ├── logic │ └── index.html ├── chess │ └── css │ │ └── chess.css ├── graph.html ├── router-orthogonal.html ├── ports.html ├── 3d.html ├── meridium.html ├── sketched.html ├── nested-clone.html ├── filters.html ├── iphone.html ├── nested.html ├── gradients.html ├── hyperlinks.html ├── transition.html ├── performance.html └── clipping.html ├── .gitignore ├── index.js ├── tutorials ├── images │ └── arch.png ├── css │ └── mark-available.css └── js │ └── bind-adjust-vertices.js ├── .csslintrc ├── .travis.yml ├── plugins ├── routers │ └── joint.routers.normal.js ├── connectors │ ├── joint.connectors.normal.js │ └── joint.connectors.smooth.js ├── highlighters │ ├── joint.highlighters.opacity.js │ └── joint.highlighters.addClass.js └── polyfills │ └── xhrResponse.js ├── .eslintrc.js ├── Makefile ├── test ├── geometry │ ├── requirejs.html │ ├── scale.js │ ├── bezier.js │ ├── snapToGrid.js │ ├── index.html │ ├── toRad.js │ └── toDeg.js ├── jointjs │ ├── webpack.js │ ├── browserify.js │ ├── requirejs.html │ ├── webpack.html │ ├── browserify.html │ ├── cell.js │ └── elements.js └── vectorizer │ └── requirejs.html └── bower.json /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory" : "lib" 3 | } -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getPortIndex.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /wrappers/geometry.foot.js: -------------------------------------------------------------------------------- 1 | 2 | return g; 3 | 4 | })); 5 | -------------------------------------------------------------------------------- /wrappers/vectorizer.foot.js: -------------------------------------------------------------------------------- 1 | 2 | return V; 3 | 4 | })); 5 | -------------------------------------------------------------------------------- /demo/fsa/css/fsa.css: -------------------------------------------------------------------------------- 1 | #paper { 2 | display: inline-block; 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | node_modules/ 3 | lib/*/* 4 | coverage.info 5 | npm-debug.log -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('./dist/joint.min'); 4 | -------------------------------------------------------------------------------- /docs/images/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/docs/images/clear.png -------------------------------------------------------------------------------- /demo/org/images/male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/demo/org/images/male.png -------------------------------------------------------------------------------- /tutorials/images/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/tutorials/images/arch.png -------------------------------------------------------------------------------- /demo/org/images/female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/demo/org/images/female.png -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/width.html: -------------------------------------------------------------------------------- 1 | width - width of the paper in pixels -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/gridSize.html: -------------------------------------------------------------------------------- 1 | gridSize - size of the grid in pixels -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/height.html: -------------------------------------------------------------------------------- 1 | height - height of the paper in pixels -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/model.html: -------------------------------------------------------------------------------- 1 | model - joint.dia.Graph object -------------------------------------------------------------------------------- /docs/images/joint.dia.Graph.bfs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/docs/images/joint.dia.Graph.bfs.png -------------------------------------------------------------------------------- /docs/images/joint.dia.Graph.dfs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/docs/images/joint.dia.Graph.dfs.png -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/style.html: -------------------------------------------------------------------------------- 1 | 2 |

An object containing CSS styles for a subelement.

-------------------------------------------------------------------------------- /demo/umlcd/css/umlcd.css: -------------------------------------------------------------------------------- 1 | .joint-type-uml-composition .marker-target { 2 | fill: #4a4e69; 3 | stroke: #4a4e69; 4 | } 5 | -------------------------------------------------------------------------------- /wrappers/joint.foot.js: -------------------------------------------------------------------------------- 1 | 2 | joint.g = g; 3 | joint.V = joint.Vectorizer = V; 4 | 5 | return joint; 6 | 7 | })); 8 | -------------------------------------------------------------------------------- /.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "fallback-colors": false, 5 | "known-properties": false 6 | } -------------------------------------------------------------------------------- /docs/images/vertical_navigation_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/docs/images/vertical_navigation_background.jpg -------------------------------------------------------------------------------- /docs/src/joint/api/util/guid.html: -------------------------------------------------------------------------------- 1 |
util.guid()

Return an identifier unique for the page.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/el.html: -------------------------------------------------------------------------------- 1 | el - CSS selector, jQuery object or a DOM element holding the container for the paper -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/remove.html: -------------------------------------------------------------------------------- 1 |
link.remove()

Remove the link from the graph.

-------------------------------------------------------------------------------- /docs/images/joint.util.shapePerimeterConnectionPoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/this/joint/master/docs/images/joint.util.shapePerimeterConnectionPoint.png -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/ref.html: -------------------------------------------------------------------------------- 1 | 2 |

CSS selector pointing to an element that is used as a reference for relative positioning attributes.

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/x-alignment.html: -------------------------------------------------------------------------------- 1 | 2 |

If set to 'middle', the subelement will be centered around its new x-coordinate.

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/y-alignment.html: -------------------------------------------------------------------------------- 1 | 2 |

If set to 'middle', the subelement will be centered around its new y-coordinate.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getCells.html: -------------------------------------------------------------------------------- 1 |
graph.getCells()

Get all the elemnet and links in the graph.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/LinkView/prototype/getBBox.html: -------------------------------------------------------------------------------- 1 |
linkView.getBBox()

Return a bounding box for a link view.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/toDeg.html: -------------------------------------------------------------------------------- 1 | 2 |
g.toDeg(rad)
3 |

Convert radians rad to degrees.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getCell.html: -------------------------------------------------------------------------------- 1 |
graph.getCell(id)

Get a cell from the graph by its id.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/remove.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.remove()
3 |

Remove the element from the DOM.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/length.html: -------------------------------------------------------------------------------- 1 | 2 |
line.length()
3 |

Return the length of the line.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getLinks.html: -------------------------------------------------------------------------------- 1 |
graph.getLinks()

Get all the links in the graph (i.e. omit elements).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/clone.html: -------------------------------------------------------------------------------- 1 |
link.clone()

Returns a new instance of the link with identical attributes.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/unembed.html: -------------------------------------------------------------------------------- 1 |
element.unembed(cell)

Free up an embedded cell from its parent element.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getElements.html: -------------------------------------------------------------------------------- 1 |
graph.getElements()

Get all the elements in the graph (i.e. omit links).

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/empty.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.empty()
3 |

Removes all the child nodes from the Vectorizer element.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/leftLine.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.leftLine()
3 |

Return the left line of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/topLine.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.topLine()
3 |

Return the top line of the rectangle.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/origin.html: -------------------------------------------------------------------------------- 1 | origin - position of zero coordinates of the paper in pixels (default is { x: 0, y: 0 } i.e. top-left corner) -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/setGridSize.html: -------------------------------------------------------------------------------- 1 | 2 |
paper.setGridSize(gridSize)
3 |

Set the grid size of the paper.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/clone.html: -------------------------------------------------------------------------------- 1 | 2 |
line.clone()
3 |

Return another line which is a clone of the line.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/bottomLine.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.bottomLine()
3 |

Return the bottom line of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/rightLine.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.rightLine()
3 |

Return the right line of the rectangle.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/getTransitions.html: -------------------------------------------------------------------------------- 1 |
link.getTransitions()

Return an array of all active transitions (their paths).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/getContentBBox.html: -------------------------------------------------------------------------------- 1 |
paper.getContentBBox()

Return the bounding box of the content inside the paper.

-------------------------------------------------------------------------------- /tutorials/css/mark-available.css: -------------------------------------------------------------------------------- 1 | /* port styling */ 2 | .available-magnet { 3 | fill: yellow; 4 | } 5 | 6 | /* element styling */ 7 | .available-cell rect { 8 | stroke-dasharray: 5, 2; 9 | } -------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/toString.html: -------------------------------------------------------------------------------- 1 | 2 |
line.toString()
3 |

Returns the line represented as a string.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/clone.html: -------------------------------------------------------------------------------- 1 | 2 |
point.clone()
3 |

Return another point which is a clone of the point.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/round.html: -------------------------------------------------------------------------------- 1 | 2 |
point.round([precision])
3 |

Rounds the point to the given precision.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/toString.html: -------------------------------------------------------------------------------- 1 | 2 |
point.toString()
3 |

Returns the point as a string x@y.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/center.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.center()
3 |

Return the point that is the center of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/round.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.round([precision])
3 |

Rounds the rectangle to the given precision.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getTransitions.html: -------------------------------------------------------------------------------- 1 |
element.getTransitions()

Return an array of all active transitions (their paths).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/hasPorts.md: -------------------------------------------------------------------------------- 1 |
element.hasPorts()
2 | 3 | Check if an element has any ports defined. Returns `boolean`. 4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/LinkView/prototype/getConnectionLength.html: -------------------------------------------------------------------------------- 1 |
linkView.getConnectionLength()

Return a total length of a link in pixels.

-------------------------------------------------------------------------------- /docs/src/joint/api/util/uuid.html: -------------------------------------------------------------------------------- 1 |
util.uuid()

Return a pseudo-UUID.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/index.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.index()
3 |

Return the index of the SVG element amongst its siblings.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/toString.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.toString()
3 |

Returns the ellipse represented as a string.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/midpoint.html: -------------------------------------------------------------------------------- 1 | 2 |
line.midpoint()
3 |

Return the point that is in the middle of the line.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/clone.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.clone()
3 |

Return another rectangle which is a clone of the rectangle.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/hasPort.md: -------------------------------------------------------------------------------- 1 |
element.hasPort(id)
2 | 3 | Check if an element contains a port with `id`. Returns `boolean`. 4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/removeLinks.html: -------------------------------------------------------------------------------- 1 |
graph.removeLinks(element)

Remove all the associated links with the element.

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/ref-dx.html: -------------------------------------------------------------------------------- 1 | 2 |

Make x-coordinate of the subelement relative to the right edge of the element referenced to by the selector in ref attribute.

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/ref-dy.html: -------------------------------------------------------------------------------- 1 | 2 |

Make y-coordinate of the subelement relative to the bottom edge of the element referenced to by the selector in ref attribute.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/svg.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.svg()
3 |

Return the Vectorizer object for the root SVG element of the element.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/fromRect.html: -------------------------------------------------------------------------------- 1 | 2 |
g.ellipse.fromRect(rect)
3 |

Returns a new ellipse object from the given rect.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/bbox.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.bbox()
3 |

Return the rectangle that is the bounding box of the ellipse.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/origin.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.origin()
3 |

Return the point that is the top left corner of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/toString.html: -------------------------------------------------------------------------------- 1 | 2 |
point.toString()
3 |

Returns the rectangle as a string x@y x@y.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/union.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.union(r)
3 |

Return a rectangle object that is a union of the two rectangles.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/clone.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.clone()
3 |

Return another ellipse which is a clone of the ellipse.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/fromEllipse.html: -------------------------------------------------------------------------------- 1 | 2 |
g.rect.fromEllipse(ellipse)
3 |

Returns a new rectangle object from the given ellipse.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/corner.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.corner()
3 |

Return the point that is the bottom right corner of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/topMiddle.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.topMiddle()
3 |

Return the point that is at the top middle of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/topRight.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.topRight()
3 |

Return the point that is the top right corner of the rectangle.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/disconnectLinks.html: -------------------------------------------------------------------------------- 1 |
graph.disconnectLinks(element)

Disconnect all the associated links with the element.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/pageOffset.html: -------------------------------------------------------------------------------- 1 |
paper.pageOffset()
2 |

Returns coordinates of the paper viewport, relative to the document. 3 |

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/magnet.html: -------------------------------------------------------------------------------- 1 | 2 |

When set to true, the subelement can become a source/target of a link during link reconnection. Useful for 3 | so called 'ports'.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/normalizeAngle.html: -------------------------------------------------------------------------------- 1 | 2 |
g.normalizeAngle(angle)
3 |

Convert the angle to the range [0, 360].

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/bottomLeft.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.bottomLeft()
3 |

Return the point that is the bottom left corner of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/leftMiddle.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.leftMiddle()
3 |

Return the point that is at the left middle of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/rightMiddle.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.rightMiddle()
3 |

Return the point that is at the right middle of the rectangle.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/scale.html: -------------------------------------------------------------------------------- 1 | 2 |
link.scale(sx, sy, origin[, opt])
3 |

Scales the link's points (vertices) relative to the given origin.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/perpendicularLinks.html: -------------------------------------------------------------------------------- 1 | perpendicularLinks - if true, links will tend to get perpendicular to their associated objects. Default is false -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/isVElement.html: -------------------------------------------------------------------------------- 1 | 2 |
V.isVElement(object)
3 |

Return true if object is a vectorizer element.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/distance.html: -------------------------------------------------------------------------------- 1 | 2 |
point.distance(p)
3 |

Return the distance between the point and another point p.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/bottomMiddle.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.bottomMiddle()
3 |

Return the point that is at the bottom middle of the rectangle.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/snapToGrid.html: -------------------------------------------------------------------------------- 1 | 2 |
g.snapToGrid(val, gridSize)
3 |

Snap the value val to a grid of size gridSize.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/removePort.md: -------------------------------------------------------------------------------- 1 |
element.removePort(port, [opt])
2 | 3 | Remove a port from an element, where `port` is a port object, or `portId`. 4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/getSourceElement.html: -------------------------------------------------------------------------------- 1 |
link.getSourceElement()

Return the source element of the link or null if there is none. 2 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/getTargetElement.html: -------------------------------------------------------------------------------- 1 |
link.getTargetElement()

Return the target element of the link or null if there is none. 2 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/rotate.html: -------------------------------------------------------------------------------- 1 | 2 |
point.rotate(o, angle)
3 |

Rotate the point by angle around the origin o.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getPorts.md: -------------------------------------------------------------------------------- 1 |
element.getPorts()
2 | 3 | Returns an array of all ports on the element. If there is no port an empty array is returned. 4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/scale.html: -------------------------------------------------------------------------------- 1 | 2 |
element.scale(sx, sy, origin[, opt])
3 |

Scales the element's position and size relative to the given origin.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/equals.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.equals(otherEllipse)
3 |

Returns true if the ellipse equals the other ellipse.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/scale.html: -------------------------------------------------------------------------------- 1 | 2 |
point.scale(sx, sy, origin)
3 |

Scale point by sx and sy about the given origin.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/clientOffset.html: -------------------------------------------------------------------------------- 1 |
paper.clientOffset()
2 |

Returns coordinates of the paper viewport, relative to the application's client area. 3 |

4 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/find.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.find(selector)
3 |

Return all elements wrapped in the Vectorizer object matching the selector.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/toJSON.html: -------------------------------------------------------------------------------- 1 | 2 |
point.toJSON()
3 |

Return the point as a simple JSON object. For example: { "x": 0, "y": 0 }.

-------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6" 4 | - "4" 5 | 6 | before_install: 7 | - npm install -g grunt-cli 8 | - npm install -g bower 9 | 10 | install: npm install 11 | 12 | before_script: 13 | - grunt install 14 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/theta.html: -------------------------------------------------------------------------------- 1 | 2 |
point.theta(p)
3 |

Return the angle (in degrees) between the point, another point p and the x-axis.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getPort.md: -------------------------------------------------------------------------------- 1 |
element.getPort(id)
2 | 3 | Returns the port specified by an `id`. If such a port does not exist the method returns `undefined`. 4 | 5 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/clone.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.clone()
3 |

Clone the Vectorizer object creating a brand new copy of the element. This clone is not automatically added to the DOM.

-------------------------------------------------------------------------------- /plugins/routers/joint.routers.normal.js: -------------------------------------------------------------------------------- 1 | // Does not make any changes to vertices. 2 | // Returns the arguments that are passed to it, unchanged. 3 | joint.routers.normal = function(vertices, opt, linkView) { 4 | 5 | return vertices; 6 | }; 7 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/addPort.md: -------------------------------------------------------------------------------- 1 |
element.addPort(port, [opt])
2 | 3 | Add a single port, where `port` could be defined as described in section [Port interface](#portinterface) 4 | 5 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getSinks.html: -------------------------------------------------------------------------------- 1 |
graph.getSinks()

Return an array of all the leafs of the graph. 2 | Time complexity: O(|V|). 3 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/multiLinks.html: -------------------------------------------------------------------------------- 1 | multiLinks - when set to false, an element may not have 2 | more than one link with the same source and target element. 3 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/createSVGTransform.html: -------------------------------------------------------------------------------- 1 | 2 |
V.createSVGTransform([matrix])
3 |

Returns a SVG transform object.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/equals.html: -------------------------------------------------------------------------------- 1 | 2 |
point.equals(p)
3 |

Return true if the point equals another point p Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/pointNearestToPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.pointNearestToPoint(p)
3 |

Return the point on the boundary of the rectangle nearest to the point p.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getSources.html: -------------------------------------------------------------------------------- 1 |
graph.getSources()

Return an array of all the roots of the graph. 2 | Time complexity: O(|V|). 3 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/constructor.html: -------------------------------------------------------------------------------- 1 | 2 |
g.ellipse(c, a, b)
3 |

Return a new ellipse object with center at point c and parameters a and b.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/magnitude.html: -------------------------------------------------------------------------------- 1 | 2 |
point.magnitude()
3 |

Return the magnitude of the point vector.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/move.html: -------------------------------------------------------------------------------- 1 | 2 |
point.move(ref, distance)
3 |

Move the point on a line that leads to another point ref by a certain distance.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/reflection.html: -------------------------------------------------------------------------------- 1 | 2 |
point.reflection(p)
3 |

Return a point that is a reflection of the point with the center of reflection at point p.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/toJSON.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.toJSON()
3 |

Return the rectangle as a simple JSON object. For example: { "x": 0, "y": 0, "width": 40, "height": 40 }.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/toRad.html: -------------------------------------------------------------------------------- 1 | 2 |
g.toRad(deg, over360)
3 |

Convert degrees deg to radians. If over360 is true, do not modulate on 360 degrees.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/isSuccessor.html: -------------------------------------------------------------------------------- 1 |
graph.isSuccessor(elementA, elementB)

Return true if elementB is a successor of elementA. 2 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/getAncestors.html: -------------------------------------------------------------------------------- 1 |
link.getAncestors()

Return an array of all the ancestors of this link starting from the immediate parent all the way up to the most distant ancestor.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/equals.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.equals(r)
3 |

Return true if the rectangle equals another rectangle r Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/isPredecessor.html: -------------------------------------------------------------------------------- 1 |
graph.isPredecessor(elementA, elementB)

Return true if elementB is a predecessor of elementA. 2 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/toPolar.html: -------------------------------------------------------------------------------- 1 | 2 |
point.toPolar(o)
3 |

Convert rectangular to polar coordinates. If the origin o is not specified, it is considered to be at (0,0).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getAncestors.html: -------------------------------------------------------------------------------- 1 |
element.getAncestors()
2 |

Return an array of all the ancestors of this element starting from the immediate parent all the way up to the most distant ancestor.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/stopTransitions.html: -------------------------------------------------------------------------------- 1 |
link.stopTransitions([path])

Stops all running transitions. If parameter path is provided, it will stop only transitions specified by this path.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/toLocalPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.toLocalPoint(x, y)
3 |

Convert a global point with coordinates x and y into the coordinate space of the element.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/containsPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.containsPoint(p)
3 |

Return true if the point p is inside the ellipse (inclusive). Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/stopTransitions.html: -------------------------------------------------------------------------------- 1 |
element.stopTransitions([path])

Stops all running transitions. If parameter path is provided, it will stop only transitions specified by this path.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/squaredLength.html: -------------------------------------------------------------------------------- 1 | 2 |
line.squaredLength()
3 |

Return the squared length of the line. Useful in cases the real length is not necessary (saves the Math.sqrt() operation).

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/update.html: -------------------------------------------------------------------------------- 1 | 2 |
point.update(x, y)
3 |

Update the point x and y coordinates with new values and return the point itself. Useful for chaining.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/random.html: -------------------------------------------------------------------------------- 1 | 2 |
g.point.random(x1, x2, y1, y2)
3 |

Returns a new point object with random coordinates that fall within the range [x1, x2] and [y1, y2].

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/containsPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.containsPoint(p)
3 |

Return true if the point p is inside the rectangle (inclusive). Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/containsRect.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.containsRect(r)
3 |

Return true if the rectangle r is inside the rectangle (inclusive). Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/moveAndExpand.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.moveAndExpand(r)
3 |

Offset the rectangle by r.x and r.y and expand it by r.width and r.height.

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/stroke.html: -------------------------------------------------------------------------------- 1 | 2 |

The stroke attribute becomes a special attribute only in case it's defined as an object. This has the exact same 3 | behaviour as the fill attribute. 4 |

-------------------------------------------------------------------------------- /docs/src/joint/api/util/cancelFrame.html: -------------------------------------------------------------------------------- 1 |
util.cancelFrame(requestId)

Cancels an animation frame request identified by requestId previously scheduled through a call to joint.util.nextFrame.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/append.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.append(els)
3 |

Append another element (or elements) els as the last child of the element. els can be Vectorizer object(s) or SVG DOM element(s).

4 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/prepend.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.prepend(els)
3 |

Prepend another element (or elements) els as the first child of the element. els can be Vectorizer object(s) or SVG DOM element(s).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/addTo.html: -------------------------------------------------------------------------------- 1 |
link.addTo(graph)

Add the link to the graph (an instance of joint.dia.Graph). 2 | This is equivalent to calling graph.addCell(link). 3 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/tangentTheta.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.tangentTheta(point)
3 |

Returns the angle between the x axis and the tangent from a point. It is valid for points laying on the ellipse boundary only.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/bbox.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.bbox(angle)
3 |

Return a rectangle that is the bounding box of the rectangle taking into account its rotation around center specified by angle degrees.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/addTo.html: -------------------------------------------------------------------------------- 1 | 2 |
element.addTo(graph)
3 |

Add the element to the graph (an instance of joint.dia.Graph). This is equivalent to calling graph.addCell(element).

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/removeCells.html: -------------------------------------------------------------------------------- 1 | 2 |
graph.removeCells(cells[, opt])
3 |
graph.removeCells(cell, cell, ..[, opt])
4 |

Removes the given cells from the graph.

5 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/hasClass.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.hasClass(className)
3 |

Return true if the element contains className in its class attribute. Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/scale.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.scale(sx [, sy])
3 |

Scale the element by sx and sy factors. If sy is not passed, it will be considered the same as sx.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/fromPolar.html: -------------------------------------------------------------------------------- 1 | 2 |
g.point.fromPolar(distance, angle, origin)
3 |

Returns a new point object from the given polar coordinates.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/disconnect.html: -------------------------------------------------------------------------------- 1 |
link.disconnect()

Disconnect the link from its source and target elements. The source and target then become a point at [0,0].

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/setInteractivity.html: -------------------------------------------------------------------------------- 1 | 2 |
paper.setInteractivity(interactive)
3 |

Set the interactivity of the paper. For example, to disable interactivity:

4 |
paper.setInteractivity(false);
5 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/findAnnotationsAtIndex.html: -------------------------------------------------------------------------------- 1 | 2 |
V.findAnnotationsAtIndex(annotations, index)
3 |

Find all the annotations (see v.text()) that apply to the character at index.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/findOne.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.findOne(selector)
3 |

Return the first element wrapped in the Vectorizer object matching the selector Return undefined if not such element was found.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/removeClass.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.removeClass(className)
3 |

Remove className from the element class attribute if it contains it. Return the Vectorizer object for easy chaining.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/adhereToRect.html: -------------------------------------------------------------------------------- 1 | 2 |
point.adhereToRect(r)
3 |

If the point lies outside the rectangle r, adjust the point so that it becomes the nearest point on the boundary of r.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/toBack.html: -------------------------------------------------------------------------------- 1 |
link.toBack()

Move the link so it is behind all other cells (elements/links). This is a method analogous to toBack method of Joint.dia.Element.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/addClass.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.addClass(className)
3 |

Append className to the element class attribute if it doesn't contain it already. Return the Vectorizer object for easy chaining.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/bearing.html: -------------------------------------------------------------------------------- 1 | 2 |
line.bearing()
3 |

Return the bearing (cardinal direction) of the line. The return value is a one of the following strings: 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW' and 'N'.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/manhattanDistance.html: -------------------------------------------------------------------------------- 1 | 2 |
point.manhattanDistance(p)
3 |

Return the manhattan distance between the point and another point p.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/createSVGPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
V.createSVGPoint(x, y)
3 |

Return the SVG point object initialized with the x and y coordinates.

-------------------------------------------------------------------------------- /demo/erd/css/erd.css: -------------------------------------------------------------------------------- 1 | #paper { 2 | width: inherit; 3 | display: block; 4 | border: 0; 5 | margin-bottom: 3px; 6 | text-align: center; 7 | background: #464a65; 8 | } 9 | #paper>svg { 10 | overflow: visible; 11 | } 12 | .connection, 13 | .connection-wrap { 14 | stroke: #ccc0ef; 15 | } -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/intersect.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.intersect(r)
3 |

Return a rectangle object that is a subtraction of the two rectangles if such an object exists (the two rectangles intersect). Return false otherwise.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/isSink.html: -------------------------------------------------------------------------------- 1 |
graph.isSink(element)

Return true if element is a leaf, i.e. there is no link coming out of the element. 2 | Time complexity: O(1). 3 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/isSource.html: -------------------------------------------------------------------------------- 1 |
graph.isSource(element)

Return true if element is a root, i.e. there is no link that targets the element. 2 | Time complexity: O(1). 3 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/toFront.html: -------------------------------------------------------------------------------- 1 |
link.toFront()

Move the element so it is on top of all other cells (elements/links). This is a method analogous to toFront method of Joint.dia.Element.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/shiftAnnotations.html: -------------------------------------------------------------------------------- 1 | 2 |
V.shiftAnnotations(annotations, index, offset)
3 |

Shift all the annotations (see v.text()) after character at index by offset positions.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/clear.html: -------------------------------------------------------------------------------- 1 |
graph.clear([options)
2 | 3 |

Remove all the cells from the graph. options object can optionally contain additional data that is passed overto the event listeners of the graph cells remove event.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/drawBackground.md: -------------------------------------------------------------------------------- 1 |
paper.drawBackground(opt);
2 | 3 | Sets the paper background defined by the `opt` object. Please see the background paper option for available configuration. 4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/snapToGrid.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.snapToGrid(gx, gy)
3 |

Adjust the position and dimensions of the rectangle such that its edges are on the nearest increment of gx on the x-axis and gy on the y-axis.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/toggleClass.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.toggleClass(className, switch)
3 |

Add or remove className from the element class attribute depending on either the class's presence or the value of the switch argument.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/translate.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.translate(tx [, ty])
3 |

Translate the element by tx pixels in x axis and ty pixels in y axis. ty is optional in which case the translation in y axis is considered zero.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/toJSON.html: -------------------------------------------------------------------------------- 1 |
link.toJSON()

Return a copy of the link's attributes for JSON serialization. This is a method analogous to toJSON method of Joint.dia.Element. 2 | 3 |

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/before.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.before(els)
3 |

Adds the given element (or elements) els before the Vectorizer element vel as a child of the parent node. els can be Vectorizer object(s) or SVG DOM element(s).

4 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/rotate.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.rotate(angle [, cx, cy])
3 |

Rotate the element by angle degrees. If the optional cx and cy coordinates are passed, they will be used as an origin for the rotation.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/translateCenterToPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.translateCenterToPoint(p)
3 |

Translate the element so that its new center will be at point p. p is an object of the form { x: [number], y: [number] }.

-------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'extends': 'eslint:recommended', 3 | 'rules': { 4 | 'indent': ['error', 4, { 'SwitchCase': 1 }], 5 | 'no-console': 0, 6 | 'no-constant-condition': 0, 7 | 'no-undef': 0, 8 | 'no-unused-vars': ['error', { 'vars': 'local', 'args': 'none' }] 9 | } 10 | }; -------------------------------------------------------------------------------- /docs/src/geometry/api/g/bezier/getFirstControlPoints.html: -------------------------------------------------------------------------------- 1 | 2 |
g.bezier.getFirstControlPoints(rhs)
3 |

Solves a tridiagonal system for one of coordinates (x or y) of first Bezier control points. rhs is a right hand side vector. Returns a solution vector.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/findView.html: -------------------------------------------------------------------------------- 1 |
link.findView(paper)

Find view (joint.dia.LinkView) for the link model in the paper. 2 | This is a shortcut to the equivalent call paper.findViewByModel(link) 3 |

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/attr.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.attr(name, value)
3 |

Set SVG attribute with name and value on the element. If name is an object of the form { [name]: [value] }, more attributes will be set in one go.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/bezier/getCurveDivider.html: -------------------------------------------------------------------------------- 1 | 2 |
g.bezier.getCurveDivider(p0, p1, p2, p3)
3 |

Divide a Bezier curve into two at point defined by value t ∈ <0,1>. Uses the deCasteljau algorithm.

4 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/sideNearestToPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.sideNearestToPoint(p)
3 |

Return the "top", "left", "right" or "bottom" string denoting the side of the rectangle which is nearest to the point p.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/defaultRouter.html: -------------------------------------------------------------------------------- 1 | defaultRouter - a router that is used by links if no router property is defined on them. It can be either an object or a function. See the Presentation section of joint.dia.Link for more information about routers -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/findAnnotationsBetweenIndexes.html: -------------------------------------------------------------------------------- 1 | 2 |
V.findAnnotationsBetweenIndexes(annotations, start, end)
3 |

Find all the annotations (see v.text()) that apply to all the characters in the start and end range.

-------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: test stest ctest cstest all 3 | 4 | # all tests 5 | test: 6 | grunt test 7 | 8 | # server-side tests only 9 | stest: 10 | grunt test:server 11 | 12 | # client-side tests only 13 | ctest: 14 | grunt test:client 15 | 16 | # code styling tests only 17 | cstest: 18 | grunt test:code-style 19 | 20 | all: 21 | grunt build:all 22 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/snapToGrid.html: -------------------------------------------------------------------------------- 1 | 2 |
point.snapToGrid(gridSize, [gridSizeY])
3 |

Snap the point (change its x and y coordinates) to a grid of size gridSize (or gridSize x gridSizeY for non-uniform grid).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/addPorts.md: -------------------------------------------------------------------------------- 1 |
element.addPorts(ports, [opt])
2 | 3 | Add array of `ports`. Ports are validated for `id` duplicities, if there is a id collision, no new ports are added, where `port` could be defined as describe in section [Port interface](#portinterface) 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/findView.html: -------------------------------------------------------------------------------- 1 |
element.findView(paper)

Find view (joint.dia.ElementView) for the element model in the paper. 2 | This is a shortcut to the equivalent call paper.findViewByModel(element) 3 |

-------------------------------------------------------------------------------- /tutorials/js/bind-adjust-vertices.js: -------------------------------------------------------------------------------- 1 | var myAdjustVertices = _.partial(adjustVertices, graph); 2 | 3 | // adjust vertices when a cell is removed or its source/target was changed 4 | graph.on('add remove change:source change:target', myAdjustVertices); 5 | 6 | // also when an user stops interacting with an element. 7 | paper.on('cell:pointerup', myAdjustVertices); 8 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/drawGrid.html: -------------------------------------------------------------------------------- 1 | 2 |
paper.drawGrid([opt])
3 |

Draw visual grid lines on the paper. Possible options:

4 | 8 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/defaultConnector.html: -------------------------------------------------------------------------------- 1 | defaultConnector - a connector that is used by links if no connector property is defined on them. It can be either an object or a function. See the Presentation section of joint.dia.Link for more information about connectors -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/bearing.html: -------------------------------------------------------------------------------- 1 | 2 |
point.bearing(p)
3 |

Return the bearing (cardinal direction) of the line between the point and another point p. 4 | The return value is a one of the following strings: 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW' and 'N'.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getBBox.html: -------------------------------------------------------------------------------- 1 | 2 |
graph.getBBox(cells[, opt])
3 |

Returns the bounding box that surrounds all the given cells. Links are ignored. An example:

4 |
var bbox = graph.getBBox(graph.getElements());
5 | // { x: Number, y: Number, width: Number, height: Number }
6 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/findViewByModel.html: -------------------------------------------------------------------------------- 1 |
paper.findViewByModel(model)

Find a view (instance of joint.dia.ElementView or joint.dia.LinkView) associated with a model. model can either be an instance of joint.dia.Element or joint.dia.Link.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/pointAt.html: -------------------------------------------------------------------------------- 1 | 2 |
line.pointAt(t)
3 |

Return a point on the line at length specified by a floating point number t from the interaval [0,1]. For example, if t equals 0.5, the function returns the midpoint of the line.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/addCells.html: -------------------------------------------------------------------------------- 1 | 2 |
graph.addCells(cells[, opt])
3 |
graph.addCells(cell, cell, ..[, opt])
4 |

Add new cells to the graph. This is just a convenience method that wraps the addCell method.

5 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/snapLinks.html: -------------------------------------------------------------------------------- 1 | snapLinks - when enabled, force a dragged link to snap to the closest element/port in the given radius. The option accepts true in which case default values are used or an object of the form 2 | { radius: <value> } where you can specify the radius (default is 50). -------------------------------------------------------------------------------- /demo/clipping.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/routing/css/routing.css: -------------------------------------------------------------------------------- 1 | .router-switch { 2 | width: 100px; 3 | margin: 4px; 4 | background: #68ddd5; 5 | color: #484e68; 6 | outline: none; 7 | font-size: 12px; 8 | border: none; 9 | padding: 4px; 10 | border-radius: 5px; 11 | cursor: pointer; 12 | } 13 | .router-switch:hover { 14 | background: #fdc685; 15 | color: #fff; 16 | } -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getFirstCell.html: -------------------------------------------------------------------------------- 1 |
graph.getFirstCell()

Get the first cell (element or link) in the graph. The first cell is defined as the cell 2 | with the lowest z property (the cell most in the back, see the Presentation section of joint.dia.Element).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getLastCell.html: -------------------------------------------------------------------------------- 1 |
graph.getLastCell()

Get the last cell (element or link) in the graph. The last cell is defined as the cell 2 | with the highest z property (the cell most in the front, see the Presentation section of joint.dia.Element).

-------------------------------------------------------------------------------- /docs/src/joint/api/util/getElementBBox.html: -------------------------------------------------------------------------------- 1 |
util.getElementBBox(el)

Return a bounding box of the element el. The advantage of this method is that it can handle 2 | both HTML and SVG elements. The resulting object is of the form { x: Number, y: Number, width: Number, height: Number }. 3 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Cell/intro.html: -------------------------------------------------------------------------------- 1 |

The basic model for diagram cells. It's a Backbone model with a few additional properties and methods. The first one to mention is a unique identifier for the cell. Each cell has a unique ID that is stored in the id property. -------------------------------------------------------------------------------- /docs/src/joint/api/dia/CellView/prototype/unhighlight.html: -------------------------------------------------------------------------------- 1 |

cellView.unhighlight([el[, options]])
2 | 3 |

Removes the highlighting being done to the cell.

4 | 5 |

It is important to note that if you highlighted a cell using custom options, you must provide those exact same options when using the unhighlight method.

6 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/isEmbeddedIn.html: -------------------------------------------------------------------------------- 1 |
link.isEmbeddedIn(element [, opt])

Return true if the link is embedded in an element element. If opt.deep 2 | is false, only direct parentage will be checked. opt.deep is true by default.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/validateMagnet.html: -------------------------------------------------------------------------------- 1 | validateMagnet(cellView, magnet) - decide whether to create a link if the user clicks a magnet. magnet is the DOM element representing the magnet. By default, this function returns true for magnets that are not explicitely set to "passive" (which is usually the case of input ports). -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/normalize.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.normalize()
3 |

Normalize the rectangle, i.e. make it so that it has non-negative width and height. If width is less than 0, the function swaps left and right corners and if height is less than 0, the top and bottom corners are swapped.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/changeInAngle.html: -------------------------------------------------------------------------------- 1 | 2 |
point.changeInAngle(dx, dy, ref)
3 |

Return the change in angle that is the result of moving the point from its previous position (-dx, -dy) to its new position. 4 | This move is relative to the ref point and x axis.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/isEmbeddedIn.html: -------------------------------------------------------------------------------- 1 |
element.isEmbeddedIn(element [, opt])
2 |

Return true if the element is embedded in another element element. If opt.deep 3 | is false, only direct parentage will be checked. opt.deep is true by default.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/toJSON.html: -------------------------------------------------------------------------------- 1 | 2 |
element.toJSON()
3 |

Return a copy of the element's attributes for JSON serialization. This can be used for persistance or serialization. Note that this method doesn't return a JSON string but rather an object that can be then serialized to JSON with JSON.stringify().

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/defaultLink.html: -------------------------------------------------------------------------------- 1 | defaultLink - link that should be created when the user clicks and drags and active magnet (when creating a link from a port via the UI). Defaults to new joint.dia.Link. It can also be a function with signature function(cellView, magnet) {} that must return an object of type joint.dia.Link. -------------------------------------------------------------------------------- /docs/src/joint/api/util/getByPath.html: -------------------------------------------------------------------------------- 1 |
util.getByPath(object, path, delim)
2 | 3 |

Return a value at the path in a nested object. delim is the delimiter used in the path Example:

4 | 5 |
joint.util.getByPath({ a: { aa: { aaa: 3 } } }, 'a/aa/aaa', '/');
6 | // 3
7 | -------------------------------------------------------------------------------- /demo/requirejs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/intersect.html: -------------------------------------------------------------------------------- 1 | 2 |
line.intersect(l)
3 |

Return the intersection point of the line with another line l. A rectangle can also be passed in as the parameter, in which case, an array of intersection points with the line is returned. Return null if there is no such point.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/prototype/intersection.html: -------------------------------------------------------------------------------- 1 | 2 |
line.intersection(l)
3 |

Return the intersection point of the line with another line l. Return null if there is no such point.

4 |

This has been deprecated in favor of intersect.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/toJSON.html: -------------------------------------------------------------------------------- 1 |
graph.toJSON()

Return an object representing the graph ready for JSON serialization. This can be used for persistance or serialization. Note that this method doesn't 2 | return a JSON string but rather an object that can be then serialized to JSON with JSON.stringify().

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/inflate.html: -------------------------------------------------------------------------------- 1 |
2 |     rect.inflate(dx [, dy])
3 | 
4 |

5 | Return a rectangle inflated in axis x by 2 * dx and in axis y by 2 * dy. 6 | When method is called with a single parameter, the resulting rectangle is inflated by 2 * dx in both x and y axis. 7 |

8 | -------------------------------------------------------------------------------- /docs/src/geometry/intro.md: -------------------------------------------------------------------------------- 1 | Together with [Vectorizer](vectorizer.html), Geometry is another lightweight library built-in to JointJS. This library implements many useful **geometry operations**. The geometry library does not have any dependencies and can be used standalone. Please see the download page that contains both the [development and minified versions](http://jointjs.com/download#geometry) of this library. -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/text.html: -------------------------------------------------------------------------------- 1 | 2 |

Valid only for <text> subelements. 3 | text attribute contains the text that will be set either directly to the <text> subelement 4 | or its <tspan> children depending on whether the text is multiline or not (contains '\n' character(s)).

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/inflate.html: -------------------------------------------------------------------------------- 1 |
2 |     ellipse.inflate(dx [, dy])
3 | 
4 |

5 | Return an ellipse inflated in axis x by 2 * dx and in axis y by 2 * dy. 6 | When method is called with a single parameter, the resulting ellipse is inflated by 2 * dx in both x and y axis. 7 |

8 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/bezier/curveThroughPoints.html: -------------------------------------------------------------------------------- 1 | 2 |
g.bezier.curveThroughPoints(points)
3 |

Return the SVG path commands that define a cubic bezier curve going through the points. 4 | This method automatically computes the cubic bezier control points necessary to create a smooth curve crossing points.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/scale/linear.html: -------------------------------------------------------------------------------- 1 | 2 |
g.scale.linear(domain, range, value)
3 |

Return the value from the domain interval linearly scaled to the range interval. Both domain and range intervals must be specified as arrays with two numbers specifying start and end of the interval.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/linkView.html: -------------------------------------------------------------------------------- 1 | linkView - object that is responsible for rendering a link model into the paper. Defaults to joint.dia.LinkView. It can also be a function of the form function(link) that takes a link model and should return an object responsible for rendering that model onto the screen (in most cases a subtype of joint.dia.LinkView) -------------------------------------------------------------------------------- /docs/templates/partials/navItems.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/clone.html: -------------------------------------------------------------------------------- 1 |
element.clone(options)

Returns a new instance of the element with identical attributes. If options.deep === true, then 2 | all the embedded cells (elements, links) of the element are cloned as well. In this case, the return value is an array of 3 | instances rather then a single instance.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/transformStringToMatrix.html: -------------------------------------------------------------------------------- 1 |
V.transformStringToMatrix(transformString)
2 |

Return the SVG transformation matrix built from the transformString E.g. 'translate(10,10) scale(2,2)' will result in matrix { a: 2, b: 0, c: 0, d: 2, e: 10, f: 10}. 3 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/bezier/getCurveControlPoints.html: -------------------------------------------------------------------------------- 1 | 2 |

g.bezier.getCurveControlPoints(knots)
3 |

Get open-ended Bezier Spline Control Points. knots should be Bezier spline points (at least two points!). Returns an array where the first item is an array of the first control points and the second item is an array of second control points.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getBBox.html: -------------------------------------------------------------------------------- 1 |
element.getBBox()
2 |

Returns an element's bounding box represented as a g.rect object (see geometry library).

if (element1.getBBox().intersect(element2.getBBox())) {
3 |     // elements intersect
4 | }
-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/normalizedDistance.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.normalizedDistance(p)
3 | Returns a normalized distance from the ellipse center to a point p. 4 | 5 | Returns a number n ( n < 1 for points inside the ellipse, n = 1 for points laying at the ellipse boundary and n > 1 for points outside the ellipse). -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/translate.html: -------------------------------------------------------------------------------- 1 |
graph.translate(tx, ty [, opt])

Translate all cells in the graph by tx and ty pixels. It uses the dia.Element.translate() 2 | and dia.Link.translate() methods internally.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/setOrigin.html: -------------------------------------------------------------------------------- 1 |
paper.setOrigin(x, y)

Deprecated in favor of translate(). Lets you modify the origin (zero coordinates) of a paper. An origin can also be passed to the options object of the joint.dia.Paper constructor. If the method is called a "translate" event is triggered on the paper.

2 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/createSVGMatrix.html: -------------------------------------------------------------------------------- 1 | 2 |
V.createSVGMatrix(extension)
3 |

Return the SVG transformation matrix initialized with the matrix extension. extension is an object of the form: { a: [number], b: [number], c: [number], d: [number], e: [number], f: [number]}.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/elementView.html: -------------------------------------------------------------------------------- 1 | elementView - object that is responsible for rendering an element model into the paper. Defaults to joint.dia.ElementView. It can also be a function of the form function(element) that takes an element model and should return an object responsible for rendering that model onto the screen (in most cases a subtype of joint.dia.ElementView) -------------------------------------------------------------------------------- /test/geometry/requirejs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Geometry | Tests | require.js 5 | 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /plugins/connectors/joint.connectors.normal.js: -------------------------------------------------------------------------------- 1 | joint.connectors.normal = function(sourcePoint, targetPoint, vertices) { 2 | 3 | // Construct the `d` attribute of the `` element. 4 | var d = ['M', sourcePoint.x, sourcePoint.y]; 5 | 6 | _.each(vertices, function(vertex) { 7 | 8 | d.push(vertex.x, vertex.y); 9 | }); 10 | 11 | d.push(targetPoint.x, targetPoint.y); 12 | 13 | return d.join(' '); 14 | }; 15 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/translate.html: -------------------------------------------------------------------------------- 1 |
link.translate(tx, ty, [options])

Translate the link vertices (and source and target if they are points) by tx pixels in x axis and 2 | ty pixels in y axis. If options object is passed, it can contain data 3 | that is passed over the the event listeners for the change event on the link or graph. 4 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/bezier/getInversionSolver.html: -------------------------------------------------------------------------------- 1 | 2 |
g.bezier.getInversionSolver(p0, p1, p2, p3)
3 |

Solves an inversion problem -- Given the (x, y) coordinates of a point which lies on a parametric curve x = x(t)/w(t), y = y(t)/w(t), find the parameter value t which corresponds to that point. Returns a function that accepts a point and returns t.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/port.html: -------------------------------------------------------------------------------- 1 | 2 |

An object containing at least an id property. This property uniquely identifies the port. 3 | If a link gets connected to a magnet that has also a port 4 | object defined, the id property of the port object will be copied to the port property 5 | of the source/target of the link.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/setDimensions.html: -------------------------------------------------------------------------------- 1 | 2 |
paper.setDimensions(width, height)
3 |

Change dimensions of a paper. Dimensions should always be passed to the options object of the joint.dia.Paper constructor. Use setDimensions() to change dimensions of the paper later on if needed. If the method is called a "resize" event is triggered on the paper.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/unsetByPath.html: -------------------------------------------------------------------------------- 1 |
util.unsetByPath(object, path, delim)
2 | 3 |

Unset (delete) a property at the path in a nested object. delim is the 4 | delimiter used in the path. Returns the augmented object.

5 | 6 |
joint.util.unsetByPath({ a: { aa: { aaa: 3 } } }, 'a/aa/aaa', '/');
7 | // { a: { aa: {} } }
8 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/fitEmbeds.html: -------------------------------------------------------------------------------- 1 |
element.fitEmbeds([opt])

Resize the element so that it fits all the embedded elements inside it. If opt.deep is true, 2 | the resizing will be done recursively for any embedded elements that contain embedded elements themselves. 3 | Set opt.padding if you want certain padding on all the parent elements. 4 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/guard.html: -------------------------------------------------------------------------------- 1 | guard - guard paper from handling a browser UI event. This function is of the form 2 | function(evt, view) and should return true if you want to prevent the paper from handling the event evt, 3 | false otherwise. This is an advanced option that can be useful if you have your own logic for handling events. 4 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/decomposeMatrix.html: -------------------------------------------------------------------------------- 1 | 2 |
V.decomposeMatrix(matrix)
3 |

Decompose the SVG transformation matrix into separate transformations. Return an object of the form: { translateX: [number], translateY: [number], scaleX: [number], scaleY: [number], skewX: [number], skewY: [number], rotation: [number] }.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/transformPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
V.transformPoint(p, matrix)
3 |

Transform a point specified by p (an object with x and y coordinates) by an SVG transformation represented by matrix. 4 | This is a convenient shortcut to calling:

5 |
var p = mySVGDocument.createSVGPoint();
6 | p.x = x;
7 | p.y = y;
8 | p.matrixTransform(matrix)
9 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/defs.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.defs()
3 |

Return the Vectorizer object for the first <defs> element of the root SVG element. Note that the <defs> element is a good place to put referenced SVG elements like gradients, clip paths, filters and others.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/findModelsInArea.html: -------------------------------------------------------------------------------- 1 |
graph.findModelsInArea(rect)

Find elements (instance of joint.dia.Element) in a certain area in the graph. rect is an object with x, y, width and height properties. Returns an 2 | array of elements whose bounding box top/left coordinate falls into the rect rectangle.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/findModelsFromPoint.html: -------------------------------------------------------------------------------- 1 |
graph.findModelsFromPoint(point)

Find elements (instance of joint.dia.Element) under a certain point in the graph. point is an object with x and y properties. Returns an 2 | array of elements whose bounding box contains point. Note that there can be more then one element as elements might overlap.

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/ref-x.html: -------------------------------------------------------------------------------- 1 | 2 |

Make x-coordinate of the subelement relative to the x-coordinate of the element referenced to by the selector in ref attribute. 3 | If ref-x is in the (0,1) interval (or expressed in percentages, e.g. '80%'), the offset is 4 | calculated from the fraction of the bounding box of the referenced element. Otherwise, it is an absolute value in pixels. 5 |

-------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/ref-y.html: -------------------------------------------------------------------------------- 1 | 2 |

Make y-coordinate of the subelement relative to the y-coordinate of the element referenced to by the selector in ref attribute. 3 | If ref-y is in the (0,1) interval (or expressed in percentages, e.g. '80%'), the offset is 4 | calculated from the fraction of the bounding box of the referenced element. Otherwise, it is an absolute value in pixels. 5 |

-------------------------------------------------------------------------------- /test/jointjs/webpack.js: -------------------------------------------------------------------------------- 1 | module('Webpack'); 2 | 3 | test('sanity checks for webpack bundle file', function(assert) { 4 | 5 | assert.ok(typeof joint !== 'undefined', 'Joint object should be defined'); 6 | assert.ok(typeof joint.dia === 'object', 'Joint object should have "dia" object'); 7 | 8 | var paper = new joint.dia.Paper(); 9 | 10 | assert.ok(paper instanceof Backbone.View, 'A new dia.Paper object can be initialized'); 11 | 12 | paper.remove(); 13 | }); 14 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/bbox.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.bbox([withoutTransformations, target])
3 |

Return the bounding box of the element after transformations are applied. If withoutTransformations is true, transformations of the element will not be considered when computing the bounding box. If target is specified, bounding box will be computed relatively to the target element.

-------------------------------------------------------------------------------- /test/vectorizer/requirejs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Vectorizer | require.js | test suite 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/search.html: -------------------------------------------------------------------------------- 1 |
graph.search(element, iteratee [, opt])

Traverse the graph starting at element following links. This function is a wrapper around 2 | dfs() or bfs(). By default, it uses dfs(). If opt.breadthFirst is set to true, bfs() will be used instead.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/transform.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.transform([matrix], [opt])
3 |

When matrix is not provided, returns the current transformation matrix of the Vectorizer element.

4 |

When matrix is provided, applies the provided transformation matrix to the Vectorizer element.

5 |

You can clear previous transformations by passing opt with property absolute:true

6 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/linkPinning.html: -------------------------------------------------------------------------------- 1 | linkPinning - when set to true (the default), links can be pinned to the paper meaning a source or target of a link can be a point. If you do not want to let the user to drag a link and drop it somewhere in a blank paper area, set this to false. The effect is 2 | that the link will be returned to its original position whenever the user drops it somewhere in a blank paper area. -------------------------------------------------------------------------------- /test/jointjs/browserify.js: -------------------------------------------------------------------------------- 1 | module('Browserify'); 2 | 3 | test('sanity checks for browserify bundle file', function(assert) { 4 | 5 | assert.ok(typeof joint !== 'undefined', 'Joint object should be defined'); 6 | assert.ok(typeof joint.dia === 'object', 'Joint object should have "dia" object'); 7 | assert.ok(typeof joint.dia.Graph === 'function', 'joint.dia.Graph should be a function'); 8 | assert.ok(typeof joint.dia.Paper === 'function', 'joint.dia.Paper should be a function'); 9 | }); 10 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/findView.html: -------------------------------------------------------------------------------- 1 |
paper.findView(element)

Find a view (instance of joint.dia.ElementView or joint.dia.LinkView) associated with a DOM element in the paper. element can either be a DOM element, jQuery object or a CSS selector. 2 | Sometimes, it is useful to find a view object for an element in the DOM. This method finds the closest view for any subelement of a view element.

-------------------------------------------------------------------------------- /docs/templates/partials/contentItems.html: -------------------------------------------------------------------------------- 1 | {{#each items}} 2 |
3 | {{#if content}} 4 | 5 | {{title}} 6 | 7 |
8 | {{{ content }}} 9 |
10 | {{/if}} 11 | {{#if items}} 12 | {{> contentItems}} 13 | {{/if}} 14 |
15 | {{/each}} -------------------------------------------------------------------------------- /test/geometry/scale.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | QUnit.module('scale', function() { 4 | 5 | QUnit.module('linear(domain, range, value)', function() { 6 | 7 | QUnit.test('returns the value from the domain interval scaled to the range interval', function(assert) { 8 | 9 | assert.equal(g.scale.linear([.5, 1], [50, 150], .75), 100, 'linear scale up'); 10 | assert.equal(g.scale.linear([50, 150], [.5, 1], 100), .75, 'linear scale down'); 11 | }); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/normalize.html: -------------------------------------------------------------------------------- 1 | 2 |
point.normalize(len)
3 |

Normalize the point vector and return the point itself. In other words, 4 | scale the line segment between (0, 0) and the point in order for it to have a length of len. 5 | If len is not specified, it is considered to be 1 in which case a unit vector is computed.

-------------------------------------------------------------------------------- /demo/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | text-align: center; 3 | font-family: 'Helvetica Neue Light','Helvetica Neue','Source Sans Pro',sans-serif; 4 | } 5 | article { 6 | padding-left: 20%; 7 | padding-right: 20%; 8 | } 9 | h2 { 10 | font-size: 24px; 11 | text-transform: uppercase; 12 | padding-bottom: 30px; 13 | margin: 32px 0 0; 14 | font-weight: bold; 15 | color: #3c4260; 16 | } 17 | article h2 { 18 | border-bottom: 1px solid #d1d2d8; 19 | } 20 | #paper { 21 | margin: 16px 0 32px; 22 | } -------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/constructor.html: -------------------------------------------------------------------------------- 1 | 2 |
g.rect(x, y, width, height)
3 |

Return a new rectangle object with top left corner at point with coordinates x, y and dimensions width and height. If only x is specified, it is considered to be an object in the form { x: [number], y: [number], width: [number], height: [number] } in which case a copy of the rectangle is returned.

-------------------------------------------------------------------------------- /docs/src/joint/api/highlighters/addClass.html: -------------------------------------------------------------------------------- 1 |

Toggles a class name on the cell view's $el.

2 | 3 |

Available options:

4 | 7 | 8 |

Example usage:

9 |
cellView.highlight(null/* defaults to cellView.el */, {
10 |     highlighter: {
11 |         name: 'addClass',
12 |         options: {
13 |             className: 'some-custom-class'
14 |         }
15 |     }
16 | });
17 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/convertToPath.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.convertToPath()
3 |

Convert an SVG element to the SVG path element. It currently works for <path>, <line>, <polygon>, <polyline>, <ellipse>, <circle> and <rect>.

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/ellipse/prototype/intersectionWithLineFromCenterToPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
ellipse.intersectionWithLineFromCenterToPoint(p, angle)
3 |

Return the point on the boundary of the ellipse that is the intersection of the ellipse with a line starting in the center of the ellipse ending in the point p. If angle is specified, the intersection will take into account the rotation of the ellipse by angle degrees around its center.

4 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/matrix.html: -------------------------------------------------------------------------------- 1 |
paper.matrix([SVGMatrix])
2 |

When called with no parameter, the method returns the current transformation matrix (instance of SVGMatrix) of the paper. It sets the new viewport transformation based on the SVGMatrix otherwise.

3 | 4 |
paper.matrix({ a: 2, b: 0, c: 0, d: 2, e: 0, f: 0 }); // scale the paper twice
5 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/offset.html: -------------------------------------------------------------------------------- 1 | 2 |
point.offset(dx [, dy])
3 |

Offset the point (change its x and y coordinates) by dx in x-axis and dy in y-axis. If only dx is specified and is a number, 4 | dy is considered to be zero. If only dx is specified and is a object, it is considered to be another point or an object in the form { x: [number], y: [number] }

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/remove.html: -------------------------------------------------------------------------------- 1 |
element.remove(options)

Remove the element from the graph. All its embedded elements will get removed too and the element gets unembedded from its parent element. By default, 2 | all the associated links are removed too. To suppress this behaviour, set options.disconnectLinks === true. In this case, all the associated 3 | links get disconnected from this element rather then removed completely from the graph.

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/convertToPathData.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.convertToPathData()
3 |

Convert an SVG element to the SVG path data (string of SVG path commands). It currently works for <path>, <line>, <polygon>, <polyline>, <ellipse>, <circle> and <rect>.

-------------------------------------------------------------------------------- /test/geometry/bezier.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | QUnit.module('bezier', function() { 4 | 5 | QUnit.module('curveThroughPoints(points)', function() { 6 | 7 | }); 8 | 9 | QUnit.module('getCurveControlPoints(knots)', function() { 10 | 11 | }); 12 | 13 | QUnit.module('getCurveDivider(p0, p1, p2, p3)', function() { 14 | 15 | }); 16 | 17 | QUnit.module('getFirstControlPoints(rhs)', function() { 18 | 19 | }); 20 | 21 | QUnit.module('getInversionSolver(p0, p1, p2, p3)', function() { 22 | 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /test/jointjs/requirejs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JointJS | require.js | test suite 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/jointjs/webpack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JointJS | Webpack | test suite 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getCommonAncestor.html: -------------------------------------------------------------------------------- 1 |
graph.getCommonAncestor(cells...)

Return the common ancestor of all the cells passed as arguments. For example, if an element B is embedded in 2 | an element A and an element C is also embedded in the element A, 3 | graph.getCommonAncestor(B, C) returns the element A. This also works on an 4 | arbitrary deep hierarchy.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getConnectedLinks.html: -------------------------------------------------------------------------------- 1 |
graph.getConnectedLinks(element, opt)

Get all the associated links to the element. If opt.inbound === true, only inbound links will be returned. Similarly, 2 | if opt.outbound === true, only outbound links will be returned. If opt.deep is true, 3 | all the links that are connected to any of the descendant elements (embedded and deeply embedded) are returned.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/resetCells.html: -------------------------------------------------------------------------------- 1 | 2 |
graph.resetCells(cells[, opt])
3 |
graph.resetCells(cell, cell, ..[, opt])
4 |

Reset cells in the graph. Update all the cells in the graph in one bulk. This is a more efficient method of adding cells to the graph if you ou want to replace all the cells in one go. options object can optionally contain additional data that is passed over to the event listeners of the graph reset event.

5 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/imageToDataUri.html: -------------------------------------------------------------------------------- 1 |
util.imageToDataUri(url, callback)

2 | Convert an image at url to the Data URI 3 | scheme. 4 | This function is able to handle PNG, JPG and SVG formats. The callback function has the following 5 | signature function(err, dataUri) {}. Useful if you want to embed images right into your diagrams 6 | instead of having them referenced externally. 7 |

8 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/nextFrame.html: -------------------------------------------------------------------------------- 1 |
util.nextFrame(callback [, context])

Tell the browser to schedule the callback function to be called before the next repaint. 2 | This is a cross-browser version of the window.requestAnimationFrame function. 3 | Returns an ID of the frame request. For convenience, you can pass a context for your callback function. 4 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/line/constructor.html: -------------------------------------------------------------------------------- 1 | 2 |
g.line(p1, p2)
3 |

Return a new line object with starting at point p1 ending at point p2. p1 and p2 are first passed through the point constructor so they can also be passed in the string forms. Examples:

4 | 5 |
var l = g.line(g.point(10, 20), g.point(50, 60));
6 | var l = new g.line('10 20', '50 60');
7 | var l = g.line('10@20', '50@60');
8 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/hasLoop.html: -------------------------------------------------------------------------------- 1 |
link.hasLoop([opt])

Return true if this link is a loop link. In a loop link 2 | source and target are equal. If opt.deep is true, 3 | the notion of a loop link is extended to a deep hierarchy. For example, 4 | if the link connects a parent element with one of its embedded elements, than the 5 | link is considered a loop link too. 6 |

-------------------------------------------------------------------------------- /test/jointjs/browserify.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JointJS | Browserify | test suite 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/reparent.html: -------------------------------------------------------------------------------- 1 |
link.reparent()

Automatically find and set the best parent element for the link so that when the parent element is moved, the link and all 2 | its vertices are moved too. The best parent is determined as the common ancestor of the source and target 3 | elements of the link. Useful for hierarchical diagrams. See the DEVS demo on how this can be used.

-------------------------------------------------------------------------------- /docs/src/joint/api/util/setByPath.html: -------------------------------------------------------------------------------- 1 |
util.setByPath(object, path, value, delim)

Set a value at the path in a nested object. delim is the 2 | delimiter used in the path. Returns the augmented object.

3 | 4 |
joint.util.setByPath({ a: 1 }, 'b/bb/bbb', 2, '/');
 5 | /*
 6 | {
 7 |  "a": 1,
 8 |  "b": {
 9 |   "bb": {
10 |    "bbb": 2
11 |   }
12 |  }
13 | }
14 | */
15 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/sortElements.html: -------------------------------------------------------------------------------- 1 |
util.sortElements(elements, comparator)

Change the order of elements (a collection of HTML elements or a selector or jQuery object) in the DOM 2 | according to the comparator(elementA, elementB) function. The comparator function has 3 | the exact same meaning as in Array.prototype.sort(comparator). 4 |

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/prototype/difference.html: -------------------------------------------------------------------------------- 1 | 2 |
point.difference(dx [, dy])
3 |

Return a point that has coordinates computed as a difference between the point and another point with coordinates dx and dy. If only 4 | dx is specified and is a number, dy is considered to be zero. If only dx is specified and is an object, 5 | it is considered to be another point or an object in the form { x: [number], y: [number] }

-------------------------------------------------------------------------------- /docs/src/geometry/api/g/rect/prototype/intersectionWithLineFromCenterToPoint.html: -------------------------------------------------------------------------------- 1 | 2 |
rect.intersectionWithLineFromCenterToPoint(p [, angle])
3 |

Return the point on the boundary of the rectangle that is the intersection of the rectangle 4 | with a line starting in the center of the rectangle ending in the point p. 5 | If angle is specified, the intersection will take into account 6 | the rotation of the rectangle by angle degrees around its center.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/fromJSON.html: -------------------------------------------------------------------------------- 1 |
graph.fromJSON(json, [options])
2 | 3 |

Load the graph from a JSON object (not string).

4 | 5 |
var jsonString = JSON.stringify(graph)
 6 | // ... send jsonString to the server, 
 7 | // store it to the localStorage or do whatever you want
 8 | // ... later on
 9 | graph.fromJSON(JSON.parse(jsonString))
10 | 11 |

options object can optionally contain additional data that is passed over to the event listeners of the graph changes.

12 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/toBack.html: -------------------------------------------------------------------------------- 1 |
element.toBack([opt])

Move the element so it is behind all other cells (elements/links). 2 | If opt.deep is true, all the embedded cells of this 3 | element will get higher z index than that of this element in a Breadth-first search (BFS) fashion. This 4 | is especially useful in hierarchical diagrams where if you want to send an element to the back, you don't want 5 | its children (embedded cells) to be hidden behind that element.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/rotate.html: -------------------------------------------------------------------------------- 1 |
element.rotate(deg, [absolute, origin, opt])

Rotate an element by deg degrees around its center. If the optional absolute parameter is true, 2 | the deg will be considered an absolute angle, not an addition to the previous angle. 3 | If origin is passed in the form of an object with x and y properties, 4 | then this point will be used as the origin for the rotation transformation. 5 |

6 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/isLink.html: -------------------------------------------------------------------------------- 1 |
element.isLink()
2 | 3 |

Always returns false. The reason the method is here is that both joint.dia.Element and joint.dia.Link inherit from joint.dia.Cell. This method is useful if you don't know what the cell is. Calling el.isLink() is equivalent to el instanceof joint.dia.Link. Example:

4 | 5 |
var cell = graph.getCell(myId)
6 | if (cell.isLink()) {
7 |     // Do something if the cell is a link.
8 | }
9 | -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/textPath.html: -------------------------------------------------------------------------------- 1 | 2 |

Valid only for <text> subelements. textPath can be either a string or an object. If it is a string, it specifies a path the text should go along. If it is an object, then it should contain a d property that specifies the path the text should go along and optinally other attributes that will be set on the automatically created <textPath> SVG element such as startOffset. See text() method of Vectorizer objects for more details.

3 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/format/number.html: -------------------------------------------------------------------------------- 1 |
util.format.number(specifier, value)
2 | 3 |

Format number value according to the specifier defined via the Python Format Specification Mini-language.

4 | 5 |
joint.util.format.number('.2f', 5)    // 5.00
6 | joint.util.format.number('03d', 5)    // 005
7 | joint.util.format.number('.1%', .205)    // 20.5%
8 | joint.util.format.number('*^9', 5)    // ****5****
9 | -------------------------------------------------------------------------------- /wrappers/geometry.head.js: -------------------------------------------------------------------------------- 1 | (function(root, factory) { 2 | 3 | if (typeof define === 'function' && define.amd) { 4 | 5 | // AMD. Register as an anonymous module. 6 | define([], factory); 7 | 8 | } else if (typeof exports === 'object') { 9 | 10 | // Node. Does not work with strict CommonJS, but 11 | // only CommonJS-like environments that support module.exports, 12 | // like Node. 13 | module.exports = factory(); 14 | 15 | } else { 16 | 17 | // Browser globals. 18 | root.g = factory(); 19 | } 20 | 21 | }(this, function() { 22 | -------------------------------------------------------------------------------- /docs/src/geometry/api/g/point/constructor.html: -------------------------------------------------------------------------------- 1 | 2 |
g.point(x [, y])
3 |

Return a new point object with x and y coordinates. If x is a string, it is considered to be in the form "[number] [number]" or "[number]@[number]" where the first number is x coordinate and the second is y coordinate. Examples:

4 | 5 |
var p = g.point(10, 20);
 6 | var p = new g.point(10, 20);
 7 | var p = g.point('10 20');
 8 | var p = g.point('10@20');
 9 | var p = g.point(g.point(10, 20));
10 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/isElement.html: -------------------------------------------------------------------------------- 1 |
link.isElement()
2 | 3 |

Always returns false. The reason the method is here is that both joint.dia.Element and joint.dia.Link inherit from joint.dia.Cell. This method is useful if you don't know what the cell is. Calling el.Element() is equivalent to el instanceof joint.dia.Element. Example:

4 | 5 |
var cell = graph.getCell(myId)
6 | if (cell.isElement()) {
7 |     // Do something if the cell is an element.
8 | }
9 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/isElement.html: -------------------------------------------------------------------------------- 1 |
element.isElement()
2 | 3 |

Always returns true. The reason the method is here is that both joint.dia.Element and joint.dia.Link inherit from joint.dia.Cell. This method is useful if you don't know what the cell is. Calling el.Element() is equivalent to el instanceof joint.dia.Element. Example:

4 | 5 |
var cell = graph.getCell(myId)
6 | if (cell.isElement()) {
7 |     // Do something if the cell is an element.
8 | }
9 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/prop.html: -------------------------------------------------------------------------------- 1 |
element.prop(properties)
2 | 3 |

Set properties, possibly nested, on the element model. This is an equivalent of the attr() method but this time for custom data properties.

4 | 5 |
element.prop('name/first', 'John')
 6 | element.prop('name/first')  // 'John'
 7 | element.prop({ name: { first: 'John' } })
 8 | // Nested arrays are supported too:
 9 | element.prop('mylist/0/data/0/value', 50)
10 | element.prop({ mylist: [ { data: [ { value: 50 } ] } ] })
11 | -------------------------------------------------------------------------------- /docs/src/joint/api/env/addTest.html: -------------------------------------------------------------------------------- 1 |
env.addTest(name, fn)
2 | 3 |

Add a custom feature-detection test where name is a string which uniquely identifies your feature test and fn is a function that returns true if the browser supports the feature, and false if it does not.

4 | 5 |
joint.env.addTest('customTest', function() {
 6 | 	// Just as an example, we will always return true here.
 7 | 	return true;
 8 | });
 9 | 
10 | if (joint.env.test('customTest')) {
11 |     // Feature is supported.
12 | }
13 | -------------------------------------------------------------------------------- /docs/src/joint/api/env/test.html: -------------------------------------------------------------------------------- 1 |
env.test(name)
2 | 3 |

Tests whether the browsers supports the given feature or not. Returns true if the feature is supported, otherwise it returns false.

4 | 5 |
if (joint.env.test('someFeature')) {
 6 |     // Feature is supported.
 7 | }
8 | 9 |

JointJS ships with the following tests:

10 | 13 | -------------------------------------------------------------------------------- /plugins/highlighters/joint.highlighters.opacity.js: -------------------------------------------------------------------------------- 1 | joint.highlighters.opacity = { 2 | 3 | /** 4 | * @param {joint.dia.CellView} cellView 5 | * @param {Element} magnetEl 6 | */ 7 | highlight: function(cellView, magnetEl) { 8 | 9 | V(magnetEl).addClass(joint.util.addClassNamePrefix('highlight-opacity')); 10 | }, 11 | 12 | /** 13 | * @param {joint.dia.CellView} cellView 14 | * @param {Element} magnetEl 15 | */ 16 | unhighlight: function(cellView, magnetEl) { 17 | 18 | V(magnetEl).removeClass(joint.util.addClassNamePrefix('highlight-opacity')); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /docs/src/joint/api/highlighters/opacity.html: -------------------------------------------------------------------------------- 1 |

Changes the opacity of the cell view's $el.

2 | 3 |

When a cell is highlighted with the opacity highlighter, its $el is given the .joint-highlight-opacity class. To customize the look of this highlighted state, you can add custom CSS rules that affect this class name.

4 | 5 |

This highlighter does not currently have any options.

6 | 7 |

Example usage:

8 |
cellView.highlight(null/* defaults to cellView.el */, {
 9 |     highlighter: {
10 |         name: 'opacity'
11 |     }
12 | });
13 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/CellView/intro.html: -------------------------------------------------------------------------------- 1 |

The view for the joint.dia.Cell model. It inherits from Backbone.View and is responsible for:

2 | 7 |

To find the view associated with a specific cell (model), use the findViewByModel method of the paper. For example:

8 |
var cellView = paper.findViewByModel(cell);
9 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/findModelsUnderElement.html: -------------------------------------------------------------------------------- 1 |
graph.findModelsUnderElement(element [, opt])

Find all the elements (instances of joint.dia.Element) that are located below element. 2 | opt.searchBy parameter optionally determines what it means for an element to be below another element. 3 | Possible values are 'bbox' (default), 'center', 'origin', 'corner', 'topRight', 4 | and 'bottomLeft'. 5 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/ElementView/intro.html: -------------------------------------------------------------------------------- 1 |

The view for the joint.dia.Element model. It inherits from joint.dia.CellView and is responsible for:

2 | 7 |

To find the view associated with a specific element (model), use the findViewByModel method of the paper.

8 |
var elementView = paper.findViewByModel(element);
9 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/events.html: -------------------------------------------------------------------------------- 1 |

The following list contains events that you can react on:

2 | 3 | 9 | 10 |
graph.on('add', function(cell) { 
11 |     alert('New cell with id ' + cell.id + ' added to the graph.') 
12 | })
13 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/cloneSubgraph.html: -------------------------------------------------------------------------------- 1 |
graph.cloneSubgraph(cells [, opt])

Clone the whole subgraph, including all the connected links whose source/target is in the subgraph. 2 | This is equivalent to calling graph.cloneCells(graph.getSubgraph(cells)). 3 |
4 | If opt.deep is true, take into account embedded cells of the subgraph cells. 5 |
6 | Return an object of the form { [original cell ID]: [clone] }. 7 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/clientToLocalPoint.html: -------------------------------------------------------------------------------- 1 |
paper.clientToLocalPoint(p)
2 |

Transform client coordinates represented by point p to the paper local coordinates. 3 | This is especially useful when you have a mouse event object and want coordinates 4 | inside the paper that correspond to event clientX and clientY point. 5 |

var localPoint1 = paper.clientToLocalPoint({ x: evt.clientX, y: evt.clientY });
6 | // alternative method signature
7 | var localPoint2 = paper.clientToLocalPoint(evt.clientX, evt.clientY);
8 |

9 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/rectToPath.html: -------------------------------------------------------------------------------- 1 | 2 |
V.rectToPath(r)
3 |

Convert a rectangle r to SVG path commands. r is an object of the form { x: [number], y: [number], width: [number], height: [number], top-ry: [number], top-ry: [number], bottom-rx: [number], bottom-ry: [number] } where x, y, width, height are the usual rectangle attributes and [top-/bottom-]rx/ry allows for specifying radius of the rectangle for all its sides (as opposed to the built-in SVG rectangle that has only rx and ry attributes).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/portProp.md: -------------------------------------------------------------------------------- 1 |
element.portProp(portId, path, [value])
2 | 3 | Set properties, possibly nested, on the element port. This is an equivalent of the attr() method but this time for custom data properties. 4 | 5 | ```javascript 6 | element.portProp('port-id', 'attrs/circle/fill', 'red'); 7 | element.portProp('port-id', 'attrs/circle/fill'); // 'red' 8 | 9 | element.portProp('port-id', 'attrs/circle', { r: 10, stroke: 'green' }); 10 | element.portProp('port-id', 'attrs/circle'); // { r: 10, stroke: 'green', fill: 'red' } 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/isLink.html: -------------------------------------------------------------------------------- 1 |
link.isLink()
2 | 3 |

Always returns true. The reason the method is here is that 4 | both joint.dia.Element and joint.dia.Link inherit from 5 | joint.dia.Cell. This method is useful if you don't know what the cell is. 6 | Calling el.isLink() is equivalent to el instanceof joint.dia.Link. 7 | Example:

8 | 9 |
var cell = graph.getCell(myId)
10 | if (cell.isLink()) {
11 |     // Do something if the cell is a link.
12 | }
-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/removeAttr.html: -------------------------------------------------------------------------------- 1 |
element.removeAttr(path, [options])

Remove a previously set attribute from the element. path can either be a string that specifies 2 | the path to the, possibly nested, attribute to be removed or an array of more paths. 3 | The associated element view makes sure the element gets re-rendered properly. 4 | If options is passed, it can contain data that is passed over to 5 | the event listeners for the change:attrs event triggered on the element 6 | itself and also on the graph the element is in. 7 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/ElementView/prototype/getBBox.html: -------------------------------------------------------------------------------- 1 |
elementView.getBBox([opt])

Return a bounding box for an element view. If opt.useModelGeometry option is set to true, the resulting bounding box will be calculated 2 | based on the element model dimensions (so that SVG sub elements sticking out of the element will be excluded). The difference from 3 | dia.Element.prototype.getBBox is that in this case, the bounding box will be adjusted based on the 4 | joint.dia.Paper translate and scale. 5 |

-------------------------------------------------------------------------------- /demo/links/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Links 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/addCell.html: -------------------------------------------------------------------------------- 1 |
graph.addCell(cell)
2 | 3 |

Add a new cell to the graph. If cell is an array, all the cells in the array will be added to the graph.

4 | 5 |
var rect = new joint.shapes.basic.Rect({ 
 6 |     position: { x: 100, y: 100 },
 7 |     size: { width: 70, height: 30 },
 8 |     attrs: { text: { text: 'my rectangle' } }
 9 | })
10 | var rect2 = rect.clone()
11 | var link = new joint.dia.Link({ source: { id: rect.id }, target: { id: rect2.id }  });
12 | var graph = new joint.dia.Graph
13 | graph.addCell(rect).addCell(rect2).addCell(link)
14 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/removeAttr.html: -------------------------------------------------------------------------------- 1 |
link.removeAttr(path, [options])

Remove a previously set attribute from the link. path can either be a string that specifies 2 | the path to the, possibly nested, attribute to be removed or an array of more paths. 3 | The associated link view makes sure the link gets re-rendered properly. 4 | If options is passed, it can contain data that is passed over to 5 | the event listeners for the change:attrs event triggered on the link 6 | itself and also on the graph the link is in. 7 |

-------------------------------------------------------------------------------- /demo/hull/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Chain Hull Algorithm 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /demo/org/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Organizational Charts 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/transition.html: -------------------------------------------------------------------------------- 1 |
link.transition(path, value [, opt])

Allows to change the link's property gradually over a period of time. This is a method analogous to transition method of Joint.dia.Element.

2 | 3 |
link.transition('target', { x: 250, y: 250 }, {
4 |     delay: 100,
5 |     duration: 500,
6 |     timingFunction: joint.util.timing.bounce,
7 |     valueFunction: joint.util.interpolate.object
8 | });
9 | // will start changing the link target coordinates in 100ms, for period of 500ms and performing a bounce effect.
-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/pageToLocalPoint.html: -------------------------------------------------------------------------------- 1 |
paper.pageToLocalPoint(p)
2 |

Transform the point p defined in the page coordinate system to the local coordinate system. 3 |

paper.on('blank:pointerup', function(evt) {
 4 |   var pagePoint = g.Point(evt.pageX, evt.pageY);
 5 |   var localPoint1 = this.pageToLocalPoint(pagePoint);
 6 |   // alternative method signature
 7 |   var localPoint2 = this.pageToLocalPoint(evt.pageX, evt.pageY);
 8 |   // Move the element to the point, where the user just clicks.
 9 |   element.position(localPoint1.x, localPoint1.y);
10 | });
11 |

12 | -------------------------------------------------------------------------------- /demo/umlsc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Unified Modeling Language 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/intro.html: -------------------------------------------------------------------------------- 1 |

The basic model for diagram links. It inherits from joint.dia.Cell with a few additional properties and methods specific to links.

2 | 3 |

For links there are two crucial attributes: source and target. It defines the starting point and the end point of the link. It can be defined as follows:

4 | 5 |
new joint.dia.Link({
 6 |         source: { id: 'source-id' },
 7 |         target: { id: 'target-id', port: 'port_id'}
 8 |     });
 9 | 
10 |     new joint.dia.Link({
11 |         source: { id: 'source-id' },
12 |         target: { x: 100, y: 100}
13 |     });
14 | 
15 | 16 | -------------------------------------------------------------------------------- /docs/images/anchor.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/translate.html: -------------------------------------------------------------------------------- 1 |
paper.translate(x, y)

Lets you modify the origin (zero coordinates) of a paper. An origin can also be passed to the options object of the joint.dia.Paper constructor. If the method is called a "translate" event is triggered on the paper. If the method is called with no paramater the current paper translate transformation is returned.

2 | 3 |
paper.translate(100, 200) // set origin to `x=100` and `y=200`
4 | paper.translate(100) // same as calling `translate(100,0)`
5 | paper.translate() // returns e.g. { tx: 100, ty: 100 }
6 | 
7 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/animateAlongPath.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.animateAlongPath(attrs, path)
3 |

Animate the element along the path SVG element (or Vectorizer object). attrs contain Animation Timing attributes describing the animation. The following example shows how to send a token along a JointJS link element:

4 |
var c = V('circle', { r: 8, fill: 'red' });
5 | c.animateAlongPath({ dur: '4s', repeatCount: 'indefinite' }, paper.findViewByModel(myLink).$('.connection')[0]);
6 | V(paper.svg).append(c);
7 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/embed.html: -------------------------------------------------------------------------------- 1 |
element.embed(cell)

Embed a cell (element or link) into the element. The element then becomes a parent of the embedded cell. When a parent is moved (translated), 2 | all cells embedded into that parent will move as well. If links are embedded, their vertices move with the parent. This way both options are available: 3 | if a link is not embedded but its source/target elements are and their parent moves, the embedded elements 4 | move with the parent but the link vertices stay at the same position. If the link is embedded with its source/target elements, its vertices move as the parent moves.

-------------------------------------------------------------------------------- /plugins/polyfills/xhrResponse.js: -------------------------------------------------------------------------------- 1 | /** 2 | * make xhr.response = 'arraybuffer' available for the IE9 3 | */ 4 | (function() { 5 | 6 | if (typeof XMLHttpRequest === 'undefined') { 7 | return; 8 | } 9 | 10 | if ('response' in XMLHttpRequest.prototype || 11 | 'mozResponseArrayBuffer' in XMLHttpRequest.prototype || 12 | 'mozResponse' in XMLHttpRequest.prototype || 13 | 'responseArrayBuffer' in XMLHttpRequest.prototype) { 14 | return; 15 | } 16 | 17 | Object.defineProperty(XMLHttpRequest.prototype, 'response', { 18 | get: function() { 19 | return new Uint8Array(new VBArray(this.responseBody).toArray()); 20 | } 21 | }); 22 | })(); 23 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/findViewsInArea.html: -------------------------------------------------------------------------------- 1 |
paper.findViewsInArea(rect [, opt])

Find views (instance of joint.dia.ElementView) in a certain area in the paper. 2 | rect is an object with x, y, width and height properties. 3 | Return an array of views whose bounding box intersects the rect rectangle. 4 |
5 | If opt.strict is true, return an array of views whose bounding box is contained within the rect rectangle (i.e. not only intersects it). 6 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/validateEmbedding.html: -------------------------------------------------------------------------------- 1 | validateEmbedding - a function that allows you to control what elements can be embedded to 2 | what other elements when the paper is put into the embeddingMode (see above). 3 | The function signature is: function(childView, parentView) and should return 4 | true if the childView element can be embedded into the parentView element. 5 | By default, all elements can be embedded into all other elements (the function returns true no matter what). 6 | -------------------------------------------------------------------------------- /demo/petri nets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Petri Nets 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /demo/vectorizer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vectorizer demo 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/validateConnection.html: -------------------------------------------------------------------------------- 1 | validateConnection(cellViewS, magnetS, cellViewT, magnetT, end, linkView) - 2 | decide whether to allow or disallow a connection between the source view/magnet (cellViewS/magnetS) 3 | and target view/magnet (cellViewT/magnetT). end is either "source" or "target" and tells which end of 4 | the link is being dragged. This is useful for defining whether, for example, a link starting in a port POut of element A can lead to a port PIn of elmement B. By default, all linkings are allowed. -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Link/prototype/prop.html: -------------------------------------------------------------------------------- 1 |
link.prop(properties)
2 | 3 |

Set properties, possibly nested, on the element model. This is an equivalent of the attr() method but this time for custom data properties.

4 | 5 |
link.prop('name/first', 'John')
 6 | link.prop('name/first')  // 'John'
 7 | link.prop({ name: { first: 'John' } })
 8 | // Nested arrays are supported too:
 9 | link.prop('mylist/0/data/0/value', 50)
10 | link.prop({ mylist: [ { data: [ { value: 50 } ] } ] })
11 | 12 |

As you can see, this is the exact same method as the joint.dia.Element:prop().

-------------------------------------------------------------------------------- /docs/src/vectorizer/api/constructor.html: -------------------------------------------------------------------------------- 1 | 2 |
V(svg)
3 |

Return a Vectorizer object. If svg parameter is a string, construct SVG DOM elements from the string markup. If svg is an SVG DOM element, just wrap that element by the Vectorizer object and return it. You can think of this function as of the jQuery $ function except that the V function does not accept selectors. The Vectorizer object contains a reference to the original SVG DOM element in its node property.

4 | 5 |
var vel = V('<g><rect/><text/></g>');
6 | console.log(vel.node);
7 | -------------------------------------------------------------------------------- /demo/erd/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ER Diagrams 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/paperToLocalPoint.html: -------------------------------------------------------------------------------- 1 |
paper.paperToLocalPoint(p)
2 |

Transform the point p defined in the paper coordinate system to the local coordinate system. 3 |

var paperCenter = g.Point(paper.options.width / 2, paper.options.height / 2);
 4 | var localPoint1 = paper.paperToLocalPoint(paperCenter);
 5 |  // alternative method signature
 6 | var localPoint2 = paper.paperToLocalPoint(paper.options.width / 2, paper.options.height / 2);
 7 | // Move the element to the center of the paper viewport.
 8 | var elSize = element.size();
 9 | element.position(localPoint1.x - elSize.width, localPoint1.y - elSize.height);
10 |

11 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/paperToLocalRect.html: -------------------------------------------------------------------------------- 1 |
paper.paperToLocalRect(rect)
2 |

Transform the rectangle rect defined in the paper coordinate system to the local coordinate system. 3 |

var paperRect = g.Rect(0, 0, paper.options.width, paper.options.height);
 4 | var localRect1 = paper.paperToLocalRect(paperRect);
 5 |  // alternative method signature
 6 | var localRect2 = paper.paperToLocalRect(0, 0, paper.options.width, paper.options.height);
 7 | // Move and resize the element to cover the entire paper viewport.
 8 | element.position(localRect1.x , localRect1.y);
 9 | element.size(localRect1.width, localRect1.height);
10 | 
11 |

12 | -------------------------------------------------------------------------------- /demo/logic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Logic Circuits 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getSuccessors.html: -------------------------------------------------------------------------------- 1 |
graph.getSuccessors(element [, opt])

Return an array of all the successors of element. By default, Depth-first search algorithm is used (important for the order of returned elements). 2 |
3 | If opt.breadthFirst is set to true, use Breadth-first search algorithm instead. 4 |
5 | If opt.deep is set to true, take into account embedded elements too (see dfs() for details). 6 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getPredecessors.html: -------------------------------------------------------------------------------- 1 |
graph.getPredecessors(element [, opt])

Return an array of all the predecessors of element. By default, Depth-first search algorithm is used (important for the order of returned elements). 2 |
3 | If opt.breadthFirst is set to true, use Breadth-first search algorithm instead. 4 |
5 | If opt.deep is set to true, take into account embedded elements too (see dfs() for details). 6 |

-------------------------------------------------------------------------------- /demo/chess/css/chess.css: -------------------------------------------------------------------------------- 1 | body { 2 | text-align: center; 3 | } 4 | #board { 5 | margin: 0 auto; 6 | border-style: none; 7 | width: 400px; 8 | position: relative; 9 | } 10 | .board-bg { 11 | border-spacing: 0; 12 | width: 402px; 13 | height: 402px; 14 | z-index: -1; 15 | border-collapse: inherit; 16 | margin: 0 auto; 17 | } 18 | #board > svg { 19 | position: absolute; 20 | top: 0; 21 | bottom: 0; 22 | left: 0; 23 | right: 0; 24 | } 25 | .board-bg td { 26 | width: 46px; 27 | height: 46px; 28 | border-style: none; 29 | background: #30d0c6; 30 | } 31 | .board-bg tr:nth-child(odd) td:nth-child(even), 32 | .board-bg tr:nth-child(even) td:nth-child(odd) { 33 | background: #7c68fd; 34 | } 35 | -------------------------------------------------------------------------------- /demo/umlcd/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Unified Modeling Language 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/shapePerimeterConnectionPoint.html: -------------------------------------------------------------------------------- 1 |
util.shapePerimeterConnectionPoint(linkView, view, magnet, ref)
2 | 3 |

This function can be directly used in the dia.Paper linkConnectionPoint parameter. When used, links will try to find the best connection point right on the perimeter of the connected shape rather than only on the bounding box. See the image below.

4 | 5 |

6 | 7 |
var paper = new joint.dia.Paper({
 8 |    // ...
 9 |    linkConnectionPoint: joint.util.shapePerimeterConnectionPoint
10 |    // ...
11 | })
12 | 13 | -------------------------------------------------------------------------------- /wrappers/vectorizer.head.js: -------------------------------------------------------------------------------- 1 | (function(root, factory) { 2 | 3 | if (typeof define === 'function' && define.amd) { 4 | 5 | // AMD. Register as an anonymous module. 6 | define(['g'], function(g) { 7 | return factory(g); 8 | }); 9 | 10 | } else if (typeof exports === 'object') { 11 | 12 | // Node. Does not work with strict CommonJS, but 13 | // only CommonJS-like environments that support module.exports, 14 | // like Node. 15 | var g = require('./geometry'); 16 | 17 | module.exports = factory(g); 18 | 19 | } else { 20 | 21 | // Browser globals. 22 | var g = root.g; 23 | 24 | root.Vectorizer = root.V = factory(g); 25 | } 26 | 27 | }(this, function(g) { 28 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/isNeighbor.html: -------------------------------------------------------------------------------- 1 |
graph.isNeighbor(elementA, elementB [, opt])

Return true if elementB is a neighbor of elementA. 2 | If opt.deep is set to true, take into account embedded elements. 3 |
4 | If opt.outbound is set to true, return true only if elementB is a successing neighbor of elementA. 5 |
6 | Similarly, if opt.inbound is set to true, return true only if elementB is a preceeding neighbor of elementA. 7 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Graph/prototype/getNeighbors.html: -------------------------------------------------------------------------------- 1 |
graph.getNeighbors(element [, opt])

Get all the neighbors of element in the graph. Neighbors are all the elements connected 2 | to element via either an inbound or an outbound link. If opt.inbound is true, 3 | only inbound neighbords (all neighbors connected with a link who's target is the element) will be returned. Similarly, if opt.outbound is true, only 4 | outbound neighbors will be returned. If opt.deep is true, 5 | return also all the neighbors of all the elements embedded inside element.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/LinkView/prototype/sendToken.html: -------------------------------------------------------------------------------- 1 |
linkView.sendToken(token, [duration], [callback])
2 |

Send a token along the link. token is an SVG element that will be animated along the link path for duration milliseconds (default is 1000ms). callback will be called once the token reaches the end of the link path. Example:

3 |
// Send an SVG circle token along the link.
4 | paper.findViewByModel(link).sendToken(V('circle', { r: 7, fill: 'green' }).node)
5 |

Note that in the code above, we use the Vectorizer mini-library to create the SVG circle element.

6 |

Please see the Petri Net simulator demo for a full working example.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/clientToLocalRect.html: -------------------------------------------------------------------------------- 1 |
paper.clientToLocalRect(rect)
2 |

Transform the rectangle rect defined in the client coordinate system to the local coordinate system. 3 |

var bcr = paper.svg.getBoundingClientRect();
 4 | var localRect1 = paper.clientToLocalRect({ x: bcr.left, y: bcr.top, width: bcr.width, height: bcr.height });
 5 | // alternative method signature
 6 | var localRect2 = paper.clientToLocalRect(bcr.left, bcr.top, bcr.width, bcr.height);
 7 | // Move the element to the center of the paper viewport.
 8 | var localCenter = localRect1.center();
 9 | var elSize = element.size();
10 | element.position(localCenter.x - elSize.width, localCenter.y - elSize.height);
11 |

12 | -------------------------------------------------------------------------------- /docs/src/joint/api/specialAttributes/ref-height.html: -------------------------------------------------------------------------------- 1 | 2 |

Set height of the subelement relatively to the height of the element referenced to by the selector in ref attribute. 3 | If the value is in the [0, 1] interval (or expressed in percentages, e.g. '80%'), the height of the subelement will be set as a percentage 4 | of the height of the referenced element. If the value is <0 or >0, the height 5 | of the subelement will be smaller/bigger than the height of the referenced element by the amount specified. 6 | Note that this makes sense only for SVG elements that support width and height attributes, such 7 | as <rect>. 8 |

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/markAvailable.html: -------------------------------------------------------------------------------- 1 | markAvailable - marks all the available magnets or elements when a link is dragged (being reconnected). Default is false. This gives a hint to the user to what other elements/ports this link can be connected. 2 | What magnets/cells are available is determined by the validateConnection function. 3 | Internally, available magnets (SVG elements) are given the 'available-magnet' class name and all the available cells the 'available-cell' class name. This allows you to change the 4 | styling of the highlight effect. 5 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/translateAndAutoOrient.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.translateAndAutoOrient(position, reference, target)
3 |

Auto-orient the element. This basically implements the orient=auto attribute of markers. The easiest way of understanding on what this does is to imagine the element is an arrowhead. Calling this method on the arrowhead makes it point to the position point while being auto-oriented (properly rotated) towards the reference point. target is the element relative to which the transformations are applied. Usually the root SVG element which is also default if not target is passed.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/getEmbeddedCells.html: -------------------------------------------------------------------------------- 1 |
element.getEmbeddedCells([opt])

Return an array of all the embedded cells of an element. If all you need is id's of all the embedded cells, 2 | use element.get('embeds'). If opt.deep is true, all the deeply embedded 3 | cells will be returned. The order in which the cells are returned depends on the search algorithm used. By 4 | default, Depth-first search (DFS) algorithm is used. If 5 | opt.breadthFirst is true, the Breadth-first search algorithm will be used instead.

-------------------------------------------------------------------------------- /demo/graph.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Graph 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/findIntersection.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.findIntersection(ref, target)
3 |

Find the intersection of a line starting in the center of the SVG node ending in the point ref (an object of the form { x: Number, y: Number }). target is an SVG element to which this node's transformations are relative to. In JointJS, target is usually the paper.viewport SVG group element. Note that ref point must be in the coordinate system of the target for this function to work properly. This function returns a point in the target coordinte system (the same system as ref is in) if an intersection is found. Returns undefined otherwise.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/interactive.html: -------------------------------------------------------------------------------- 1 | interactive - if set to false, interaction with elements and links is disabled. If it is a function, it will be called with the cell view in action and the name of the method it is evaluated in ('pointerdown', 'pointermove', ...). If the returned value of 2 | such a function is false interaction will be disabled for the action. For links, there are special properties of the interaction object that are useful to disable the default behaviour. These 3 | properties are: vertexAdd, vertexMove, vertexRemove and arrowheadMove. By setting any of these properties to false, you can disable the related default action on links. -------------------------------------------------------------------------------- /docs/src/vectorizer/intro.html: -------------------------------------------------------------------------------- 1 |

JointJS exports three global variables, the joint namespace, the V variable and the g variable (that is described later in the Geometry section). The V variable is a function of a little SVG helper library that we call Vectorizer. The reason why this library sits in its own namespace and not inside the joint namespace is that it can be used completely standalone, even without JointJS. It is a very helpful library making life easier when dealing with SVG. You can think of it as of a very lightweight jQuery for SVG. If you want to use Vectorizer as a standalone library, see the download page that contains both the development and minified versions.

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/constructor.html: -------------------------------------------------------------------------------- 1 |

joint.dia.Paper is the view for the joint.dia.Graph model. It inherits from the Backbone View. When a paper is associated with a graph, the paper makes sure that all the cells added to the graph are automatically rendered.

2 | 3 |
var graph = new joint.dia.Graph
 4 | var paper = new joint.dia.Paper({
 5 |     el: $('#paper'),
 6 |     width: 600,
 7 |     height: 400,
 8 |     gridSize: 10,
 9 |     model: graph
10 | });
11 | 
12 | var rect = new joint.shapes.basic.Rect({
13 |     position: { x: 50, y: 70 },
14 |     size: { width: 100, height: 40 }
15 | });
16 | 
17 | graph.addCell(rect);
18 | 19 |

Paper automatically handles this change and renders the rectangle to the SVG document that it internally holds.

20 | -------------------------------------------------------------------------------- /demo/router-orthogonal.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Orthogonal router demo 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /demo/ports.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Ports 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/localToPageRect.html: -------------------------------------------------------------------------------- 1 |
paper.localToPageRect(rect)
2 |

Transform the rectangle rect defined in local coordinate system to the page coordinate system. 3 |

var bbox = element.getBBox();
 4 | var pageRect1 = paper.localToPageRect(bbox);
 5 |  // alternative method signature
 6 | var pageRect2 = paper.localToPageRect(bbox.x, bbox.y, bbox.width, bbox.height);
 7 | // Draw an HTML rectangle above the element.
 8 | var div = document.createElement('div');
 9 | div.style.position = 'absolute';
10 | div.style.background = 'red';
11 | div.style.left = pageRect1.x + 'px';
12 | div.style.top = pageRect1.y + 'px';
13 | div.style.width = pageRect1.width + 'px';
14 | div.style.height = pageRect1.height + 'px';
15 | document.body.appendChild(div);
16 |

17 | -------------------------------------------------------------------------------- /demo/fsa/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Finite State Machines 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/localToPaperRect.html: -------------------------------------------------------------------------------- 1 |
paper.localToPaperRect(rect)
2 |

Transform the rectangle rect defined in the local coordinate system to the paper coordinate system. 3 |

var bbox = element.getBBox();
 4 | var paperRect1 = paper.localToPaperRect(bbox);
 5 |  // alternative method signature
 6 | var paperRect2 = paper.localToPaperRect(bbox.x, bbox.y, bbox.width, bbox.height);
 7 | // Draw an HTML rectangle above the element.
 8 | var div = document.createElement('div');
 9 | div.style.position = 'absolute';
10 | div.style.background = 'red';
11 | div.style.left = paperRect1.x + 'px';
12 | div.style.top = paperRect1.y + 'px';
13 | div.style.width = paperRect1.width + 'px';
14 | div.style.height = paperRect1.height + 'px';
15 | paper.el.appendChild(div);
16 |

17 | -------------------------------------------------------------------------------- /demo/3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 3d shapes experiment 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/localToClientRect.html: -------------------------------------------------------------------------------- 1 |
paper.localToClientRect(rect)
2 |

Transform the rectangle rect defined in local coordinate system to the client coordinate system. 3 |

var bbox = element.getBBox();
 4 | var clientRect1 = paper.localToClientRect(bbox);
 5 |  // alternative method signature
 6 | var clientRect2 = paper.localToClientRect(bbox.x, bbox.y, bbox.width, bbox.height);
 7 | // Draw an HTML rectangle above the element.
 8 | var div = document.createElement('div');
 9 | div.style.position = 'fixed';
10 | div.style.background = 'red';
11 | div.style.left = clientRect1.x + 'px';
12 | div.style.top = clientRect1.y + 'px';
13 | div.style.width = clientRect1.width + 'px';
14 | div.style.height = clientRect1.height + 'px';
15 | paper.el.appendChild(div);
16 |

17 | -------------------------------------------------------------------------------- /demo/meridium.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Meridium client shapes 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /demo/sketched.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hand-drawn shapes 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/scale.html: -------------------------------------------------------------------------------- 1 |
paper.scale([sx, sy, ox, oy])

Scale a paper by sx factor in x axis and sy factor in y axis. 2 | ox and oy are optional and determine the origin of the scale transformation. This method effectively implements a paper zoom in/out. If the method is called a "scale" event is triggered on the paper. When the method is called with no parameter the current paper scale transformation is returned.

3 | 4 |
paper.scale(2) // scale 2x (uniformly)
5 | paper.scale(2,3) // scale 2x in `x` axis 3x in `y` axis (non-uniformly)
6 | paper.scale(2,2,100,100) // scale with the origin of the transformation at point `x=100` and `y=100`
7 | paper.scale() // returns e.g. { sx: 2, sy: 2 }
8 | 
9 | -------------------------------------------------------------------------------- /docs/src/joint/api/highlighters/stroke.html: -------------------------------------------------------------------------------- 1 |

Adds a stroke around the cell view's $el.

2 | 3 |

Available options:

4 | 10 | 11 |

Example usage:

12 |
cellView.highlight(null/* defaults to cellView.el */, {
13 |     highlighter: {
14 |         name: 'stroke',
15 |         options: {
16 |             padding: 10,
17 |             rx: 5,
18 |             ry: 5,
19 |             attrs: {
20 |                 'stroke-width': 3,
21 |                 stroke: '#FF0000'
22 |             }
23 |         }
24 |     }
25 | });
26 | -------------------------------------------------------------------------------- /demo/nested-clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Embeds clone demo 7 | 8 | 9 | 10 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /plugins/highlighters/joint.highlighters.addClass.js: -------------------------------------------------------------------------------- 1 | joint.highlighters.addClass = { 2 | 3 | className: joint.util.addClassNamePrefix('highlighted'), 4 | 5 | /** 6 | * @param {joint.dia.CellView} cellView 7 | * @param {Element} magnetEl 8 | * @param {object=} opt 9 | */ 10 | highlight: function(cellView, magnetEl, opt) { 11 | 12 | var options = opt || {}; 13 | var className = options.className || this.className; 14 | V(magnetEl).addClass(className); 15 | }, 16 | 17 | /** 18 | * @param {joint.dia.CellView} cellView 19 | * @param {Element} magnetEl 20 | * @param {object=} opt 21 | */ 22 | unhighlight: function(cellView, magnetEl, opt) { 23 | 24 | var options = opt || {}; 25 | var className = options.className || this.className; 26 | V(magnetEl).removeClass(className); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /demo/filters.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Filters 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /demo/iphone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | iPhone demo 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /demo/nested.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Embeds demo 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/geometry/snapToGrid.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | QUnit.module('snapToGrid(value, gridSize)', function() { 4 | 5 | QUnit.test('returns value rounded to the nearest increment of the given grid size', function(assert) { 6 | 7 | var expected = [ 8 | { value: 9, gridSize: 10, newValue: 10 }, 9 | { value: 17, gridSize: 10, newValue: 20 }, 10 | { value: 4, gridSize: 10, newValue: 0 }, 11 | { value: 3, gridSize: 2, newValue: 4 } 12 | ]; 13 | 14 | var value, gridSize, newValue; 15 | 16 | for (var i = 0; i < expected.length; i++) { 17 | value = expected[i].value; 18 | gridSize = expected[i].gridSize; 19 | newValue = expected[i].newValue; 20 | assert.equal(g.snapToGrid(value, gridSize), newValue, 'value = ' + value + ', gridSize = ' + gridSize); 21 | } 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /demo/gradients.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Gradients 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /demo/hyperlinks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hyperlinks inside JointJS elements 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /demo/transition.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Transition 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/pageToLocalRect.html: -------------------------------------------------------------------------------- 1 |
paper.pageToLocalRect(rect)
2 |

Transform the rectangle rect defined in the page coordinate system to the local coordinate system. 3 |

var x, y;
 4 | paper.on('blank:pointerdown', function(evt) {
 5 |   x = evt.pageX;
 6 |   y = evt.pageY;
 7 | });
 8 | paper.on('blank:pointerup', function(evt) {
 9 |   var pageRect = g.Rect(x, y, evt.pageX - x, evt.pageY - y).normalize();
10 |   var localRect1 = this.pageToLocalRect(pageRect);
11 |   // alternative method signature
12 |   var localRect2 = this.pageToLocalRect(x, y, evt.pageX - x, evt.pageY - y).normalize();
13 |   // Move and resize the element to cover the area, that the user just selected.
14 |   element.position(localRect1.x, localRect1.y);
15 |   element.resize(localRect1.width, localRect1.height);
16 | });
17 |

18 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/localToPagePoint.html: -------------------------------------------------------------------------------- 1 |
paper.localToPagePoint(p)
2 |

Transform the point p defined in the local coordinate system to the page coordinate system. 3 |

var rightMidPoint = element.getBBox().rightMiddle();
 4 | var pagePoint1 = paper.localToPagePoint(rightMidPoint);
 5 |  // alternative method signature
 6 | var pagePoint2 = paper.localToPagePoint(rightMidPoint.x, rightMidPoint.y);
 7 | // Draw an HTML rectangle next to the element.
 8 | var div = document.createElement('div');
 9 | div.style.position = 'absolute';
10 | div.style.background = 'red';
11 | div.style.left = pagePoint1.x + 'px';
12 | div.style.top = pagePoint1.y + 'px';
13 | div.style.width = '40px';
14 | div.style.height = '40px';
15 | div.style.marginLeft = '10px';
16 | div.style.marginTop = '-20px';
17 | document.body.appendChild(div);
18 |

19 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/properties.html: -------------------------------------------------------------------------------- 1 |

The following list contains properties exposed by the paper object:

2 | 3 | 9 | 10 |

Normally, you do not need to access these properties directly but in some (advanced) situations, it is handy to have access to them.

11 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/localToPaperPoint.html: -------------------------------------------------------------------------------- 1 |
paper.localToPaperPoint(p)
2 |

Transform the point p defined in the local coordinate system to the paper coordinate system. 3 |

var rightMidPoint = element.getBBox().rightMiddle();
 4 | var paperPoint1 = paper.localToPaperPoint(rightMidPoint);
 5 |  // alternative method signature
 6 | var paperPoint2 = paper.localToPaperPoint(rightMidPoint.x, rightMidPoint.y);
 7 | // Draw an HTML rectangle next to the element.
 8 | var div = document.createElement('div');
 9 | div.style.position = 'absolute';
10 | div.style.background = 'red';
11 | div.style.left = paperPoint1.x + 'px';
12 | div.style.top = paperPoint1.y + 'px';
13 | div.style.width = '40px';
14 | div.style.height = '40px';
15 | div.style.marginLeft = '10px';
16 | div.style.marginTop = '-20px';
17 | paper.el.appendChild(div); 
18 |

19 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/V/transformRect.html: -------------------------------------------------------------------------------- 1 | 2 |
V.transformRect(r, matrix)
3 |

Transform a rectangle specified by r (an object with x, y, width and height properties) by an SVG transformation represented by matrix. This function is used internally in the V.prototype.bbox method to return a bounding box of an SVG element relative to another SVG parent element. However, this can be used elsewhere too, that's why it is publicly exposed. Whenever you need to transform a bounding box to a coordinate system of another element, use this function. To get the transformation matrix of the target element relative to which you want to tranform your rectangle, use e.g. the native SVG method: var matrix = svgSourceElement.getTransformToElement(svgTargetElement).

-------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/localToClientPoint.html: -------------------------------------------------------------------------------- 1 |
paper.localToClientPoint(p)
2 |

Transform the point p defined in the local coordinate system to the client coordinate system. 3 |

var rightMidPoint = element.getBBox().rightMiddle();
 4 | var clientPoint1 = paper.localToClientPoint(rightMidPoint);
 5 |  // alternative method signature
 6 | var clientPoint2 = paper.localToClientPoint(rightMidPoint.x, rightMidPoint.y);
 7 | // Draw an HTML rectangle next to the element.
 8 | var div = document.createElement('div');
 9 | div.style.position = 'fixed';
10 | div.style.background = 'red';
11 | div.style.left = clientPoint1.x + 'px';
12 | div.style.top = clientPoint1.y + 'px';
13 | div.style.width = '40px';
14 | div.style.height = '40px';
15 | div.style.marginLeft = '10px';
16 | div.style.marginTop = '-20px';
17 | document.body.appendChild(div);
18 |

19 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Paper/prototype/options/restrictTranslate.html: -------------------------------------------------------------------------------- 1 | restrictTranslate - restrict the translation (movement) of elements by a given bouding box. If set to true, the user will not be able to move elements outside the boundary of the paper area. It's set to false by default. This option also accepts a function with signature function(elementView) in which case it must return a bounding box (an object of the form { x: Number, y: Number, width: Number, height: Number }) that defines the area in which the element represented by elementView can be moved. For example, to restrict translatoin of embedded elements by the bounding box defined by their parent element, you can do:

2 | 3 |
restrictTranslate: function(elementView) {
4 |     var parentId = elementView.model.get('parent');
5 |     return parentId && this.model.getCell(parentId).getBBox();
6 | }
7 | -------------------------------------------------------------------------------- /docs/demo/devs/shapes.devs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | DISCRETE EVENT SYSTEM SPECIFICATION 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /test/jointjs/cell.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | QUnit.module('cell', function(hooks) { 4 | 5 | QUnit.module('isElement()', function(hooks) { 6 | 7 | QUnit.test('should be a function', function(assert) { 8 | 9 | assert.equal(typeof joint.dia.Cell.prototype.isElement, 'function'); 10 | }); 11 | 12 | QUnit.test('should return FALSE', function(assert) { 13 | 14 | var cell = new joint.dia.Cell; 15 | 16 | assert.notOk(cell.isElement()); 17 | }); 18 | }); 19 | 20 | QUnit.module('isLink()', function(hooks) { 21 | 22 | QUnit.test('should be a function', function(assert) { 23 | 24 | assert.equal(typeof joint.dia.Cell.prototype.isLink, 'function'); 25 | }); 26 | 27 | QUnit.test('should return FALSE', function(assert) { 28 | 29 | var cell = new joint.dia.Cell; 30 | 31 | assert.notOk(cell.isLink()); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/CellView/prototype/highlight.html: -------------------------------------------------------------------------------- 1 |
cellView.highlight([el[, options]])
2 | 3 |

Highlights the cell view.

4 | 5 |

Arguments:

6 | 22 | -------------------------------------------------------------------------------- /test/jointjs/elements.js: -------------------------------------------------------------------------------- 1 | QUnit.module('elements', function(hooks) { 2 | 3 | QUnit.module('isElement()', function(hooks) { 4 | 5 | QUnit.test('should be a function', function(assert) { 6 | 7 | assert.equal(typeof joint.dia.Element.prototype.isElement, 'function'); 8 | }); 9 | 10 | QUnit.test('should return TRUE', function(assert) { 11 | 12 | var element = new joint.dia.Element; 13 | 14 | assert.ok(element.isElement()); 15 | }); 16 | }); 17 | 18 | QUnit.module('isLink()', function(hooks) { 19 | 20 | QUnit.test('should be a function', function(assert) { 21 | 22 | assert.equal(typeof joint.dia.Element.prototype.isLink, 'function'); 23 | }); 24 | 25 | QUnit.test('should return FALSE', function(assert) { 26 | 27 | var element = new joint.dia.Element; 28 | 29 | assert.notOk(element.isLink()); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /demo/performance.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Joint JS - Performance 1000x1000 6 | 7 | 8 | 9 | 24 |
25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/joint/api/dia/Element/prototype/position.html: -------------------------------------------------------------------------------- 1 |
element.position(x, y, [opt])

Set the element position to x and y coordinates. This is almost equivalent to 2 | element.set('position', { x: x, y: y }, opt). However, this method provides some additional functionality. 3 | If you set opt.parentRelative flag to true, the x and y 4 | coordinates will be treated relatively to the parent element of this element. If position() is called 5 | without arguments, it returns the current position. If position({ parentRealtive: true }) is called 6 | without x and y coordinates and with the parentRelativeflag set to true, 7 | the method returns the current position of the element relative to its parent. 8 |

-------------------------------------------------------------------------------- /demo/clipping.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | SVG Clipping 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /docs/src/vectorizer/api/prototype/sample.html: -------------------------------------------------------------------------------- 1 | 2 |
vel.sample(interval)
3 |

Sample the underlying SVG element (it currently works only on paths - where it is most useful anyway). Return an array of objects of the form { x: Number, y: Number, distance: Number }. Each of these objects represent a point on the path. This basically creates a discrete representation of the path (which is possible a curve). The sampling interval defines the accuracy of the sampling. In other words, we travel from the beginning of the path to the end by interval distance (on the path, not between the resulting points) and collect the discrete points on the path. This is very useful in many situations. For example, SVG does not provide a built-in mechanism to find intersections between two paths. Using sampling, we can just generate bunch of points for each of the path and find the closest ones from each set.

-------------------------------------------------------------------------------- /plugins/connectors/joint.connectors.smooth.js: -------------------------------------------------------------------------------- 1 | joint.connectors.smooth = function(sourcePoint, targetPoint, vertices) { 2 | 3 | var d; 4 | 5 | if (vertices.length) { 6 | 7 | d = g.bezier.curveThroughPoints([sourcePoint].concat(vertices).concat([targetPoint])); 8 | 9 | } else { 10 | // if we have no vertices use a default cubic bezier curve, cubic bezier requires 11 | // two control points. The two control points are both defined with X as mid way 12 | // between the source and target points. SourceControlPoint Y is equal to sourcePoint Y 13 | // and targetControlPointY being equal to targetPointY. 14 | var controlPointX = (sourcePoint.x + targetPoint.x) / 2; 15 | 16 | d = [ 17 | 'M', sourcePoint.x, sourcePoint.y, 18 | 'C', controlPointX, sourcePoint.y, controlPointX, targetPoint.y, 19 | targetPoint.x, targetPoint.y 20 | ]; 21 | } 22 | 23 | return d.join(' '); 24 | }; 25 | -------------------------------------------------------------------------------- /docs/src/joint/api/util/flattenObject.html: -------------------------------------------------------------------------------- 1 |
util.flattenObject(object, delim, stop)
2 | 3 |

Flatten a nested object up until the stop function returns true. The stop function takes the value of the node currently traversed. delim is a delimiter for the combined keys in the resulting object. Example:

4 | 5 |
joint.util.flattenObject({ 
 6 |     a: { 
 7 |         a1: 1, 
 8 |         a2: 2, 
 9 |         a3: { 
10 |             a31: 5, 
11 |             a32: { 
12 |                 a321: { a3211: 5 } 
13 |             } 
14 |         } 
15 |     }, 
16 |     b: 6 
17 | }, '/', function(v) { return !!v.a321; });
18 | 
19 | /*
20 | {
21 |  "a/a1": 1,
22 |  "a/a2": 2,
23 |  "a/a3/a31": 5,
24 |  "a/a3/a32": {
25 |   "a321": {
26 |    "a3211": 5
27 |   }
28 |  },
29 |  "b": 6
30 | }
31 | */
32 | -------------------------------------------------------------------------------- /test/geometry/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Geometry | Tests 5 | 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jointjs", 3 | "description": "JavaScript diagramming library", 4 | "main": [ 5 | "dist/joint.js", 6 | "dist/joint.css" 7 | ], 8 | "ignore": [ 9 | "*", 10 | "!dist/**" 11 | ], 12 | "moduleType": [ 13 | "globals", 14 | "amd", 15 | "node" 16 | ], 17 | "license": "MPL-2.0", 18 | "authors": [ 19 | "David Durman (https://github.com/DavidDurman)", 20 | "Roman Bruckner (https://github.com/kumilingus)", 21 | "Emanuele Palombo (https://github.com/elbowz)", 22 | "Charles Hill (https://github.com/chill117)", 23 | "Daniel K. (https://github.com/FredyC)", 24 | "Vladimir Talas (https://github.com/vtalas)", 25 | "Petr Skala (https://github.com/pskala)" 26 | ], 27 | "dependencies": { 28 | }, 29 | "devDependencies": { 30 | "blanket": "1.1.7", 31 | "qunit": "1.21.0", 32 | "requirejs": "2.1.22" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/geometry/toRad.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | QUnit.module('toRad(degrees)', function() { 4 | 5 | QUnit.test('should be a function', function(assert) { 6 | 7 | assert.equal(typeof g.toRad, 'function'); 8 | }); 9 | 10 | QUnit.test('should correctly convert the angle (in degrees) to radians', function(assert) { 11 | 12 | var values = [ 13 | // Values have a maximum precision of 3 decimal places. 14 | { radians: 0.785, degrees: 45 }, 15 | { radians: 1.047, degrees: 60 }, 16 | { radians: 1.571, degrees: 90 }, 17 | { radians: 2.793, degrees: 160 }, 18 | { radians: 4.712, degrees: 270 } 19 | ]; 20 | 21 | var degrees, radians; 22 | 23 | for (var i = 0; i < values.length; i++) { 24 | degrees = values[i].degrees; 25 | radians = values[i].radians; 26 | assert.equal(g.toRad(degrees).toFixed(3), radians, 'degrees = ' + degrees); 27 | } 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /test/geometry/toDeg.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | QUnit.module('toDeg(radians)', function() { 4 | 5 | QUnit.test('should be a function', function(assert) { 6 | 7 | assert.equal(typeof g.toDeg, 'function'); 8 | }); 9 | 10 | QUnit.test('should correctly convert the angle (in radians) to degrees', function(assert) { 11 | 12 | var values = [ 13 | // Values have a maximum precision of 3 decimal places. 14 | { radians: 1, degrees: 57.296 }, 15 | { radians: 2, degrees: 114.592 }, 16 | { radians: 3, degrees: 171.887 }, 17 | { radians: 3.2, degrees: 183.346 }, 18 | { radians: 5, degrees: 286.479 } 19 | ]; 20 | 21 | var degrees, radians; 22 | 23 | for (var i = 0; i < values.length; i++) { 24 | degrees = values[i].degrees; 25 | radians = values[i].radians; 26 | assert.equal(g.toDeg(radians).toFixed(3), degrees, 'radians = ' + radians); 27 | } 28 | }); 29 | }); 30 | --------------------------------------------------------------------------------