Wayla / bezier-stream

Generate d3 svg on stream data
MIT License
8 stars 1 forks source link

single dom problem #1

Open mcollina opened 11 years ago

mcollina commented 11 years ago

Should not be wrapped inside a single dom? D3 as defaults operates on a "global" DOM. Could not create problems for this kind of visualization?

heapwolf commented 11 years ago

a global dom would be ideal since they are so large and slow to create, just recycling the node to hold the calculation i think should work fine, maybe i'm missing something?

mcollina commented 11 years ago

You are right that creating a DOM is slow, but then you have to clean it up correctly, as you are appending a new svg for each stream, and not cleaning up the DOM when it closes. Moreover, you are always using the same id, which is bad (not sure how JSDOM will behave on that). The svg needs to be cleaned up after the source stream closes.

I always hate globals, so I'm biased here.

heapwolf commented 11 years ago

I agree. To fix this, perhaps the answer is just to remove the node? That way the same id can be used and a only a single dom needs to be created.

mcollina commented 11 years ago

Just removing the node after is ok, this is a sync function.

Il giorno lunedì 22 luglio 2013, Paolo Fragomeni ha scritto:

I agree. To fix this, perhaps the answer is just to remove the node? That way the same id can be used and a only a single dom needs to be created.

— Reply to this email directly or view it on GitHubhttps://github.com/Wayla/bezier-stream/issues/1#issuecomment-21375383 .