Skip to content
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(echarts): add data zoom options (start/end/lock) #29421

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hexcafe
Copy link
Contributor

@hexcafe hexcafe commented Jul 1, 2024

SUMMARY

Add 3 Customization Options for echarts data zoom:

  • start: The end percentage of the window out of the data extent, in the range of 0 ~ 100.
  • end: The end percentage of the window out of the data extent, in the range of 0 ~ 100.
  • zoomLock: Specify whether to lock the size of window (selected area).

Currently, when Data Zoom is enabled in ECharts, the default start and end values are set to 0 and 100, respectively, which means all data is displayed in a single chart by default. This may not be ideal for high-density data scenarios.

By introducing these customization options, users can set the default data range for data zooming. This can be particularly beneficial for users with high-density data, allowing them to control the default size of the sliding window more effectively.

For example, users can set start to 0 and end to 10, which will display the top 10% of the data by default.
Users can still navigate through the rest of the data range by dragging the data zoom bar.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
image

After:
image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the viz:charts:echarts Related to Echarts label Jul 1, 2024
@rusackas
Copy link
Member

rusackas commented Jul 1, 2024

Hmm... I've never really wished for this, I just scale down the zoom window until it's the density I want. But... I guess this seems reasonable. Two questions:

  1. Do the zoom start/end settings apply to the default display of the chart? This might be a problem to some who wand to see ALL the data on the dashboard by default before they play with the slider.
  2. Are the new controls dynamic (e.g. they only appear when you check the "Data Zoom" checkbox?

I'll spin up a test env to kick the tires, but just thought I'd express those questions while I wait for it to spin up :D

@rusackas
Copy link
Member

rusackas commented Jul 1, 2024

/testenv up

Copy link
Contributor

github-actions bot commented Jul 1, 2024

@rusackas Ephemeral environment spinning up at http://54.71.140.132:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@hexcafe
Copy link
Contributor Author

hexcafe commented Jul 1, 2024

Hi Evan,
Thank you for your review!

This feature allows customization of the default zoom window for a specific chart in the design phase, while still permitting users to adjust it as needed in the view phase.

  1. Do the zoom start/end settings apply to the default display of the chart? This might be a problem to some who wand to see ALL the data on the dashboard by default before they play with the slider.

No, these settings take effect only if users set them manually. Otherwise, the default values (0 for start and 100 for end) will be used. This ensures that all data is displayed by default and maintains the current behavior.

  1. Are the new controls dynamic (e.g. they only appear when you check the "Data Zoom" checkbox?

Yes, they are fully dynamic and only appear when the "Data Zoom" checkbox is checked.

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

Successfully merging this pull request may close these issues.

None yet

2 participants