Skip to content

Commit ac9aa58

Browse files
authored
no tip for tip (#1598)
1 parent f8a18a1 commit ac9aa58

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/mark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function maybeChannels(channels) {
153153
}
154154

155155
function maybeTip(tip) {
156-
return tip === true ? "xy" : maybeKeyword(tip, "tip", ["x", "y", "xy"]);
156+
return tip === true ? "xy" : tip === false ? null : maybeKeyword(tip, "tip", ["x", "y", "xy"]);
157157
}
158158

159159
export function withTip(options, tip) {

src/marks/tip.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const ignoreChannels = new Set(["geometry", "href", "src", "ariaLabel"]);
2323

2424
export class Tip extends Mark {
2525
constructor(data, options = {}) {
26+
if (options.tip) options = {...options, tip: false};
27+
if (options.title === undefined && isIterable(data) && isTextual(data)) options = {...options, title: identity};
2628
const {
2729
x,
2830
y,
@@ -56,7 +58,7 @@ export class Tip extends Mark {
5658
x2: {value: x2, scale: "x", optional: x1 == null},
5759
y2: {value: y2, scale: "y", optional: y1 == null}
5860
},
59-
options.title === undefined && isIterable(data) && isTextual(data) ? {...options, title: identity} : options,
61+
options,
6062
defaults
6163
);
6264
this.anchor = maybeAnchor(anchor, "anchor");

0 commit comments

Comments
 (0)