-
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.
feat(facet): support legend filter (#5593)
- Loading branch information
Showing
8 changed files
with
135 additions
and
63 deletions.
There are no files selected for viewing
Binary file added
BIN
+79.5 KB
...tion/snapshots/interaction/penguins-point-repeat-matrix-legend-filter/step0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
35 changes: 35 additions & 0 deletions
35
__tests__/plots/interaction/penguins-point-repeat-matrix-legend-filter.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,35 @@ | ||
import { G2Spec } from '../../../src'; | ||
import { LEGEND_ITEMS_CLASS_NAME } from '../../../src/interaction/legendFilter'; | ||
import { step } from './utils'; | ||
|
||
export function penguinsPointRepeatMatrixLegendFilter(): G2Spec { | ||
return { | ||
type: 'repeatMatrix', | ||
width: 480, | ||
height: 480, | ||
paddingLeft: 50, | ||
paddingBottom: 50, | ||
data: { | ||
type: 'fetch', | ||
value: 'data/penguins.csv', | ||
}, | ||
encode: { | ||
position: ['culmen_length_mm', 'culmen_depth_mm'], | ||
}, | ||
children: [ | ||
{ | ||
type: 'point', | ||
encode: { | ||
color: 'species', | ||
}, | ||
}, | ||
], | ||
}; | ||
} | ||
|
||
penguinsPointRepeatMatrixLegendFilter.steps = ({ canvas }) => { | ||
const { document } = canvas; | ||
const elements = document.getElementsByClassName(LEGEND_ITEMS_CLASS_NAME); | ||
const [e0] = elements; | ||
return [step(e0, 'click')]; | ||
}; |
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 |
---|---|---|
|
@@ -30,3 +30,5 @@ export function liquidCustomShape(): G2Spec { | |
}, | ||
}; | ||
} | ||
|
||
liquidCustomShape.maxError = 10; |
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