Skip to content

fix(GlChart): Upgrade to echarts 4.9.0

Miguel Rincon requested to merge mrincon-echarts-4.x-upgrade into main

What does this MR do?

echarts recently released version 5 with tree-shaking capabilities, this MR upgrades to a newer latest 4.x version before addressing breaking changes of version 5.

Why not 4.9.x? There are some differences in the positions of the labels between 4.3 and 4.6 that I would like to address in isolation, so I take a step-by-step approach. Also, this is the version that we are shipping with GitLab at the moment.

Why 4.9.x? All the differences we see in the charts have been present in version 4.6.0 which is the version that we actually ship with GitLab, meaning that the newer snapshots show more accuratly what we actually ship with GitLab.

$ yarn upgrade echarts@^4.9.0

See more: https://echarts.apache.org/en/changelog.html

But some many snapshots are different what gives?

echarts upgraded its dependency zrender, and their SVG engine which causes some labels to move slightly in our snapshots, this is because the newer version of zrender takes the font into account in the calculation. This is more obvious in the x-axis labels.

The good news is that this has no impact in the charts, I tested this by lining up the latest GitLab UI version and the version with the upgrade, some labels change slightly:

browser Tabs Switching Test
Chrome on Big Sur (no change!) chrome-big-sur
Firefox on Big Sur (big improvement 🎉) ff-big-sur
Edge on Windows windows-edge
Chrome on Windows chrome-windows

Does this MR meet the acceptance criteria?

Conformity

  • Code review guidelines.
  • GitLab UI's contributing guidelines.
  • [-] If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer.
  • [-] If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
  • If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui package can be upgraded quickly after the changes are released:
  • Added the ~"component:*" label(s) if applicable.

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • Security reports checked/validated by a reviewer from the AppSec team

Accessibility

If this MR adds or modifies a component, take a few moments to review the following:

  • All actions and functionality can be done with a keyboard.
  • Links, buttons, and controls have a visible focus state.
  • All content is presented in text or with a text equivalent. For example, alt text for SVG, or aria-label for icons that have meaning or perform actions.
  • Changes in a component’s state are announced by a screen reader. For example, changing aria-expanded="false" to aria-expanded="true" when an accordion is expanded.
  • Color combinations have sufficient contrast.
Edited by Lukas Eipert

Merge request reports

Loading