-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
should i
be relative to the internal flattened array?
#77
Comments
here's what a flattened uniform structure would look like that allows modifying the default y axis or y series would require technically, the axes order doesnt matter s long and we can treat the first encountered also, there's no such option for {
data: [
[1,2,3,4],
[47,22,13,4]
],
series: [
null,
{},
],
axes: [
null,
{values: () => {}, side: 3}
],
scales: {
x: {},
y: {},
}
} there's no need for scales: [
null,
{auto: false},
] |
Have you a sample demo for this? thanks. |
a sample demo of what? |
multiple x-axes like image. |
right now the public API is split into
x
andy
sections, but internally they're merged to keep the loops uniform, with just a sprinkling ofif (i ==0)
branching to split offx
.the public API accepts
i
that is against the internal flattened array, but this is not terribly intuitive, especially since uPlot goes to additional lengths to make it look like the internals match the externals, e.g.uPlot/src/Line.js
Line 174 in 589d1dd
this can probably be improved.
i've considered dropping the x/y and simply making the lists flat but it results in awkwardness elsewhere. e.g.
x
is required, but if nothing needs to be customized for the x axis, you need to provide options that start with null:axes: [null, {values}]
. also, there can be multiple x axes (let's say different units), then what?i guess one route can be to attach an extra required property to each option item in a flat list, eg.
dir: 'x'
, but that's not great either.considerations:
if we simply disallow multiple x axes, then this whole situation becomes easier. we can use flat lists and simply say that data[0], series[0] and axes[0] are all
x
, everything else isy
, and then we just use a flati
as we do now and everything becomes logically aligned. yes, there will beaxes: [null, {}, {}]
but it's easy to reason about.The text was updated successfully, but these errors were encountered: