-
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.
- Loading branch information
Showing
7 changed files
with
94 additions
and
27 deletions.
There are no files selected for viewing
Binary file added
BIN
+23.3 KB
__tests__/integration/snapshots/interaction/missing-area-tooltip-marker/step0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.7 KB
__tests__/integration/snapshots/interaction/missing-area-tooltip-marker/step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
55 changes: 55 additions & 0 deletions
55
__tests__/plots/interaction/missing-area-tooltip-marker.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,55 @@ | ||
import { G2Spec, PLOT_CLASS_NAME } from '../../../src'; | ||
import { step } from './utils'; | ||
|
||
export function missingAreaTooltipMarker(): G2Spec { | ||
return { | ||
type: 'area', | ||
data: { | ||
type: 'fetch', | ||
value: 'data/aapl.csv', | ||
transform: [ | ||
{ | ||
type: 'map', | ||
callback: (d) => ({ | ||
...d, | ||
close: d.date.getUTCMonth() <= 3 ? NaN : d.close, | ||
}), | ||
}, | ||
], | ||
}, | ||
encode: { | ||
x: 'date', | ||
y: 'close', | ||
}, | ||
style: { | ||
connect: true, | ||
connectFill: 'grey', | ||
connectFillOpacity: 0.15, | ||
}, | ||
interaction: { | ||
tooltip: { | ||
body: false, | ||
markerR: 10, | ||
markerStrokeWidth: 5, | ||
markerStroke: '#aaa', | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
missingAreaTooltipMarker.tooltip = true; | ||
|
||
missingAreaTooltipMarker.steps = ({ canvas }) => { | ||
const { document } = canvas; | ||
const [plot] = document.getElementsByClassName(PLOT_CLASS_NAME); | ||
return [ | ||
step(plot, 'pointermove', { | ||
offsetX: 100, | ||
offsetY: 350, | ||
}), | ||
step(plot, 'pointermove', { | ||
offsetX: 176, | ||
offsetY: 350, | ||
}), | ||
]; | ||
}; |
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