AtelierArith / PyPlotly.jl

Pythonista friendly Julia interface for plotly
https://discourse.julialang.org/t/pyplotly-jl/76035
MIT License
5 stars 1 forks source link

Do you think this package would enable a person to plot Python Plotly code in a julia notebook? #14

Open russelljjarvis opened 2 years ago

russelljjarvis commented 2 years ago

Do you think your package would enable a person to plot Python Plotly code in a julia notebook or Pluto?

I think the variety of possible and tested plots is reduced for julia plotly versus python plotly especially for network apps. I want to make a julia dashboard app, that resuses already established Python plotly apps where possible.

terasakisatoshi commented 2 years ago

Hi @russelljjarvis

Thank you for finding this pacakge.

Do you think your package would enable a person to plot Python Plotly code in a julia notebook or Pluto?

I believe we can display fig object in a Jupyter Notebook.

image

terasakisatoshi commented 2 years ago

If you like to create application with Dash.jl check this out:

https://github.com/plotly/Dash.jl/issues/50#issuecomment-1033972687

terasakisatoshi commented 2 years ago

Our package converts Python plotly objects into PlotlyJS.jl objects using the following code:

https://github.com/AtelierArith/PyPlotly.jl/blob/aa9a8b21a450754ccfd3821b7eae646f8e06769b/src/PyPlotly.jl#L16-L28

Therefore our package should work as long as PlotlyJS.jl lives.

russelljjarvis commented 2 years ago

Argghh!! that is the best part. Thanks that perfectly answers my question.

russelljjarvis commented 2 years ago

If you like to create application with Dash.jl check this out:

plotly/Dash.jl#50 (comment)

I am torn between dash.jl and pluto.jl I think its too much work to keep track of HTML divs. In Python, streamlit has meant you can make web apps without managing all the HTML, I am hoping to find a similar approach to streamlit in Julia, Pluto might work. So far using plotly.jl in pluto gives me errors, so I might come around to dash after all.

terasakisatoshi commented 2 years ago

Hi, @russelljjarvis

I've updated PyPlotly so that we can display plotly object on Pluto notebook.

image

How to reproduce:

Clone PyPlotly again (or run git pull to get the latest update.)

$ git clone https://github.com/AtelierArith/PyPlotly.jl.git
$ cd PyPlotly.jl
$ julia --project=@. -e 'using Pkg; Pkg.instantiate()'

Then, initialize Pluto.jl via julia> using Pluto; Pluto.run() from /path/to/PyPlotly.jl.

Access to https://github.com/AtelierArith/PyPlotly.jl/blob/main/playground/pluto/jlsample.jl

russelljjarvis commented 2 years ago

This is super interesting. Thanks for continuing the thread, I will replicate it!

russelljjarvis commented 2 years ago

I replicated it, its great the real time CPU visualization with plotly works on my computer!

Do you think you could build it on pluto-on-binder too?

http://pluto-on-binder.glitch.me/

This would be like a public dashboard portal almost.

terasakisatoshi commented 2 years ago

Do you think you could build it on pluto-on-binder too?

It seems this is not easy than we expected. Below is a screenshot.

image
russelljjarvis commented 2 years ago

No worries. You have created a great tool. I think public julia dashboards are still in the early days.

have you seen next journal? Its not really like a public dashboard website, but it at least renders and makes shareable interactive diagrams in Julia notebooks https://nextjournal.com/julia

There are instructions on how to setup PlutoSliderServer here for deployment on something like digital ocean, but it does not look fun. https://juliahub.com/ui/Packages/PlutoSliderServer/NwWkP/0.3.10

terasakisatoshi commented 2 years ago

No worries. You have created a great tool.

Thank you so much! 😄

I think public julia dashboards are still in the early days.

Well, there is a Julia library https://github.com/GenieFramework/Stipple.jl

have you seen next journal? Its not really like a public dashboard website, but it at least renders and makes shareable interactive diagrams in Julia notebooks https://nextjournal.com/julia

Yes, this is very cool I think.

russelljjarvis commented 2 years ago

I think the deployment options are: