Skip to content

Commit

Permalink
FIXUP
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed Feb 13, 2023
1 parent aeb630f commit 68680cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions packages/ui/src/ui/treemap/treemap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Treemap = ({ className, data, Item }) => {
const height = containerRef?.current?.clientHeight || 210;

const values = data.map(({ value }) => value);
const itemCoordinates = squarify(values, width, height, 0, 0);
const itemCoordinates = squarify(values, 100, 100, 0, 0);

const newItems = data.map((item, index) => {
const coordinates = itemCoordinates[index];
Expand All @@ -49,10 +49,10 @@ export const Treemap = ({ className, data, Item }) => {
return {
...item,
style: {
left: coordinates[0],
top: coordinates[1],
width: coordinates[2] - coordinates[0],
height: coordinates[3] - coordinates[1],
left: `${coordinates[0]}%`,
top: `${coordinates[1]}%`,
width: `${coordinates[2] - coordinates[0]}%`,
height: `${coordinates[3] - coordinates[1]}%`,
},
};
});
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/src/ui/treemap/treemap.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.root {
position: relative;
border: 1px solid var(--color-outline);
}

.root::before {
Expand All @@ -18,14 +17,15 @@
}

.item::before {
left: 2px;
top: 2px;
right: 2px;
bottom: 2px;
left: 1px;
top: 1px;
right: 1px;
bottom: 1px;
content: '';
position: absolute;
display: block;
outline: 1px solid var(--color-outline);
border: 1px solid var(--color-outline);
border-radius: var(--radius-small);
}

.itemLabel {
Expand Down

0 comments on commit 68680cd

Please sign in to comment.