From dbb178b2226c9d233e8137449c8e7148d94b0b62 Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 25 Jul 2019 00:27:00 +0200 Subject: [PATCH] refactor(edges): dont add width and height params --- dist/ReactGraph.css | 2 +- dist/ReactGraph.js | 5 +++++ example/index.html | 1 + src/NodeRenderer/NodeTypes/wrapNode.js | 2 +- src/graph-utils.js | 20 +++++++++++++------- src/style.css | 2 +- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/dist/ReactGraph.css b/dist/ReactGraph.css index c9f1d064..1ab30709 100644 --- a/dist/ReactGraph.css +++ b/dist/ReactGraph.css @@ -60,7 +60,7 @@ width: 100%; height: 100%; position: absolute; - z-index: 2; + z-index: 3; pointer-events: none; transform-origin: 0 0; } diff --git a/dist/ReactGraph.js b/dist/ReactGraph.js index 542ddbcd..32b33fec 100644 --- a/dist/ReactGraph.js +++ b/dist/ReactGraph.js @@ -204,6 +204,10 @@ return element.data && element.data.source && element.data.target; }; var parseElements = function parseElements(e) { + if (isEdge(e)) { + return e; + } + return _objectSpread2({}, e, { __rg: { position: e.position, @@ -32893,6 +32897,7 @@ className: nodeClasses, ref: nodeElement, style: { + zIndex: selected ? 10 : 3, transform: "translate(".concat(position.x, "px,").concat(position.y, "px)") }, onClick: function onClick(e) { diff --git a/example/index.html b/example/index.html index 8ac422f9..323a4f14 100644 --- a/example/index.html +++ b/example/index.html @@ -4,6 +4,7 @@ + Document