-
Notifications
You must be signed in to change notification settings - Fork 3
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
Plotting DataFrames with Elixir.Time
columns
#22
Comments
Hi @spencerkent there are two issues here:
You could do the following: now = DateTime.utc_now(:second)
times =
0..10
|> Enum.map(fn x -> DateTime.add(now, x, :second) end)
|> Enum.map(&DateTime.to_iso8601/1)
y = 10..20 |> Enum.to_list()
Tucan.lineplot([t: t, y: y], "t", "y", x: [type: :temporal, axis: [format: "%H:%M:%S"]]) the |
Okay, thanks! Tucan makes using Vega Lite a lot easier—it might be in that same spirit for Tucan to handle this conversion for us (having to know the details of Vega Lite's timestamp handling kind of defeats the purpose of Tucan's abstraction). |
@spencerkent correction no explicit casting is needed if the you pass
The issue is present only if you pass We could support something like this that automatically sets the proper format to the dataset: Tucan.lineplot([t: t, y: y], "t", "y", x: [type: :temporal], format: [t: :time]) WDYT? |
Since "temporal" to me means either a |
The issue here is that VegaLite itself does not handle times unless you explicitly specify the format. |
My recommendation would be for Tucan to detect whether the # works regardless of whether t is DateTime or Time
Tucan.lineplot([t: t, y: y], "t", "y", x: [type: :temporal]) |
Hey, thanks for the useful library!
I was surprised to get a blank graph in response to the following:
Providing the temporal-type argument does not yield anything different:
Am I missing a configuration parameter that's needed for Tucan to show the plot?
The text was updated successfully, but these errors were encountered: