Skip to content

Commit a4a8fe7

Browse files
committed
update styles in visx components - root and rectangles, increase font sizes, accessibility color changes
1 parent 2c21d14 commit a4a8fe7

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export default function ComponentMap({
165165
/>
166166

167167
<svg ref={containerRef} width={totalWidth} height={totalHeight}>
168-
<LinearGradient id='links-gradient' from='#fd9b93' to='#fe6e9e' />
168+
<LinearGradient id='links-gradient' from='#e75e62' to='#f00008' />
169169
<rect
170170
onClick={() => {
171171
hideTooltip();
@@ -188,18 +188,19 @@ export default function ComponentMap({
188188
key={i}
189189
data={link}
190190
percent={stepPercent}
191-
stroke='#ff6569'
191+
stroke='#F00008'
192192
strokeWidth='1'
193193
fill='none'
194194
/>
195195
))}
196196

197197
{tree.descendants().map((node, key) => {
198198
const widthFunc:number = (name) => {
199+
// is this the name of the component - so if it's longer it will make the box wider?
199200
const nodeLength = name.length;
200-
if (nodeLength < 5) return nodeLength + 40;
201-
if (nodeLength < 10) return nodeLength + 60;
202-
return nodeLength + 70;
201+
if (nodeLength < 5) return nodeLength + 80; // change from 40 to 80, to see what's affected
202+
if (nodeLength < 10) return nodeLength + 120; // change from 60 to 120 to see what's affected
203+
return nodeLength + 140; // change from 70 to 140 to see what happens
203204
};
204205
const width:number = widthFunc(node.data.name);
205206
const height:number = 25;
@@ -236,9 +237,9 @@ export default function ComponentMap({
236237
<Group top={top} left={left} key={key} className='rect'>
237238
{node.depth === 0 && (
238239
<circle
239-
r={12}
240+
r={25} // increase from 12 to 25 to improve visibility
240241
fill="url('#links-gradient')"
241-
stroke='#ff6569'
242+
stroke='#F00008' // changing to red #F00008 to increase readability with sharper contrast
242243
onClick={() => {
243244
dispatch(toggleExpanded(node.data));
244245
hideTooltip();
@@ -256,7 +257,7 @@ export default function ComponentMap({
256257
fill={node.children ? '#161521' : '#62d6fb'}
257258
stroke={
258259
node.data.isExpanded && node.data.children.length > 0
259-
? '#ff6569'
260+
? '#F00008' // changed to #F00008 for higher contrast
260261
: '#4D4D4D'
261262
}
262263
strokeWidth={1.5}

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ const NO_STATE_MSG = 'No state change detected. Trigger an event to change state
2323

2424
const StateRoute = (props: StateRouteProps) => {
2525
const { snapshot, hierarchy, snapshots, viewIndex, webMetrics, currLocation } = props;
26-
console.log(props);
26+
// console.log(props);
2727
console.log('snapshot props', snapshot);
28-
console.log('hierarchy props', hierarchy);
29-
console.log('snapshots props', snapshots);
28+
// console.log('hierarchy props', hierarchy);
29+
// console.log('snapshots props', snapshots);
3030
console.log('viewIndex props', viewIndex);
31-
console.log('webMetrics props', webMetrics);
32-
console.log('currentLocation props', currLocation)
31+
// console.log('webMetrics props', webMetrics);
32+
// console.log('currentLocation props', currLocation)
3333
const [{ tabs, currentTab }, dispatch] = useStoreContext();
3434
const { hierarchy, sliderIndex, viewIndex } = tabs[currentTab];
3535
console.log()

src/app/styles/components/_buttons.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
border-radius: 5px;
1313
cursor: pointer;
1414
line-height: 1.5em;
15-
font: 400 14px 'Roboto', sans-serif;
15+
font: 400 16px 'Roboto', sans-serif;
1616
// font-size: $button-text-size;
1717
width: 120px;
1818
background: $red-color-gradient;
@@ -107,7 +107,7 @@
107107
border-radius: 3px;
108108
background-color: #565a61;
109109
font: normal 11px 'Roboto', sans-serif;
110-
color: #b0b0b0;
110+
color: #FFFFFF;
111111
transform: rotateX(90deg);
112112
transition: opacity 300ms, transform 0.15s linear;
113113
opacity: 0;
@@ -143,6 +143,8 @@
143143
border-color: transparent;
144144
background: $blue-color-gradient;
145145
border-radius: 5px;
146+
font-weight: 500;
147+
font-size: 16px;
146148
}
147149

148150
.play-button:hover {

src/app/styles/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
* {
55
font-family: 'Roboto', sans-serif;
6+
font-size: 16px;
67
}
78

89
/* width */

0 commit comments

Comments
 (0)