Skip to content

Commit

Permalink
fix: fix ids
Browse files Browse the repository at this point in the history
  • Loading branch information
abrgr committed Sep 19, 2023
1 parent 1dc361b commit c2e1bd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/flow-graph/routing-layer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ export const RoutingLayer = ({
return (
<svg className={styles.routing}>
{connectorPoss.map(({ connector }, connIdx) => {
const endMarkerId = `end-${sourceState}-${connIdx}`;
const startMarkerId = `start-${sourceState}-${connIdx}`;
const sourceId = sourceState.replace(/[^a-zA-Z0-9_-]/g, "-");
const endMarkerId = `end-${sourceId}-${connIdx}`;
const startMarkerId = `start-${sourceId}-${connIdx}`;
const path = pointsToPath(connector.points);
const reversePath = pointsToPath(
Array.from(connector.points).reverse()
Expand Down
5 changes: 3 additions & 2 deletions src/components/svg-flow-graph/routing-layer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export const RoutingLayer = ({
return (
<svg x1={0} y1={0} width="100%" height="100%">
{connectorPoss.map(({ connector }, connIdx) => {
const endMarkerId = `end-${sourceState}-${connIdx}`;
const startMarkerId = `start-${sourceState}-${connIdx}`;
const sourceId = sourceState.replace(/[^a-zA-Z0-9_-]/g, "-");
const endMarkerId = `end-${sourceId}-${connIdx}`;
const startMarkerId = `start-${sourceId}-${connIdx}`;
const path = pointsToPath(connector.points);
const reversePath = pointsToPath(
Array.from(connector.points).reverse()
Expand Down

0 comments on commit c2e1bd5

Please sign in to comment.