plotly / Dash.NET

F# interface to Dash- the most downloaded framework for building ML & data science web apps
https://plotly.github.io/Dash.NET
MIT License
67 stars 11 forks source link

Dash Core components auto generate #14

Open kaashyapan opened 3 years ago

kaashyapan commented 3 years ago

Does there exist an interface definition file of some kind from which the Dash core components are auto generated for Python & Julia ?

I can see the props here https://dash.plotly.com/dash-core-components/textarea. Is there a json or yaml file etc.. that is used by Python / Julia ?

alexcjohnson commented 3 years ago

The way this works today is first a JS script calls react-docgen to extract the prop info, then in Python we read that information in and generate matching source code for all the back ends. The ideal would be for .NET to add to this, such that npm run build:backends that every component package defines would create .NET bindings as well.

mungojam commented 3 years ago

I don't know if it would work or help, but you could consider source generators for this which are a standard way to generate code at .net build time

kaashyapan commented 3 years ago

Source generators are C#. The aim of this project is to base it on F# with an easy to use api from C#. Ideal route would be a simple F# script that reads the output of react-docgen and generates F# similar to the Feliz api for eacg component.

But I think it would help if we hand code the api to idiomatic F# first and automate generation after it has crystallised.

There is some work being done in https://github.com/plotly/Dash.NET/pull/19 & https://github.com/plotly/Dash.NET/pull/16