Skip to content

Conversation

@Adityakashyap1011
Copy link

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Changes the default brush selection mode from 'single' to 'multiple' and increases the opacity of selected areas from 0.1 to 1.0 for better visibility.

Fixed issues

  • Brush selection now defaults to multiple mode for improved user experience
  • Selected area opacity increased from 0.1 to 1.0 for clearer visual feedback

Details

Before: What was the problem?

Issue 1: Brush Selection Mode

  • The brush component defaulted to 'single' selection mode
  • Users had to manually click the "keep selection" button to enable multiple selections
  • Each new brush selection would replace the previous one by default
  • This required an extra step for a common use case (selecting multiple areas)

Issue 2: Selected Area Opacity

  • The opacity of selected areas was set to 0.1, making them barely visible
  • Visual feedback for brush selections was too faint and unclear
  • Users had difficulty seeing which areas were selected

After: How does it behave after the fixing?

Brush Selection Mode:

  • The brush component now defaults to 'multiple' selection mode
  • The "keep selection" button is highlighted/emphasized by default
  • Users can make multiple brush selections immediately without any extra clicks
  • Each new selection adds to existing selections instead of replacing them
  • The brush mode is always set to 'multiple' for consistent behavior

Selected Area Opacity:

  • Selected areas now have an opacity of 1.0 (fully opaque)
  • Provides clear and visible feedback for brushed regions
  • Significantly improves visual clarity when selecting multiple areas
  • Users can now clearly see all selected regions

Implementation details:

  1. Changed BrushModel.defaultOption.brushMode from 'single' to 'multiple'
  2. Updated Brush.ts (toolbox feature) to default to 'multiple' mode in the render method
  3. Modified onclick method to always use 'multiple' mode
  4. Increased opacity of selected brush areas from 0.1 to 1.0

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Note: Documentation should be updated to reflect that brush selection now defaults to multiple mode and the changed opacity behavior of selected areas.

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

Note: No security-sensitive Web APIs are used in this PR.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

Test file created: test/brush-multiple-test.html to demonstrate the new default behavior and improved opacity settings.

Merging options

  • Please squash the commits into a single one when merging.

Other information

Files modified:

  • src/component/brush/BrushModel.ts - Changed default brushMode to 'multiple' and increased opacity to 1.0
  • src/component/toolbox/feature/Brush.ts - Updated to always use 'multiple' mode
  • test/brush-multiple-test.html - Added test file for verification

Breaking change consideration: This changes default behavior but improves UX. The increased opacity provides much better visual feedback. Users who specifically want single-selection mode or different opacity can still configure it via options.

2025-11-12.11-43-30.mp4

@echarts-bot echarts-bot bot added PR: awaiting doc Document changes is required for this PR. PR: awaiting review labels Nov 12, 2025
@echarts-bot
Copy link

echarts-bot bot commented Nov 12, 2025

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

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 PR: awaiting doc label.

.gitignore Outdated
*.asm

# Distribution files
/dist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we release a new version, files in these folders still need to be committed, so please ignore them and just do not commit them instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we release a new version, files in these folders still need to be committed, so please ignore them and just do not commit them instead.

resolved in e8238a2

@Adityakashyap1011 Adityakashyap1011 force-pushed the fix/bug-multipleBrushAndOpacity branch 2 times, most recently from 92de0c8 to 9f86048 Compare November 14, 2025 06:39
-feat: added the multiple selection without use of prolong mouse down event
Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's more intuitive to use multiple for default brushMode. And we are very careful to make default value changes because it may cause compatibility problems.

And I don't see the opacity changes as you mentioned in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: awaiting doc Document changes is required for this PR. PR: revision needed size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants