Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/marks/tip.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ export class Tip extends Mark {
format = formatChannels;
}

// Format the tip text, skipping any nulls.
const T = new Array(index.length);
for (const i of index) T[i] = format.call(mark, i, index, sources, scales, values);
index = index.filter((i) => T[i] != null);

// We don’t call applyChannelStyles because we only use the channels to
// derive the content of the tip, not its aesthetics.
const g = create("svg:g", context)
Expand All @@ -150,7 +155,7 @@ export class Tip extends Mark {
this.setAttribute("fill-opacity", 1);
this.setAttribute("stroke", "none");
// iteratively render each channel value
const lines = format.call(mark, i, index, sources, scales, values);
const lines = T[i];
if (typeof lines === "string") {
for (const line of mark.splitLines(lines)) {
renderLine(that, {value: mark.clipLine(line)});
Expand Down
Loading