d3-flame-graph icon indicating copy to clipboard operation
d3-flame-graph copied to clipboard

refactor: html elements

Open spiermar opened this issue 5 years ago • 5 comments

spiermar avatar Oct 23 '18 21:10 spiermar

@wonder-mice that's the large one. Might need a bit more time to review. After this, it's just a simple function rename PR that should be merged straight away.

spiermar avatar Oct 23 '18 21:10 spiermar

Without looking into the code too much yet, with my not-so-large example profiles, this can be 2x faster than current master. Having said that, it's a very different approach to rendering the data, and the styling needs to be improved a bit. The colors seem to be off, a bit darker, and the highlighted nodes are not easily visible. I might cherry pick a couple other changes from this PR, like the tooltips, before reviewing the code in more detail.

spiermar avatar Oct 23 '18 22:10 spiermar

Colors are darker because I removed transparency to make blending easier for browser. Color mapper should care about that, imho. That said, I talked with WebKit folks and they said it doesn’t really matters, since it always does alpha blending regardless. Still think opacity by default is bad :)

wonder-mice avatar Oct 23 '18 23:10 wonder-mice

I realized my mistake. Looks like your intention was to be a d3 plugin. But I was looking at it as flamegraph builder that just happened to use d3 because it was easier at some point. I have some pending patches that add very interesting functionality (better comparison mode), but they have d3 completely removed (because I didn't find how to do it with d3 efficiently and the only part of d3 still in use was node match-by-id-reuse machinery). I surely share the patches later, maybe you'll figure out how to do it in d3 if you find them interesting enough.

wonder-mice avatar Oct 24 '18 15:10 wonder-mice

I realized my mistake. Looks like your intention was to be a d3 plugin. But I was looking at it as flamegraph builder that just happened to use d3 because it was easier at some point. I have some pending patches that add very interesting functionality (better comparison mode), but they have d3 completely removed (because I didn't find how to do it with d3 efficiently and the only part of d3 still in use was node match-by-id-reuse machinery). I surely share the patches later, maybe you'll figure out how to do it in d3 if you find them interesting enough.

Not particularly attached to d3, but I've built other pure JavaScript visualizations in the past and quickly things get out of hand, and I've found d3 to be easier to maintain in the long run. I'll try to get all these changes in first, then we can chat about the other changes. I can have a look in the patches and talk with a few guys here about possible d3 implementation ideas too.

spiermar avatar Oct 24 '18 20:10 spiermar