Skip to content

fix: Include trace-contributed layout attributes in generated types - #8020

Merged
camdecoster merged 4 commits into
mainfrom
cam/8018/include-trace-layout-attributes
Sep 4, 2026
Merged

fix: Include trace-contributed layout attributes in generated types#8020
camdecoster merged 4 commits into
mainfrom
cam/8018/include-trace-layout-attributes

Conversation

@camdecoster

@camdecoster camdecoster commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

@camdecoster
camdecoster marked this pull request as ready for review September 4, 2026 20:01
@KoolADE85 KoolADE85 self-assigned this Sep 4, 2026

@KoolADE85 KoolADE85 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nicely done! 💃

@camdecoster
camdecoster merged commit fe6422f into main Sep 4, 2026
86 checks passed
@camdecoster
camdecoster deleted the cam/8018/include-trace-layout-attributes branch September 4, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Layout type is missing all trace-contributed layout attributes in v4.0.0 (barmode, boxmode, scattermode, …)

2 participants