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

waffle stroke #2204

Merged
merged 4 commits into from
Nov 21, 2024
Merged

waffle stroke #2204

merged 4 commits into from
Nov 21, 2024

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Oct 19, 2024

closes #2186

before after
before after

(to apply after #2203)

@Fil Fil requested a review from mbostock October 19, 2024 16:13
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no visual difference here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test and the other ones below have a small visible difference, but for the best

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this would be unchanged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test is the one exhibiting the bug (see description)

Base automatically changed from fil/waffle-href to main October 19, 2024 17:14
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.

A thing I noticed is that these waffles have invisible slivers that extend the full width of the band. Related to #2132 I guess. Need more time to work on this but we probably want to simplify the polygon we’re using to render the waffle cells.

image

@Fil
Copy link
Contributor Author

Fil commented Oct 19, 2024

Yes, it explains the gradient we see at the top of the "before" image in the description. It would be nice to clean this up too.

(Related: #2132)

@mbostock mbostock mentioned this pull request Oct 20, 2024
@Fil Fil mentioned this pull request Oct 30, 2024
3 tasks
@Fil
Copy link
Contributor Author

Fil commented Oct 30, 2024

integrated in #2215

@Fil Fil marked this pull request as draft October 30, 2024 16:46
@@ -142,7 +142,7 @@ function waffleRender({render, ...options}) {
.attr("transform", template`translate(${x0},${y0})`)
.attr("d", (i) => `M${polygon[i].join("L")}Z`)
.attr("fill", (i) => `url(#${patternId}-${i})`)
.attr("stroke", this.stroke == null ? null : (i) => `url(#${patternId}-${i})`)
.attr("stroke", this.stroke == null ? null : "none")
Copy link
Member

Choose a reason for hiding this comment

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

Just noting that this is visually equivalent to saying:

            .attr("stroke", "none")

I.e., there’s never a stroke applied to the path element, it’s just that sometimes we have to suppress it when it would otherwise be inherited from the parent G element.

@mbostock mbostock marked this pull request as ready for review November 21, 2024 22:40
@mbostock mbostock merged commit 5fb8616 into main Nov 21, 2024
1 check passed
@mbostock mbostock deleted the fil/waffle-stroke branch November 21, 2024 22:40
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.

Waffle pattern does not account for strokeWidth
2 participants