rlei-odes opened a new pull request, #43427:
URL: https://github.com/apache/superset/pull/43427

   ### SUMMARY
   
   `itemStyle.decal` is the ECharts property for a patterned fill — hatching,
   cross-hatching, dots — rather than a solid colour. It is the only member of
   `itemStyle` missing from `itemStyleSchema` in `eChartOptionsSchema.ts`, so 
it is
   stripped during validation while `color`, `borderColor`, `borderWidth`,
   `borderType`, `borderRadius`, the shadow properties and `opacity` all pass.
   
   That gap looks accidental. A decal is the same kind of value as its siblings 
— a
   static data structure, which is what the safe parser exists to permit — and 
it
   introduces no new type of input: `symbol` reuses the `symbolTypeSchema` 
string
   already accepted for series symbols and legend icons. The schema mirrors
   ECharts' `DecalObject` in full rather than a subset, in the same way
   `lineStyleSchema` does, so there is no arbitrary line to defend later.
   
   **What this does not do.** It does not make patterned fills usable. A decal 
is a
   per-series property, and per-series options cannot be reached through this
   control at all today: `mergeCustomEChartOptions` replaces arrays rather than
   merging them, so supplying `series` discards the computed series, and the
   replacement cannot carry its own data because `data` is deliberately not in
   `seriesSchema`. Closing the allowlist gap is one half of making a decal
   reachable; the merge behaviour is the other, and that is a larger question 
than
   this PR.
   
   So this is a small consistency fix rather than a feature. I am opening it
   because it is a one-property gap that costs nothing, and because I am working
   toward the other half — per-series visual treatments where the fill pattern
   carries meaning independently of colour, which is a common convention in
   business reporting. Background and the wider discussion:
   https://github.com/apache/superset/discussions/43426
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable — this widens what the options schema accepts and adds no
   control. Nothing renders differently unless a chart opts in through the
   existing *ECharts Options* control, which the testing instructions cover.
   
   ### TESTING INSTRUCTIONS
   
   Unit tests: `npm run test -- 
plugins/plugin-chart-echarts/src/utils/safeEChartOptionsParser`
   
   The unit tests are the verification here, because **a decal cannot currently 
be
   exercised end to end through the control**, for reasons unrelated to this
   change:
   
   - a decal is a per-series property, so reaching one means supplying `series`;
   - `mergeCustomEChartOptions` replaces arrays rather than merging them, so
     supplying `series` discards the computed series;
   - and the replacement cannot carry its own data, because `data` is not in
     `seriesSchema` — by design, since data comes from the query.
   
   So the option is accepted and merged, and nothing in Superset sets one yet.
   That is what makes this a prerequisite rather than a feature, and I would 
rather
   say so than dress up a demo.
   
   What is worth checking for regressions:
   
   1. Load an existing chart that already uses *Customize → ECharts Options*, 
with
      top-level keys such as `xAxis` / `yAxis`, and confirm it renders as 
before.
      Those merge as objects and are unaffected.
   2. Confirm validation still rejects a malformed decal —
      `{ series: { itemStyle: { decal: { rotation: 'sideways' } } } }` raises a
      validation error rather than being silently dropped — and that unknown 
keys
      inside a decal are still stripped. Both are covered by the new unit tests.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: 
https://github.com/apache/superset/discussions/43426
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to