Skip to content

Commit 37fd0db

Browse files
make all edges and borders black
1 parent 46a7cb1 commit 37fd0db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Visualizer.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function toFlowEdges(layout: MyELKNodeLayedOut): FlowEdge[] {
288288

289289
export function EClassNode({ data }: NodeProps<FlowClass>) {
290290
return (
291-
<div className="rounded-md border border-dotted border-stone-400 h-full w-full" style={{ backgroundColor: data.color! || "white" }}>
291+
<div className="rounded-md border border-dotted border-black h-full w-full" style={{ backgroundColor: data.color! || "white" }}>
292292
{/* <MyNodeToolbar type="class" id={data.id} selected={data.selected} /> */}
293293
<Handle type="target" position={Position.Top} className="invisible" />
294294
</div>
@@ -304,7 +304,7 @@ export function ENode(
304304
>
305305
) {
306306
return (
307-
<div className="p-1 rounded-md border bg-white border-stone-400 h-full w-full" ref={props?.outerRef}>
307+
<div className="p-1 rounded-md border bg-white border-black h-full w-full" ref={props?.outerRef}>
308308
{/* {props?.outerRef ? <></> : <MyNodeToolbar type="class" id={props!.data!.id} selected={props!.data!.selected} />} */}
309309

310310
<div className="font-mono text-xs truncate max-w-96 min-w-4 text-center" ref={props?.innerRef}>
@@ -335,10 +335,10 @@ export function ENode(
335335
// );
336336
// }
337337

338-
export function CustomEdge({ markerEnd, data }: EdgeProps<FlowEdge>) {
338+
export function CustomEdge({ data, ...rest }: EdgeProps<FlowEdge>) {
339339
const { points } = data!;
340340
const edgePath = points.map(({ x, y }, index) => `${index === 0 ? "M" : "L"} ${x} ${y}`).join(" ");
341-
return <BaseEdge path={edgePath} markerEnd={markerEnd} />;
341+
return <BaseEdge path={edgePath} {...rest} />;
342342
}
343343

344344
const nodeTypes: NodeTypes = {
@@ -413,7 +413,7 @@ function LayoutFlow({ egraph, outerElem, innerElem }: { egraph: string; outerEle
413413
nodesFocusable={true}
414414
// nodeDragThreshold={100}
415415
onNodeClick={onNodeClick}
416-
defaultEdgeOptions={{ markerEnd: { type: MarkerType.ArrowClosed } }}
416+
defaultEdgeOptions={{ markerEnd: { type: MarkerType.ArrowClosed, color: "black" }, style: { stroke: "black", strokeWidth: 0.5 } }}
417417
>
418418
{selectedNode ? (
419419
<Panel position="top-center">

0 commit comments

Comments
 (0)