Justin-ZS commented on PR #21613:
URL: https://github.com/apache/echarts/pull/21613#issuecomment-4600227354
Thanks for the fix. This does avoid the crash for `pieces: [{ lte: null }]`,
but I think it is fixing the symptom in `LineView` rather than the root cause
in `PiecewiseModel.getVisualMeta`.
A remaining problematic case is:
```js
visualMap: {
type: 'piecewise',
pieces: [{ lte: 10, color: 'red' }],
outOfRange: { color: 'blue' }
}
```
With the current PR, `visualMeta.stops` is still empty and only
`outerColors` is set. So line rendering falls back to a single color, losing
the finite boundary at `10`; the line should be red for `<= 10` and blue after
that.
Suggested direction:
- Fix `PiecewiseModel.getVisualMeta` so half-infinite intervals also emit
their finite edge into `stops`, e.g. `[{ value: 10, color: 'red' }, { value:
10, color: outOfRangeColor }]`.
- Keep a defensive empty-stop fallback in `LineView` for the true full-range
case like `[-Infinity, Infinity]`.
- If duplicate same-value stops are emitted, `LineView` should decide
whether to reverse colors from the axis direction, not from
`colorStops[0].coord > colorStops[last].coord`, because duplicate boundary
stops have the same coord.
This keeps the responsibility aligned: visualMap produces correct
`visualMeta`, and line only consumes it defensively.
--
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]