Skip to content

Commit 86ac53e

Browse files
authored
default title to identity if text (#1586)
1 parent bb51b4e commit 86ac53e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/marks/tip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {anchorX, anchorY} from "../interactions/pointer.js";
77
import {Mark} from "../mark.js";
88
import {maybeAnchor, maybeFrameAnchor, maybeTuple, number, string} from "../options.js";
99
import {applyDirectStyles, applyFrameAnchor, applyIndirectStyles, applyTransform, impliedString} from "../style.js";
10+
import {identity, isIterable, isTextual} from "../options.js";
1011
import {inferTickFormat} from "./axis.js";
1112
import {applyIndirectTextStyles, defaultWidth, ellipsis, monospaceWidth} from "./text.js";
1213
import {cut, clipper, splitter, maybeTextOverflow} from "./text.js";
@@ -55,7 +56,7 @@ export class Tip extends Mark {
5556
x2: {value: x2, scale: "x", optional: x1 == null},
5657
y2: {value: y2, scale: "y", optional: y1 == null}
5758
},
58-
options,
59+
options.title === undefined && isIterable(data) && isTextual(data) ? {...options, title: identity} : options,
5960
defaults
6061
);
6162
this.anchor = maybeAnchor(anchor, "anchor");

0 commit comments

Comments
 (0)