Skip to content

Commit 2e64de1

Browse files
committed
Add color on relationship cardinality
Issue : #651
1 parent 2f1adf3 commit 2e64de1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/EditorCanvas/Relationship.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@ export default function Relationship({ data }) {
148148
x={cardinalityStartX}
149149
y={cardinalityStartY}
150150
text={cardinalityStart}
151+
color={data.color}
151152
/>
152153
<CardinalityLabel
153154
x={cardinalityEndX}
154155
y={cardinalityEndY}
155156
text={cardinalityEnd}
157+
color={data.color}
156158
/>
157159
</>
158160
)}
@@ -182,7 +184,7 @@ export default function Relationship({ data }) {
182184
);
183185
}
184186

185-
function CardinalityLabel({ x, y, text, r = 12, padding = 14 }) {
187+
function CardinalityLabel({ x, y, text, r = 12, padding = 14 , color = "grey"}) {
186188
const [textWidth, setTextWidth] = useState(0);
187189
const textRef = useRef(null);
188190

@@ -202,7 +204,7 @@ function CardinalityLabel({ x, y, text, r = 12, padding = 14 }) {
202204
ry={r}
203205
width={textWidth + padding}
204206
height={r * 2}
205-
fill="grey"
207+
fill={color}
206208
className="group-hover:fill-sky-600"
207209
/>
208210
<text

0 commit comments

Comments
 (0)