Migrate to d3 v6

This commit is contained in:
Sebastian Serth
2020-12-14 13:02:39 +01:00
parent c6004a8e82
commit d547ae2c5a
4 changed files with 122 additions and 113 deletions

View File

@@ -87,10 +87,10 @@ $(document).on('turbolinks:load', function() {
.enter()
.append("rect")
.attr("class", "value-bar")
.on("mousemove", function (d) {
.on("mousemove", function (event, d) {
tooltip
.style("left", d3.event.pageX - 50 + "px")
.style("top", d3.event.pageY + 50 + "px")
.style("left", event.pageX - 50 + "px")
.style("top", event.pageY + 50 + "px")
.style("display", "inline-block")
.html("<%= I18n.t('activerecord.models.exercise.one') %> ID: " + d.exercise_id + "<br>" +
"<%= I18n.t('activerecord.attributes.exercise.title') %>: " + d.exercise_title + "<br>" +
@@ -99,7 +99,7 @@ $(document).on('turbolinks:load', function() {
.on("mouseout", function () {
tooltip.style("display", "none");
})
.on("click", function (d) {
.on("click", function (_event, d) {
Turbolinks.visit("/exercises/" + d.exercise_id + "/statistics");
})
.attr("x", function (d) {