Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from sarbull/main
Browse files Browse the repository at this point in the history
Extract nodeDistance on x, y coords to external properties
  • Loading branch information
sarbull authored Jul 30, 2021
2 parents 973a3ff + f02d2ae commit 1c46e77
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
16 changes: 12 additions & 4 deletions happi-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ class HappiGraph extends PolymerElement {
nodeCountLimit: {
type: Number,
value: 0
},
nodeDistanceX: {
type: Number,
value: 350
},
nodeDistanceY: {
type: Number,
value: 350
}
};
}
Expand Down Expand Up @@ -256,8 +264,8 @@ class HappiGraph extends PolymerElement {
improvedLayout: false,
hierarchical: {
enabled:true,
levelSeparation: 450,
nodeSpacing: 350,
levelSeparation: this.nodeDistanceY,
nodeSpacing: this.nodeDistanceX,
treeSpacing: 200,
direction: this.graphDirection === 'HORIZONTAL' ? 'LR' : 'DU', // UD, DU, LR, RL
sortMethod: 'directed', // hubsize, directed
Expand Down Expand Up @@ -311,8 +319,8 @@ class HappiGraph extends PolymerElement {
id: "root",
layoutOptions: {
"elk.algorithm": "layered",
"elk.spacing.nodeNode": 200,
"elk.layered.spacing.baseValue": 150,
"elk.spacing.nodeNode": this.nodeDistanceY,
"elk.layered.spacing.baseValue": this.nodeDistanceX,
"elk.direction": this.graphDirection === 'HORIZONTAL' ? 'RIGHT' : 'UP'
},
children: [
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "happi-graph",
"version": "2.11.0",
"version": "3.0.0",
"description": "Happi Graph Web Component using Polymer 3.0",
"main": "happi-graph.js",
"scripts": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"@polymer/test-fixture": "^4.0.2",
"@webcomponents/webcomponentsjs": "^2.0.0",
"chai": "^4.2.0",
"egeria-js-commons": "git+https://github.com/odpi/egeria-js-commons#v0.2.1",
"egeria-js-commons": "git+https://github.com/odpi/egeria-js-commons#3.0.0",
"jest": "^27.0.6",
"mocha": "^6.1.4",
"polymer-cli": "^1.9.11",
Expand Down

0 comments on commit 1c46e77

Please sign in to comment.