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

Feature request: plot multiple values of 1 data type in a chart #51

Open
luc-tielen opened this issue Jun 21, 2018 · 0 comments
Open

Feature request: plot multiple values of 1 data type in a chart #51

luc-tielen opened this issue Jun 21, 2018 · 0 comments

Comments

@luc-tielen
Copy link

Hi,

Is it possible to add possibility to plot multiple values from a single data type.
For example, I'm working on a toy example that shows history of git diffs over time.
Data type is as follows:

type alias Delta =
  { author : Author
  , commit : Commit
  , summary : Summary
  , time : Time
  , additions : Int
  , deletions : Int
  }

But viewCustom does not allow this to be plotted directly, it expects x and y.
So I have to first make 2 lists containing (Time, Float) for the additions and deletions.

...
chartConfig : GraphModel -> LineChart.Config (Time.Time, Int) GraphMsg
chartConfig model =
  { x = Axis.time 1270 "Time" Tuple.first
  , y = Axis.default 450 "LOC" (Tuple.second >> toFloat)
...

This is all fine for plotting, but when I try to show hover data.. most information is now lost.
I have a workaround, but it involves me keeping track of a Dict Time Delta and it's noticably slower for large repositories.

Ideally, it should be possible to have chartConfig : GraphModel -> LineChart.Config Delta GraphMsg;
giving me full access to the data.
Any chance this could be integrated into the library? Or does anyone know a better way of dealing with this kind of data?

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

No branches or pull requests

1 participant