Skip to content

Commit a1ed164

Browse files
committed
decreased width for small child nodes in Component Map, dropdown color and margin changed
1 parent f385bd8 commit a1ed164

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

src/app/components/StateRoute/ComponentMap/ComponentMap.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ export default function ComponentMap({
239239

240240
{tree.descendants().map((node, key) => {
241241
const widthFunc: number = (name) => {
242-
// function that takes in a node's name and returns a number that is related to the length of the name. Used for determining the node width.
242+
//returns a number that is related to the length of the name. Used for determining the node width.
243243
const nodeLength = name.length;
244-
return nodeLength * 7 + 20;
245-
if (nodeLength <= 5) return nodeLength + 80; // returns a number between 80-85
246-
if (nodeLength <= 10) return nodeLength + 120; // returns a number between 125-130
247-
return nodeLength + 140; // returns a number greater than 150
244+
//return nodeLength * 7 + 20; //uncomment this line if we want each node to be directly proportional to the name.length (instead of nodes of similar sizes to snap to the same width)
245+
if (nodeLength <= 5) return nodeLength + 50;
246+
if (nodeLength <= 10) return nodeLength + 120;
247+
return nodeLength + 140;
248248
};
249249

250250
const width: number = widthFunc(node.data.name); // the width is determined by the length of the node.name

src/app/components/StateRoute/ComponentMap/LinkControls.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ const controlStyles: ControlStyles = {
88
};
99

1010
const dropDownStyle: DropDownStyle = {
11-
margin: '0.5em',
11+
margin: '0.1em',
1212
//fontSize: '16px',
1313
fontFamily: 'Roboto, sans-serif',
1414
borderRadius: '4px',
1515
borderStyle: 'solid',
1616
borderWidth: '1px',
17-
backgroundColor: '#242529',
18-
color: 'white',
17+
backgroundColor: '#d9d9d9',
18+
color: '#161617',
1919
padding: '2px',
2020
};
2121

src/app/styles/abstracts/_variablesLM.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ $state-background: $background-color-strong;
103103
$state-cont-border: $contrasting-color;
104104

105105
//MAP TAB
106-
$map-options-dropdown: $primary-color;
107106
$map-options-label: $dark-text;
107+
//the dropdown colors are determined in the dropDownStyle object in LinkControls.tsx
108108
$map-link: $contrasting-color;
109109
// $map-root-fill: $primary-color; //root fill is currently a visx LinearGradient defined in ComponentMap.tsx
110110
$map-root-stroke: $primary-color;

src/app/styles/components/_componentMap.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
color: $map-options-label;
77
}
88

9-
.comp-map-dropdown {
10-
background-color: #ff0000;
11-
color: #ff0000;
12-
background: #ff0000;
13-
}
9+
//this was supposed to control the dropDownStyle object in LinkControls.tsx (the dropdown menus in ComponentMap)
10+
// .comp-map-dropdown {
11+
// backgroundColor: #ff0008;
12+
// color: #ff0007;
13+
// background: #ff0006;
14+
// }
1415

1516
// .compMapParent {
1617
// //fill: $map-parent-fill;

0 commit comments

Comments
 (0)