inim-repl / INim

Interactive Nim shell / REPL / Playground
MIT License
644 stars 23 forks source link

Working with plotly in inim #116

Closed sieste closed 3 years ago

sieste commented 3 years ago

I'd like to use plotly (or some other interactive plotting library) for exploratory data analysis in inim. I can do this to create a simple plot

import plotly var tr = Trace[float](xs: @[1.0, 2.0], ys: @[1.0, 2.0]) var pl = Plot[float](traces: @[tr]) pl.show()

The plot opens in a new browser tab. After that, every time I run another command in inim, for example

var x = @[1,2,3]

the command pl.show() seems to be re-executed, opening yet a new browser tab. Is there any way to avoid this behaviour?

mratsim commented 3 years ago

It might easier to use Jupyter and nim_magic for EDA https://github.com/apahl/nim_magic

0atman commented 3 years ago

Yeah, def go for Jupyter, really good workflow there :ok_hand: