0

I'm using the d3.js library to create group elements ("g") that can be double clicked to do something. In Firefox everything works perfectly fine but in Safari or Chrome it doesn't fire. Anything I need to add in the index.html to make it work?

https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event

Here is how I added the dblclick event to the group elements in the javascript file:

  let pflichtveranstaltungen = d3
    .select(".studyplan-schedule")
    .select("svg")
    .selectAll("pf")
    .data(dataPflichtveranstaltungen)
    .enter()
    .append("g")
    .attr("transform", (d) => "translate (" + d.x + ", " + d.y + ")")
    .attr("id", (d) => d.name)
    .attr("initialX", (d) => d.x)
    .attr("initialY", (d) => d.y)
    .attr("currentX", (d) => d.x)
    .attr("currentY", (d) => d.y)
    .attr("area", (d) => d.area)
    .attr("ects", (d) => d.ects)
    .attr("prerequisites", (d) => d.prerequisites)
    .attr("completed", "false")
    .call(dragHandler)
    .on("dblclick", completed);

Here is a link in case you want to try it yourself: http://stud1.cs.uni-koeln.de/studyplan/dist/

It's my first question, so please let me know if you need more details

Thank you all!

CenanK
  • 1
  • 2

0 Answers0