Add fullscreen button and remove initial pan animation
Add a fullscreen toggle to the zoom controls using inline Lucide SVG icons (Maximize/X). Remove the 500ms transition on initial center so the chart starts focused on the root person immediately.
This commit is contained in:
@@ -79,12 +79,9 @@ export default class Chart {
|
||||
|
||||
centerOnRoot() {
|
||||
const { width, height } = this.svg.node().getBoundingClientRect();
|
||||
this.svg
|
||||
.transition()
|
||||
.duration(500)
|
||||
.call(
|
||||
this.zoomBehavior.transform,
|
||||
zoomIdentity.translate(width / 2, height / 2)
|
||||
);
|
||||
this.svg.call(
|
||||
this.zoomBehavior.transform,
|
||||
zoomIdentity.translate(width / 2, height / 2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user