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

Scale domain vs filter selection: automatic axis scaling #5802

Closed
aldanor opened this issue Jan 26, 2020 · 5 comments
Closed

Scale domain vs filter selection: automatic axis scaling #5802

aldanor opened this issue Jan 26, 2020 · 5 comments

Comments

@aldanor
Copy link

aldanor commented Jan 26, 2020

In Scale Domains docs it is noted:

An alternate way to construct this technique would be to filter out
the input data to the top (detail) view like so:

{
  "vconcat": [{
    "transform": [{"filter": {"selection": "brush"}}],
    ...
  }]
}

Which is indeed almost the same (although filter method being much slower, as noted in the docs), except for one difference:

  • With filter-selection method (demo), the y-axis of the upper chart will be automatically zoomed in to the selected points. This is pretty neat, especially if you have large amount of points.
  • With scale-domain method (demo), the y-axis remains frozen as you move the selection around.

The question: is it possible to have the y-axis automatically zoom in to the selected points as you move the selection, with "scale domain" method (same as it does with filter-selection method)?

// I've checked all scale-domain issues here, on altair repo and SO and couldn't find anything related; apologies if it's something obvious.

@domoritz
Copy link
Member

Please use stack overflow or slack for questions. We reserve the issue tracker for bugs and feature requests (including doc requests).

@aldanor
Copy link
Author

aldanor commented Jan 27, 2020

@domoritz I would've posted a feature request if someone could confirm this is currently impossible, hence the question (apologies for hassle).

I've posted an SO question - hoping someone could answer that.

@domoritz
Copy link
Member

If you want to filter the data to the selected points or set the scale domain to only include some filtered data, you need to use the filter method.

@aldanor
Copy link
Author

aldanor commented Jan 27, 2020

@domoritz Thanks. The problem is, scale domain method with binding to x-axis works surprisingly fine if there's around 100K points in the dataset, whereas filter method almost dies.

I was wondering, if scale domain method is so efficient (because it doesn't have to scan through all data points along the x axis), is there a faster way to auto-scale the resulting plot along the y-axis? If this was possible, it would make vega-lite miles ahead all of the existing tools.

Alternatively, maybe it was possible to show the full dataset (with scale domain), but auto-scale it along y-axis using heavily resampled dataset? (so that it can compute y-min and y-max much faster on a smaller number of points). Not entirely sure that's possible in vega-lite.

// I was even thinking, it might be even fine to have to pre-compute some mins/maxes for a quantized matrix of (start, end) selection ranges and pass them to vega-lite as a separate dataset, but not sure if it's doable either.

@domoritz
Copy link
Member

Can you find out what's slow? I'd rather improve the performance of filtering than support two ways to achieve the same thing. That would be fantastic. Feel free to open a new issue with the goal of performance improvements for your use case. Thanks!

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

2 participants