-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(axis): add axisAreaClear action. close #18446 #19232
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-19232@45fab44 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes under dist
and fix the lint problems as the bot suggests. Please also add test cases for this.
Hi @Ovilia, I've fixed problems and a test case has been added as required. Please take a look, thank you : ) |
And it seems that the project is now having problems with transparency disappearing. I get this problem when interacting with the examples on the website: https://echarts.apache.org/examples/en/editor.html?c=parallel-simple. So the problem described in detail should not be caused by my changes. |
intervals: ParallelAxisInterval[] | ||
parallelAxisId?: string; | ||
intervals?: ParallelAxisInterval[]; | ||
axes?: string[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is axisName of every axis, it should be named to be axisNames
.
event: 'axisAreaSelected' | ||
// update: 'updateVisual' | ||
event: 'axisAreaSelected', | ||
update: 'updateVisual' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why update: 'updateVisual'
should be uncommented? I don't know why it's originally commented.
* Register the clear action | ||
*/ | ||
registers.registerAction(clearActionInfo, function (payload: ParallelAxisAreaSelectPayload, ecModel: GlobalModel) { | ||
if (payload.axes && payload.axes.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking if (payload.axes)
should be enough.
registers.registerAction(clearActionInfo, function (payload: ParallelAxisAreaSelectPayload, ecModel: GlobalModel) { | ||
if (payload.axes && payload.axes.length) { | ||
// clear specific axes/axis by name | ||
payload.axes.forEach(axisName => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the forEach
in zrUtil
to make it compatible for more devices.
Brief Information
This pull request is in the type of:
What does this PR do?
This PR adds and registers axisAreaClear action so that user can clear the axis range selection by calling the dispatchAction().
Fixed issues
[Feature] Clear axis range selection by action in parallel coordinates plot #18446
Details
Before: What was the problem?
There is no action available to clear the axis range selection in parallel coordinates plot. The only option is to click on an axis, but it would be helpful to clear the axis range selection by dispatching an action.
After: How does it behave after the fixing?
Now, dispatchAction( { type: 'axisAreaClear'} ) will clear the axis selection range on all axes.
Additionally, dispatchAction( { type: 'axisAreaClear', axes: ['x', 'y'] } ) will clear the axis selection range on the axes named 'x' and 'y' (the name as defined in the option.parallelAxis[i].name property).
No problems have been found with dispatchAction( { type: 'axisAreaClear'} ) so far, but a bug was found when testing { type: 'axisAreaClear', axes: ['x', 'y'] }.
For example, in the image below, if I only want to clear the selection range on the first axis by dispatchAction(), the selection range on the second axis is still there but the transparency is gone.
Would appreciate it if anyone can tell me how to fix it.
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information