Commit 59b27b52 authored by Kento HASEGAWA's avatar Kento HASEGAWA

Fix zooming on the viewer

parent 79827d1a
...@@ -68,10 +68,10 @@ class ADC2019BoardViewer { ...@@ -68,10 +68,10 @@ class ADC2019BoardViewer {
let _self = this; let _self = this;
var zoom = d3.zoom() var zoom = d3.zoom()
.scaleExtent([0.5, 5]) .scaleExtent([0.2, 2])
.translateExtent([ .translateExtent([
[-this.width * 2, -this.height * 2], [-this.width * 10, -this.height * 10],
[this.width * 2, this.height * 2] [this.width * 10, this.height * 10]
]) ])
.on("zoom", zoomed); .on("zoom", zoomed);
...@@ -81,9 +81,9 @@ class ADC2019BoardViewer { ...@@ -81,9 +81,9 @@ class ADC2019BoardViewer {
// this.slider.property("value", d3.event.scale); // this.slider.property("value", d3.event.scale);
} }
function slided(d) { // function slided(d) {
zoom.scaleTo(this.svg, d3.select(this).property("value")); // zoom.scaleTo(this.svg, d3.select(this).property("value"));
} // }
// var slider = d3.select("body").append("input") // var slider = d3.select("body").append("input")
// .datum({}) // .datum({})
...@@ -95,7 +95,6 @@ class ADC2019BoardViewer { ...@@ -95,7 +95,6 @@ class ADC2019BoardViewer {
// .on("input", slided); // .on("input", slided);
this.svg.call(zoom).on('dblclick.zoom', null); this.svg.call(zoom).on('dblclick.zoom', null);
} }
_draw_solution(data){ _draw_solution(data){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment