christophergandrud / christophergandrud/networkD3

Target Font-size for mouseover transition is hardcoded

Open
#299 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
659
Forks
259
PR merge metrics
No merged PRs in 30d

Description

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](https://user-images.githubusercontent.com/27009682/220160028-c0db8d5a-71a0-46a9-811a-9d338c4ff068.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.