Aleem89 commented on code in PR #45505:
URL: https://github.com/apache/superset/pull/45505#discussion_r4351503240
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts:
##########
@@ -3311,9 +3311,9 @@ describe('EchartsTimeseries tooltip truncation', () => {
expect(html).not.toContain(longSeriesName);
});
- test('preserves the echarts marker in every mode', () => {
+ test('keeps the series color marker in every mode', () => {
(['off', 'end', 'start', 'middle'] as const).forEach(mode => {
- expect(buildTooltip(mode)).toContain('background-color:#1f77b4');
+ expect(buildTooltip(mode).replace(/\s/g, '')).toContain('color:#1f77b4');
Review Comment:
Good catch, thanks. All three assertions now match on
`style="color:#1f77b4;`, which only `tooltipMarker` emits (3336be5).
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -1767,14 +1729,11 @@ export default function transformProps(
}
const seriesForKey = series.find(s => s.name === key);
const symbolForSeries = (seriesForKey as any)?.symbol || 'circle';
- const marker = value.color
- ? getSymbolMarker(symbolForSeries, value.color)
- : value.marker;
const row = formatForecastTooltipSeries({
...value,
seriesName: key,
formatter: getSeriesFormatter(key),
- marker,
+ marker: tooltipMarker(value.color, symbolForSeries),
Review Comment:
Done in 05241ca. `formatForecastTooltipSeries` now builds the marker from
`color` plus an optional `symbol`, so `marker` is gone from `ForecastValue`
along with the `echarts/types/src/util/format` import, and neither caller has
to override anything. Timeseries resolves symbols through a `Map<name, symbol>`
built once outside the formatter. The forecast unit tests pass `color` and
expect the real marker now.
--
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]