refactor(stlyes): use react-flow__container helper

This commit is contained in:
moklick
2021-11-04 15:13:14 +01:00
parent 31ad12ec9c
commit 72f1d8b4e3
12 changed files with 108 additions and 190 deletions
+7 -4
View File
@@ -207,7 +207,6 @@ const Edge = memo(
);
const selector = (s: ReactFlowState) => ({
transform: s.transform,
connectionNodeId: s.connectionNodeId,
connectionHandleId: s.connectionHandleId,
connectionHandleType: s.connectionHandleType,
@@ -222,7 +221,6 @@ const selector = (s: ReactFlowState) => ({
const EdgeRenderer = (props: EdgeRendererProps) => {
const {
transform,
connectionNodeId,
connectionHandleId,
connectionHandleType,
@@ -246,7 +244,13 @@ const EdgeRenderer = (props: EdgeRendererProps) => {
return (
<>
{edgeTree.map(({ level, edges, isMaxLevel }) => (
<svg key={level} style={{ zIndex: level }} width={width} height={height} className="react-flow__edges">
<svg
key={level}
style={{ zIndex: level }}
width={width}
height={height}
className="react-flow__edges react-flow__container"
>
{isMaxLevel && <MarkerDefinitions defaultColor={defaultMarkerColor} />}
<g>
{edges.map((edge: Edge) => {
@@ -289,7 +293,6 @@ const EdgeRenderer = (props: EdgeRendererProps) => {
connectionHandleType={connectionHandleType!}
connectionPositionX={connectionPosition.x}
connectionPositionY={connectionPosition.y}
transform={transform}
connectionLineStyle={connectionLineStyle}
connectionLineType={connectionLineType}
isConnectable={nodesConnectable}