Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rationalise Plotly and GoogleCharts #29

Open
isaacabraham opened this issue Feb 5, 2016 · 11 comments
Open

Rationalise Plotly and GoogleCharts #29

isaacabraham opened this issue Feb 5, 2016 · 11 comments

Comments

@isaacabraham
Copy link

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.

@TahaHachana
Copy link
Collaborator

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.

@tpetricek
Copy link
Member

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 :).

@isaacabraham
Copy link
Author

@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 :-)

@TahaHachana
Copy link
Collaborator

TahaHachana commented May 6, 2016

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

@isaacabraham
Copy link
Author

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:[email protected]
Sent: ‎06/‎05/‎2016 17:34
To: TahaHachana/XPlotmailto:[email protected]
Cc: Isaac Abrahammailto:[email protected]; Mentionmailto:[email protected]
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:
#29 (comment)

@isaacabraham
Copy link
Author

Here's the work I did on it...

https://gist.github.com/isaacabraham/7211954b28ac4792e790bf9d6b211a0b

@cartermp
Copy link
Collaborator

cartermp commented Nov 8, 2019

@isaacabraham would you be willing to contribute your code (and/or enhancements to it?)

@isaacabraham
Copy link
Author

@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.

@cartermp
Copy link
Collaborator

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.

@dsyme
Copy link
Member

dsyme commented Nov 10, 2019

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.

@isaacabraham
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants