mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-11-26 01:11:44 +08:00
smol comit
This commit is contained in:
@@ -297,27 +297,38 @@ export default function Canvas(props) {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{linking && (
|
{linking && (
|
||||||
<line
|
<path
|
||||||
x1={line.startX}
|
d={`M ${line.startX} ${line.startY} L ${line.endX} ${line.endY}`}
|
||||||
y1={line.startY}
|
|
||||||
x2={line.endX}
|
|
||||||
y2={line.endY}
|
|
||||||
stroke="red"
|
stroke="red"
|
||||||
strokeDasharray="5,5"
|
strokeDasharray="8,8"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{props.relationships.map((e, i) => (
|
{props.relationships.map((e, i) => {
|
||||||
<line
|
const r = 20;
|
||||||
key={i}
|
const invert1 = e.startY < e.endY ? 1 : 0;
|
||||||
x1={e.startX}
|
const invert2 = e.startY < e.endY ? 0 : 1;
|
||||||
y1={e.startY}
|
|
||||||
x2={e.endX}
|
return (
|
||||||
y2={e.endY}
|
<path
|
||||||
stroke="gray"
|
key={i}
|
||||||
strokeWidth={2.5}
|
d={`M ${e.startX} ${e.startY} L ${e.startX + 224} ${
|
||||||
onClick={() => {}}
|
e.startY
|
||||||
/>
|
} L ${e.startX + 254} ${e.startY} A ${r} ${r} 0 0 ${invert1} ${
|
||||||
))}
|
e.startX + 254 + 20
|
||||||
|
} ${invert1 === 1 ? e.startY + r : e.startY - r} L ${
|
||||||
|
e.startX + 254 + 20
|
||||||
|
} ${
|
||||||
|
invert2 === 1 ? e.endY + r : e.endY - r
|
||||||
|
} A ${r} ${r} 0 0 ${invert2} ${e.startX + 254 + 40} ${
|
||||||
|
e.endY
|
||||||
|
} L ${e.endX} ${e.endY}`}
|
||||||
|
stroke="gray"
|
||||||
|
fill="none"
|
||||||
|
strokeWidth={2.5}
|
||||||
|
onClick={() => {}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
Collapse,
|
Collapse,
|
||||||
Input,
|
|
||||||
Form,
|
Form,
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
@@ -32,15 +31,7 @@ export default function ReferenceOverview(props) {
|
|||||||
return (
|
return (
|
||||||
<Collapse>
|
<Collapse>
|
||||||
{props.relationships.map((r, i) => (
|
{props.relationships.map((r, i) => (
|
||||||
<Collapse.Panel
|
<Collapse.Panel key={i} header={<div>{r.name}</div>} itemKey={`${i}`}>
|
||||||
key={i}
|
|
||||||
header={
|
|
||||||
<div>
|
|
||||||
<Input defaultValue={r.name} borderless />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
itemKey={`${i}`}
|
|
||||||
>
|
|
||||||
<Form>
|
<Form>
|
||||||
<div className="flex justify-between items-center my-1">
|
<div className="flex justify-between items-center my-1">
|
||||||
<div className="me-3">
|
<div className="me-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user