Skip to content

Commit 49fcc89

Browse files
committed
Improved the layout of the graph when no graph direction is specified in the dgml file.
1 parent 0ad333c commit 49fcc89

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## Version 1.0.2
4+
5+
- Improved the layout of the graph when no graph direction is specified in the dgml file.
6+
37
## Version 1.0.1
48

59
- Updated package references.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "DGMLViewer",
55
"description": "DGMLViewer is viewer for dgml (Directed Graph Markup Language) files",
66
"icon": "icon.png",
7-
"version": "1.0.1",
7+
"version": "1.0.2",
88
"repository": "https://github.com/CoderAllan/vscode-dgmlviewer",
99
"engines": {
1010
"vscode": "^1.52.0"

templates/dgmlViewer_Template.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
};
2222
var options = {
2323
physics: {
24-
enabled: false
24+
enabled: true,
25+
solver: 'repulsion'
2526
},
2627
edges: {
2728
smooth: false // Make edges straight lines.
@@ -36,6 +37,9 @@
3637
var container = document.getElementById('network');
3738
var network = new vis.Network(container, data, options);
3839
var seed = network.getSeed();
40+
network.on("stabilizationIterationsDone", function () {
41+
network.setOptions( { physics: false } );
42+
});
3943

4044
const vscode = acquireVsCodeApi();
4145
const helpTextDiv = document.getElementById('helpText');
@@ -298,6 +302,9 @@
298302
}
299303
options.layout.randomSeed = seed;
300304
network = new vis.Network(container, data, options);
305+
network.on("stabilizationIterationsDone", function () {
306+
network.setOptions( { physics: false } );
307+
});
301308
}
302309

303310
}());

0 commit comments

Comments
 (0)