You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we can use Dash.NET in F# scripts (plotly/Dash.NET#24), It seems like a perfect candidate for setting up a basic backend for rendering Plotly.NET charts during interactive scripting. The current workflow creates temporary files that get opened in the browser, and this can lead easily to this kind of Tab-apocalypse:
I envision this like the following:
The backend
Just a basic api that accepts plotly.js figure json and passes it to a Dash.NET Graph component on the frontend.
This could be either a new package e.g. Plotly.NET.FigureServer or added to Plotly.NET.Interactive
The workflow
Option 1: register in some kind of global config
startFigureServer(Port=XYZ, OpenBrowser=true)//custom port, open browser
PlotlyGlobalConfig.FigureServer.Port // access port on some global object
Option 2: use a record / object for the server
letfigureServer= FigureServer.init(Port=XYZ, OpenBrowser=true)//custom port, open browser
figureServer.start()
figureServer.Port// access port on some local instance
sending figures to that backend
Option1: via optional setting in Chart.Show.
This is easier to do when adding backend option 1.
SomeChart
|> Chart.Show(useFigureServer =true)// read necessary info from global config
SomeChart
|> Chart.Show(FigureServer = figureServer)// when using the local object approach (option 2 above)
Why would this be super awesome actually?
Well, this enables us for example to create an extension for VSCode that rneders charts from scripts directly into a plot window. Wouldn't that be amazing?
Reacted by Timo Mühlhaus, Jack Parmer and Artem Makhno
Activity
kMutagene commentedon Apr 29, 2022
actually not sure if there is a real use case for this anymore, now that rendering in notebooks works so well. might revisit this in the future.