Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Sep 19, 2024
1 parent 83dd9bb commit 22cf701
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dashboard/components/DdlGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import {
} from "../lib/layout"

const nodeRadius = 12
const ddlNameMargin = nodeRadius * 3
const ddlMarginX = nodeRadius * 8
const ddlMarginY = nodeRadius * 8
const ddlNameMarginX = ddlMarginX / 2
const ddlNameMarginY = nodeRadius * 7
const ddlDistanceX = nodeRadius * 2
const ddlDistanceY = nodeRadius * 2

Expand Down Expand Up @@ -50,10 +51,6 @@ export default function DdlGraph({
ddlDistanceY
)

const layoutResult = ddlLayout.map(({ x, y, ...data }) => {
return { x: x + ddlMarginX / 2, y: y + ddlMarginY / 2, ...data }
})

let svgWidth = 0
let svgHeight = 0
ddlLayout.forEach(({ x, y }) => {
Expand All @@ -63,7 +60,7 @@ export default function DdlGraph({
const edges = generateDdlEdges(ddlLayout)

return {
layoutResult,
layoutResult: ddlLayout,
svgWidth,
svgHeight,
edges,
Expand Down Expand Up @@ -97,7 +94,8 @@ export default function DdlGraph({
.text(({ ddl_name, schema_name }) => `${schema_name}.${ddl_name}`)
.attr("font-family", "inherit")
.attr("text-anchor", "middle")
.attr("dy", ddlNameMargin)
.attr("dx", ddlNameMarginX)
.attr("dy", ddlNameMarginY)
.attr("fill", "black")
.attr("font-size", 12)

Expand All @@ -113,6 +111,8 @@ export default function DdlGraph({
})

circle
.attr("cx", ddlMarginX / 2)
.attr("cy", ddlMarginY / 2)
.attr("fill", "white")
.attr("stroke-width", 1)
.attr("stroke", theme.colors.gray[500])
Expand Down

0 comments on commit 22cf701

Please sign in to comment.