|
|
|
@ -18,7 +18,7 @@ let runs = [
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
d3.select('svg')
|
|
|
|
d3.select('#container')
|
|
|
|
.style('width', WIDTH)
|
|
|
|
.style('width', WIDTH)
|
|
|
|
.style('height', HEIGHT);
|
|
|
|
.style('height', HEIGHT);
|
|
|
|
|
|
|
|
|
|
|
|
@ -98,14 +98,14 @@ const render = () => {
|
|
|
|
render();
|
|
|
|
render();
|
|
|
|
|
|
|
|
|
|
|
|
const bottomAxis = d3.axisBottom(xScale); //pass the appropriate scale in as a parameter
|
|
|
|
const bottomAxis = d3.axisBottom(xScale); //pass the appropriate scale in as a parameter
|
|
|
|
d3.select('svg')
|
|
|
|
d3.select('#container')
|
|
|
|
.append('g') //put everything inside a group
|
|
|
|
.append('g') //put everything inside a group
|
|
|
|
.attr('id', 'x-axis') //add an id
|
|
|
|
.attr('id', 'x-axis') //add an id
|
|
|
|
.call(bottomAxis) //generate the axis within the group
|
|
|
|
.call(bottomAxis) //generate the axis within the group
|
|
|
|
.attr('transform', 'translate(0,'+HEIGHT+')'); //move it to the bottom
|
|
|
|
.attr('transform', 'translate(0,'+HEIGHT+')'); //move it to the bottom
|
|
|
|
|
|
|
|
|
|
|
|
const leftAxis = d3.axisLeft(yScale);
|
|
|
|
const leftAxis = d3.axisLeft(yScale);
|
|
|
|
d3.select('svg')
|
|
|
|
d3.select('#container')
|
|
|
|
.append('g')
|
|
|
|
.append('g')
|
|
|
|
.attr('id', 'y-axis') //add an id
|
|
|
|
.attr('id', 'y-axis') //add an id
|
|
|
|
.call(leftAxis); //no need to transform, since it's placed correctly initially
|
|
|
|
.call(leftAxis); //no need to transform, since it's placed correctly initially
|
|
|
|
@ -122,7 +122,7 @@ const createTable = () => {
|
|
|
|
|
|
|
|
|
|
|
|
createTable();
|
|
|
|
createTable();
|
|
|
|
|
|
|
|
|
|
|
|
d3.select('svg').on('click', (event) => {
|
|
|
|
d3.select('#container').on('click', (event) => {
|
|
|
|
let x = event.offsetX;
|
|
|
|
let x = event.offsetX;
|
|
|
|
let y = event.offsetY;
|
|
|
|
let y = event.offsetY;
|
|
|
|
if(lastTransform !== null){
|
|
|
|
if(lastTransform !== null){
|
|
|
|
@ -154,4 +154,4 @@ const zoomCallback = (event) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const zoom = d3.zoom()
|
|
|
|
const zoom = d3.zoom()
|
|
|
|
.on('zoom', zoomCallback);
|
|
|
|
.on('zoom', zoomCallback);
|
|
|
|
d3.select('svg').call(zoom);
|
|
|
|
d3.select('#container').call(zoom);
|
|
|
|
|