Skip to content

Commit c7da482

Browse files
added dcumentation to the ComponentMap
1 parent 8de1b80 commit c7da482

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ export default function ComponentMap({
3131
const [linkType, setLinkType] = useState<string>('diagonal');
3232
const [stepPercent, setStepPercent] = useState<number>(0.5);
3333
const forceUpdate = useForceUpdate();
34-
34+
// setting the margins for the Map to render in the tab
3535
const innerWidth = totalWidth - margin.left - margin.right;
3636
const innerHeight = totalHeight - margin.top - margin.bottom;
3737

3838
let origin: { x: number; y: number };
3939
let sizeWidth: number;
4040
let sizeHeight: number;
4141

42+
// rendering for the different tab selections
4243
if (layout === 'polar') {
4344
origin = {
4445
x: innerWidth / 2,
@@ -56,7 +57,7 @@ export default function ComponentMap({
5657
sizeHeight = innerWidth;
5758
}
5859
}
59-
60+
// controls for the map
6061
const LinkComponent = getLinkComponent({ layout, linkType, orientation });
6162
return totalWidth < 10 ? null : (
6263
<div>
@@ -70,6 +71,7 @@ export default function ComponentMap({
7071
setLinkType={setLinkType}
7172
setStepPercent={setStepPercent}
7273
/>
74+
7375
<svg width={totalWidth} height={totalHeight}>
7476
<LinearGradient id='links-gradient' from='#fd9b93' to='#fe6e9e' />
7577
<rect width={totalWidth} height={totalHeight} rx={14} fill='#242529' />
@@ -94,7 +96,7 @@ export default function ComponentMap({
9496

9597
{tree.descendants().map((node, key) => {
9698
const width = 40;
97-
const height = 20;
99+
const height = 15;
98100

99101
let top: number;
100102
let left: number;

0 commit comments

Comments
 (0)