This repository has been archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add dir support #3888
Open
geminoa
wants to merge
17
commits into
almende:develop
Choose a base branch
from
geminoa:add_dir
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add dir support #3888
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As described in TODO, dotparser.js does not support 'arrowhead' attribubte of edge. This update is for adding 'dot' and 'tee'(bar) styles.
To support box arrowhead of graphviz, add Box endpoint class in EndPoints.js and box attribute in dotparser.js.
To support diamond arrowhead of graphviz, add Diamond endpoint class in EndPoints.js and diamond attribute in dotparser.js.
To support crow arrowhead of graphviz, add Crow endpoint class in EndPoints.js and crow attribute in dotparser.js.
To support normal arrowhead of graphviz, add Triangle endpoint class in EndPoints.js and normal attribute in dotparser.js.
To support curve arrowhead of graphviz, add Curve endpoint class in EndPoints.js and curve attribute in dotparser.js.
To support inverted curve arrowhead of graphviz, add InvertedCurve endpoint class in EndPoints.js and icurve attribute in dotparser.js.
To support vee arrowhead of graphviz, add Vee endpoint class in EndPoints.js and vee attribute in dotparser.js.
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'.
Add followingn options for 'arrows.to.type'. * box * crow * curve * diamond * inv_curve * triangle * inv_triangle * vee
Add arrow types for the example. 'box', 'crow', 'curve', 'inv_curve', 'diamond', 'triangle', 'inv_triangle', 'vee'
Directional arrow has 'dir' attribute for defining direction of 'forward', 'back', 'both' or 'none'. This update enables to 'dir' attribute. If you define an edge as 'a -> b[arrowhead=normal, dir=both]', arrowheads are depicted both of source and destination.
This update is for comply with graphviz more strictly. As explained in [1], graphviz has limitations for combination of arrow[head|tail] and dir but dotparser.js does not behaviour as same. [1] https://www.graphviz.org/doc/info/attrs.html#h:undir_note If attribute list includes 'dir', following cases just be supported. 1. both or none + arrowhead, arrowtail 2. forward + arrowhead (arrowtail is not affedted) 3. back + arrowtail (arrowhead is not affected) In this update, parsed attributes is pushed 'attr_list' at once and setValue() is not called in while loop in parseAttributeList(). setValue() is called after while loop ends. It is because for checking attributes which change the same attribute of vis. For instance, both of 'arrowhead' and 'dir' (edge style defined in DOT) make changes for the same 'arrows' attribute in vis. If setValue() is called from while loop, previous change is overwritten.
Merge remote-tracking branch 'upstream/develop' into add_dir
looks good to me ✅ notice the differences: dot --> both dot http://localhost:8080/examples/network/data/dotLanguage/dotEdgeStyles.html beforeafter |
merged here, thanks for the contribution @geminoa 😄 🙏 visjs-community/visjs-network#23 |
This was referenced Sep 3, 2018
This was referenced Jul 26, 2019
💌 Thanks @geminoa for your contribution! |
mojoaxel
added
Network
visjs APPLIED
this PR was merged into a repo of the visjs family
labels
Jul 27, 2019
29 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This update is for fixing TODO for 'dir' support. It is to comply with behaviour of graphviz described in [1].
[1] https://www.graphviz.org/doc/info/attrs.html#h:undir_note