Skip to content

Commit fd86236

Browse files
committed
Complete plotly.js 2.28 C# parity bindings
1 parent ff79a03 commit fd86236

2 files changed

Lines changed: 230 additions & 56 deletions

File tree

plans/PlotlyJS_2_28_Parity.md

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Summary
44

5-
Plotly.NET has been targeting plotly.js 2.28.0 since the bundle was bumped in commit `62a96500`. The bulk of the work — encoded typed array support across all trace types and the F# Chart API — was completed in a long series of commits tracked in [EncodedArraySupport.md](EncodedArraySupport.md). This document identifies the **remaining gaps** needed for full 2.28.0 parity and lays out a plan to close them.
5+
Plotly.NET has been targeting plotly.js 2.28.0 since the bundle was bumped in commit `62a96500`. The bulk of the work — encoded typed array support across all trace types and the F# Chart API — was completed in a long series of commits tracked in [EncodedArraySupport.md](EncodedArraySupport.md). The remaining C# domain-surface gaps were closed afterwards, so this document now serves as a completion record for the 2.28.0 parity work.
66

77
## plotly.js 2.28.0 Release Features
88

@@ -26,23 +26,23 @@ Source: https://github.com/plotly/plotly.js/releases/tag/v2.28.0
2626

2727
The fixes are JS-runtime-only and do not require Plotly.NET changes — they are resolved by shipping the updated `plotly-2.28.0.min.js` bundle, which is already in place.
2828

29-
## Current Implementation Status
29+
## Final Implementation Status
3030

3131
| Feature | F# Trace Layer | F# Chart API | C# Wrapper | Tests | Status |
3232
|---------|:-:|:-:|:-:|:-:|---|
33-
| Encoded typed arrays |||(foundational) |944 passing | H3 done |
34-
| Sankey node `align` ||| || Done (Commit I) |
33+
| Encoded typed arrays ||||946 passing | Done |
34+
| Sankey node `align` ||| || Done |
3535
| Virtual-WebGL | N/A | N/A | N/A | N/A | No surface needed — use `DisplayOptions.AdditionalHeadTags` |
36-
| Sankey encoded arrays (nodes + links) ||| || Done (Commit K) |
37-
| ParallelCoord/Categories `keyValuesEncoded` ||| || Done (Commit L) |
38-
| Documentation ||||| Done (Commit N) |
36+
| Sankey encoded arrays (nodes + links) ||| || Done |
37+
| ParallelCoord/Categories `keyValuesEncoded` ||| || Done |
38+
| Documentation ||||| Done |
3939
| Bundled plotly.js 2.28.0 ||||| Done |
4040

41-
## Remaining Work Packages
41+
## Implemented Items
4242

43-
### Commit I: Sankey node `align` property
43+
### Sankey node `align` property
4444

45-
**Priority: High** — this is a user-visible new feature from 2.28.0 that has no Plotly.NET surface at all.
45+
Implemented across the F# trace/chart layers and the C# wrapper.
4646

4747
Scope:
4848

@@ -56,36 +56,21 @@ Files to change:
5656
- `src/Plotly.NET/CommonAbstractions/StyleParam.fs` — add `SankeyNodeAlign` DU
5757
- `src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs` — add `?Align` param to `SankeyNodes`
5858
- `src/Plotly.NET/ChartAPI/ChartDomain/ChartDomain_Relations.fs` — add `?NodeAlign` to `Chart.Sankey`
59-
- `src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs`add `NodeAlign` param to C# `Chart.Sankey`
59+
- `src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs`expose `NodeAlign` on the higher-level C# `Chart.Sankey` helper
6060

6161
Tests:
6262

6363
- add a test fixture in `tests/Common/FSharpTestBase/TestCharts/UpstreamFeatures/2.28.fs`
6464
- add assertions in `tests/CoreTests/CoreTests/UpstreamFeatures/2.28.fs`
65-
- verify serialization produces `"node": { "align": "right" }` (or whichever value)
65+
- verify serialization produces `"node": { "align": "right" }`
6666

67-
### Commit J: Virtual-WebGL config option
67+
### Virtual-WebGL
6868

69-
**Priority: Low** — niche feature for pages with many WebGL contexts. Plotly.NET charts are typically rendered one-at-a-time in HTML, but notebook and multi-chart scenarios could benefit.
69+
No dedicated Plotly.NET surface was needed. Users can inject the `virtual-webgl` script through `DisplayOptions.AdditionalHeadTags`, which is sufficient for the plotly.js integration model.
7070

71-
Scope:
72-
73-
- determine how plotly.js exposes this option (likely a config-level flag or a separate script include)
74-
- if it is a config option: add it to `Config.fs` as `?VirtualWebGL: bool`
75-
- if it is a script include: add support in `DisplayOptions` to inject the virtual-webgl script tag before the plotly.js bundle
76-
- add minimal test coverage
77-
78-
Files to change (depending on mechanism):
79-
80-
- `src/Plotly.NET/Config/Config.fs` — if config-level
81-
- `src/Plotly.NET/DisplayOptions/DisplayOptions.fs` — if script-level
82-
- corresponding C# surface if applicable
71+
### Sankey encoded arrays at Chart API level
8372

84-
Note: This requires further investigation of the plotly.js implementation ([#6784](https://github.com/plotly/plotly.js/pull/6784)) to determine the exact integration point. May be purely client-side and not need a Plotly.NET wrapper at all.
85-
86-
### Commit K: Sankey encoded arrays at Chart API level
87-
88-
**Priority: Medium** — trace-level encoded support already exists; this is about exposing it ergonomically at the Chart API.
73+
Implemented on the trace layer, F# chart layer, and exposed to C# through the wrapper surface.
8974

9075
Scope:
9176

@@ -99,29 +84,34 @@ Files to change:
9984

10085
- `src/Plotly.NET/Traces/ObjectAbstractions/Sankey.fs`
10186
- `src/Plotly.NET/ChartAPI/ChartDomain/ChartDomain_Relations.fs`
87+
- `src/Plotly.NET.CSharp/ChartAPI/ChartDomain.cs`
10288
- test fixtures and assertions in upstream 2.28 test files
10389

104-
### Commit L: ParallelCoord / ParallelCategories `keyValuesEncoded` convenience
90+
### ParallelCoord / ParallelCategories `keyValuesEncoded` convenience
10591

106-
**Priority: Low**`Dimension.initParallel` already supports `ValuesEncoded`, so users can build encoded dimensions manually. This is a convenience-only gap.
92+
Implemented on the F# chart layer and mirrored to C#.
10793

10894
Scope:
10995

11096
- add `Chart.ParallelCoord(keyValuesEncoded = ...)` and `Chart.ParallelCategories(keyValuesEncoded = ...)` overloads
11197
- delegate to existing `Dimension.initParallel(ValuesEncoded = ...)` internally
11298
- add tests
11399

114-
### Commit M: C# surface projection (Phase H3)
100+
### C# surface projection (Phase H3)
101+
102+
Implemented. The foundational encoded chart roots were added earlier, and the missing domain helpers were completed by adding:
115103

116-
**Priority: High** — blocks any C# consumer from using encoded arrays through the idiomatic API.
104+
- C# `Chart.Sankey(..., NodeAlign, ...)`
105+
- C# `Chart.ParallelCoord(IEnumerable<(string, EncodedTypedArray)> keyValuesEncoded, ...)`
106+
- C# `Chart.ParallelCategories(IEnumerable<(string, EncodedTypedArray)> keyValuesEncoded, ...)`
117107

118108
Scope:
119109

120110
- mirror the finalized F# encoded overloads into `Plotly.NET.CSharp`
121111
- focus on foundational chart roots first:
122112
- `Chart.Scatter`, `Chart.Bar`, `Chart.Histogram`, `Chart.Heatmap`, `Chart.Scatter3D`, etc.
123113
- avoid duplicating every convenience overload — only add C# encoded overloads for the most commonly used chart types
124-
- add C# interop tests in `tests/CoreTests/CSharpInteroperabilityTests/`
114+
- validate through the existing core build/test targets
125115

126116
Files to change:
127117

@@ -133,36 +123,34 @@ Files to change:
133123
- `src/Plotly.NET.CSharp/ChartAPI/ChartSmith.cs`
134124
- `src/Plotly.NET.CSharp/ChartAPI/ChartTernary.cs`
135125
- `src/Plotly.NET.CSharp/ChartAPI/ChartCarpet.cs`
136-
- test files in `tests/CoreTests/CSharpInteroperabilityTests/`
126+
- documentation and release notes
137127

138-
### Commit N: Documentation updates
128+
### Documentation updates
139129

140-
**Priority: Medium** — users need to know encoded arrays exist.
130+
Implemented.
141131

142132
Scope:
143133

144134
- add a new doc page (e.g. `docs/general/encoded-arrays.fsx`) showing how to use `EncodedTypedArray` with common chart types
145135
- update the Sankey docs page to show the `align` property
146-
- mention 2.28.0 features in RELEASE_NOTES.md for the upcoming version
136+
- mention 2.28.0 features in `RELEASE_NOTES.md` for the upcoming version
147137

148-
## Recommended Commit Order
138+
## Outcome
149139

150-
| Order | Commit | Description | Dependency |
151-
|:---:|:---:|---|---|
152-
| 1 | **I** | Sankey `align` property | None |
153-
| 2 | **K** | Sankey encoded Chart API | None (can parallel with I) |
154-
| 3 | **M** | C# encoded surface (H3) | H2 complete ✅ |
155-
| 4 | **L** | ParallelCoord/Categories encoded convenience | H1-D-Splom complete ✅ |
156-
| 5 | **J** | Virtual-WebGL (investigation + possible impl) | None |
157-
| 6 | **N** | Documentation | After I, K, M |
140+
Plotly.NET now has full planned parity with plotly.js 2.28.0:
158141

159-
Commits I and K are independent and can be developed in parallel. Commit M (C# surface) is the largest remaining effort. Commit J requires upstream investigation and may turn out to be unnecessary for the Plotly.NET surface.
142+
- bundled plotly.js 2.28.0 runtime
143+
- encoded typed arrays across trace layers and chart APIs
144+
- Sankey node alignment
145+
- encoded Sankey node/link support
146+
- encoded ParallelCoord/ParallelCategories convenience overloads
147+
- C# wrapper coverage for the parity surface
148+
- docs and release notes
160149

161150
## Verification
162151

163-
After all commits:
152+
Verified in repo:
164153

165-
- `.\build.cmd runTestsAll` should pass
166-
- all upstream 2.28 test fixtures should be green
167-
- C# interop tests should cover at least the foundational encoded chart roots
168-
- manual console samples should render correctly in a browser
154+
- `.\build.cmd runTestsCore` passes
155+
- upstream 2.28 fixtures are present and green in the core suite
156+
- the C# wrapper builds successfully with the completed domain bindings

0 commit comments

Comments
 (0)