Skip to content

Commit b2e298f

Browse files
(added) visx text dependency, text labelsl to axis, re-position X, Y maxes
1 parent e0704af commit b2e298f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,17 @@
107107
},
108108
"dependencies": {
109109
"@visx/axis": "^1.0.0",
110+
"@visx/glyph": "^1.0.0",
111+
"@visx/gradient": "^1.0.0",
110112
"@visx/grid": "^1.0.0",
113+
"@visx/group": "^1.0.0",
114+
"@visx/hierarchy": "^1.0.0",
111115
"@visx/legend": "^1.0.0",
112116
"@visx/responsive": "^1.0.0",
113117
"@visx/scale": "^1.0.0",
114-
"@visx/tooltip": "^1.0.0",
115-
"@visx/gradient": "^1.0.0",
116-
"@visx/group": "^1.0.0",
117-
"@visx/hierarchy": "^1.0.0",
118-
"@visx/glyph": "^1.0.0",
119118
"@visx/shape": "^1.0.0",
119+
"@visx/text": "^1.0.0",
120+
"@visx/tooltip": "^1.0.0",
120121
"acorn": "^7.3.1",
121122
"acorn-jsx": "^5.2.0",
122123
"bower": "^1.8.8",

src/app/components/PerformanceVisx.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export type BarStackProps = {
3838
/* DEFAULT STYLING */
3939
const axisColor = '#679DCA';
4040
const background = "#242529";
41-
const defaultMargin = { top: 40, right: 30, bottom: 0, left: 35 };
41+
const defaultMargin = { top: 60, right: 30, bottom: 0, left: 50 };
4242
const tooltipStyles = {
4343
...defaultStyles,
4444
minWidth: 60,
@@ -138,7 +138,7 @@ const colorScale = scaleOrdinal<CityName, string>({
138138
// setting max dimensions and scale ranges
139139
if (width < 10) return null;
140140
const xMax = width - margin.left - margin.right
141-
const yMax = height - margin.top - 100;
141+
const yMax = height - margin.top - 150;
142142
snapshotIdScale.rangeRound([0, xMax]);
143143
renderingScale.range([yMax, 0]);
144144

@@ -215,8 +215,6 @@ renderingScale.range([yMax, 0]);
215215
stroke={axisColor}
216216
tickStroke={axisColor}
217217
strokeWidth={2}
218-
numTicks={8}
219-
hideZero={true}
220218
tickLabelProps={() => ({
221219
fill: axisColor,
222220
fontSize: 11,
@@ -237,14 +235,15 @@ renderingScale.range([yMax, 0]);
237235
textAnchor: 'middle',
238236
})}
239237
/>
240-
<Text x="-100" y="15" transform="rotate(-90)" fontSize={10} fill="#00FFFF">
241-
Rendering Time
242-
</Text>
238+
<Text x={-xMax / 2} y="15" transform="rotate(-90)" fontSize={10} fill="#FFFFFF">
239+
Rendering Time (ms)
240+
</Text>
241+
<Text x={xMax / 2} y={yMax + 100} fontSize={10} fill="#FFFFFF">
242+
Snapshot Id
243+
</Text>
243244

244245
</svg>
245246

246-
247-
// OPTIONAL legend
248247
{/* <div
249248
style={{
250249
position: "absolute",

0 commit comments

Comments
 (0)