d3-flame-graph
d3-flame-graph copied to clipboard
export svg
Hi, Was there any idea about how to implement this feature? It would be a great thing to have.
The SVG tag created by this library seems to have the all data. What is missing is the callback methods that would handle "clicking" on frame adding the "interactive" feature to it. Something like the SVG from original flame-graph library have https://github.com/brendangregg/FlameGraph/blob/master/demos/cpu-mixedmode-flamegraph-java.svg?short_path=704339e
If there was an Idea for this feature, maybe I would be able to contribute :)
@kristoffSC this is a feature I discussed with @brendangregg a while ago. The way I'm thinking about this now is that this should not be a feature of the d3 plugin, but the application using it, mostly because some features are highly customizable can change significantly from application to application. Also, a few notes on using SVG as an output format:
- Right now the plugin is generating an SVG, but that might not be the case in the future. HTML canvas was an option for example.
- The SVG, with all embedded JavaScript to add the "interactive" features is a bit awful and limited in functionality.
- It would also require a fairly large rewrite of the interactive functions just for that.
In the internal version of https://github.com/Netflix/flamescope, FlameCommander, we implemented a feature to download a self contained HTML file with the flame graph and all features. I could probably create an example based on that.
Also, @andreasgerstmayr implemented a flame graph HTML output for perf
.