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: Adding the option and feature to enable borders with color, opacity and width control on heatmaps along with white borders on emphasis #32358

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

Conversation

Dev10-34
Copy link

@Dev10-34 Dev10-34 commented Feb 24, 2025

SUMMARY

In heatmaps, when there can be several continuous same colored regions, making it hard to distinguish between each heatmap element itself. Depending on need of the user, this differentiation capability might be required or crucial to their work.
Added a color picker color control which keeps the borders transparent by default. Users can set the opacity as needed.
Added a slider control to set the border width as needed.
Added a feature which pops out the element upon emphasis with white borders and shadows.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE
image

AFTER
image
image
image

TESTING INSTRUCTIONS

No test files found for the same.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI: Adds an 'Enable Borders' Checkbox to Heatmap Customization, adds border and emphasis feature to heatmaps.
  • 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

…/controlPanel.tsx

	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/types.ts
	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
@dosubot dosubot bot added the viz:charts:heatmap Related to the Heatmap chart label Feb 24, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/types.ts
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Documentation
Logging
Error Handling
Readability
Design
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

Copy link
Contributor

@rusackas Processing your ephemeral environment request here. Action: up.

@rusackas rusackas changed the title [feat] Adding the option and feature to enable black borders on heatmaps along with white borders on emphasis feat: Adding the option and feature to enable black borders on heatmaps along with white borders on emphasis Feb 24, 2025
Copy link
Contributor

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

@michael-s-molina
Copy link
Member

Thanks for the PR @Dev10-34. Could you instead of adding a checkbox to enabling black borders, add a control to set the border color which by default is transparent (no border)? This is important as the color border may conflict with the color scheme used by the chart.

@Dev10-34
Copy link
Author

Dev10-34 commented Feb 24, 2025

Thanks for the PR @Dev10-34. Could you instead of adding a checkbox to enabling black borders, add a control to set the border color which by default is transparent (no border)? This is important as the color border may conflict with the color scheme used by the chart.

Thank you for the response! I don't quite get what you mean by a control. Do you mean something like a slider? I was primarily thinking that just the way the show values works for heatmap, where darker elements get the values written in white and lighter elements get a value written in black; but done for borders

@michael-s-molina
Copy link
Member

michael-s-molina commented Feb 24, 2025

Do you mean something like a slider?

Something like the Series colors control of the Waterfall chart.

Screenshot 2025-02-24 at 16 30 38

…/controlPanel.tsx

	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/types.ts
@pull-request-size pull-request-size bot added size/M and removed size/S labels Feb 25, 2025
…/controlPanel.tsx

	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/types.ts
@Dev10-34
Copy link
Author

Do you mean something like a slider?

Something like the Series colors control of the Waterfall chart.

Screenshot 2025-02-24 at 16 30 38

I couldn't quite get the opacity part down. So for now, I have added 2 things. One checkbox which will let you control whether you want the borders or not and secondly a color picker so that you are able to change the color of your border as needed. The opacity function doesn't seem to work for waterfall chart either.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Could you also remove the package-lock.json changes as there was no package change in this PR?

…s.ts

	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
@Dev10-34
Copy link
Author

I added a function in utils.ts which lets you change the opacity as well now

@Dev10-34 Dev10-34 changed the title feat: Adding the option and feature to enable black borders on heatmaps along with white borders on emphasis feat: Adding the option and feature to enable borders on heatmaps along with white borders on emphasis Feb 26, 2025
…s.ts

	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx
	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/types.ts
@github-actions github-actions bot removed the packages label Feb 26, 2025
@Dev10-34 Dev10-34 changed the title feat: Adding the option and feature to enable borders on heatmaps along with white borders on emphasis feat: Adding the option and feature to enable borders with color, opacity and width control on heatmaps along with white borders on emphasis Feb 26, 2025
…/controlPanel.tsx

	modified:   superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @Dev10-34. I left some suggestion to improve variable names.

@Dev10-34
Copy link
Author

I applied all the suggestions which you gave, however, upon re running there seems to be a bug sorta where even though the border width is set to 0 as default, on initial creation of the chart. If you move the border width slider, it fixes itself. Everything else works as intended functionally, just the visuals of the initial chart creation shows the borders as well, even if all the defaults are set correctly.
Giving borderWidth variable in transformProps.ts an initial value as 0 seems to fix this issue

Copy link
Contributor

@michael-s-molina Processing your ephemeral environment request here. Action: up.

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

Successfully merging this pull request may close these issues.

4 participants