Skip to content

Commit c28e91e

Browse files
committed
add webmetric button style changes
1 parent 017987e commit c28e91e

File tree

7 files changed

+48
-22
lines changed

7 files changed

+48
-22
lines changed

high-contrast-colors.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## High Contrast Colors to Help with Color Blindness
2+
- Dark Blue (#000080)
3+
- Light Blue (#ADD8E6)
4+
- Dark Green (#006400)
5+
- Light Green (#90EE90)
6+
- Dark Red (#8B0000)
7+
- Light Red (#FFC0CB)
8+
- Dark Purple (#800080)
9+
- Light Purple (#BA55D3)
10+
- Dark Yellow (#FFD700)
11+
- Light Yellow (#FFFFE0)
12+
- Dark Orange (#FF8C00)
13+
- Light Orange (#FFA500)
14+
- Dark Brown (#8B4513)
15+
- Light Brown (#D2691E)
16+
- Dark Gray (#A9A9A9)
17+
- Light Gray (#D3D3D3)

src/app/components/StateRoute/PerformanceVisx/BarGraph.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AxisBottom, AxisLeft } from '@visx/axis';
77
import { scaleBand, scaleLinear, scaleOrdinal } from '@visx/scale';
88
import { useTooltip, useTooltipInPortal, defaultStyles } from '@visx/tooltip';
99
import { Text } from '@visx/text';
10-
import { schemeSet3 } from 'd3-scale-chromatic';
10+
import { schemeSet1 } from 'd3-scale-chromatic';
1111
import { onHover, onHoverExit, save } from '../../../actions/actions';
1212
import { useStoreContext } from '../../../store';
1313
import { snapshot, TooltipData, Margin, BarGraphProps } from '../../../FrontendTypes';
@@ -19,14 +19,14 @@ const margin = {
1919
bottom: 0,
2020
left: 50,
2121
};
22-
const axisColor = '#FF6569';
22+
const axisColor = '#F00008';
2323
const background = '#242529';
2424
const tooltipStyles = {
2525
...defaultStyles,
2626
minWidth: 60,
2727
backgroundColor: 'rgba(0,0,0,0.9)',
2828
color: 'white',
29-
fontSize: '14px',
29+
fontSize: '16px',
3030
lineHeight: '18px',
3131
fontFamily: 'Roboto',
3232
};
@@ -75,10 +75,10 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
7575
domain: [0, data.maxTotalRender],
7676
nice: true,
7777
});
78-
// Gives each bar on the graph a color using schemeSet3 imported from D3
78+
// Gives each bar on the graph a color using schemeSet1 imported from D3
7979
const colorScale = scaleOrdinal<string>({
8080
domain: keys,
81-
range: schemeSet3,
81+
range: schemeSet1,
8282
});
8383

8484
// setting max dimensions and scale ranges
@@ -268,16 +268,16 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
268268
textAnchor: 'middle',
269269
})}
270270
/>
271-
<Text x={-yMax / 2 - 75} y='15' transform='rotate(-90)' fontSize={12} fill='#FFFFFF'>
271+
<Text x={-yMax / 2 - 75} y='15' transform='rotate(-90)' fontSize={16} fill='#FFFFFF'>
272272
Rendering Time (ms)
273273
</Text>
274274
<br />
275275
{snapshot === 'All Snapshots' ? (
276-
<Text x={xMax / 2 + 15} y={yMax + 70} fontSize={12} fill='#FFFFFF'>
276+
<Text x={xMax / 2 + 15} y={yMax + 70} fontSize={16} fill='#FFFFFF'>
277277
Snapshot ID
278278
</Text>
279279
) : (
280-
<Text x={xMax / 2 + 15} y={yMax + 70} fontSize={12} fill='#FFFFFF'>
280+
<Text x={xMax / 2 + 15} y={yMax + 70} fontSize={16} fill='#FFFFFF'>
281281
Components
282282
</Text>
283283
)}

src/app/components/StateRoute/PerformanceVisx/BarGraphComparison.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AxisBottom, AxisLeft } from '@visx/axis';
99
import { scaleBand, scaleLinear, scaleOrdinal } from '@visx/scale';
1010
import { useTooltip, useTooltipInPortal, defaultStyles } from '@visx/tooltip';
1111
import { Text } from '@visx/text';
12-
import { schemeSet3 } from 'd3-scale-chromatic';
12+
import { schemeTableau10 } from 'd3-scale-chromatic';
1313
import { makeStyles } from '@material-ui/core/styles';
1414
import Select from '@material-ui/core/Select';
1515
import MenuItem from '@material-ui/core/MenuItem';
@@ -104,7 +104,7 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
104104
});
105105
// the domain array will assign each key a different color to make rectangle boxes
106106
// and use range to set the color scheme each bar
107-
const duplicate = schemeSet3.slice();
107+
const duplicate = schemeTableau10.slice();
108108
const colorScale = scaleOrdinal<string, string>({
109109
domain: keys,
110110
range: duplicate,

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,31 +107,31 @@ const StateRoute = (props: StateRouteProps) => {
107107
formatted={(val) =>
108108
Number.isNaN(val) ? '- ms' : `${((val / 100) * 2500).toFixed(2)} ms`
109109
}
110-
label='LCP'
110+
label='Largest Contentful Paint'
111111
name='Largest Contentful Paint'
112112
description='Measures loading performance. The benchmark is less than 2500 ms.'
113113
/>
114114
<WebMetrics
115115
color={FIDColor}
116116
series={webMetrics.FID * 25}
117117
formatted={(val) => (Number.isNaN(val) ? '- ms' : `${(val / 25).toFixed(2)} ms`)}
118-
label='FID'
118+
label='First Input Delay'
119119
name='First Input Delay'
120120
description='Measures interactivity. The benchmark is less than 100 ms.'
121121
/>
122122
<WebMetrics
123123
color={FCPColor}
124124
series={(webMetrics.FCP / 1000) * 100}
125125
formatted={(val) => `${((val / 100) * 1000).toFixed(2)} ms`}
126-
label='FCP'
126+
label='First Contentful Paint'
127127
name='First Contentful Paint'
128128
description='Measures the time it takes the browser to render the first piece of DOM content. No benchmark.'
129129
/>
130130
<WebMetrics
131131
color={TTFBColor}
132132
series={(webMetrics.TTFB / 10) * 100}
133133
formatted={(val) => `${((val / 100) * 10).toFixed(2)} ms`}
134-
label='TTFB'
134+
label='Time To First Byte'
135135
name='Time to First Byte'
136136
description='Measures the time it takes for a browser to receive the first byte of page content. The benchmark is 600 ms.'
137137
/>

src/app/components/StateRoute/Tree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const Tree = (props: TreeProps) => {
4848
// @ts-ignore
4949
<JSONTree
5050
// @ts-ignore
51-
data={snapshots[currLocation.index] || snapshot}
51+
data={snapshots[currLocation.index] || snapshot}
5252
theme={{ extend: colors, tree: () => ({ className: 'json-tree' }) }}
5353
shouldExpandNode={() => true}
5454
getItemString={getItemString}

src/app/components/WebMetrics.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ const radialGraph = (props) => {
108108
options={state.options}
109109
series={state.series}
110110
type='radialBar'
111-
height={200}
112-
width={200}
111+
height={350}
112+
width={350}
113113
/>
114114
</div>
115115
</Trigger>

src/app/styles/components/_buttons.scss

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@
9191
outline: none;
9292
height: 20px;
9393
margin-bottom: 8px;
94-
width: 70px;
94+
width: 100px;
9595
border: none;
96-
border-radius: 3px;
97-
background: $grey-color-gradient;
98-
font: normal 16px 'Roboto', sans-serif;
96+
/* border-radius: 3px; */
97+
background: linear-gradient(145deg, #5c6068, #4d5157);
98+
font: normal 16px "Roboto", sans-serif;
9999
color: #FFFFFF;
100+
display: flex;
101+
justify-content: center;
102+
align-items: center;
103+
padding: 5px;
100104
}
101105

102106
.jump-button {
@@ -107,11 +111,16 @@
107111
border: transparent;
108112
border-radius: 3px;
109113
background-color: #232529;
110-
font: normal 16px 'Roboto', sans-serif;
114+
font: normal 16px "Roboto", sans-serif;
111115
color: #FFFFFF;
112116
transform: rotateX(90deg);
113117
transition: opacity 300ms, transform 0.15s linear;
114118
opacity: 0;
119+
display: flex;
120+
align-items: center;
121+
justify-content: center;
122+
padding: 2px;
123+
padding-bottom: 5px;
115124
}
116125

117126
.jump-button:hover {

0 commit comments

Comments
 (0)