networkD3 icon indicating copy to clipboard operation
networkD3 copied to clipboard

Target Font-size for mouseover transition is hardcoded

Open Seferin opened this issue 2 years ago • 0 comments
trafficstars

In diagonalNetwork.js the font-size for mouseover transition is hardcoded to 25px:

// mouseover event handler
function mouseover() {
  d3.select(this).select("circle").transition()
    .duration(750)
    .attr("r", 9);

  d3.select(this).select("text").transition()
    .duration(750)
    .style("stroke-width", ".5px")
    .style("font", "25px " + x.options.fontFamily)
    .style("opacity", 1);
}

This works fine when networkD3::diagonalNetwork() is called with a fontsize of 10 - mouseover makes the label text larger - but when networkD3::diagonalNetwork() is called with a fontsize of 35 the label becomes smaller with mouseover.

Can a transition target fontsize parameter option be added to the call?

Or alternatively, can the px value be set relative to the fontsize option in the call?

Example of issue in report created from DataExplorer that passes a fontsize default of 35 to a networkD3::diagonalNetwork() call:

image

Seferin avatar Feb 20 '23 16:02 Seferin