Graph Prop: isInteractive (#56)

* feat(props): add isInteractive

* refactor(selection): dont allow if not interactive

* feat(renderer): add class if is interactive

* chore(inactive): add tests

* refactor(inactive): no connection line, no edge selection

closes #49
This commit is contained in:
Moritz
2019-10-23 18:42:17 +02:00
committed by GitHub
parent cf4bd7199a
commit 873fb50b19
28 changed files with 2528 additions and 377 deletions
+17 -8
View File
@@ -67,7 +67,9 @@
}
@keyframes dashdraw {
from {stroke-dashoffset: 10}
from {
stroke-dashoffset: 10;
}
}
.react-flow__nodes {
@@ -79,21 +81,30 @@
transform-origin: 0 0;
}
.is-interactive {
.react-flow__node {
cursor: grab;
&:hover > * {
box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.08);
}
}
.react-flow__handle {
cursor: crosshair;
}
}
.react-flow__node {
position: absolute;
color: #222;
font-family: sans-serif;
font-size: 12px;
text-align: center;
cursor: grab;
user-select: none;
pointer-events: all;
transform-origin: 0 0;
&:hover > * {
box-shadow: 0 1px 5px 2px rgba(0, 0, 0, 0.08);
}
&.selected > * {
box-shadow: 0 0 0 2px #555;
}
@@ -104,7 +115,6 @@
width: 10px;
height: 8px;
background: rgba(255, 255, 255, 0.4);
cursor: crosshair;
&.bottom {
top: auto;
@@ -123,7 +133,6 @@
top: 50%;
left: 0;
transform: translate(0, -50%);
}
&.right {