-
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(interaction): muti iteraction (#5419)
- Loading branch information
Showing
10 changed files
with
206 additions
and
126 deletions.
There are no files selected for viewing
Binary file added
BIN
+46.1 KB
...ts__/integration/snapshots/interaction/countries-bubble-multi-legends/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
+33.9 KB
...ts__/integration/snapshots/interaction/countries-bubble-multi-legends/step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions
50
__tests__/plots/interaction/countries-bubble-multi-legends.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,50 @@ | ||
import { G2Spec } from '../../../src'; | ||
import { LEGEND_ITEMS_CLASS_NAME } from '../../../src/interaction/legendFilter'; | ||
import { SLIDER_CLASS_NAME } from '../../../src/interaction/sliderFilter'; | ||
import { dispatchValueChange } from './appl-line-slider-filter'; | ||
import { step } from './utils'; | ||
|
||
export function countriesBubbleMultiLegends(): G2Spec { | ||
return { | ||
type: 'point', | ||
padding: 'auto', | ||
data: { | ||
type: 'fetch', | ||
value: 'data/countries.json', | ||
}, | ||
encode: { | ||
x: 'change in female rate', | ||
y: 'change in male rate', | ||
size: 'pop', | ||
color: 'continent', | ||
shape: 'point', | ||
}, | ||
scale: { | ||
color: { range: ['#ffd500', '#82cab2', '#193442', '#d18768', '#7e827a'] }, | ||
x: { nice: true }, | ||
y: { nice: true }, | ||
size: { range: [4, 30] }, | ||
}, | ||
style: { stroke: '#bbb', fillOpacity: 0.8 }, | ||
slider: { | ||
x: { labelFormatter: (d) => d.toFixed(1) }, | ||
y: { labelFormatter: (d) => d.toFixed(1) }, | ||
}, | ||
}; | ||
} | ||
|
||
countriesBubbleMultiLegends.steps = ({ canvas }) => { | ||
const { document } = canvas; | ||
const elements = document.getElementsByClassName(LEGEND_ITEMS_CLASS_NAME); | ||
const [e0] = elements; | ||
const sliders = document.getElementsByClassName(SLIDER_CLASS_NAME); | ||
const [s1] = sliders; | ||
return [ | ||
step(e0, 'click'), | ||
{ | ||
changeState: () => { | ||
dispatchValueChange(s1); | ||
}, | ||
}, | ||
]; | ||
}; |
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
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
Oops, something went wrong.