From 2cf2904220e2bef555a27102e4d9d20171b67e18 Mon Sep 17 00:00:00 2001 From: geminoa Date: Sun, 1 Apr 2018 03:55:51 +0900 Subject: [PATCH] Add arrow types for EndPoints.js (#3839) * Add arrowhead support As described in TODO, dotparser.js does not support 'arrowhead' attribubte of edge. This update is for adding 'dot' and 'tee'(bar) styles. * Add example for arrow styles * Add box arrowhead To support box arrowhead of graphviz, add Box endpoint class in EndPoints.js and box attribute in dotparser.js. * Add diamond arrowhead To support diamond arrowhead of graphviz, add Diamond endpoint class in EndPoints.js and diamond attribute in dotparser.js. * Add crow arrowhead To support crow arrowhead of graphviz, add Crow endpoint class in EndPoints.js and crow attribute in dotparser.js. * Add normal arrowhead To support normal arrowhead of graphviz, add Triangle endpoint class in EndPoints.js and normal attribute in dotparser.js. * Add curve arrowhead To support curve arrowhead of graphviz, add Curve endpoint class in EndPoints.js and curve attribute in dotparser.js. * Add inverted curve arrowhead To support inverted curve arrowhead of graphviz, add InvertedCurve endpoint class in EndPoints.js and icurve attribute in dotparser.js. * Add vee arrowhead To support vee arrowhead of graphviz, add Vee endpoint class in EndPoints.js and vee attribute in dotparser.js. * Add arrowhead examples * Fix bug for accessing null attribute In createEdge(), accessing 'attr' causes an error if the edge has no attribute and the value is null. This update fixes bug for accessing null 'attr'. * Update description for arrows.to.type option Add followingn options for 'arrows.to.type'. * box * crow * curve * diamond * inv_curve * triangle * inv_triangle * vee * Update edgeStyle example for arrow types Add arrow types for the example. 'box', 'crow', 'curve', 'inv_curve', 'diamond', 'triangle', 'inv_triangle', 'vee' --- docs/network/edges.html | 2 +- .../data/dotLanguage/dotEdgeStyles.html | 74 ++++-- examples/network/edgeStyles/arrowTypes.html | 65 +++-- lib/network/dotparser.js | 41 ++- .../components/edges/util/EndPoints.js | 248 ++++++++++++++++++ 5 files changed, 385 insertions(+), 45 deletions(-) diff --git a/docs/network/edges.html b/docs/network/edges.html index 8efddbc5..da35bed0 100644 --- a/docs/network/edges.html +++ b/docs/network/edges.html @@ -232,7 +232,7 @@ network.setOptions(options); arrows.to.type String arrow - The type of endpoint. Possible values are: arrow, bar, circle. The default is arrow. + The type of endpoint. Possible values are: arrow, bar, circle, box, crow, curve, diamond, inv_curve, triangle, inv_triangle, vee. The default is arrow. arrows.middle diff --git a/examples/network/data/dotLanguage/dotEdgeStyles.html b/examples/network/data/dotLanguage/dotEdgeStyles.html index 9d5644b0..a27dac9b 100644 --- a/examples/network/data/dotLanguage/dotEdgeStyles.html +++ b/examples/network/data/dotLanguage/dotEdgeStyles.html @@ -36,8 +36,6 @@ #left, #right { position: absolute; - width: 50%; - height: 100%; margin: 0; padding: 10px; box-sizing: border-box; @@ -45,11 +43,15 @@ } #left { + width: 40%; + height: 80%; top: 0; left: 0; } #right { + width: 60%; + height: 100%; top: 0; right: 0; } @@ -82,7 +84,7 @@ } - + @@ -91,27 +93,43 @@

- Example of edge styles support + Example of edge styles support.

- + + + + + + + + + + + + + + + + + + +
AttributesDesriptions
labelText displayed on the edge
colorEdge color
styleEdge style (solid, dashed, dotted)
arrowheadArrow style (dot, box, crow, curve, icurve, normal, inv, diamond, tee, vee)
-
- - - -
+
+ + +
+
+ +