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

delaunay + voronoi #917

Merged
merged 21 commits into from
Jun 9, 2022
Merged

delaunay + voronoi #917

merged 21 commits into from
Jun 9, 2022

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Jun 7, 2022

Fixes #812. TODO:

  • delaunayLink
  • delaunayMesh
  • hull
  • voronoi (voronoiCell?)
  • voronoiMesh
  • pointerEvents
  • faceting
  • variable styles for delaunayLink (computed by target data)
  • variable styles for voronoi
  • group by z for voronoi
  • group by z for delaunayLink
  • group by z or stroke for delaunayMesh
  • tests
  • documentation

Screen Shot 2022-06-07 at 8 37 42 AM

Plot.plot({
  marks: [
    Plot.delaunayLink(data, {x: "culmen_depth_mm", y: "culmen_length_mm", stroke: "culmen_length_mm"})
  ]
})

@mbostock mbostock requested a review from Fil June 7, 2022 15:38
@mbostock mbostock changed the title delaunayLink delaunay + voronoi Jun 7, 2022
@mbostock
Copy link
Member Author

mbostock commented Jun 7, 2022

Screen Shot 2022-06-07 at 8 53 59 AM

Plot.plot({
  marks: [
    Plot.dot(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm", fill: "currentColor", r: 1.5}),
    Plot.voronoi(penguins, {x: "culmen_depth_mm", y: "culmen_length_mm", stroke: "species"})
  ]
})

@Fil
Copy link
Contributor

Fil commented Jun 8, 2022

In the case of Delaunay, I can see how it is useful to connect points by group; I've tried to implement it in #925. However I can't really figure a use case for doing this with Voronoi (except to be consistent? Being consistent is a good thing.).

I'm curious also how you plan to use pointerEvents, probably with titles? Should we add titles in the penguinCulmenVoronoi test? A nit: commit e8ddf63 should probably be separated from this PR since it affects all marks.

* delaunay updates:
- group by z or stroke for delaunayLink
- group by z or stroke for delaunayMesh

* a few fixes

* no group by stroke for delaunayLink

Co-authored-by: Mike Bostock <[email protected]>
@mbostock mbostock marked this pull request as ready for review June 8, 2022 18:05
@mbostock mbostock force-pushed the mbostock/delaunay branch from 6d0dc10 to 67bfac4 Compare June 8, 2022 23:31
@Fil Fil mentioned this pull request Jun 9, 2022
10 tasks
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Suggestions:

  • add an image of Delaunay + hull?(test/output/penguinCulmenDelaunaySpecies.svg demonstrates it well).
  • default pointerEvents to "auto" (equivalent to "visiblePainted", but more well-known?)

#928 tracks a few follow-ups that I have in mind.

@mbostock mbostock merged commit 30eca95 into main Jun 9, 2022
@mbostock mbostock deleted the mbostock/delaunay branch June 9, 2022 15:38
@mbostock mbostock mentioned this pull request Dec 14, 2022
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.

Voronoi mark
2 participants