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);
|
||||
|
||||
this.zoomBehavior = d3.zoom().on('zoom', () => {
|
||||
const transform = d3.event.transform;
|
||||
svg.select('g').attr('transform', 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')');
|
||||
});
|
||||
this.zoomBehavior = d3.zoom()
|
||||
.scaleExtent([0.5, 4])
|
||||
.on('zoom', () => {
|
||||
const transform = d3.event.transform;
|
||||
svg.select('g').attr('transform', 'translate(' + transform.x + ',' + transform.y + ') scale(' + transform.k + ')');
|
||||
});
|
||||
svg.call(this.zoomBehavior);
|
||||
|
||||
const __this = this;
|
||||
|
|
Loading…
Reference in New Issue
Block a user