Skip to content

feat: DH-23610: update plotly.js to v4.1.1 - #2759

Merged
mofojed merged 7 commits into
deephaven:mainfrom
mofojed:DH-23610-plotly-v4
Oct 2, 2026
Merged

mofojed merged 7 commits into
deephaven:mainfrom
mofojed:DH-23610-plotly-v4

Conversation

@mofojed

@mofojed mofojed commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Update plotly.js 3.1.0 -> 4.1.1 and react-plotly.js ^2.6.0 -> ^4.1.0. Both
packages now ship their own types, so @types/plotly.js and
@types/react-plotly.js are dropped.

plotly.js v4 replaced the catch-all PlotData type with one interface per
trace type, so plotly/plotlyTypes.ts merges the trace types our partial
bundle registers back into a single PlotData. The untyped
plotly.js/lib/* subpaths and react-plotly.js/factory are declared
ambiently, which allows the @ts-ignore comments in plotly/Plotly.ts to
be removed.

These are just types breaking changes, there should be no
runtime breaking changes with the @deephaven/js-plugin-plotly-express
plugin. Ran all plotly-express e2e tests against this UI and they passed.

Bump .nvmrc to v24.20.0 for the npm version required to install.

BREAKING CHANGE: ChartModel.getData() now returns Partial<PlotData>[]
using the PlotData type exported from @deephaven/chart instead of
plotly's Partial<Data>[], and @deephaven/chart no longer depends on
@types/plotly.js. These are just types breaking changes, there should be no
runtime breaking changes with the @deephaven/js-plugin-plotly-express
plugin.

@mofojed
mofojed requested a balanced review from Copilot September 17, 2026 15:14
@mofojed mofojed self-assigned this Sep 17, 2026
@codecov

codecov Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 35.29412% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.97%. Comparing base (6be18b5) to head (888ad98).

Files with missing lines Patch % Lines
packages/chart/src/Chart.tsx 0.00% 5 Missing ⚠️
packages/chart/src/ChartUtils.ts 50.00% 4 Missing ⚠️
packages/chart/src/ChartModel.ts 0.00% 1 Missing ⚠️
packages/chart/src/MockChartModel.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2759      +/-   ##
==========================================
+ Coverage   52.84%   52.97%   +0.12%     
==========================================
  Files         816      816              
  Lines       47388    47388              
  Branches    12245    12433     +188     
==========================================
+ Hits        25044    25104      +60     
+ Misses      22324    22264      -60     
  Partials       20       20              
Flag Coverage Δ
unit 52.97% <35.29%> (+0.12%) ⬆️

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.

Copilot AI 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.

🟡 Changes recommended

Unresolved React and Node compatibility metadata issues remain, along with an unsupported indicator trace type.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Upgrades Plotly.js and React Plotly, adapting chart integration and typings for Plotly v4.

Changes:

  • Adds merged Plotly trace typings and ambient module declarations.
  • Updates chart models, utilities, and React integration.
  • Removes obsolete type packages and refreshes dependencies.
  • Updates the required Node.js version.
File summaries
File Summary Review notes
packages/chart/src/plotly/plotlyTypes.ts Defines merged trace types. IndicatorData is accepted but not registered in the runtime bundle.
packages/chart/src/plotly/Plotly.ts Updates partial bundle imports. No final comment.
packages/chart/src/plotly/plotly-extends.d.ts Declares Plotly submodules. No final comment.
packages/chart/src/plotly/createPlotlyComponent.ts Updates the factory import. No final comment.
packages/chart/src/MockChartModel.ts Adapts mock data types. No final comment.
packages/chart/src/index.ts Exports PlotData. No final comment.
packages/chart/src/FigureChartModel.ts Migrates model data types. No final comment.
packages/chart/src/ChartUtils.ts Updates Plotly utility typings. No final comment.
packages/chart/src/ChartModel.ts Updates the getData() contract. No final comment.
packages/chart/src/Chart.tsx Updates chart integration and state types. No final comment.
packages/chart/package.json Upgrades Plotly dependencies. React peer range and Node engine range are incompatible with the new dependencies.
package.json Removes obsolete type packages. No final comment.
package-lock.json Refreshes dependency resolutions. No final comment.
.nvmrc Updates the Node.js version. No final comment.
Review details

Suppressed comments (1)

packages/chart/src/plotly/plotlyTypes.ts:18

  • IndicatorData is included here, but the custom bundle in Plotly.ts never imports or registers the indicator module. Because plotly.js/lib/core.js pre-registers no trace modules, the exported PlotData type accepts indicator traces that this chart cannot render. Register the module or remove IndicatorData from this union so the documented supported-type list matches the runtime bundle.
  | IndicatorData
  • Files reviewed: 12/14 changed files
  • Comments generated: 2
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/chart/package.json
Comment thread packages/chart/package.json Outdated
Copilot AI review requested due to automatic review settings September 17, 2026 19:30

Copilot AI 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.

🟡 Changes recommended

Unresolved dependency metadata, published declaration, trace registration, and compatibility issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

packages/chart/package.json:46

  • This changes the published @deephaven/chart peer contract from React >=16.8.0 to only React 18/19, so React 16/17 consumers can no longer satisfy the package even though the previous contract allowed them. Please include this compatibility break in the PR's BREAKING CHANGE description; it currently documents only the getData() and type-package changes.
    "react": "^18.0.0 || ^19.0.0"

packages/chart/src/plotly/plotlyTypes.ts:18

  • SupportedTraceData is documented as the trace types registered by the partial bundle, but IndicatorData is included here while Plotly.ts never imports or registers plotly.js/lib/indicator.js. This lets consumers create a type-valid indicator trace that the bundled runtime cannot render; either register the module or remove this type from the supported union.
  | IndicatorData
  • Files reviewed: 12/14 changed files
  • Comments generated: 2
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment thread packages/chart/package.json
Comment thread packages/chart/src/plotly/plotlyTypes.ts
Copilot AI review requested due to automatic review settings September 18, 2026 13:46

Copilot AI 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.

🟡 Changes recommended

The public trace type advertises unsupported traces, and the breaking compatibility changes are incompletely documented.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

packages/chart/src/plotly/plotlyTypes.ts:52

  • The new public PlotData does not match the partial bundle it describes: SupportedTraceData includes IndicatorData even though Plotly.ts never registers the indicator module, and widening type to PlotType admits every other unregistered trace as well. Consumers can therefore construct data that type-checks against @deephaven/chart but fails when rendered by its exported partial Plot; narrow this API to the registered trace literals (or register every advertised trace), and keep arbitrary server input in a separate type.
  • Files reviewed: 18/20 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread packages/chart/package.json
Comment thread packages/chart/package.json
@mofojed mofojed changed the title feat: update plotly.js to v4.1.1 feat: DH-23610: update plotly.js to v4.1.1 Sep 21, 2026
mofojed and others added 5 commits September 25, 2026 13:12
Update plotly.js 3.1.0 -> 4.1.1 and react-plotly.js ^2.6.0 -> ^4.1.0. Both
packages now ship their own types, so @types/plotly.js and
@types/react-plotly.js are dropped.

plotly.js v4 replaced the catch-all `PlotData` type with one interface per
trace type, so `plotly/plotlyTypes.ts` merges the trace types our partial
bundle registers back into a single `PlotData`. The untyped
`plotly.js/lib/*` subpaths and `react-plotly.js/factory` are declared
ambiently, which allows the `@ts-ignore` comments in `plotly/Plotly.ts` to
be removed.

Bump .nvmrc to v24.20.0 for the npm version required to install.

BREAKING CHANGE: `ChartModel.getData()` now returns `Partial<PlotData>[]`
using the `PlotData` type exported from `@deephaven/chart` instead of
plotly's `Partial<Data>[]`, and `@deephaven/chart` no longer depends on
`@types/plotly.js`.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
plotly.js 4.1.1 declares `engines.node: >=22.0.0`, but `@deephaven/chart`
still claimed `>=16`, so the published metadata advertised support for a
range that cannot be installed under engine-strict.

Bump `@deephaven/chart` and every package that transitively depends on it
via `dependencies`: app-utils, console, dashboard-core-plugins, iris-grid,
plugin and pouch-storage. iris-grid, plugin and pouch-storage reach chart
through `@deephaven/console`. code-studio and embed-widget are also in the
closure but declare no engines field.

BREAKING CHANGE: these packages now declare `engines.node: >=22`. Node 16-21
consumers were already unable to install plotly.js v4 under engine-strict;
the metadata now reflects that.
Copilot AI review requested due to automatic review settings September 28, 2026 13:35

Copilot AI 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.

react-plotly.js v4 peers on `react: ^18.0.0 || ^19.0.0`, and
`@deephaven/chart` now declares the same range. Packages that depend on
chart still advertised `react >=16.8.0` (or an open-ended `>=18.0.0`),
which React 16/17 consumers could not satisfy through the nested peers.

Align `react` and `react-dom` peer ranges to `^18.0.0 || ^19.0.0` for
console, dashboard-core-plugins, app-utils, iris-grid and pouch-storage.
iris-grid and pouch-storage reach chart through `@deephaven/console`.

BREAKING CHANGE: `@deephaven/chart`, `@deephaven/console`,
`@deephaven/dashboard-core-plugins`, `@deephaven/app-utils`,
`@deephaven/iris-grid` and `@deephaven/pouch-storage` now require React 18
or 19 (`react`/`react-dom` `^18.0.0 || ^19.0.0`). React 16/17 consumers must
upgrade React before upgrading these packages.
Copilot AI review requested due to automatic review settings September 28, 2026 15:29

Copilot AI 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.

@mofojed
mofojed requested review from a team and vbabich and removed request for a team October 2, 2026 17:57
@mofojed
mofojed merged commit af8215a into deephaven:main Oct 2, 2026
11 checks passed
@mofojed
mofojed deleted the DH-23610-plotly-v4 branch October 2, 2026 20:47
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants