Skip to content

Commit

Permalink
null filter on the href channel (observablehq#1699)
Browse files Browse the repository at this point in the history
* null filter on the href channel

closes observablehq#1696

* the title channel is not filtering the mark, unless it's a tip mark (observablehq#1704)

* the title channel is not filtering the mark, unless it's a tip mark

(any mark that depends on this channel must declare it)

* rename to sparse title

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
  • Loading branch information
Fil and mbostock authored Jun 22, 2023
1 parent 5e313d9 commit 428bdbc
Show file tree
Hide file tree
Showing 6 changed files with 22,031 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/marks/tip.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class Tip extends Mark {
textAnchor = "start",
textOverflow,
textPadding = 8,
title,
pointerSize = 12,
pathFilter = "drop-shadow(0 3px 4px rgba(0,0,0,0.2))"
} = options;
Expand All @@ -56,7 +57,8 @@ export class Tip extends Mark {
x1: {value: x1, scale: "x", optional: x2 == null},
y1: {value: y1, scale: "y", optional: y2 == null},
x2: {value: x2, scale: "x", optional: x1 == null},
y2: {value: y2, scale: "y", optional: y1 == null}
y2: {value: y2, scale: "y", optional: y1 == null},
title: {value: title, optional: true} // filter: defined
},
options,
defaults
Expand Down
6 changes: 3 additions & 3 deletions src/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ export function styles(
mark.shapeRendering = impliedString(shapeRendering, "auto");

return {
title: {value: title, optional: true},
href: {value: href, optional: true},
ariaLabel: {value: variaLabel, optional: true},
title: {value: title, optional: true, filter: null},
href: {value: href, optional: true, filter: null},
ariaLabel: {value: variaLabel, optional: true, filter: null},
fill: {value: vfill, scale: "auto", optional: true},
fillOpacity: {value: vfillOpacity, scale: "auto", optional: true},
stroke: {value: vstroke, scale: "auto", optional: true},
Expand Down
Loading

0 comments on commit 428bdbc

Please sign in to comment.