Skip to content

Commit e96421e

Browse files
committed
finished styling performance tab
1 parent d156496 commit e96421e

File tree

3 files changed

+60
-72
lines changed

3 files changed

+60
-72
lines changed

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

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,18 @@ const margin = {
2424
top: 30,
2525
right: 30,
2626
bottom: 0,
27-
left: 50,
27+
left: 70,
2828
};
2929
const axisColor = '#161617';
3030
const axisTickLabelColor = '#363638';
3131
const axisLabelColor = '#363638';
3232
const tooltipStyles = {
3333
...defaultStyles,
3434
minWidth: 60,
35-
//backgroundColor: 'rgba(0,0,0,0.9)', //defaults to white
36-
//color: 'white', //defaults to a gray
37-
fontSize: '16px',
3835
lineHeight: '18px',
39-
fontFamily: 'Roboto',
36+
zIndex: 100,
37+
pointerEvents: 'all !important',
38+
padding: '12px',
4039
};
4140

4241
const BarGraph = (props: BarGraphProps): JSX.Element => {
@@ -75,7 +74,7 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
7574

7675
const keys = Object.keys(data.componentData);
7776
const getSnapshotId = (d: snapshot) => d.snapshotId; // data accessor (used to generate scales) and formatter (add units for on hover box). d comes from data.barstack post filtered data
78-
const formatSnapshotId = (id) => `Snapshot ID: ${id}`; // returns snapshot id when invoked in tooltip section
77+
const formatSnapshotId = (id) => `ID: ${id}`; // returns snapshot id when invoked in tooltip section
7978
const formatRenderTime = (time) => `${time} ms `; // returns render time when invoked in tooltip section
8079

8180
const snapshotIdScale = scaleBand<string>({
@@ -91,16 +90,16 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
9190
});
9291

9392
const LMcolorScale = [
94-
'#a0c1d6',
95-
'#669bbc',
96-
'#105377',
97-
'#003049',
98-
'#55a8ac',
99-
'#3c6e71',
100-
'#1c494b',
101-
'#c1676d',
102-
'#c1121f',
103-
'#780000',
93+
'#14b8a6', // Teal (matching existing accent)
94+
'#0d9488', // Darker teal (matching existing accent)
95+
'#3c6e71', // Primary strong teal
96+
'#284b63', // Primary blue
97+
'#2c5282', // Deeper blue
98+
'#1a365d', // Navy
99+
'#2d3748', // Blue gray
100+
'#4a5568', // Darker blue gray
101+
'#718096', // Medium blue gray
102+
'#a0aec0', // Light blue gray
104103
];
105104

106105
const colorScale = scaleOrdinal<string>({
@@ -257,17 +256,18 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
257256
fontSize: 11,
258257
textAnchor: 'middle',
259258
})}
259+
tickFormat={() => ''} // Add this line to hide tick labels
260260
/>
261-
<Text x={-yMax / 2 - 75} y='15' transform='rotate(-90)' fontSize={16} fill={axisLabelColor}>
261+
<Text x={-yMax / 2 - 75} y='30' transform='rotate(-90)' fontSize={16} fill={axisLabelColor}>
262262
Rendering Time (ms)
263263
</Text>
264264
<br />
265265
{snapshot === 'All Snapshots' ? (
266-
<Text x={xMax / 2 + 15} y={yMax + 70} fontSize={16} fill={axisLabelColor}>
266+
<Text x={xMax / 2 + 15} y={yMax + 65} fontSize={16} fill={axisLabelColor}>
267267
Snapshot ID
268268
</Text>
269269
) : (
270-
<Text x={xMax / 2 + 15} y={yMax + 70} fontSize={16} fill={axisLabelColor}>
270+
<Text x={xMax / 2 + 15} y={yMax + 65} fontSize={16} fill={axisLabelColor}>
271271
Components
272272
</Text>
273273
)}
@@ -282,11 +282,15 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
282282
left={tooltipLeft}
283283
style={tooltipStyles}
284284
>
285-
<div style={{ color: colorScale(tooltipData.key) }}>
285+
<div
286+
style={{
287+
color: colorScale(tooltipData.key),
288+
paddingBottom: '8px',
289+
}}
290+
>
286291
{' '}
287292
<strong>{tooltipData.key}</strong>{' '}
288293
</div>
289-
<div>{'State: ' + data.componentData[tooltipData.key].stateType}</div>
290294
<div> {'Render time: ' + formatRenderTime(tooltipData.bar.data[tooltipData.key])} </div>
291295
<div>
292296
{' '}

src/app/styles/components/_performanceVisx.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
color: #1e293b;
6767
}
6868

69+
// bar graph background
6970
.perf-rect {
70-
fill: $perf-background;
71+
fill: white;
7172
}

src/app/styles/layout/_stateContainer.scss

Lines changed: 33 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -65,40 +65,6 @@
6565
}
6666
}
6767

68-
// Web Metrics Container
69-
.web-metrics-container {
70-
display: grid;
71-
grid-template-columns: auto auto;
72-
justify-content: center;
73-
}
74-
75-
//container for metrics
76-
.metric {
77-
min-height: 200px;
78-
min-width: 200px;
79-
}
80-
81-
.bargraph {
82-
position: relative;
83-
margin-top: 1rem;
84-
}
85-
86-
.bar-graph-axis {
87-
stroke: cornflowerblue;
88-
}
89-
90-
#hover-box {
91-
max-width: 230px;
92-
background-color: #51565e;
93-
border-radius: 5px;
94-
color: white;
95-
}
96-
97-
// bar graph container
98-
.bargraph-position {
99-
position: relative;
100-
}
101-
10268
// tool tip styles
10369
.tooltip-header {
10470
padding: 12px;
@@ -179,24 +145,41 @@
179145
background: #94a3b8;
180146
}
181147

182-
/* JSON Tree styling */
183-
.json-tree {
184-
overflow: auto;
185-
list-style: none;
148+
.tooltip-container {
149+
animation: tooltipFade 150ms ease-out;
186150
}
187151

188-
/* Animation for Tooltip Appearance */
189-
@keyframes tooltipFade {
190-
from {
191-
opacity: 0;
192-
transform: translateY(4px);
193-
}
194-
to {
195-
opacity: 1;
196-
transform: translateY(0);
197-
}
152+
// Web Metrics Container
153+
.web-metrics-container {
154+
display: grid;
155+
grid-template-columns: auto auto;
156+
justify-content: center;
198157
}
199158

200-
.tooltip-container {
201-
animation: tooltipFade 150ms ease-out;
159+
//container for metrics
160+
.metric {
161+
min-height: 200px;
162+
min-width: 200px;
163+
}
164+
165+
.bargraph {
166+
position: relative;
167+
margin-top: 1rem;
168+
}
169+
170+
.bar-graph-axis {
171+
stroke: cornflowerblue;
172+
}
173+
174+
#hover-box {
175+
max-width: 230px;
176+
background-color: #51565e;
177+
border-radius: 5px;
178+
color: white;
179+
}
180+
181+
/* Tree styling */
182+
.json-tree {
183+
overflow: auto;
184+
list-style: none;
202185
}

0 commit comments

Comments
 (0)