Skip to content

Commit 8018d10

Browse files
committed
update error message; set text colors to app dark; tried error checks in d3
1 parent eb41f09 commit 8018d10

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/app/components/ErrorHandler.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ErrorHandler extends React.Component {
1212
}
1313

1414
render() {
15-
return this.state.errorOccurred ? <h1>An error occurred</h1> : this.props.children
15+
return this.state.errorOccurred ? <div margin="8px">Unexpected Error</div> : this.props.children
1616
}
1717
}
1818

src/app/components/PerfView.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const PerfView = ({ snapshots, viewIndex, width = 600, height = 600 }) => {
4242
const packFunc = useCallback(data => {
4343
return d3.pack()
4444
.size([width, height])
45-
.radius(d => { return d.r; })
45+
// .radius(d => { return d.r; })
4646
.padding(3)(d3.hierarchy(data)
4747
.sum(d => { return d.componentData.actualDuration || 0; })
4848
.sort((a, b) => { return b.value - a.value; }));
@@ -109,7 +109,9 @@ const PerfView = ({ snapshots, viewIndex, width = 600, height = 600 }) => {
109109
// Zoom/relocated nodes and labels based on dimensions given [x, y, r]
110110
function zoomViewArea(newXYR) {
111111
// console.log('zoomTo -> newXYR', newXYR);
112-
const k = width / newXYR[2];
112+
// if (!newXYR.every(val => Number.isNaN(val))) { console.log('NaN'); return; }
113+
114+
const k = (width / newXYR[2]);
113115
view = newXYR;
114116
label.attr('transform', d => `translate(${(d.x - newXYR[0]) * k},${(d.y - newXYR[1]) * k})`);
115117
node.attr('transform', d => `translate(${(d.x - newXYR[0]) * k},${(d.y - newXYR[1]) * k})`);

src/app/styles/components/d3graph.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ div.tooltip {
109109
.perf-chart-labels {
110110
font: 12px sans-serif;
111111
/* color: white; */
112-
fill: rgb(231, 231, 231);
112+
/* fill: rgb(231, 231, 231); */
113+
fill: #2a2f3a;
113114
pointer-events: none;
114115
text-anchor: middle;
115116
};

0 commit comments

Comments
 (0)