zoom fixed 0.5x ~ 4x
This commit is contained in:
parent
46349fb178
commit
485dc7e8c1
|
@ -199,10 +199,12 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
const svg = d3.select(this.discoveryTargetRef.nativeElement);
|
const svg = d3.select(this.discoveryTargetRef.nativeElement);
|
||||||
|
|
||||||
this.zoomBehavior = d3.zoom().on('zoom', () => {
|
this.zoomBehavior = d3.zoom()
|
||||||
const transform = d3.event.transform;
|
.scaleExtent([0.5, 4])
|
||||||
svg.select('g').attr('transform', 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')');
|
.on('zoom', () => {
|
||||||
});
|
const transform = d3.event.transform;
|
||||||
|
svg.select('g').attr('transform', 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')');
|
||||||
|
});
|
||||||
svg.call(this.zoomBehavior);
|
svg.call(this.zoomBehavior);
|
||||||
|
|
||||||
const __this = this;
|
const __this = this;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user