d3-annotation icon indicating copy to clipboard operation
d3-annotation copied to clipboard

"wrap" is performance heavy

Open pbadenski opened this issue 6 years ago • 3 comments

I have a dynamically updating graph on a page with annotations. It updates around 2-3 times per second. It's working rather well with the only exception of "wrap" calls which incur a big performance penalty (probably 60% - 80% of the total cost of rendering the annotation).

One way to address that would be to allow the user to disable wrapping. Not ideal - but does the trick when performance is the priority.

pbadenski avatar Nov 29 '17 11:11 pbadenski

What is the code you're using on update? Are you re-calling the function or using the .update() function? the .update() shouldn't re-wrap it should only handle position changes. I'm curious if you're seeing otherwise though.

susielu avatar Nov 29 '17 14:11 susielu

Recalling the function. I think this is only option for me - labels are dynamic and I'm using dynamic force-directed positioning for notes.

pbadenski avatar Nov 29 '17 15:11 pbadenski

Ahh okay so your text is changing while it animates? (just curious) regardless I think it makes sense to add a 'don't wrap' option

susielu avatar Nov 29 '17 18:11 susielu