Skip to content

Add histogram series support - #48

Merged
Federicocervelli merged 3 commits into
developmentfrom
feature/histogram-support
May 28, 2026
Merged

Add histogram series support#48
Federicocervelli merged 3 commits into
developmentfrom
feature/histogram-support

Conversation

@Federicocervelli

Copy link
Copy Markdown
Owner

Summary

  • add pure histogram binning helpers and HistogramDataset interval metadata
  • add Chart.addHistogram and declarative createChart histogram series
  • add docs, website example, unit tests, and visual-test coverage

Validation

  • bun run typecheck
  • bun test
  • bun run docs:readme
  • bun run test:generated-docs
  • bun run test:docs-snippets
  • bun run pages:build
  • bun run test:visual -- --cases histogram
  • bun run test:exports
  • bun run test:package
  • bun run test:bundle-size

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec09318497

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/createChart.ts

if (autoFit) {
chart.fitToData(typeof autoFit === "object" ? autoFit : undefined);
chart.fitToData(typeof autoFit === "object" ? autoFit : hasHistogram ? { includeZero: true } : undefined);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Limit histogram zero-baseline fit to histogram axis

createChart(...) now forces fitToData({ includeZero: true }) whenever any histogram series is present, but includeZero is applied to both Y axes inside Chart.fitToData. In mixed-axis charts (e.g., histogram on left axis plus a right-axis series with values far from zero), the right axis is unnecessarily expanded to include 0, which can severely compress the non-histogram data and distort the default first render. This regression is triggered by default autoFit: true and should be scoped to histogram series/axis only (or left to explicit user opt-in).

Useful? React with 👍 / 👎.

@Federicocervelli
Federicocervelli merged commit 358241f into development May 28, 2026
1 check failed
@Federicocervelli
Federicocervelli deleted the feature/histogram-support branch May 28, 2026 18:30
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.

1 participant