I am using svelte in my project and I have a scatter chart, whenever the data updates the dots move to the right positions and most labels (dot annotations) do too.
However there are some labels that don’t move all the way and hence forth gets stuck until the data changes completely.
I previously had updated the scales via svelte’s “$” which worked amazingly well for all other charts.
I stopped this and now update directly in the “plotchart” function but the issue remains.
Is it possible that I am not doing updates on text elements the right way?
this is my label updates:
dotLabels .selectAll(".fixedLabel") .data(plotdata, d => d.player) .join( (enter) => enter .append("text") .attr('class', 'bar-label text-xs fixedLabel') .attr("x", d => x(Number(d[xvar]))) .attr("y", d => y(Number(d[yvar]))) .text(d => d.player) (update) => update .transition(t) .attr("x", d => x(Number(d[xvar]))) .attr("y", d => y(Number(d[yvar]))) (exit) => exit.remove());
I’ve been at this for about 2 weeks now I can’t really think of anything else to try.
If someone has an idea, or experienced something similar that’d be great to let me know.
edit: as additional info, the texts and dots get the same x and y positions according to console.log inside the updates. Which makes this doubly weird.