Skip to content

fix(types): allow scriptable and indexed grid tick widths - #12321

Open
jakezwang wants to merge 1 commit into
chartjs:masterfrom
jakezwang:fix/scriptable-grid-tick-width
Open

jakezwang wants to merge 1 commit into
chartjs:masterfrom
jakezwang:fix/scriptable-grid-tick-width

Conversation

@jakezwang

Copy link
Copy Markdown

Fixes #12320.

grid.tickWidth already supports scriptable and indexable values at runtime and in the axis styling documentation, but GridLineOptions only accepts a number. Use ScriptableAndArray<number, ScriptableScaleContext>, matching the neighboring lineWidth declaration.

The type regression covers a callback in Partial<GridLineOptions>, an inferred callback in a chart configuration, an array of widths, and a scalar width. The first three cases fail type checking before this change.

Validation: pnpm@8.13.0 lint-types (build, declaration generation, and full type suite passed); ESLint on the changed files; git diff --check. Runtime code is unchanged.

AI assistance: implementation, test, and this description were prepared with OpenAI Codex.

Signed-off-by: Jake Wang <jakezwang@users.noreply.github.com>
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.

Minor type definition issue with tickWidth in index.d.ts - should be Scriptable<number, ScriptableScaleContext>

1 participant