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

fix(chart & heatmap): make to fix that y label is rendering out of bounds #20011

Merged
merged 1 commit into from
May 20, 2022

Conversation

prosdev0107
Copy link
Contributor

SUMMARY

[viz] heatmap Y axis labels rendering out-of-bounds

Description
Heatmap Y axis label rendering out-of-bounds, despite using auto for the LEFT MARGIN control.
This issue is happened when the Y axis value is number type and in case of that Y axis value is string type, Y axis label is rendering correctly in bounds. So I fixed this issue by increasing the pixel value per char in case of number type.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:

heatmap-out-bound.mov

AFTER:

fix-heatmap-outbounds.mov

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

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #20011 (288c262) into master (62e1c34) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #20011      +/-   ##
==========================================
- Coverage   66.28%   66.28%   -0.01%     
==========================================
  Files        1712     1712              
  Lines       63968    63969       +1     
  Branches     6731     6731              
==========================================
  Hits        42404    42404              
- Misses      19853    19854       +1     
  Partials     1711     1711              
Flag Coverage Δ
javascript 51.27% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...plugins/legacy-plugin-chart-heatmap/src/Heatmap.js 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62e1c34...288c262. Read the comment docs.

@@ -121,6 +121,7 @@ function Heatmap(element, props) {
let longestY = 1;

records.forEach(datum => {
if (typeof datum.y === 'number') pixelsPerCharY = 7;
Copy link
Contributor

Choose a reason for hiding this comment

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

can the user change the font size? Will it work in that case?
Please add a comment above explaining why this is adjusted like so

Copy link
Member

Choose a reason for hiding this comment

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

Soon, we may be dealing with different fonts, tool. Is this an issue with the ECharts library itself that we're just working around here? If so, I wonder if they've already addressed it in a newer version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The user can't change the font size of y label.
I think that this maybe the issue of legacy charts library itself.

Copy link
Member

Choose a reason for hiding this comment

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

Actually It is implemented using d3 and the implementation does not seem elegant. Let's migrate to echarts later.

Copy link
Member

Choose a reason for hiding this comment

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

We will later, but we need to get that prioritized on the roadmap... it'll be a while.

Copy link
Contributor

@diegomedina248 diegomedina248 left a comment

Choose a reason for hiding this comment

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

LGTM on my end.. @rusackas @stephenLYZ in your court if you want to deal with fonts now or punt it, since that's a larger discussion and this is a legacy plugin

@rusackas
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

@rusackas rusackas merged commit 56e9695 into apache:master May 20, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels Preset-Patch size/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants