From 0e6aac46343d3796ea45291d42a0dfe9ce5bc3f4 Mon Sep 17 00:00:00 2001 From: Alex de Mulder Date: Wed, 19 Aug 2015 21:16:38 +0200 Subject: [PATCH] - Added support for Gephi directed edges, edge labels and titles. --- HISTORY.md | 1 + lib/network/gephiParser.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 5894cb3a..b59f5723 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -23,6 +23,7 @@ http://visjs.org - Made the network keep its 'view' during a change of the size of the container. - Added improvedLayout as experimental option for greatly improved stabilization times. - Added adaptiveTimestep as experimental option for greatly improved stabilization times. +- Added support for Gephi directed edges, edge labels and titles. ## 2015-07-27, version 4.7.0 diff --git a/lib/network/gephiParser.js b/lib/network/gephiParser.js index 0e492964..124d6b45 100644 --- a/lib/network/gephiParser.js +++ b/lib/network/gephiParser.js @@ -29,6 +29,9 @@ function parseGephi(gephiJSON, optionsObj) { edge['attributes'] = gEdge.attributes; edge['label'] = gEdge.label; edge['title'] = gEdge.attributes !== undefined ? gEdge.attributes.title : undefined; + if (gEdge['type'] === 'Directed') { + edge['arrows'] = 'to'; + } // edge['value'] = gEdge.attributes !== undefined ? gEdge.attributes.Weight : undefined; // edge['width'] = edge['value'] !== undefined ? undefined : edgegEdge.size; if (gEdge.color && options.inheritColor === false) {