SciNim / nim-plotly

plotly wrapper for nim-lang
https://scinim.github.io/nim-plotly/
MIT License
181 stars 15 forks source link

add JS backend, add heatmaps #9

Closed Vindaar closed 6 years ago

Vindaar commented 6 years ago

In the last few days I implemented an experimental Javascript backend for this. I needed to be able to update the plots after they are created using Plotly.react, which I couldn't do with the C backend.

So this imports several of the plotly.js functions when the JS backend is used. These can then be used as for example in the fig_javascript.nim example. It was inspired by the work of @sdwfrost here: https://github.com/sdwfrost/nim-plotly-example

The commits also add support for heatmaps.

I still haven't merged your recent commits into this branch. I'll do that on Sunday.

As a simple example what's possible with the Javascript backend, see the gif here: https://github.com/Vindaar/NeuralNetworkLiveDemo

brentp commented 6 years ago

this is awesome! let me know when it's ready. I see you have a comment about moving the js stuff into its own module. that would be preferable to me.

Vindaar commented 6 years ago

I just rebased the code onto the current master branch, cleaned up a few things, added a heatmap example and a parseTraces proc.

If I didn't screw up anything while rebasing (everything seems to work still ;) ), I'd say this can be merged. If you want me to squash some of the commits, let me know.

brentp commented 6 years ago

I meant to squash the commits via the github UI, but forgot. Ah well.

thanks! The heatmaps will be useful.