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

Some transforms (and marks) require facets to be exclusive #1648

Closed
mbostock opened this issue May 28, 2023 · 1 comment · Fixed by #1649
Closed

Some transforms (and marks) require facets to be exclusive #1648

mbostock opened this issue May 28, 2023 · 1 comment · Fixed by #1649
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

The design of channels assumes that either facets are exclusive (i.e., each datum appears in at most one facet) or that if facets are not exclusive, that the derived channel value is the same across all facets. Yet this is not true in all cases, such as the stack transform in conjunction with the exclude facet mode. This problem will become more common if we extend faceting to support animation #995 with filtering to show earlier/latter values, and was also encountered when switching the Voronoi mark to compute the Voronoi diagram in an initializer #1623.

Related #1041 #1057 #1068 #1069 #1070 (but we never filed an issue for the bug).

@mbostock mbostock added the bug Something isn’t working label May 28, 2023
@mbostock
Copy link
Member Author

From #1623:

I think we probably need a redux of the approach in #1069. Ideally, it’s like a transform wrapper that says “this transform/initializer needs exclusive facets”, and it expands the faceted index and channels as needed to meet the constraint that the facets are exclusive, and the downstream code therefore doesn’t need any changing.

mbostock added a commit that referenced this issue Aug 1, 2024
* selectively generate one voronoi cell with the pointer

* voronoi initializer

* defined

* the voronoi cell depends on i and fi (e.g. facet: exclude)

* transpose cells channel

* prettier

* undo comment edits

* facet reindexation to be handled separately (#1648)

* update test

* voronoi mark + reindexed facets

* Apply the transform option before any initializer

* simpler!

* more tests

* update tests

* missing import

* remove maybeClip (bad merge operation)

* only voronoi needs exclusiveFacets

---------

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant