-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tooltip): hide tooltip when move mask (#4860)
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
__tests__/integration/snapshots/tooltip/alphabet-interval-brush-tooltip/step1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
null |
48 changes: 48 additions & 0 deletions
48
__tests__/plots/tooltip/alphabet-interval-brush-tooltip.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { CustomEvent } from '@antv/g'; | ||
import { G2Spec, PLOT_CLASS_NAME } from '../../../src'; | ||
import { brush } from '../interaction/penguins-point-brush'; | ||
|
||
export function alphabetIntervalBrushTooltip(): G2Spec { | ||
return { | ||
type: 'interval', | ||
transform: [{ type: 'sortX', by: 'y', reverse: true }], | ||
data: { | ||
type: 'fetch', | ||
value: 'data/alphabet.csv', | ||
}, | ||
encode: { | ||
x: 'letter', | ||
y: 'frequency', | ||
color: 'steelblue', | ||
}, | ||
state: { | ||
active: { fill: 'red' }, | ||
}, | ||
interaction: { | ||
brushHighlight: true, | ||
}, | ||
}; | ||
} | ||
|
||
alphabetIntervalBrushTooltip.steps = ({ canvas }) => { | ||
const { document } = canvas; | ||
const plot = document.getElementsByClassName(PLOT_CLASS_NAME)[0]; | ||
return [ | ||
{ | ||
skip: true, | ||
changeState: () => { | ||
brush(plot, 400, 300, 600, 400); | ||
}, | ||
}, | ||
{ | ||
changeState: () => { | ||
plot.dispatchEvent( | ||
new CustomEvent('pointerover', { | ||
offsetX: 500, | ||
offsetY: 360, | ||
}), | ||
); | ||
}, | ||
}, | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters