XPlot icon indicating copy to clipboard operation
XPlot copied to clipboard

Update binding with more chart types

Open colombod opened this issue 6 years ago • 15 comments

Some plotly.js types are missing. E.g. pointcloud and sunburts.

colombod avatar Oct 14 '19 13:10 colombod

Boxplots are a big one too.

cartermp avatar Nov 07 '19 14:11 cartermp

I tried to give it a shot the other day and was overwhelmed by the amount of work.

The current binding seems to work by running Graph.fsx. It downloads plot-schema.json (the latest link is https://raw.githubusercontent.com/plotly/plotly.js/master/dist/plot-schema.json) and generate types to correspond to plotly schema.

The javascript schema has grown a lot since XPlot was updated years ago. There are also lots of overlapping type definitions. They are fine in dynamic Javascript world. But we have to accommodate the union of all type members in fsharp.

zyzhu avatar Nov 07 '19 15:11 zyzhu

The other impression is Graph.fs looks way too long. It would be good break it down into pieces.

zyzhu avatar Nov 07 '19 16:11 zyzhu

The other impression is Graph.fs looks way too long. It would be good break it down into pieces.

How would you like to go about it, if you show me the way I would be more than happy to share the workload and get all new features

colombod avatar Nov 07 '19 16:11 colombod

There is another repo FSharp.Plotly that was inspired by XPlot. It binds to some Plotly charts too. You may take a look at their breakdown. https://github.com/muehlhaus/FSharp.Plotly/tree/master/src/FSharp.Plotly

zyzhu avatar Nov 07 '19 16:11 zyzhu

Breaking up Graph.fs into separate files for each specific graph type seems quite tractable. I imagine that'll help with contributions, too.

cartermp avatar Nov 07 '19 16:11 cartermp

Related: #49

cartermp avatar Nov 08 '19 18:11 cartermp

I have a fable library I'm working on that is pretty serviceable at the moment that may be of use: Feliz.Plotly

Shmew avatar Nov 09 '19 11:11 Shmew

link #115

cartermp avatar Nov 10 '19 16:11 cartermp

@Shmew Interesting! How portable (i.e., in non-Fable environments) do you think the generated types are? Would love to incorporate your generator for XPlot here.

cartermp avatar Nov 11 '19 02:11 cartermp

Pretty much everything outside of Plotly.plot is just an object, would probably be pretty easy to implement. From what I can tell it looks like this is just creating an inline html page.

Is there a reason to not use Fable at that point? It's pretty easy to build sites with no backend like the docs for the library are. Which lets the application be more performant, and have the full plotly.js api available for use.

Shmew avatar Nov 11 '19 03:11 Shmew

I would love to see more bindings, especially the organisation chart.

ErikSchierboom avatar Nov 12 '19 08:11 ErikSchierboom

@Shmew I'm considering incorporating Fable in XPlot, since at the end of the day it's just producing JS and Fable is good for that.

cartermp avatar Nov 13 '19 02:11 cartermp

@cartermp Would let you also be able to support additional visualization libraries fairly easy too, and stay up-to-date with those already supported. I can try to help if you do make the jump, and the gitter is very active and helpful as well.

Shmew avatar Nov 13 '19 03:11 Shmew

@cartermp just one comment on this thread, but the work by @Shmew is absolutely amazing - worth checking to replace the current XPlot bindings with it. Just did the same for using Plotly on Bridge.Net - took less than a day to get it working based on his generator code: Plotly.Bridge

theolivenbaum avatar Nov 13 '19 14:11 theolivenbaum