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:
+17
-8
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user