Skip to content

Commit

Permalink
chore: use const for padding
Browse files Browse the repository at this point in the history
Signed-off-by: Zxilly <[email protected]>
  • Loading branch information
Zxilly committed Jul 22, 2024
1 parent bbd393f commit de6bc06
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ui/src/TreeMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { group } from "d3-array";
import type { HierarchyNode } from "d3-hierarchy";
import { hierarchy, treemap, treemapSquarify } from "d3-hierarchy";
import { useTitle, useWindowSize } from "react-use";

import type { Entry } from "./tool/entry.ts";
import createRainbowColor from "./tool/color.ts";
import { Tooltip } from "./Tooltip.tsx";
import { Node } from "./Node.tsx";

import "./style.scss";
import { trimPrefix } from "./tool/utils.ts";
import { shallowCopy } from "./tool/copy.ts";
import { PADDING, TOP_PADDING } from "./tool/const.ts";

interface TreeMapProps {
entry: Entry;
Expand Down Expand Up @@ -56,8 +55,8 @@ function TreeMap({ entry }: TreeMapProps) {
const layout = useMemo(() => {
return treemap<Entry>()
.size([width, height])
.paddingInner(1)
.paddingTop(20)
.paddingInner(PADDING)
.paddingTop(TOP_PADDING)
.round(true)
.tile(treemapSquarify);
}, [height, width]);
Expand Down

0 comments on commit de6bc06

Please sign in to comment.