GeezerVison is showing github.com — fix: Include trace-contributed layout attributes in generated types by camdecoster · Pull Request #8020 · plotly/plotly.js
Conversation
camdecoster
commented
Sep 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Description
Update type generator to include trace-contributed layout attributes.
Closes #8018.
Changes
- Update generator script
- Update types
- Update docs
Testing
- Be on main
- Save the following in the project root:
import type { Layout, PolarLayout } from './src/types/index';
declare const l: Layout;
declare const p: PolarLayout;
l.barmode = 'relative'; l.barnorm = 'fraction'; l.bargap = 0.1;
l.boxmode = 'group'; l.violinmode = 'overlay'; l.funnelmode = 'stack';
l.waterfallmode = 'group'; l.scattermode = 'group'; l.hiddenlabels = ['a'];
l.piecolorway = ['red']; l.sunburstcolorway = ['red']; l.treemapcolorway = ['red'];
l.iciclecolorway = ['red']; l.funnelareacolorway = ['red']; l.extendpiecolors = true;
p.barmode = 'overlay'; p.bargap = 0.3;
l.polar2 = { barmode: 'stack' };
// @ts-expect-error barpolar supports only stack/overlay
p.barmode = 'relative';
// @ts-expect-error enum still rejects bad values
l.barmode = 'nonsense';
// @ts-expect-error unknown keys still rejected
l.notAReal = 1;
- Run the following command:
npx tsc --noEmit --ignoreConfig --strict --skipLibCheck --moduleResolution bundler --module esnext --target es2020 ./temp.ts
- Note that the result is an error
- Switch to this branch
- Run the command again
- Note that no error occurs
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.