SBIN2010 commented on code in PR #45397:
URL: https://github.com/apache/superset/pull/45397#discussion_r4405728014


##########
superset-frontend/plugins/plugin-chart-echarts/test/Histogram/transformProps.test.ts:
##########
@@ -108,5 +109,43 @@ test('does not treat adhoc groupby labels as histogram bin 
edges', () => {
   expect(xAxis.data).toHaveLength(2);
   expect(xAxis.data.every(label => !label.includes('NaN'))).toBe(true);
   expect(series[0].name).toBe('WEST');
-  expect(series[0].data).toEqual([3, 7]);
+  expect(series[0].data).toEqual([{ value: 3 }, { value: 7 }]);
+});
+
+test('dims bars outside the selected bin and uses a pointer cursor', () => {
+  const props = new ChartProps({
+    formData,
+    width: 800,
+    height: 600,
+    queriesData: [{ data: [{ '0 - 5': 3, '5 - 10': 7 }] }],
+    theme: supersetTheme,
+    filterState: {
+      selectedValues: [getHistogramCrossFilterKey({ start: 0, end: 5 }, [])],
+    },
+    emitCrossFilters: true,
+  });
+  const { series } = readChart(props);
+  const points = series[0].data as {
+    value: number;
+    itemStyle?: { opacity?: number };
+  }[];
+
+  expect(points[0].itemStyle?.opacity).toBeUndefined();
+  expect(points[1].itemStyle?.opacity).toBe(0.3);

Review Comment:
   The test now verifies that selecting bin 0–5 on the WEST side dims the 
corresponding bin on the EAST side, while leaving its own column bright.



-- 
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