Skip to content

Commit 23b7981

Browse files
committed
no-tip
Rationale: tip is more fundamental than brush, and other interactions (such as lasso) will want to do the same
1 parent 595b9ab commit 23b7981

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/interactions/brush.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class Brush extends Mark {
3232
if (type === "start" && !clearing) {
3333
target = event.sourceEvent?.currentTarget ?? this;
3434
currentNode = _brushNodes.indexOf(target);
35-
if (event.sourceEvent) context.ownerSVGElement.classList.add("plot-brushing");
35+
if (event.sourceEvent) context.ownerSVGElement.classList.add("no-tip");
3636
if (!clearing) {
3737
clearing = true;
3838
selectAll(_brushNodes.filter((_, i) => i !== currentNode)).call(_brush.move, null);
@@ -47,7 +47,7 @@ export class Brush extends Mark {
4747

4848
if (selection === null) {
4949
if (type === "end") {
50-
context.ownerSVGElement.classList.remove("plot-brushing");
50+
context.ownerSVGElement.classList.remove("no-tip");
5151
for (let i = 0; i < _brushNodes.length; ++i) {
5252
inactive.update(true, i);
5353
ctx.update(false, i);

src/interactions/pointer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function pointerK(kx, ky, {x, y, px, py, maxRadius = 40, channels, render, ...op
167167
if (i == null) return; // not pointing
168168
if (state.sticky && state.roots.some((r) => r?.contains(event.target))) return; // stay sticky
169169
if (state.sticky) (state.sticky = false), state.renders.forEach((r) => r(null)); // clear all pointers
170-
else if (svg.classList.contains("plot-brushing")) return void update(null); // cancel tip on brush start
170+
else if (svg.classList.contains("no-tip")) return void update(null); // cancel tip on brush start
171171
else (state.sticky = true), render(i);
172172
event.stopImmediatePropagation(); // suppress other pointers
173173
}

0 commit comments

Comments
 (0)