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

Use delaunator v5; adopt type=module #120

Merged
merged 26 commits into from
Jun 4, 2021
Merged

Use delaunator v5; adopt type=module #120

merged 26 commits into from
Jun 4, 2021

Conversation

Fil
Copy link
Member

@Fil Fil commented Mar 26, 2021

TODO:

  • update README.md
  • check LICENSE
  • switch the default branch to main

This is a story in 4 images
https://next.observablehq.com/d/62b5c48194cba6b2

before v5

delaunator v5 ➘

xy

delaunator v5 + ignore ab ➘

opposite-infinite

delaunator v5 + direction ➘

victory

see 3d26401 for the detailed explanation.

Fixes #119.

Fil added 2 commits March 26, 2021 11:01
…te triangles created by points of the hull that are almost exactly aligned.

The "circumcenter" of such a triangle is a point at the infinite, in the direction orthogonal to the hull.

It must also be "away from the center". But we can't rely on the sign of *ab*, since it's itself a difference of two products and can be of the wrong sign, leading to a ray that sometimes goes in the opposite direction.

To overcome this problem, we use the first point of the first triangle as a guide to tell us which way is "away from the center".
@Fil Fil requested a review from mourner March 26, 2021 10:10
Copy link
Collaborator

@mourner mourner left a comment

Choose a reason for hiding this comment

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

The last image speaks for itself — amazing!

We should probably coordinate with @mbostock on the "type": "module" change because it's technically a breaking change and a part of D3.

@Fil
Copy link
Member Author

Fil commented Apr 21, 2021

we also want to include #113 or #115

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

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

We should remove the esm dependency if we are adopting type: module, and we should add an engines: {"node": ">=12"} restriction. I’m also inclined to switch to mocha for testing, since mocha’s test runner already supports ES modules. And I’d also upgrade our other major dependencies at the same time (eslint and rollup have new major versions).

In short, let’s decide on a consistent strategy for the D3 modules and adopt it universally. Related d3/d3-format#112

Edit: so, mostly what’s in #115, but with mocha instead of tape + tape-await + esm.

follow changes in d3-format:
* type=module
* add exports
* remove zip
* update dependencies
@Fil Fil changed the title Use delaunator v5 to fix the exterior rays on degenerate (collinear) triangles on the hull Use delaunator v5; adopt type=module Apr 26, 2021
@Fil
Copy link
Member Author

Fil commented Apr 26, 2021

@mbostock this PR is ready; I don't think I have the rights to switch the default branch to main.

@mbostock
Copy link
Member

I’ve renamed to main.

package.json Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/voronoi.js Outdated Show resolved Hide resolved
Co-authored-by: Mike Bostock <mbostock@gmail.com>
@Fil Fil mentioned this pull request May 10, 2021
@mbostock mbostock mentioned this pull request Jun 4, 2021
35 tasks
@mbostock mbostock merged commit 22d1739 into main Jun 4, 2021
@mbostock mbostock deleted the test-delaunator-v5 branch June 4, 2021 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Broken voronoi
4 participants