diff --git a/examples/network/data/dotLanguage/dotEdgeStyles.html b/examples/network/data/dotLanguage/dotEdgeStyles.html
index a27dac9ba..88ae035f7 100644
--- a/examples/network/data/dotLanguage/dotEdgeStyles.html
+++ b/examples/network/data/dotLanguage/dotEdgeStyles.html
@@ -158,6 +158,9 @@
DOT edge styles
' ahs -> diamond[label="diamond", arrowhead=diamond]; \n' +
' ahs -> tee[label="tee", arrowhead=tee]; \n' +
' ahs -> vee[label="vee", arrowhead=vee]; \n' +
+ ' ahs -> both[label="both", dir=both]; \n' +
+ ' ahs -> back[label="back", dir=back]; \n' +
+ ' ahs -> none[label="none", dir=none]; \n' +
'}';
// create a network
diff --git a/lib/network/dotparser.js b/lib/network/dotparser.js
index 2efd580b1..23cbe200f 100644
--- a/lib/network/dotparser.js
+++ b/lib/network/dotparser.js
@@ -740,13 +740,38 @@ function parseAttributeList() {
vee: 'vee'
};
+ var dirTypes = {
+ forward: ["to"],
+ back: ["from"],
+ both: ["to", "from"],
+ none: []
+ };
+
if (name === 'arrowhead') {
var arrowType = arrowTypes[value];
name = 'arrows';
value = {to: {enabled:true, type: arrowType}};
}
- setValue(attr, name, value); // name can be a path
+ if (name === 'dir') {
+ // First set all arrows to disabled
+ var status = {enabled: false};
+ var prop = "";
+ for (prop in dirTypes["both"]) {
+ name = `arrows.${dirTypes["both"][prop]}`;
+ setValue(attr, name, status);
+ }
+
+ var dirType = dirTypes[value];
+ for (prop in dirType) {
+ name = `arrows.${dirType[prop]}`;
+ status = {enabled: true};
+ setValue(attr, name, status); // name can be a path
+ }
+
+ } else {
+ setValue(attr, name, value); // name can be a path
+ }
getToken();
if (token ==',') {