Spaces:
Running
Running
Better styling for node groups.
Browse files
lynxkite-app/web/src/index.css
CHANGED
@@ -88,6 +88,25 @@ body {
|
|
88 |
}
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
.tooltip {
|
92 |
padding: 8px;
|
93 |
border-radius: 4px;
|
@@ -526,12 +545,17 @@ body {
|
|
526 |
z-index: -10 !important;
|
527 |
}
|
528 |
|
|
|
529 |
.selected .comment-view,
|
530 |
.selected .lynxkite-node {
|
531 |
outline: var(--xy-selection-border, var(--xy-selection-border-default));
|
532 |
outline-offset: 7.5px;
|
533 |
}
|
534 |
|
|
|
|
|
|
|
|
|
535 |
.graph-creation-view {
|
536 |
display: flex;
|
537 |
width: 100%;
|
|
|
88 |
}
|
89 |
}
|
90 |
|
91 |
+
.in-group .lynxkite-node {
|
92 |
+
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
|
93 |
+
opacity: 0.3;
|
94 |
+
transition: opacity 0.3s;
|
95 |
+
}
|
96 |
+
|
97 |
+
.in-group .lynxkite-node:hover {
|
98 |
+
opacity: 1;
|
99 |
+
}
|
100 |
+
|
101 |
+
.react-flow__node-group,
|
102 |
+
.react-flow__node-group.selectable.selected,
|
103 |
+
.react-flow__node-group:hover {
|
104 |
+
box-shadow: 0px 3px 30px 0px rgba(0, 0, 0, 0.3);
|
105 |
+
border-radius: 20px;
|
106 |
+
border: none;
|
107 |
+
background-color: #fffb;
|
108 |
+
}
|
109 |
+
|
110 |
.tooltip {
|
111 |
padding: 8px;
|
112 |
border-radius: 4px;
|
|
|
545 |
z-index: -10 !important;
|
546 |
}
|
547 |
|
548 |
+
.selected.selectable.react-flow__node-group,
|
549 |
.selected .comment-view,
|
550 |
.selected .lynxkite-node {
|
551 |
outline: var(--xy-selection-border, var(--xy-selection-border-default));
|
552 |
outline-offset: 7.5px;
|
553 |
}
|
554 |
|
555 |
+
.selected.selectable.react-flow__node-group {
|
556 |
+
outline-offset: 20px;
|
557 |
+
}
|
558 |
+
|
559 |
.graph-creation-view {
|
560 |
display: flex;
|
561 |
width: 100%;
|
lynxkite-app/web/src/workspace/Workspace.tsx
CHANGED
@@ -374,11 +374,13 @@ function LynxKiteFlow() {
|
|
374 |
let left = Number.POSITIVE_INFINITY;
|
375 |
let bottom = Number.NEGATIVE_INFINITY;
|
376 |
let right = Number.NEGATIVE_INFINITY;
|
|
|
377 |
for (const node of selectedNodes) {
|
378 |
-
if (node.position.y < top) top = node.position.y;
|
379 |
-
if (node.position.x < left) left = node.position.x;
|
380 |
-
if (node.position.y + node.height! > bottom)
|
381 |
-
|
|
|
382 |
}
|
383 |
groupNode.position = {
|
384 |
x: left,
|
@@ -394,6 +396,7 @@ function LynxKiteFlow() {
|
|
394 |
...n,
|
395 |
position: { x: n.position.x - left, y: n.position.y - top },
|
396 |
parentId: groupNode.id,
|
|
|
397 |
selected: false,
|
398 |
}
|
399 |
: n,
|
@@ -407,6 +410,7 @@ function LynxKiteFlow() {
|
|
407 |
node.position.x -= left;
|
408 |
node.position.y -= top;
|
409 |
node.parentId = groupNode.id;
|
|
|
410 |
node.selected = false;
|
411 |
}
|
412 |
}
|
@@ -426,6 +430,7 @@ function LynxKiteFlow() {
|
|
426 |
...n,
|
427 |
position: { x: n.position.x + g.position.x, y: n.position.y + g.position.y },
|
428 |
parentId: undefined,
|
|
|
429 |
};
|
430 |
}),
|
431 |
);
|
@@ -441,6 +446,7 @@ function LynxKiteFlow() {
|
|
441 |
node.position.x += g.position.x;
|
442 |
node.position.y += g.position.y;
|
443 |
node.parentId = undefined;
|
|
|
444 |
}
|
445 |
});
|
446 |
}
|
|
|
374 |
let left = Number.POSITIVE_INFINITY;
|
375 |
let bottom = Number.NEGATIVE_INFINITY;
|
376 |
let right = Number.NEGATIVE_INFINITY;
|
377 |
+
const PAD = 10;
|
378 |
for (const node of selectedNodes) {
|
379 |
+
if (node.position.y - PAD < top) top = node.position.y - PAD;
|
380 |
+
if (node.position.x - PAD < left) left = node.position.x - PAD;
|
381 |
+
if (node.position.y + PAD + node.height! > bottom)
|
382 |
+
bottom = node.position.y + PAD + node.height!;
|
383 |
+
if (node.position.x + PAD + node.width! > right) right = node.position.x + PAD + node.width!;
|
384 |
}
|
385 |
groupNode.position = {
|
386 |
x: left,
|
|
|
396 |
...n,
|
397 |
position: { x: n.position.x - left, y: n.position.y - top },
|
398 |
parentId: groupNode.id,
|
399 |
+
extent: "parent",
|
400 |
selected: false,
|
401 |
}
|
402 |
: n,
|
|
|
410 |
node.position.x -= left;
|
411 |
node.position.y -= top;
|
412 |
node.parentId = groupNode.id;
|
413 |
+
node.extent = "parent";
|
414 |
node.selected = false;
|
415 |
}
|
416 |
}
|
|
|
430 |
...n,
|
431 |
position: { x: n.position.x + g.position.x, y: n.position.y + g.position.y },
|
432 |
parentId: undefined,
|
433 |
+
extent: undefined,
|
434 |
};
|
435 |
}),
|
436 |
);
|
|
|
446 |
node.position.x += g.position.x;
|
447 |
node.position.y += g.position.y;
|
448 |
node.parentId = undefined;
|
449 |
+
node.extent = undefined;
|
450 |
}
|
451 |
});
|
452 |
}
|
lynxkite-app/web/src/workspace/nodes/LynxKiteNode.tsx
CHANGED
@@ -82,7 +82,7 @@ function LynxKiteNodeComponent(props: LynxKiteNodeProps) {
|
|
82 |
}
|
83 |
return (
|
84 |
<div
|
85 |
-
className={`node-container ${expanded ? "expanded" : "collapsed"} `}
|
86 |
style={{
|
87 |
width: props.width || 200,
|
88 |
height: expanded ? props.height || 200 : undefined,
|
|
|
82 |
}
|
83 |
return (
|
84 |
<div
|
85 |
+
className={`node-container ${expanded ? "expanded" : "collapsed"} ${props.parentId ? "in-group" : ""}`}
|
86 |
style={{
|
87 |
width: props.width || 200,
|
88 |
height: expanded ? props.height || 200 : undefined,
|