Skip to content

Commit

Permalink
waffle href (#2203)
Browse files Browse the repository at this point in the history
* waffle href

* fix syntax

* ariaLabel, href; fix test

* test title, too

---------

Co-authored-by: Mike Bostock <[email protected]>
  • Loading branch information
Fil and mbostock authored Oct 19, 2024
1 parent 07cab1e commit 27e8fff
Show file tree
Hide file tree
Showing 3 changed files with 444 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/marks/waffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class WaffleY extends BarY {

function waffleRender(y) {
return function (index, scales, values, dimensions, context) {
const {ariaLabel, href, title, ...visualValues} = values;
const {unit, gap, rx, ry, round} = this;
const {document} = context;
const Y1 = values.channels[`${y}1`].value;
Expand Down Expand Up @@ -86,7 +87,7 @@ function waffleRender(y) {
.attr("id", (i) => `${patternId}-${i}`)
.select("rect")
.call(applyDirectStyles, this)
.call(applyChannelStyles, this, values)
.call(applyChannelStyles, this, visualValues)
)
.call((g) =>
g
Expand All @@ -104,6 +105,7 @@ function waffleRender(y) {
)
.attr("fill", (i) => `url(#${patternId}-${i})`)
.attr("stroke", this.stroke == null ? null : (i) => `url(#${patternId}-${i})`)
.call(applyChannelStyles, this, {ariaLabel, href, title})
)
.node();
};
Expand Down
Loading

0 comments on commit 27e8fff

Please sign in to comment.