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

tip for dense raster #1647

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

tip for dense raster #1647

wants to merge 1 commit into from

Conversation

mbostock
Copy link
Member

Ref. #1634. Crashes on raster mandelbrot, but works on raster volcano.

Screenshot 2023-05-27 at 5 03 15 PM

@mbostock mbostock requested a review from Fil May 28, 2023 00:05
@Fil
Copy link
Contributor

Fil commented May 28, 2023

I've played around this a bit. Nothing conclusive at this stage but here are some notes about various issues that this raised:

  1. We'd want a color swatch next to the value, when applicable (e.g., in the screenshot above, tipRasterDense). Using title seems like too much of a shortcut.

  2. When experimenting with custom spatial interpolators, it appears that —if possible— I’d prefer the color scale to be determined by the rasterized values rather than by the original data values. In that sense a raster interpolator feels like a transform.

With this in mind, we might want to compute the raster (in data space) as an initializer, like we do for voronoi in #1623. However, it might be tricky because the pointer will still want the untransformed index, X, and Y, if they exist.

When using a function sampler (mandelbrot), or a rectangular dataset (volcano), otoh, it would be quite slow if the transform were to create a huge index, X and Y channels, and value, then look for the closest point pixel by pixel. In that case we should directly look up the value in the derived raster.

@mbostock
Copy link
Member Author

mbostock commented May 28, 2023

The (1) issue you raise is related to what I raised yesterday in #1646: the reason we’re seeing the title tip here is because the data is an array of numbers (primitives). I also feel it would be better to see x and y, and fill with a color swatch. Perhaps we can somehow opt-out of the isTextual test when deriving a tip for the raster mark… (and ideally there is a way the user can explicitly opt-out of that behavior with tip: true, too, but fixing the automatic behavior is more important.)

For (2) I don’t think it will be practical to use the pointer transform as currently implemented for dense grids; I think it could add a lot of complexity. I would prefer if we could build a specialized “rasterPointer” instead that understands dense grids and does the lookup directly, and keep these problems decoupled. I also want to build continuous crosshairs.

@Fil
Copy link
Contributor

Fil commented Sep 4, 2024

related #1629

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

Successfully merging this pull request may close these issues.

2 participants