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

Can we make it easy to generate common plot types? #189

Open
DougBurke opened this issue Jul 12, 2021 · 1 comment
Open

Can we make it easy to generate common plot types? #189

DougBurke opened this issue Jul 12, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@DougBurke
Copy link
Owner

As suggested by @ysangkok in the New-York Haskell Meetup Co-Hack, can we provide "simple" routines to set up basic operations - e.g. scatter plot?

One issue is that it's hard to extend since we can create a VegaLite type but then can't deconstruct it to extend/add/adjust plot options (given that VegaLite is just Aeson's Value rather than a hvega type).

@DougBurke DougBurke added the enhancement New feature or request label Jul 12, 2021
@ysangkok
Copy link

I have been playing with VegaLite and I am still wondering how I'd input Haskell lists of numbers into the system. I saw dataFromColumns, and its example:

dataFromColumns [ Parse [ ( "Year", FoDate "%Y" ) ] ]
  . dataColumn "Animal" (Strings [ "Fish", "Dog", "Cat" ])
  . dataColumn "Age" (Numbers [ 28, 12, 6 ])
  . dataColumn "Year" (Strings [ "2010", "2014", "2015" ])

But this expression yields a function [DataColumn] -> [DataColumn]. I fail to get the intuition of this example, since each dataColumn call seems to tack on data, but doesn't actually change the type. Furthermore, I can't stuff this value into a place where I'd have a dataFromUrl. I think many users of the library will be plotting generated data, so I think an easy interface should allow for ingesting matrices of N dimensions easily without requiring having them in JSON.

Looking at the example in dataFromJson:

dataFromUrl "data/weather.csv" [ Parse [ ( "date", FoDate "%Y-%m-%d %H:%M" ) ] ]

This example indeed has type Data. So wouldn't it be more intuitive if the other dataFromX functions also had examples with the Data type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants