pfitzseb / ProfileCanvas.jl

MIT License
88 stars 6 forks source link

add function for exporting an html file #18

Closed charleskawczynski closed 2 years ago

charleskawczynski commented 2 years ago

This PR adds a function, html_file, for saving the profile to a given filename. Closes #17.

charleskawczynski commented 2 years ago

I'm now realizing that this isn't strictly necessary as I can do something similar to what's done in the test suite, by doing something like:

    trace = ProfileCanvas.view(Profile.fetch())
    html = sprint(show, "text/html", trace)
    open("flame.html", "w") do io
        print(io, html)
    end

but this is a bit more round-about compared to the proposed changes, so I'm fine with merging or using sprint to extract the output that way.

EDIT: actually, this doesn't seem to work, the window / view is severely truncated when I tried this out in TurbulenceConvection#1278.