Skip to content

feat(a11y): enable ECharts aria-label - #28171

Merged
rusackas merged 3 commits into
apache:masterfrom
frassinier:patch-1
Aug 8, 2026
Merged

rusackas merged 3 commits into
apache:masterfrom
frassinier:patch-1

Conversation

@frassinier

@frassinier frassinier commented Apr 22, 2024 •

Copy link
Copy Markdown
Contributor

SUMMARY

Increasing accessibility support in Apache/Superset through enhanced a11y features, such as generating aria-label with Echarts, is crucial for ensuring inclusivity and usability for all users, including those with disabilities.

By adhering to WCAG guidelines and making adjustments to colors and patterns as required, we not only enhance the user experience for individuals with disabilities but also align with standards for accessibility, promoting a more inclusive and equitable platform for all users.

        aria: {
          enabled: true,
          decal: {
            show: true,
          },
        },

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

@frassinier frassinier changed the title feat(a11y): enable aria description for echarts feat(a11y): enable ECharts aria-label Apr 22, 2024
@frassinier frassinier changed the title feat(a11y): enable ECharts aria-label feat(a11y): enable Echarts aria-label Apr 22, 2024
@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Apr 22, 2024
@john-bodley john-bodley changed the title feat(a11y): enable Echarts aria-label feat(a11y): enable ECharts aria-label Apr 22, 2024
@rusackas

Copy link
Copy Markdown
Member

I'm not sure we want to turn on the patterns by default. A lot of people don't want/need them, and this provides no option to disable them. We could, of course, add a chart control, but I don't think that's much better. I think the right approach might be to wait until we have this SIP in effect, so a user can choose to apply this across the board for charts/dashboards they view/edit/create.

@frassinier

frassinier commented Apr 22, 2024 •

Copy link
Copy Markdown
Contributor Author

@rusackas, I agree! but what do you think of just adding the automated aria-label, maybe under a feature flag?

@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Jun 4, 2024
@rusackas

Copy link
Copy Markdown
Member

Sorry this slid under the radar. I think we're all for aria-label additions, and we can review the idea of the patterns when we have the User Preferences feature (currently in SIP process). This needs a rebase, if you don't mind doing so... hopefully we can get it across the finish line!

@frassinier

Copy link
Copy Markdown
Contributor Author

@rusackas, all set!

@rusackas

Copy link
Copy Markdown
Member

I think for now, whilst we await the User Preference SIP, we should just add this as a config flag so admins can turn it on and off. Would love to get this merged if we can do so :)

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #a6ac45

Actionable Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx - 1
Review Details
  • Files reviewed - 1 · Commit Range: 4914b99..2f31970
    • superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +202 to +210
chartRef.current.setOption(
{
aria: {
enabled: true,
},
...echartOptions,
},
true,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aria configuration misplaced

The aria configuration is placed in a separate setOption call that gets overridden by the subsequent themed setOption during normal rendering (when not refreshing), preventing aria from being enabled. Move the aria setting into the base theme to ensure it's included in the final options.

Code suggestion
Check the AI-generated fix before applying
 --- superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
 +++ superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
 @@ -190,15 +190,6 @@
        Object.entries(zrEventHandlers || {}).forEach(([name, handler]) => {
          chartRef.current?.getZr().off(name);
          chartRef.current?.getZr().on(name, handler);
        });
 -
 -      chartRef.current.setOption(
 -        {
 -          aria: {
 -            enabled: true,
 -          },
 -          ...echartOptions,
 -        },
 -        true,
 -      );
        const getEchartsTheme = (options: any) => {
          const antdTheme = theme;
          const echartsTheme = {
 @@ -212,6 +203,9 @@
            axisPointer: {
              lineStyle: { color: antdTheme.colorPrimary },
              label: { color: antdTheme.colorText },
            },
 +          aria: {
 +            enabled: true,
 +          },
          } as any;
          if (options?.xAxis) {
            echartsTheme.xAxis = {
 @@ -276,7 +270,7 @@
        const themedEchartOptions = mergeEchartsThemeOverrides(
          baseTheme,
          echartOptions,
 -        globalOverrides,
 +        globalOverrides,
          chartOverrides,
          animationOverride,
        );
 @@ -288,4 +282,4 @@
        chartRef.current?.setOption(themedEchartOptions, {
          notMerge,
          replaceMerge: notMerge ? undefined : ['series'],
 -        lazyUpdate: isDashboardRefreshing,
 +        lazyUpdate: isDashboardRefreshing,
        });
      }
    }, [didMount, echartOptions, eventHandlers, zrEventHandlers, theme, vizType]);

Code Review Run #a6ac45


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@rusackas

Copy link
Copy Markdown
Member

Thanks for the patience @frassinier, we're still excited for this one. As mentioned, let's put it behind a config flag so admins can opt in while we wait on the User Preferences SIP. Then I think we can get it across the line. I'll see about helping CI along a bit in the meantime.

@rusackas

Copy link
Copy Markdown
Member

I'll see if I can help CI along here for now...

@rusackas

Copy link
Copy Markdown
Member

Rebased this onto current master. Heads up, the setOption block your change lived in got refactored away, so I moved aria: { enabled: true } into the new theme-merge pipeline as a base default. Same effect, just lives elsewhere now, mind giving it a sanity check? Thanks!

@netlify

netlify Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 52ad75f
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a76157f017d080008d7756f
😎 Deploy Preview https://deploy-preview-28171--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.42%. Comparing base (38ba4a6) to head (52ad75f).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #28171      +/-   ##
==========================================
+ Coverage   57.10%   66.42%   +9.31%     
==========================================
  Files        2857     2727     -130     
  Lines      161125   150948   -10177     
  Branches    37060    35654    -1406     
==========================================
+ Hits        92014   100263    +8249     
+ Misses      68259    48970   -19289     
- Partials      852     1715     +863     
Flag Coverage Δ
javascript 73.19% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review

bito-code-review Bot commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #30d26f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 3273ddb..3273ddb
    • superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

rusackas commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

@frassinier if the diff look OK to you as it is now, I'm happy with the theme-driven approach. My only thing is I think we should default to "off" then anyone can customize their theme to enable it.

Per review discussion, keep this opt-in via theme overrides until the
User Preferences SIP lands, rather than changing default behavior for
all deployments.
@bito-code-review

bito-code-review Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #1a4da9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 3273ddb..a003cb6
    • superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Default-off change looks right, and it's opt-in via theme override until the User Preferences work lands. CI's green (those cypress/npm failures were the same infra flake going around today, cleared on rerun). Thanks for staying with this one, @frassinier.

@rusackas rusackas added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Aug 6, 2026
@rusackas
rusackas merged commit d14ab29 into apache:master Aug 8, 2026
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-if-green If approved and tests are green, please go ahead and merge it for me plugins size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants