Skip to content

Commit 31f7ac5

Browse files
mbostockFil
authored andcommitted
no implicit title on derived tip (#1658)
1 parent 5dac159 commit 31f7ac5

File tree

3 files changed

+75
-1
lines changed

3 files changed

+75
-1
lines changed

src/plot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ function inferTips(marks) {
492492
const t = mark.tip;
493493
if (t) {
494494
const p = t === "x" ? pointerX : t === "y" ? pointerY : pointer;
495-
tips.push(tip(mark.data, p(derive(mark)))); // TODO tip options?
495+
const options = p(derive(mark)); // TODO tip options?
496+
options.title = null; // prevent implicit title for primitive data
497+
tips.push(tip(mark.data, options));
496498
}
497499
}
498500
return tips;

test/output/tipGroupPrimitives.svg

Lines changed: 64 additions & 0 deletions
Loading

test/plots/tip.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ export async function tipGeoCentroid() {
122122
});
123123
}
124124

125+
export async function tipGroupPrimitives() {
126+
return Plot.plot({
127+
height: 80,
128+
x: {type: "band"},
129+
marks: [Plot.barY("de156a2fc8", Plot.groupX({y: "count"}, {x: (d) => d, tip: true}))]
130+
});
131+
}
132+
125133
export async function tipHexbin() {
126134
const olympians = await d3.csv<any>("data/athletes.csv", d3.autoType);
127135
return Plot.hexagon(olympians, Plot.hexbin({r: "count"}, {x: "weight", y: "height", tip: true})).plot();

0 commit comments

Comments
 (0)