Skip to content

Commit

Permalink
Fix zoom on network visualisation
Browse files Browse the repository at this point in the history
d3.event was removed, we must instead take event as an argument.
  • Loading branch information
joedight authored and rht committed Jul 12, 2022
1 parent 39c608d commit ad796f5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mesa/visualization/templates/js/NetworkModule_d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ const NetworkModule = function (svg_width, svg_height) {
.attr("class", "d3tooltip")
.style("opacity", 0);

svg.call(
d3.zoom().on("zoom", () => {
g.attr("transform", d3.event.transform);
})
);
const zoom = d3.zoom()
.on("zoom", (event) => {
g.attr("transform", event.transform);
});

svg.call(zoom);

const links = g.append("g").attr("class", "links");

Expand Down

0 comments on commit ad796f5

Please sign in to comment.