You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose the data is given as an object of columns:
df = {x: [1, 2, 3], y: [1, 2, 3]}
(This is how Quarto returns dataframes, and arquero does something similar.)
To use this in a mark we can call:
Plot.barX(data, {x: df.x, y: df.y, …)
But there is no good way to specify data:
if we specify it as {length: n} it will get materialized at some point, which is not optimal if the dataframe has millions of rows.
if we pass df.x as data, it is semantically incorrect
technically new Array(df.x.length) is fine, but it's a mental stretch
I wonder if we could have either: data = n (a number) —which would be read as new Array(n)—; or a special symbol that would say "use the channels' length". Another useful possibility would be for "dataframe objects" to have some sort of length property.
Suppose the data is given as an object of columns:
df = {x: [1, 2, 3], y: [1, 2, 3]}
(This is how Quarto returns dataframes, and arquero does something similar.)
To use this in a mark we can call:
Plot.barX(data, {x: df.x, y: df.y, …)
But there is no good way to specify data:
df.x
as data, it is semantically incorrectnew Array(df.x.length)
is fine, but it's a mental stretchI wonder if we could have either: data = n (a number) —which would be read as
new Array(n)
—; or a special symbol that would say "use the channels' length". Another useful possibility would be for "dataframe objects" to have some sort of length property.cc: @allisonhorst ; discussion after reading https://allisonhorst.github.io/posts/2022-10-14-bird-attacks/
The text was updated successfully, but these errors were encountered: