Open isaacabraham opened 8 years ago
I agree, a higher level API for creating Plotly charts (at least the common types) would make it more appealing and familiar for someone used to FSharp.Charting. This is on my to-do and hopefully I'll implement it soon.
I agree this would be great - XPlot is currently providing just a thin layer, which makes a lot of sense.
I think a great starting point would be just a script prototyping some of the wrapping - @isaacabraham, if you want to have a go at this, it can be very useful for exploring how to do this :).
@tpetricek is that a gentle "nudge" in my direction? :-) OK - I will! And this time I commit to actually coming up with at least a fork for review :-)
I've started implementing this for some chart types
let sales = ["2013", 1000; "2014", 1170; "2015", 660; "2016", 1030]
let expenses = ["2013", 400; "2014", 460; "2015", 1120; "2016", 540]
[sales; expenses]
|> Plotly.Line
|> Plotly.Show
I started work on this some months ago and got somewhere with it. The problem was whether to use pipe style or methods on a class. The latter allows optional args but the former can be nice with pipes.
I also wasn't sure how to unify both facades... Let me post a gist of where I got to.
From: Taha Hachanamailto:notifications@github.com Sent: 06/05/2016 17:34 To: TahaHachana/XPlotmailto:XPlot@noreply.github.com Cc: Isaac Abrahammailto:isaac.abraham@gmail.com; Mentionmailto:mention@noreply.github.com Subject: Re: [TahaHachana/XPlot] Rationalise Plotly and GoogleCharts (#29)
I've started implementing this for some chart types
`let sales = ["2013", 1000; "2014", 1170; "2015", 660; "2016", 1030] let expenses = ["2013", 400; "2014", 460; "2015", 1120; "2016", 540]
[sales; expenses] |> Plotly.Line |> Plotly.Show`
You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/TahaHachana/XPlot/issues/29#issuecomment-217476117
Here's the work I did on it...
https://gist.github.com/isaacabraham/7211954b28ac4792e790bf9d6b211a0b
@isaacabraham would you be willing to contribute your code (and/or enhancements to it?)
@cartermp I vaguely remember looking into this. I think the problem was that the abstractions quickly became somewhat leaky because both chart APIs differed quite rapidly after doing basic operations.
Gotcha, makes sense. I was wondering if there's a way to make it work similar to Julia's Plots library, which offers a consistent API across multiple backends. Probably possible, just needs some careful design work.
Gotcha, makes sense. I was wondering if there's a way to make it work similar to Julia's Plots library, which offers a consistent API across multiple backends. Probably possible, just needs some careful design work.
Also worth taking a look at Oxyplot and seeing whether that should be brought into the family of charting options for use from F# Interactive (separate to XPlot). It's mostly used from C# but I think might be pretty good from F# now anonymous records are supported.
Having a consistent, unified charting "model" that we could use would be absolutely excellent - there are several projects chart projects all with similar but slightly different APIs.
Having the option of both these charting libraries is great. However, the APIs to consume them both are very different. GoogleCharts is somewhat similar to FSharp.Charting in that you can chuck lists of tuples and it just works - Plotly is completely different though, where you have to manually assign to x and y fields etc. etc..
It would be nice if the two APIs were brought in sync with one another.