EnxDev commented on code in PR #45223:
URL: https://github.com/apache/superset/pull/45223#discussion_r4263638264
##########
superset-frontend/plugins/plugin-chart-echarts/src/Bubble/EchartsBubble.tsx:
##########
@@ -16,9 +16,71 @@
* specific language governing permissions and limitations
* under the License.
*/
+import { useMemo } from 'react';
+import {
+ ContextMenuFilters,
+ DataRecordValue,
+ getColumnLabel,
+ getNumberFormatter,
+ getTimeFormatter,
+ QueryFormColumn,
+ QueryObjectFilterClause,
+} from '@superset-ui/core';
import { BubbleChartTransformedProps } from './types';
import Echart from '../components/Echart';
+import { EventHandlers } from '../types';
import { useLegendEventHandlers } from '../utils/legendEventHandlers';
+import { formatSeriesName } from '../utils/series';
+import {
+ BubbleDatum,
+ ENTITY_INDEX,
+ getBubbleCrossFilterDataMask,
+ getSelectedBubbleKeys,
+ isBubbleDatum,
+ SERIES_INDEX,
+ toJsonSafeFilterValue,
+} from './crossFilter';
+
+const noop = () => {};
+
+type BubbleEvent = {
+ componentType?: string;
+ data?: unknown;
+ event?: { stop: () => void; event: PointerEvent };
+};
+
+function buildDrillFilters(
+ entity: QueryFormColumn,
+ series: QueryFormColumn | undefined,
+ datum: BubbleDatum,
+ dateFormat: string | undefined,
+ coltypeMapping: BubbleChartTransformedProps['coltypeMapping'],
+): QueryObjectFilterClause[] {
+ const columns: Array<{ col: QueryFormColumn; value: DataRecordValue }> = [
+ { col: entity, value: datum[ENTITY_INDEX] },
+ ];
+ if (series) {
+ columns.push({ col: series, value: datum[SERIES_INDEX] });
+ }
+ const timeFormatter = getTimeFormatter(dateFormat);
+ const numberFormatter = getNumberFormatter();
Review Comment:
Nit, take it or leave it. The drill filters still go through the smart
formatter here, so a numeric entity reads `Drill to detail by 12.3k` in the
context menu.
That's what the other ECharts charts do with a default number format, so
it's fine to leave. Dropping `numberFormatter` here too would just keep it in
line with the chip.
--
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]