Skip to content

Commit 3e72539

Browse files
committed
D3 Implementation
1 parent 677b561 commit 3e72539

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

app/charts/route-trace.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as d3 from 'd3';
2-
class RouteTrace {
32

3+
class RouteTrace {
44
containerEl;
55
props;
66
svg;
@@ -24,8 +24,8 @@ class RouteTrace {
2424
.enter()
2525
.append('circle')
2626
.style('fill', 'red')
27-
.attr('cx', 20)
28-
.attr('cy', 200)
27+
.attr('cx', () => Math.random() * width)
28+
.attr('cy', () => Math.random() * height)
2929
.attr('r', 20)
3030
.on('mouseup', (d, i, nodes) => this.setActiveDatapoint(d, nodes[i]));
3131
}

app/containers/GraphsContainer.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import TemperatureChart from '../charts/temperature-chart.jsx';
77
import LatencyChart from '../charts/latency-chart.jsx';
88
import MemoryChart from '../charts/memory-chart.jsx';
99
import RouteTrace from '../charts/route-trace.jsx';
10+
// import RouteLocations from '../charts/route-copy.jsx';
1011
import MicroServiceTraffic from '../charts/microservice-traffic.jsx';
1112
import '../stylesheets/graphs.css';
1213

@@ -16,10 +17,10 @@ const GraphsContainer = (props) => {
1617
const { service } = props;
1718
const initialData = {
1819
nodes: [
19-
{ id: 'reverse-proxy' },
20-
{ id: 'books' },
21-
{ id: 'customers' },
22-
{ id: 'orders' },
20+
{ id1: 'reverse-proxy' },
21+
{ id2: 'books' },
22+
{ id3: 'customers' },
23+
{ id4: 'orders' },
2324
],
2425
links: [
2526
{ source: 'reverse-proxy', target: 'books' },
@@ -56,7 +57,7 @@ const GraphsContainer = (props) => {
5657
vis = new RouteTrace(canvas.current, d3Props);
5758
}
5859
}
59-
60+
6061
return (
6162
<div className="graphsGrid">
6263
<div ref={canvas}/>

0 commit comments

Comments
 (0)