Skip to content

Commit 1467348

Browse files
committed
display icons in custom edge labels
1 parent e091987 commit 1467348

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/extensions/react-flow/_react-flow_v12.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
position: absolute;
6868
}
6969

70-
.react-flow .react-flow__edges svg {
70+
.react-flow .react-flow__edges svg:not(.#{$eccgui}-icon) {
7171
position: absolute;
7272
overflow: visible;
7373
pointer-events: none;

src/extensions/react-flow/edges/EdgeLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface EdgeLabelProps extends React.HTMLAttributes<HTMLDivElement> {
2828
*/
2929
fullWidth?: boolean;
3030
/**
31-
* Label is diaplayed without a box that comes with borders and background color.
31+
* Label is displayed without a box that comes with borders and background color.
3232
*/
3333
loose?: boolean;
3434
/**

src/extensions/react-flow/edges/_edges.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ path.react-flow__edge-path-highlight {
271271

272272
// Custom label
273273

274+
.#{$eccgui}-graphviz__edge-labelobject {
275+
overflow: visible;
276+
}
277+
274278
.#{$eccgui}-graphviz__edge-label {
275279
--#{$eccgui}-reactflow-edge-label-color: currentcolor;
276280
--#{$eccgui}-reactflow-edge-label-color-background: #{$card-background-color};

src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import React, { useCallback, useEffect, useState } from "react";
22
import { ArrowHeadType, Elements, getMarkerEnd, ReactFlowProvider } from "react-flow-renderer";
33
import { Meta, StoryFn } from "@storybook/react";
44

5-
import { EdgeLabel, EdgeLabelObject, ReactFlow } from "./../../../../../index";
6-
import { EdgeDefault, EdgeDefaultDataProps as EdgeData } from "./../EdgeDefault";
5+
import { EdgeDefaultProps, EdgeLabel, EdgeLabelObject, ReactFlowExtended } from "./../../../../../index";
76
import { edgeTypes } from "./../../../../cmem/react-flow/configuration/workflow";
7+
import { EdgeDefault, EdgeDefaultDataProps as EdgeData } from "./../EdgeDefault";
88

99
const EdgeDefaultDataProps = (data: EdgeData) => {
1010
// this is only a mock to get it as sub element in the table
11-
return <></>;
11+
return <>{data.intent}</>;
1212
};
1313

1414
export default {
@@ -23,7 +23,7 @@ export default {
2323
},
2424
} as Meta<typeof EdgeDefault>;
2525

26-
const EdgeDefaultExample = (args: any) => {
26+
const EdgeDefaultExample = (args: EdgeDefaultProps) => {
2727
const [reactflowInstance, setReactflowInstance] = useState(null);
2828
const [elements, setElements] = useState([] as Elements);
2929

@@ -66,7 +66,7 @@ const EdgeDefaultExample = (args: any) => {
6666

6767
return (
6868
<ReactFlowProvider>
69-
<ReactFlow
69+
<ReactFlowExtended
7070
elements={elements}
7171
style={{ height: "400px" }}
7272
onLoad={onLoad}

0 commit comments

Comments
 (0)