Skip to content

Commit

Permalink
fix waffle stroke (when constant)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Oct 19, 2024
1 parent c1aab3b commit d3f851e
Show file tree
Hide file tree
Showing 9 changed files with 815 additions and 109 deletions.
4 changes: 2 additions & 2 deletions src/marks/waffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export class WaffleY extends BarY {
}

function waffleRender(y) {
const {unit, gap, rx, ry, round} = this;
return function (index, scales, {href, ...values}, dimensions, context) {
const {unit, gap, rx, ry, round} = this;
const {document} = context;
const Y1 = values.channels[`${y}1`].value;
const Y2 = values.channels[`${y}2`].value;
Expand Down Expand Up @@ -103,7 +103,7 @@ function waffleRender(y) {
.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")
.call(applyChannelStyles, this, {href})
)
.node();
Expand Down
154 changes: 77 additions & 77 deletions test/output/waffleHref.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions test/output/waffleStroke.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions test/output/waffleStrokeMixed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d3f851e

Please sign in to comment.