Open KatiRG opened 5 years ago
Excellent! I have used that then. I guess it is not important for the circle and text to be under the same g
node. I normally see it done like that (like mbostock here https://observablehq.com/@d3/scatterplot) but this works fine too! Thanks
The problem with that is that some text would be under some dots. It used to be like that but was switch to the current way.
I'm thinking of contributing a modification to
scatterChart
to allow text labels to be appended to circles. In the current form, the circles are not grouped under ag
node and therefore it is not possible to add any text. In my modified form, I definescatterGroups
with an appendedg
that the circles are then attached to, and with a small addition of code, the text can be appended under the sameg
. I usecx
andcy
to determine the position of the text. The text itself comes fromz.getNames
in the settings file:So here is the modified
scatter.js
code:Which creates this dom: