Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

UXW-5117 Fix Timeline event pills displayed on a wrong date when merged (#80567)

Denis Berezin7692d3f47984
diff --git a/.loki/reference/chrome_laptop_viz_TimelineEventsBand_Clusters.png b/.loki/reference/chrome_laptop_viz_TimelineEventsBand_Clusters.png
new file mode 100644
index 00000000000..2562420c324
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_TimelineEventsBand_Clusters.png differ
diff --git a/.loki/reference/chrome_laptop_viz_TimelineEventsBand_Expanded_Stack.png b/.loki/reference/chrome_laptop_viz_TimelineEventsBand_Expanded_Stack.png
new file mode 100644
index 00000000000..8a2f9967f3b
Binary files /dev/null and b/.loki/reference/chrome_laptop_viz_TimelineEventsBand_Expanded_Stack.png differ
diff --git a/e2e/test/scenarios/organization/timelines-question.cy.spec.js b/e2e/test/scenarios/organization/timelines-question.cy.spec.js
index e693f1826d5..6fc6ecd28d0 100644
--- a/e2e/test/scenarios/organization/timelines-question.cy.spec.js
+++ b/e2e/test/scenarios/organization/timelines-question.cy.spec.js
@@ -514,6 +514,78 @@ describe("scenarios > organization > timelines > question", () => {
.should("be.visible");
});
+ it("should stack close events from different data points and spread the stack on hover", () => {
+ H.createTimelineWithEvents({
+ timeline: { name: "Releases" },
+ events: [
+ {
+ name: "Jan release",
+ timestamp: "2027-01-30T00:00:00Z",
+ icon: "star",
+ },
+ {
+ name: "Feb fix",
+ timestamp: "2027-02-02T00:00:00Z",
+ icon: "warning",
+ },
+ {
+ name: "Summer party",
+ timestamp: "2028-07-04T00:00:00Z",
+ icon: "cake",
+ },
+ ],
+ });
+
+ H.visitQuestionAdhoc({
+ dataset_query: {
+ type: "query",
+ query: {
+ "source-table": ORDERS_ID,
+ aggregation: [["count"]],
+ breakout: [
+ ["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }],
+ ],
+ },
+ database: SAMPLE_DB_ID,
+ },
+ display: "line",
+ });
+
+ cy.log("adjacent-month events collapse into an overlapped stack");
+ cy.findByTestId("timeline-event-stack").should(
+ "have.attr",
+ "data-expanded",
+ "false",
+ );
+ H.timelineEventChip("Summer party").should("be.visible");
+
+ cy.log("hovering the stack spreads it and hides unrelated chips");
+ H.timelineEventChip("Feb fix").realHover({ position: "right" });
+ cy.findByTestId("timeline-event-stack").should(
+ "have.attr",
+ "data-expanded",
+ "true",
+ );
+ H.timelineEventChip("Summer party").should("not.be.visible");
+ H.timelineEventMarkerLine().should("exist");
+
+ cy.log("a spread member behaves like a regular chip");
+ H.timelineEventChip("Jan release").realHover();
+ cy.findByTestId("timeline-event-popover")
+ .findByText("Jan release")
+ .should("be.visible");
+ H.timelineEventMarkerLine().should("exist");
+
+ cy.log("moving away collapses the stack and restores other chips");
+ cy.findByTestId("qb-header").realHover();
+ cy.findByTestId("timeline-event-stack").should(
+ "have.attr",
+ "data-expanded",
+ "false",
+ );
+ H.timelineEventChip("Summer party").should("be.visible");
+ });
+
it("should collapse close events into a count chip and focus the sidebar on the group from 'See all'", () => {
H.createTimelineWithEvents({
timeline: { name: "Releases" },
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/option/index.ts b/frontend/src/metabase/visualizations/echarts/cartesian/option/index.ts
index b15a098fed1..dbc5b245001 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/option/index.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/option/index.ts
@@ -188,9 +188,8 @@ export function buildGridAndSeriesOption(
const timelineEventsSeries = getTimelineSelectionSeries(
timelineEventsModel,
selectedTimelineEventIds,
+ chartModel,
chartLayout,
- panelCount,
- isSplitPanels,
renderingContext,
);
@@ -317,18 +316,22 @@ export const getCartesianChartOption = (
};
};
-function getTimelineSelectionSeries(
+export function getTimelineSelectionSeries(
timelineEventsModel: TimelineEventsModel | null,
selectedTimelineEventIds: TimelineEventId[],
+ chartModel: BaseCartesianChartModel,
chartLayout: ChartLayout,
- panelCount: number,
- isSplitPanels: boolean,
renderingContext: RenderingContext,
): EChartsSeriesOption | null {
if (timelineEventsModel == null) {
return null;
}
+ const panelCount = chartModel.seriesModels.filter(
+ (series) => series.visible,
+ ).length;
+ const isSplitPanels = chartLayout.panelHeight != null;
+
const splitPanelYExtent = isSplitPanels
? getSplitPanelTimelineEventsYExtent(chartLayout, panelCount)
: undefined;
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.ts b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.ts
index c02fe1a40d0..0caa02470cb 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.ts
@@ -8,7 +8,10 @@ import type {
DateRange,
TimeSeriesInterval,
} from "metabase/visualizations/echarts/cartesian/model/types";
-import type { TimelineEventGroup } from "metabase/visualizations/echarts/cartesian/timeline-events/types";
+import type {
+ TimelineEventCluster,
+ TimelineEventGroup,
+} from "metabase/visualizations/echarts/cartesian/timeline-events/types";
import type { TimelineEvent } from "metabase-types/api";
import type { ChartLayout } from "../layout/types";
@@ -55,47 +58,41 @@ const groupEventsByUnitStart = (
}));
};
-export const mergeOverlappingTimelineEventGroups = (
+export const buildTimelineEventClusters = (
eventGroups: TimelineEventGroup[],
interval: TimeSeriesInterval,
intervalWidth: number,
-): TimelineEventGroup[] => {
+): TimelineEventCluster[] => {
const sortedGroups = [...eventGroups].sort((a, b) =>
dayjs.utc(a.date).isAfter(dayjs.utc(b.date)) ? 1 : -1,
);
- const mergedGroups: TimelineEventGroup[] = [];
-
- sortedGroups.forEach((currentGroup) => {
- if (mergedGroups.length === 0) {
- mergedGroups.push(currentGroup);
- return;
- }
-
- const lastGroup = _.last(mergedGroups);
- if (!lastGroup) {
- return;
+ const clusters: TimelineEventCluster[] = [];
+
+ sortedGroups.forEach((group) => {
+ const lastCluster = _.last(clusters);
+
+ if (lastCluster != null) {
+ const lastGroupDate =
+ lastCluster.groups[lastCluster.groups.length - 1].date;
+ const intervalsDiff =
+ dayjs.utc(group.date).diff(dayjs.utc(lastGroupDate), interval.unit) /
+ interval.count;
+ const pixelDiff = intervalsDiff * intervalWidth;
+
+ if (pixelDiff < CHART_STYLE.timelineEvents.minDistance) {
+ clusters[clusters.length - 1] = {
+ date: lastCluster.date,
+ groups: [...lastCluster.groups, group],
+ };
+ return;
+ }
}
- const lastGroupDate = dayjs.utc(lastGroup.date);
- const currentGroupDate = dayjs.utc(currentGroup.date);
-
- const intervalsDiff =
- currentGroupDate.diff(lastGroupDate, interval.unit) / interval.count;
- const pixelDiff = intervalsDiff * intervalWidth;
-
- if (pixelDiff < CHART_STYLE.timelineEvents.minDistance) {
- const combinedEvents = [...lastGroup.events, ...currentGroup.events];
- mergedGroups[mergedGroups.length - 1] = {
- date: lastGroup.date,
- events: combinedEvents,
- };
- } else {
- mergedGroups.push(currentGroup);
- }
+ clusters.push({ date: group.date, groups: [group] });
});
- return mergedGroups;
+ return clusters;
};
const getTimelineEventsInsideRange = (
@@ -145,7 +142,7 @@ export const getTimelineEventsModel = (
chartModel.xAxisModel.interval,
chartLayout,
);
- return mergeOverlappingTimelineEventGroups(
+ return buildTimelineEventClusters(
timelineEventsByUnitStart,
chartModel.xAxisModel.interval,
intervalWidth,
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.unit.spec.ts b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.unit.spec.ts
index 25314378a43..bf615d25874 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.unit.spec.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/model.unit.spec.ts
@@ -1,7 +1,7 @@
import type { TimeSeriesInterval } from "metabase/visualizations/echarts/cartesian/model/types";
import { createMockTimelineEvent } from "metabase-types/api/mocks";
-import { mergeOverlappingTimelineEventGroups } from "./model";
+import { buildTimelineEventClusters } from "./model";
import type { TimelineEventGroup } from "./types";
const createMockTimelineEventGroup = (
@@ -20,8 +20,8 @@ const createMockTimeSeriesInterval = (
...opts,
});
-describe("mergeOverlappingTimelineEventGroups", () => {
- it("should not merge events that are far apart", () => {
+describe("buildTimelineEventClusters", () => {
+ it("should keep groups that are far apart as separate clusters", () => {
const eventGroups: TimelineEventGroup[] = [
createMockTimelineEventGroup({
date: "2024-01-01T00:00:00Z",
@@ -36,18 +36,18 @@ describe("mergeOverlappingTimelineEventGroups", () => {
const interval = createMockTimeSeriesInterval({ count: 1, unit: "day" });
const intervalWidth = 80; // 800px / 10 days
- const result = mergeOverlappingTimelineEventGroups(
+ const result = buildTimelineEventClusters(
eventGroups,
interval,
intervalWidth,
);
expect(result).toHaveLength(2);
- expect(result[0].events).toEqual(eventGroups[0].events);
- expect(result[1].events).toEqual(eventGroups[1].events);
+ expect(result[0].groups).toEqual([eventGroups[0]]);
+ expect(result[1].groups).toEqual([eventGroups[1]]);
});
- it("should merge events that are close together", () => {
+ it("should cluster groups that are close together, preserving member groups", () => {
const eventGroups: TimelineEventGroup[] = [
createMockTimelineEventGroup({
date: "2024-01-01T00:00:00Z",
@@ -62,20 +62,18 @@ describe("mergeOverlappingTimelineEventGroups", () => {
const interval = createMockTimeSeriesInterval({ count: 1, unit: "minute" });
const intervalWidth = 100; // 100px per minute
- const result = mergeOverlappingTimelineEventGroups(
+ const result = buildTimelineEventClusters(
eventGroups,
interval,
intervalWidth,
);
expect(result).toHaveLength(1);
- expect(result[0].events).toEqual([
- ...eventGroups[0].events,
- ...eventGroups[1].events,
- ]);
+ expect(result[0].date).toBe(eventGroups[0].date);
+ expect(result[0].groups).toEqual(eventGroups);
});
- it("should merge chips that would overlap given the wider chip width", () => {
+ it("should cluster chips that would overlap given the chip width", () => {
const eventGroups: TimelineEventGroup[] = [
createMockTimelineEventGroup({
date: "2024-01-01T00:00:00Z",
@@ -89,23 +87,20 @@ describe("mergeOverlappingTimelineEventGroups", () => {
const interval = createMockTimeSeriesInterval({ count: 1, unit: "minute" });
// 25px apart: wider than the old 16px threshold but still under a chip
- // width, so the fixed-width chips would overlap and must merge.
+ // width, so the fixed-width chips would overlap and must cluster.
const intervalWidth = 50; // 0.5 min * 50px = 25px
- const result = mergeOverlappingTimelineEventGroups(
+ const result = buildTimelineEventClusters(
eventGroups,
interval,
intervalWidth,
);
expect(result).toHaveLength(1);
- expect(result[0].events).toEqual([
- ...eventGroups[0].events,
- ...eventGroups[1].events,
- ]);
+ expect(result[0].groups).toEqual(eventGroups);
});
- it("should correctly merge events when interval count is greater than 1", () => {
+ it("should correctly cluster groups when interval count is greater than 1", () => {
const eventGroups: TimelineEventGroup[] = [
createMockTimelineEventGroup({
date: "2024-01-01T00:00:00Z",
@@ -124,17 +119,73 @@ describe("mergeOverlappingTimelineEventGroups", () => {
const interval = createMockTimeSeriesInterval({ count: 5, unit: "minute" });
const intervalWidth = 13; // 13px per 5-minute interval
- const result = mergeOverlappingTimelineEventGroups(
+ const result = buildTimelineEventClusters(
eventGroups,
interval,
intervalWidth,
);
expect(result).toHaveLength(2);
- expect(result[0].events).toEqual([
- ...eventGroups[0].events,
- ...eventGroups[1].events,
+ expect(result[0].groups).toEqual([eventGroups[0], eventGroups[1]]);
+ expect(result[1].groups).toEqual([eventGroups[2]]);
+ });
+
+ it("should fold a continuous run into one cluster even when it spans more than minDistance from the anchor", () => {
+ const eventGroups: TimelineEventGroup[] = [
+ createMockTimelineEventGroup({
+ date: "2024-01-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 1 })],
+ }),
+ createMockTimelineEventGroup({
+ date: "2024-01-02T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 2 })],
+ }),
+ createMockTimelineEventGroup({
+ date: "2024-01-03T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 3 })],
+ }),
+ ];
+
+ const interval = createMockTimeSeriesInterval({ count: 1, unit: "day" });
+ // each step is 20px < minDistance, but the full run spans 40px
+ const intervalWidth = 20;
+
+ const result = buildTimelineEventClusters(
+ eventGroups,
+ interval,
+ intervalWidth,
+ );
+
+ expect(result).toHaveLength(1);
+ expect(result[0].groups).toEqual(eventGroups);
+ });
+
+ it("should anchor a cluster at its earliest group's date", () => {
+ const eventGroups: TimelineEventGroup[] = [
+ createMockTimelineEventGroup({
+ date: "2024-01-03T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 2 })],
+ }),
+ createMockTimelineEventGroup({
+ date: "2024-01-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 1 })],
+ }),
+ ];
+
+ const interval = createMockTimeSeriesInterval({ count: 1, unit: "day" });
+ const intervalWidth = 10; // 2 days apart = 20px < minDistance
+
+ const result = buildTimelineEventClusters(
+ eventGroups,
+ interval,
+ intervalWidth,
+ );
+
+ expect(result).toHaveLength(1);
+ expect(result[0].date).toBe("2024-01-01T00:00:00Z");
+ expect(result[0].groups.map(({ date }) => date)).toEqual([
+ "2024-01-01T00:00:00Z",
+ "2024-01-03T00:00:00Z",
]);
- expect(result[1].events).toEqual(eventGroups[2].events);
});
});
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.ts b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.ts
index 321eca547b1..11c35b92a39 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.ts
@@ -8,6 +8,13 @@ import type { TimelineEventId } from "metabase-types/api";
export const TIMELINE_EVENT_SELECTION_SERIES_ID = "timeline-event-selection";
+export const EMPTY_TIMELINE_SELECTION_SERIES: LineSeriesOption = {
+ id: TIMELINE_EVENT_SELECTION_SERIES_ID,
+ type: "line",
+ data: [],
+ markLine: { data: [] },
+};
+
export interface SplitPanelYExtent {
topY: number;
bottomY: number;
@@ -21,6 +28,7 @@ export const getTimelineEventsSelectionSeries = (
splitPanelYExtent?: SplitPanelYExtent,
): LineSeriesOption | null => {
const selectedDates = timelineEventsModel
+ .flatMap(({ groups }) => groups)
.filter(({ events }) =>
events.some((event) => selectedEventIds.includes(event.id)),
)
@@ -56,7 +64,7 @@ export const getTimelineEventsSelectionSeries = (
symbol: "none",
lineStyle: {
type: "solid",
- color: getColor("core-brand"),
+ color: getColor("border-strong"),
width: CHART_STYLE.timelineEvents.selectionLineWidth,
},
label: {
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.unit.spec.ts b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.unit.spec.ts
index a978641a929..b0d98c55263 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.unit.spec.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/option.unit.spec.ts
@@ -17,13 +17,27 @@ const renderingContext: RenderingContext = {
const timelineEventsModel: TimelineEventsModel = [
{
date: "2025-01-01T00:00:00Z",
- events: [createMockTimelineEvent({ id: 1 })],
+ groups: [
+ {
+ date: "2025-01-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 1 })],
+ },
+ ],
},
{
date: "2025-02-01T00:00:00Z",
- events: [
- createMockTimelineEvent({ id: 2 }),
- createMockTimelineEvent({ id: 3 }),
+ groups: [
+ {
+ date: "2025-02-01T00:00:00Z",
+ events: [
+ createMockTimelineEvent({ id: 2 }),
+ createMockTimelineEvent({ id: 3 }),
+ ],
+ },
+ {
+ date: "2025-03-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 4 })],
+ },
],
},
];
@@ -62,6 +76,16 @@ describe("getTimelineEventsSelectionSeries", () => {
]);
});
+ it("draws the line at the member group's own date, not the cluster anchor", () => {
+ const series = getTimelineEventsSelectionSeries(
+ timelineEventsModel,
+ [4],
+ renderingContext,
+ );
+
+ expect(series?.markLine?.data).toEqual([{ xAxis: "2025-03-01T00:00:00Z" }]);
+ });
+
it("uses two-point segments spanning the panel extent for split panels", () => {
const series = getTimelineEventsSelectionSeries(
timelineEventsModel,
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/types.ts b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/types.ts
index 0c197b66747..108eef05ca3 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/types.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/timeline-events/types.ts
@@ -5,4 +5,9 @@ export type TimelineEventGroup = {
events: TimelineEvent[];
};
-export type TimelineEventsModel = TimelineEventGroup[];
+export type TimelineEventCluster = {
+ date: string;
+ groups: TimelineEventGroup[];
+};
+
+export type TimelineEventsModel = TimelineEventCluster[];
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/CartesianChart.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/CartesianChart.tsx
index 990060dc895..07e184d6b0e 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/CartesianChart.tsx
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/CartesianChart.tsx
@@ -1,12 +1,5 @@
import type { EChartsType } from "echarts/core";
-import {
- type MouseEvent,
- useCallback,
- useEffect,
- useMemo,
- useRef,
- useState,
-} from "react";
+import { type MouseEvent, useCallback, useMemo, useRef, useState } from "react";
import React from "react";
import { useSet } from "react-use";
@@ -32,10 +25,9 @@ import { useChartEvents } from "metabase/visualizations/visualizations/Cartesian
import { TimelineEventsBand } from "./TimelineEventsBand";
import { useChartDebug } from "./use-chart-debug";
import { useModelsAndOption } from "./use-models-and-option";
+import { useTimelineEventsHover } from "./use-timeline-events-hover";
import {
- getClosestDatumIndex,
getDashboardAdjustedSettings,
- getDataSeriesEChartsIndices,
getHoveredFromHighlighted,
} from "./utils";
@@ -92,11 +84,6 @@ function CartesianChartInner(props: VisualizationProps) {
const [hoveredTimelineEventGroup, setHoveredTimelineEventGroup] =
useState<TimelineEventGroup | null>(null);
- const hoveredTimelineEventIds = useMemo(
- () => hoveredTimelineEventGroup?.events.map((event) => event.id),
- [hoveredTimelineEventGroup],
- );
-
const {
chartModel,
chartLayout,
@@ -112,7 +99,6 @@ function CartesianChartInner(props: VisualizationProps) {
settings,
},
containerRef,
- hoveredTimelineEventIds,
);
useChartDebug({ isQueryBuilder, rawSeries, option, chartModel });
@@ -195,42 +181,17 @@ function CartesianChartInner(props: VisualizationProps) {
? chartModel.seriesModels.filter((series) => series.visible).length - 1
: 0;
- useEffect(() => {
- const chart = chartRef.current;
- if (chart == null || hoveredTimelineEventGroup == null) {
- return;
- }
-
- const dataIndex = getClosestDatumIndex(
- chartModel.transformedDataset,
- hoveredTimelineEventGroup.date,
- );
- const seriesIndices = getDataSeriesEChartsIndices(
- chartModel.seriesModels,
- option,
- );
- if (dataIndex < 0 || seriesIndices.length === 0) {
- return;
- }
-
- seriesIndices.forEach((seriesIndex) => {
- chart.dispatchAction({
- type: "highlight",
- seriesIndex,
- dataIndex: [dataIndex],
- });
- });
-
- return () => {
- seriesIndices.forEach((seriesIndex) => {
- chart.dispatchAction({
- type: "downplay",
- seriesIndex,
- dataIndex: [dataIndex],
- });
- });
- };
- }, [hoveredTimelineEventGroup, chartModel, option]);
+ useTimelineEventsHover({
+ chartRef,
+ hoveredTimelineEventGroup,
+ chartModel,
+ chartLayout,
+ option,
+ timelineEventsModel,
+ renderingContext,
+ display: card.display,
+ selectedTimelineEventIds,
+ });
// We can't navigate a user to a particular card from a visualizer viz,
// so title selection is disabled in this case
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.tsx
index 69589b52da4..8672a4e7992 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.tsx
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.tsx
@@ -9,10 +9,7 @@ import type { TimelineEvent, TimelineEventId } from "metabase-types/api";
import S from "./TimelineEventsBand.module.css";
import { TimelineEventRow, TimelineEventsList } from "./TimelineEventsList";
-import {
- type PositionedTimelineEventGroup,
- getTimelineEventGroupIconName,
-} from "./utils";
+import { getTimelineEventGroupIconName } from "./utils";
const MAX_VISIBLE_EVENTS = 3;
@@ -22,10 +19,18 @@ const POPOVER_OFFSET =
TIMELINE_EVENTS_BAND.bandPaddingY +
AXIS_CLEARANCE;
+export const POPOVER_CLOSE_DELAY_MS = 150;
+
interface TimelineEventChipProps {
- eventsGroup: PositionedTimelineEventGroup;
+ group: TimelineEventGroup;
+ x: number;
centerY: number;
selectedEventIds: TimelineEventId[];
+ hidden?: boolean;
+ zIndex?: number;
+ className?: string;
+ onFocus?: () => void;
+ onBlur?: () => void;
onGroupHover?: (group: TimelineEventGroup | null) => void;
onOpenTimelines?: (eventIds?: number[]) => void;
onSelectTimelineEvents?: (events: TimelineEvent[]) => void;
@@ -34,16 +39,21 @@ interface TimelineEventChipProps {
}
export const TimelineEventChip = ({
- eventsGroup,
+ group,
+ x,
centerY,
selectedEventIds,
+ hidden = false,
+ zIndex,
+ className,
+ onFocus,
+ onBlur,
onGroupHover,
onOpenTimelines,
onSelectTimelineEvents,
onDeselectTimelineEvents,
onSeeAllEvents,
}: TimelineEventChipProps) => {
- const { group, x } = eventsGroup;
const { events } = group;
// Remounting the hover card via a fresh key is how an action taken from the
@@ -101,22 +111,37 @@ export const TimelineEventChip = ({
position="top"
offset={POPOVER_OFFSET}
openDelay={50}
- closeDelay={150}
+ closeDelay={POPOVER_CLOSE_DELAY_MS}
shadow="md"
classNames={{ dropdown: S.bridgeDropdown }}
>
<HoverCard.Target>
<UnstyledButton
- className={cx(S.chip, isSelected && S.chipSelected)}
- style={{ left: x, top: centerY }}
+ className={cx(
+ S.chip,
+ className,
+ isSelected && S.chipSelected,
+ hidden && S.chipHidden,
+ )}
+ style={{
+ transform: `translate(${x}px, ${centerY}px) translate(-50%, -50%)`,
+ width: TIMELINE_EVENTS_BAND.chipWidth,
+ height: TIMELINE_EVENTS_BAND.chipHeight,
+ zIndex,
+ }}
data-testid="timeline-event-chip"
data-selected={isSelected}
+ data-hidden={hidden}
+ aria-hidden={hidden}
+ tabIndex={hidden ? -1 : undefined}
aria-label={
isSingleEvent ? events[0].name : t`${events.length} events`
}
onClick={canSelect ? handleChipClick : undefined}
onMouseEnter={() => onGroupHover?.(group)}
onMouseLeave={() => onGroupHover?.(null)}
+ onFocus={onFocus}
+ onBlur={onBlur}
>
{isSingleEvent ? (
<Icon name={getTimelineEventGroupIconName(group)} size={12} />
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.unit.spec.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.unit.spec.tsx
index d8f2d033547..72374aa0d00 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.unit.spec.tsx
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventChip.unit.spec.tsx
@@ -1,13 +1,18 @@
import userEvent from "@testing-library/user-event";
import { renderWithProviders, screen, waitFor } from "__support__/ui";
+import type { TimelineEventGroup } from "metabase/visualizations/echarts/cartesian/timeline-events/types";
import type { TimelineEvent, TimelineEventId } from "metabase-types/api";
import { createMockTimelineEvent } from "metabase-types/api/mocks";
import { TimelineEventChip } from "./TimelineEventChip";
-import type { PositionedTimelineEventGroup } from "./utils";
-const singleGroup: PositionedTimelineEventGroup = {
+interface ChipFixture {
+ group: TimelineEventGroup;
+ x: number;
+}
+
+const singleGroup: ChipFixture = {
group: {
date: "2025-01-01T00:00:00Z",
events: [
@@ -17,7 +22,7 @@ const singleGroup: PositionedTimelineEventGroup = {
x: 100,
};
-const twoGroup: PositionedTimelineEventGroup = {
+const twoGroup: ChipFixture = {
group: {
date: "2025-02-01T00:00:00Z",
events: [
@@ -28,7 +33,7 @@ const twoGroup: PositionedTimelineEventGroup = {
x: 200,
};
-const manyGroup: PositionedTimelineEventGroup = {
+const manyGroup: ChipFixture = {
group: {
date: "2025-03-01T00:00:00Z",
events: [
@@ -42,9 +47,10 @@ const manyGroup: PositionedTimelineEventGroup = {
};
interface SetupOpts {
- eventsGroup?: PositionedTimelineEventGroup;
+ eventsGroup?: ChipFixture;
selectedEventIds?: TimelineEventId[];
withCallbacks?: boolean;
+ hidden?: boolean;
onSeeAllEvents?: (events: TimelineEvent[]) => void;
}
@@ -52,6 +58,7 @@ const setup = ({
eventsGroup = singleGroup,
selectedEventIds = [],
withCallbacks = true,
+ hidden,
onSeeAllEvents,
}: SetupOpts = {}) => {
const onGroupHover = jest.fn();
@@ -61,9 +68,11 @@ const setup = ({
renderWithProviders(
<TimelineEventChip
- eventsGroup={eventsGroup}
+ group={eventsGroup.group}
+ x={eventsGroup.x}
centerY={120}
selectedEventIds={selectedEventIds}
+ hidden={hidden}
onGroupHover={onGroupHover}
onOpenTimelines={withCallbacks ? onOpenTimelines : undefined}
onSelectTimelineEvents={
@@ -248,4 +257,12 @@ describe("TimelineEventChip", () => {
).not.toBeInTheDocument();
});
});
+
+ it("marks the chip as hidden when hidden", () => {
+ setup({ eventsGroup: singleGroup, hidden: true });
+ expect(screen.getByTestId("timeline-event-chip")).toHaveAttribute(
+ "data-hidden",
+ "true",
+ );
+ });
});
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventStack.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventStack.tsx
new file mode 100644
index 00000000000..dda6cca0774
--- /dev/null
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventStack.tsx
@@ -0,0 +1,204 @@
+import { useCallback, useEffect, useRef } from "react";
+
+import {
+ TIMELINE_BAND_HEIGHT,
+ TIMELINE_EVENTS_BAND,
+} from "metabase/visualizations/echarts/cartesian/constants/style";
+import type {
+ TimelineEventCluster,
+ TimelineEventGroup,
+} from "metabase/visualizations/echarts/cartesian/timeline-events/types";
+import type { TimelineEvent, TimelineEventId } from "metabase-types/api";
+
+import { POPOVER_CLOSE_DELAY_MS, TimelineEventChip } from "./TimelineEventChip";
+import S from "./TimelineEventsBand.module.css";
+
+interface TimelineEventStackProps {
+ cluster: TimelineEventCluster;
+ memberXs: number[];
+ centerY: number;
+ plotBounds: { left: number; right: number };
+ isExpanded: boolean;
+ hidden: boolean;
+ onExpandedChange: (isExpanded: boolean) => void;
+ selectedEventIds: TimelineEventId[];
+ onGroupHover?: (group: TimelineEventGroup | null) => void;
+ onOpenTimelines?: (eventIds?: number[]) => void;
+ onSelectTimelineEvents?: (events: TimelineEvent[]) => void;
+ onDeselectTimelineEvents?: () => void;
+ onSeeAllEvents?: (events: TimelineEvent[]) => void;
+}
+
+const getSpreadCenter = (
+ x: number,
+ spreadWidth: number,
+ plotBounds: { left: number; right: number },
+) => {
+ const minCenter = plotBounds.left + spreadWidth / 2;
+ const maxCenter = Math.max(plotBounds.right - spreadWidth / 2, minCenter);
+ return Math.min(Math.max(x, minCenter), maxCenter);
+};
+
+export const TimelineEventStack = ({
+ cluster,
+ memberXs,
+ centerY,
+ plotBounds,
+ isExpanded,
+ hidden,
+ onExpandedChange,
+ selectedEventIds,
+ onGroupHover,
+ onOpenTimelines,
+ onSelectTimelineEvents,
+ onDeselectTimelineEvents,
+ onSeeAllEvents,
+}: TimelineEventStackProps) => {
+ const { chipWidth, chipGap } = TIMELINE_EVENTS_BAND;
+ const { groups } = cluster;
+ const count = groups.length;
+
+ const wrapperRef = useRef<HTMLDivElement>(null);
+ const collapseTimeoutRef = useRef<number>();
+ const isPointerInsideRef = useRef(false);
+ const onExpandedChangeRef = useRef(onExpandedChange);
+ onExpandedChangeRef.current = onExpandedChange;
+
+ const cancelCollapse = useCallback(() => {
+ window.clearTimeout(collapseTimeoutRef.current);
+ }, []);
+
+ const scheduleCollapse = useCallback(() => {
+ cancelCollapse();
+ collapseTimeoutRef.current = window.setTimeout(() => {
+ if (!isPointerInsideRef.current) {
+ onExpandedChangeRef.current(false);
+ }
+ }, POPOVER_CLOSE_DELAY_MS);
+ }, [cancelCollapse]);
+
+ const handlePointerEnter = () => {
+ isPointerInsideRef.current = true;
+ cancelCollapse();
+ onExpandedChange(true);
+ };
+
+ const handlePointerLeave = () => {
+ isPointerInsideRef.current = false;
+ scheduleCollapse();
+ };
+
+ const handleMemberFocus = () => {
+ cancelCollapse();
+ onExpandedChange(true);
+ };
+
+ // React's mouse-leave tracking is unreliable across the members' portaled
+ // popovers (moving chip → popover → chart never reports leaving the stack),
+ // so while expanded the pointer is tracked at the document level instead:
+ // anything hovered outside the stack and its popovers collapses it.
+ useEffect(() => {
+ if (!isExpanded) {
+ return;
+ }
+
+ const handleDocumentMouseOver = (event: MouseEvent) => {
+ const target = event.target;
+ if (!(target instanceof Element)) {
+ return;
+ }
+
+ const isInside =
+ wrapperRef.current?.contains(target) ||
+ target.closest(`.${S.bridgeDropdown}`) != null;
+
+ isPointerInsideRef.current = Boolean(isInside);
+ if (isInside) {
+ cancelCollapse();
+ } else {
+ scheduleCollapse();
+ }
+ };
+
+ const handleDocumentKeyDown = (event: KeyboardEvent) => {
+ if (event.key === "Escape") {
+ isPointerInsideRef.current = false;
+ cancelCollapse();
+ onExpandedChangeRef.current(false);
+ }
+ };
+
+ document.addEventListener("mouseover", handleDocumentMouseOver);
+ document.addEventListener("keydown", handleDocumentKeyDown);
+ return () => {
+ document.removeEventListener("mouseover", handleDocumentMouseOver);
+ document.removeEventListener("keydown", handleDocumentKeyDown);
+ };
+ }, [isExpanded, cancelCollapse, scheduleCollapse]);
+
+ useEffect(() => cancelCollapse, [cancelCollapse]);
+
+ const availableWidth = plotBounds.right - plotBounds.left;
+ const spreadStep =
+ count > 1
+ ? Math.min(
+ chipWidth + chipGap,
+ Math.max((availableWidth - chipWidth) / (count - 1), 0),
+ )
+ : 0;
+ const spreadWidth = chipWidth + (count - 1) * spreadStep;
+ const clusterMidpointX = (memberXs[0] + memberXs[memberXs.length - 1]) / 2;
+ const spreadCenter = getSpreadCenter(
+ clusterMidpointX,
+ spreadWidth,
+ plotBounds,
+ );
+ const getMemberX = (index: number) =>
+ isExpanded
+ ? spreadCenter + (index - (count - 1) / 2) * spreadStep
+ : memberXs[index];
+
+ return (
+ <div
+ ref={wrapperRef}
+ className={hidden ? S.stackHidden : undefined}
+ data-testid="timeline-event-stack"
+ data-expanded={isExpanded}
+ onMouseEnter={hidden ? undefined : handlePointerEnter}
+ onMouseLeave={handlePointerLeave}
+ >
+ {isExpanded && !hidden && (
+ <div
+ className={S.stackHoverPad}
+ style={{
+ left: spreadCenter - spreadWidth / 2,
+ top: centerY - TIMELINE_BAND_HEIGHT / 2,
+ width: spreadWidth,
+ height: TIMELINE_BAND_HEIGHT,
+ }}
+ />
+ )}
+ {groups.map((group, index) => {
+ return (
+ <TimelineEventChip
+ key={group.date}
+ group={group}
+ x={getMemberX(index)}
+ centerY={centerY}
+ zIndex={index}
+ className={S.stackMember}
+ hidden={hidden}
+ selectedEventIds={selectedEventIds}
+ onFocus={handleMemberFocus}
+ onBlur={scheduleCollapse}
+ onGroupHover={onGroupHover}
+ onOpenTimelines={onOpenTimelines}
+ onSelectTimelineEvents={onSelectTimelineEvents}
+ onDeselectTimelineEvents={onDeselectTimelineEvents}
+ onSeeAllEvents={onSeeAllEvents}
+ />
+ );
+ })}
+ </div>
+ );
+};
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.module.css b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.module.css
index 5713c0d2e36..1c31044662f 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.module.css
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.module.css
@@ -1,3 +1,10 @@
+.band {
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ isolation: isolate;
+}
+
.track {
position: absolute;
display: flex;
@@ -35,12 +42,12 @@
.chip {
position: absolute;
+ top: 0;
+ left: 0;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
- width: 2rem;
- height: 1.5rem;
padding: 0;
border: 1px solid var(--mb-color-border);
border-radius: 0.75rem;
@@ -48,11 +55,10 @@
color: var(--mb-color-icon-primary);
cursor: pointer;
pointer-events: all;
- transform: translate(-50%, -50%);
}
.chip:hover {
- background-color: var(--mb-color-background_surface-primary-hover);
+ background-color: var(--mb-color-background_page-secondary);
}
.chipSelected {
@@ -60,6 +66,42 @@
border-color: var(--mb-color-text-brand);
}
+.chipHidden {
+ pointer-events: none;
+}
+
+.chipHidden:not(.stackMember) {
+ opacity: 0;
+}
+
+.stackHidden {
+ opacity: 0;
+ pointer-events: none;
+}
+
+/* invisible catcher filling the gaps between spread stack members so the
+ pointer never "leaves" the stack while moving across it */
+.stackHoverPad {
+ position: absolute;
+ pointer-events: all;
+}
+
+@media (prefers-reduced-motion: no-preference) {
+ .chip {
+ transition: opacity 150ms ease;
+ }
+
+ .stackMember {
+ transition:
+ transform 200ms ease,
+ opacity 150ms ease;
+ }
+
+ .stackHidden {
+ transition: opacity 150ms ease;
+ }
+}
+
.listItemWrapper {
padding: 0.75rem;
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.stories.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.stories.tsx
new file mode 100644
index 00000000000..36cc48e513f
--- /dev/null
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.stories.tsx
@@ -0,0 +1,111 @@
+import type { StoryObj } from "@storybook/react";
+import { userEvent, within } from "@storybook/test";
+
+import { VisualizationWrapper } from "__support__/storybook";
+import { DateTimeColumn, NumberColumn } from "__support__/visualizations";
+import { Box } from "metabase/ui";
+import { registerVisualization } from "metabase/visualizations";
+import Visualization from "metabase/visualizations/components/Visualization";
+import { LineChart } from "metabase/visualizations/visualizations/LineChart";
+import type { Series } from "metabase-types/api";
+import {
+ createMockCard,
+ createMockTimelineEvent,
+} from "metabase-types/api/mocks";
+
+export default {
+ title: "viz/TimelineEventsBand",
+};
+
+registerVisualization(LineChart);
+
+const MONTH_COUNT = 36;
+
+const rows = Array.from({ length: MONTH_COUNT }, (_, index) => {
+ const year = 2024 + Math.floor(index / 12);
+ const month = String((index % 12) + 1).padStart(2, "0");
+ return [`${year}-${month}-01`, 10 + ((index * 7) % 40)];
+});
+
+// The mock mirrors the runtime series payload; the Series type additionally
+// expects dataset metadata that the visualization does not read here.
+const MOCK_SERIES = [
+ {
+ card: createMockCard({ id: 1, name: "Timeline events", display: "line" }),
+ data: {
+ cols: [
+ DateTimeColumn({ name: "Created At" }),
+ NumberColumn({ name: "Count" }),
+ ],
+ rows,
+ },
+ },
+] as Series;
+
+// At this chart width adjacent month ticks sit closer than the chip width, so
+// the two release events cluster into an overlapped stack, while the three
+// same-month fixes merge into a single count chip.
+const TIMELINE_EVENTS = [
+ createMockTimelineEvent({
+ id: 1,
+ name: "Product launch",
+ timestamp: "2024-03-15T00:00:00Z",
+ icon: "star",
+ }),
+ createMockTimelineEvent({
+ id: 2,
+ name: "Fix one",
+ timestamp: "2025-02-03T00:00:00Z",
+ icon: "warning",
+ }),
+ createMockTimelineEvent({
+ id: 3,
+ name: "Fix two",
+ timestamp: "2025-02-14T00:00:00Z",
+ icon: "warning",
+ }),
+ createMockTimelineEvent({
+ id: 4,
+ name: "Fix three",
+ timestamp: "2025-02-25T00:00:00Z",
+ icon: "warning",
+ }),
+ createMockTimelineEvent({
+ id: 5,
+ name: "v1.0 release",
+ timestamp: "2025-10-10T00:00:00Z",
+ icon: "cloud",
+ }),
+ createMockTimelineEvent({
+ id: 6,
+ name: "v1.1 release",
+ timestamp: "2025-11-20T00:00:00Z",
+ icon: "bell",
+ }),
+];
+
+const Template = () => (
+ <VisualizationWrapper>
+ <Box h={500} w={800}>
+ <Visualization
+ rawSeries={MOCK_SERIES}
+ width={800}
+ timelineEvents={TIMELINE_EVENTS}
+ selectedTimelineEventIds={[5]}
+ />
+ </Box>
+ </VisualizationWrapper>
+);
+
+export const Clusters: StoryObj = {
+ render: Template,
+};
+
+export const ExpandedStack: StoryObj = {
+ render: Template,
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const stackTopChip = await canvas.findByLabelText("v1.1 release");
+ await userEvent.hover(stackTopChip);
+ },
+};
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.tsx
index fb93bc2aef2..9a2a131e707 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.tsx
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.tsx
@@ -13,11 +13,12 @@ import type {
import type { TimelineEvent, TimelineEventId } from "metabase-types/api";
import { TimelineEventChip } from "./TimelineEventChip";
+import { TimelineEventStack } from "./TimelineEventStack";
import S from "./TimelineEventsBand.module.css";
import {
- type PositionedTimelineEventGroup,
- arePositionedGroupsEqual,
- getPositionedTimelineEventGroups,
+ type PositionedTimelineEventCluster,
+ arePositionedClustersEqual,
+ getPositionedTimelineEventClusters,
} from "./utils";
interface TimelineEventsBandProps {
@@ -54,11 +55,15 @@ export const TimelineEventsBand = ({
const plotLeft = chartLayout.padding.left;
const plotRight = chartSize.width - chartLayout.padding.right;
- const [positionedGroups, setPositionedGroups] = useState<
- PositionedTimelineEventGroup[]
+ const [positionedClusters, setPositionedClusters] = useState<
+ PositionedTimelineEventCluster[]
>([]);
- const updatePositionedGroups = useCallback(() => {
+ const [expandedClusterDate, setExpandedClusterDate] = useState<string | null>(
+ null,
+ );
+
+ const updatePositionedClusters = useCallback(() => {
const canPosition =
chartInstance != null &&
timelineEventsModel != null &&
@@ -66,7 +71,7 @@ export const TimelineEventsBand = ({
chartSize.width > 0;
const next = canPosition
- ? getPositionedTimelineEventGroups({
+ ? getPositionedTimelineEventClusters({
timelineEventsModel,
chartInstance,
plotBounds: { left: plotLeft, right: plotRight },
@@ -74,8 +79,8 @@ export const TimelineEventsBand = ({
})
: [];
- setPositionedGroups((previous) =>
- arePositionedGroupsEqual(previous, next) ? previous : next,
+ setPositionedClusters((previous) =>
+ arePositionedClustersEqual(previous, next) ? previous : next,
);
}, [
chartInstance,
@@ -87,25 +92,31 @@ export const TimelineEventsBand = ({
]);
useEffect(() => {
- updatePositionedGroups();
- }, [updatePositionedGroups]);
+ updatePositionedClusters();
+ }, [updatePositionedClusters]);
useEffect(() => {
if (!chartInstance) {
return;
}
- chartInstance.on("finished", updatePositionedGroups);
+ chartInstance.on("finished", updatePositionedClusters);
return () => {
- chartInstance.off("finished", updatePositionedGroups);
+ chartInstance.off("finished", updatePositionedClusters);
};
- }, [chartInstance, updatePositionedGroups]);
+ }, [chartInstance, updatePositionedClusters]);
+
+ // Collapse any spread stack when the chart genuinely re-lays-out; the
+ // equality bail-out above keeps ECharts "finished" events from firing this.
+ useEffect(() => {
+ setExpandedClusterDate(null);
+ }, [positionedClusters]);
- if (positionedGroups.length === 0) {
+ if (positionedClusters.length === 0) {
return null;
}
return (
- <div data-testid="timeline-events-band">
+ <div className={S.band} data-testid="timeline-events-band">
<div
className={S.track}
style={{
@@ -115,19 +126,49 @@ export const TimelineEventsBand = ({
height: TIMELINE_BAND_HEIGHT,
}}
/>
- {positionedGroups.map((eventsGroup) => (
- <TimelineEventChip
- key={eventsGroup.group.date}
- eventsGroup={eventsGroup}
- centerY={centerY}
- selectedEventIds={selectedTimelineEventIds ?? []}
- onGroupHover={onGroupHover}
- onOpenTimelines={onOpenTimelines}
- onSelectTimelineEvents={onSelectTimelineEvents}
- onDeselectTimelineEvents={onDeselectTimelineEvents}
- onSeeAllEvents={onSeeAllEvents}
- />
- ))}
+ {positionedClusters.map(({ cluster, memberXs }) => {
+ const isHidden =
+ expandedClusterDate != null && expandedClusterDate !== cluster.date;
+
+ if (cluster.groups.length === 1) {
+ return (
+ <TimelineEventChip
+ key={cluster.date}
+ group={cluster.groups[0]}
+ x={memberXs[0]}
+ centerY={centerY}
+ hidden={isHidden}
+ selectedEventIds={selectedTimelineEventIds ?? []}
+ onGroupHover={onGroupHover}
+ onOpenTimelines={onOpenTimelines}
+ onSelectTimelineEvents={onSelectTimelineEvents}
+ onDeselectTimelineEvents={onDeselectTimelineEvents}
+ onSeeAllEvents={onSeeAllEvents}
+ />
+ );
+ }
+
+ return (
+ <TimelineEventStack
+ key={cluster.date}
+ cluster={cluster}
+ memberXs={memberXs}
+ centerY={centerY}
+ plotBounds={{ left: plotLeft, right: plotRight }}
+ hidden={isHidden}
+ isExpanded={expandedClusterDate === cluster.date}
+ onExpandedChange={(isExpanded) =>
+ setExpandedClusterDate(isExpanded ? cluster.date : null)
+ }
+ selectedEventIds={selectedTimelineEventIds ?? []}
+ onGroupHover={onGroupHover}
+ onOpenTimelines={onOpenTimelines}
+ onSelectTimelineEvents={onSelectTimelineEvents}
+ onDeselectTimelineEvents={onDeselectTimelineEvents}
+ onSeeAllEvents={onSeeAllEvents}
+ />
+ );
+ })}
</div>
);
};
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.unit.spec.tsx b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.unit.spec.tsx
index d51e0e97c03..f0aed3c196b 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.unit.spec.tsx
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/TimelineEventsBand.unit.spec.tsx
@@ -1,16 +1,27 @@
+import userEvent from "@testing-library/user-event";
import type { EChartsType } from "echarts/core";
import { createMockChartLayout } from "__support__/echarts";
-import { renderWithProviders, screen } from "__support__/ui";
+import {
+ fireEvent,
+ renderWithProviders,
+ screen,
+ waitFor,
+} from "__support__/ui";
import type { TimelineEventsModel } from "metabase/visualizations/echarts/cartesian/timeline-events/types";
import { createMockTimelineEvent } from "metabase-types/api/mocks";
import { TimelineEventsBand } from "./TimelineEventsBand";
+const getChipCenterX = (chip: HTMLElement) => {
+ const match = chip.style.transform.match(/^translate\((-?[\d.]+)px/);
+ return match ? parseFloat(match[1]) : NaN;
+};
+
const createChartInstance = (
pixelByDate: Record<string, number>,
): EChartsType =>
- // Unjustified type cast. FIXME
+ // the band only calls convertToPixel and the event methods, so a stub suffices
({
convertToPixel: (_finder: unknown, value: string) =>
pixelByDate[value] ?? NaN,
@@ -21,11 +32,38 @@ const createChartInstance = (
const timelineEventsModel: TimelineEventsModel = [
{
date: "2025-01-01T00:00:00Z",
- events: [createMockTimelineEvent({ id: 1, name: "First" })],
+ groups: [
+ {
+ date: "2025-01-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 1, name: "First" })],
+ },
+ ],
},
{
date: "2025-02-01T00:00:00Z",
- events: [createMockTimelineEvent({ id: 2, name: "Second" })],
+ groups: [
+ {
+ date: "2025-02-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 2, name: "Second" })],
+ },
+ ],
+ },
+];
+
+const stackedTimelineEventsModel: TimelineEventsModel = [
+ timelineEventsModel[0],
+ {
+ date: "2025-02-01T00:00:00Z",
+ groups: [
+ {
+ date: "2025-02-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 2, name: "Stack A" })],
+ },
+ {
+ date: "2025-02-02T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 3, name: "Stack B" })],
+ },
+ ],
},
];
@@ -47,6 +85,8 @@ const setup = (opts: SetupOpts = {}) => {
"2025-02-01T00:00:00Z": 300,
});
+ const onGroupHover = jest.fn();
+
renderWithProviders(
<TimelineEventsBand
chartInstance={chartInstance}
@@ -62,18 +102,24 @@ const setup = (opts: SetupOpts = {}) => {
})}
xAxisIndex={0}
selectedTimelineEventIds={opts.selectedTimelineEventIds}
+ onGroupHover={onGroupHover}
/>,
);
+
+ return { onGroupHover };
};
describe("TimelineEventsBand", () => {
- it("renders a chip per visible event group", () => {
+ it("renders a chip per visible event cluster", () => {
setup();
expect(screen.getByTestId("timeline-events-band")).toBeInTheDocument();
expect(screen.getAllByTestId("timeline-event-chip")).toHaveLength(2);
+ expect(
+ screen.queryByTestId("timeline-event-stack"),
+ ).not.toBeInTheDocument();
});
- it("marks the chip for a selected event group as selected", () => {
+ it("marks the chip for a selected event cluster as selected", () => {
setup({ selectedTimelineEventIds: [2] });
const chips = screen.getAllByTestId("timeline-event-chip");
expect(chips[0]).toHaveAttribute("data-selected", "false");
@@ -93,4 +139,172 @@ describe("TimelineEventsBand", () => {
screen.queryByTestId("timeline-events-band"),
).not.toBeInTheDocument();
});
+
+ describe("stacks", () => {
+ it("renders a collapsed stack with a member chip per data point", () => {
+ setup({ timelineEventsModel: stackedTimelineEventsModel });
+
+ const stack = screen.getByTestId("timeline-event-stack");
+ expect(stack).toHaveAttribute("data-expanded", "false");
+ expect(screen.getByLabelText("Stack A")).toBeInTheDocument();
+ expect(screen.getByLabelText("Stack B")).toBeInTheDocument();
+ });
+
+ it("renders collapsed members at their own data point positions", () => {
+ setup({
+ timelineEventsModel: stackedTimelineEventsModel,
+ chartInstance: createChartInstance({
+ "2025-01-01T00:00:00Z": 120,
+ "2025-02-01T00:00:00Z": 300,
+ "2025-02-02T00:00:00Z": 315,
+ }),
+ });
+
+ expect(getChipCenterX(screen.getByLabelText("Stack A"))).toBe(300);
+ expect(getChipCenterX(screen.getByLabelText("Stack B"))).toBe(315);
+ });
+
+ it("expands on member hover, hides other chips, and reports the entered member", async () => {
+ const { onGroupHover } = setup({
+ timelineEventsModel: stackedTimelineEventsModel,
+ });
+
+ await userEvent.hover(screen.getByLabelText("Stack B"));
+
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "true",
+ );
+ expect(screen.getByLabelText("First")).toHaveAttribute(
+ "data-hidden",
+ "true",
+ );
+ expect(onGroupHover).toHaveBeenLastCalledWith(
+ stackedTimelineEventsModel[1].groups[1],
+ );
+ });
+
+ it("reports the hovered member group once the stack is spread", async () => {
+ const { onGroupHover } = setup({
+ timelineEventsModel: stackedTimelineEventsModel,
+ });
+
+ await userEvent.hover(screen.getByLabelText("Stack B"));
+ await userEvent.hover(screen.getByLabelText("Stack A"));
+
+ expect(onGroupHover).toHaveBeenLastCalledWith(
+ stackedTimelineEventsModel[1].groups[0],
+ );
+ });
+
+ it("collapses on Escape while expanded", async () => {
+ setup({ timelineEventsModel: stackedTimelineEventsModel });
+
+ await userEvent.hover(screen.getByLabelText("Stack B"));
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "true",
+ );
+
+ fireEvent.keyDown(document, { key: "Escape" });
+
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "false",
+ );
+ });
+
+ it("collapses and unhides other chips after the pointer leaves", async () => {
+ setup({ timelineEventsModel: stackedTimelineEventsModel });
+
+ await userEvent.hover(screen.getByLabelText("Stack B"));
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "true",
+ );
+
+ await userEvent.unhover(screen.getByLabelText("Stack B"));
+
+ await waitFor(() => {
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "false",
+ );
+ });
+ expect(screen.getByLabelText("First")).toHaveAttribute(
+ "data-hidden",
+ "false",
+ );
+ });
+
+ it("collapses when the pointer moves outside after visiting a member popover", async () => {
+ setup({ timelineEventsModel: stackedTimelineEventsModel });
+
+ await userEvent.hover(screen.getByLabelText("Stack B"));
+ await userEvent.hover(screen.getByLabelText("Stack A"));
+ expect(
+ await screen.findByTestId("timeline-event-popover"),
+ ).toBeInTheDocument();
+
+ fireEvent.mouseOver(document.body);
+
+ await waitFor(() => {
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "false",
+ );
+ });
+ });
+
+ it("compresses a spread that would overflow the plot to fit within it", async () => {
+ // 15 members at full spacing need 508px while the plot is 440px wide
+ const wideCluster: TimelineEventsModel = [
+ {
+ date: "2025-02-01T00:00:00Z",
+ groups: Array.from({ length: 15 }, (_, index) => ({
+ date: `2025-02-${String(index + 1).padStart(2, "0")}T00:00:00Z`,
+ events: [
+ createMockTimelineEvent({ id: index + 1, name: `E${index + 1}` }),
+ ],
+ })),
+ },
+ ];
+
+ setup({ timelineEventsModel: wideCluster });
+
+ await userEvent.hover(screen.getByLabelText("E15"));
+ expect(screen.getByTestId("timeline-event-stack")).toHaveAttribute(
+ "data-expanded",
+ "true",
+ );
+
+ const memberCenters = screen
+ .getAllByTestId("timeline-event-chip")
+ .map(getChipCenterX);
+ // plot spans padding.left (50) to chartSize.width - padding.right (490)
+ const chipHalfWidth = 16;
+ expect(Math.min(...memberCenters)).toBeGreaterThanOrEqual(
+ 50 + chipHalfWidth,
+ );
+ expect(Math.max(...memberCenters)).toBeLessThanOrEqual(
+ 490 - chipHalfWidth,
+ );
+ });
+
+ it("marks only the selected member of a collapsed stack, not the top chip", () => {
+ setup({
+ timelineEventsModel: stackedTimelineEventsModel,
+ selectedTimelineEventIds: [2],
+ });
+
+ expect(screen.getByLabelText("Stack A")).toHaveAttribute(
+ "data-selected",
+ "true",
+ );
+ expect(screen.getByLabelText("Stack B")).toHaveAttribute(
+ "data-selected",
+ "false",
+ );
+ });
+ });
});
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.ts b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.ts
index 1475a2275e3..a7f2352d74b 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.ts
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.ts
@@ -1,6 +1,7 @@
import type { EChartsType } from "echarts/core";
import type {
+ TimelineEventCluster,
TimelineEventGroup,
TimelineEventsModel,
} from "metabase/visualizations/echarts/cartesian/timeline-events/types";
@@ -19,9 +20,9 @@ export const TIMELINE_ICON_TO_SMALL_ICON_MAP = {
cloud: "cloud_12",
} satisfies Record<TimelineIcon, IconName>;
-export interface PositionedTimelineEventGroup {
- group: TimelineEventGroup;
- x: number;
+export interface PositionedTimelineEventCluster {
+ cluster: TimelineEventCluster;
+ memberXs: number[];
}
export const getTimelineEventGroupIconName = (
@@ -38,32 +39,51 @@ interface PositioningInput {
xAxisIndex: number;
}
-export const getPositionedTimelineEventGroups = ({
+const toPixelX = (
+ chartInstance: EChartsType,
+ xAxisIndex: number,
+ date: string,
+): number => {
+ const pixel = chartInstance.convertToPixel({ xAxisIndex }, date);
+ return Array.isArray(pixel) ? pixel[0] : pixel;
+};
+
+export const getPositionedTimelineEventClusters = ({
timelineEventsModel,
chartInstance,
plotBounds,
xAxisIndex,
-}: PositioningInput): PositionedTimelineEventGroup[] => {
+}: PositioningInput): PositionedTimelineEventCluster[] => {
const { left, right } = plotBounds;
- return timelineEventsModel.flatMap((group) => {
- const pixel = chartInstance.convertToPixel({ xAxisIndex }, group.date);
- const x = Array.isArray(pixel) ? pixel[0] : pixel;
+ return timelineEventsModel.flatMap((cluster) => {
+ const anchorX = toPixelX(chartInstance, xAxisIndex, cluster.date);
- if (!Number.isFinite(x) || x < left || x > right) {
+ if (!Number.isFinite(anchorX) || anchorX < left || anchorX > right) {
return [];
}
- return [{ group, x }];
+ const memberXs = cluster.groups.map((group) => {
+ const memberX = toPixelX(chartInstance, xAxisIndex, group.date);
+ return Number.isFinite(memberX)
+ ? Math.min(Math.max(memberX, left), right)
+ : anchorX;
+ });
+
+ return [{ cluster, memberXs }];
});
};
-export const arePositionedGroupsEqual = (
- a: PositionedTimelineEventGroup[],
- b: PositionedTimelineEventGroup[],
+export const arePositionedClustersEqual = (
+ a: PositionedTimelineEventCluster[],
+ b: PositionedTimelineEventCluster[],
): boolean =>
a.length === b.length &&
a.every((item, index) => {
const other = b[index];
- return item.group === other.group && item.x === other.x;
+ return (
+ item.cluster === other.cluster &&
+ item.memberXs.length === other.memberXs.length &&
+ item.memberXs.every((x, memberIndex) => x === other.memberXs[memberIndex])
+ );
});
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.unit.spec.ts b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.unit.spec.ts
index bc24fa063a4..f67049310c5 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.unit.spec.ts
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/TimelineEventsBand/utils.unit.spec.ts
@@ -5,8 +5,8 @@ import type { TimelineEventsModel } from "metabase/visualizations/echarts/cartes
import { createMockTimelineEvent } from "metabase-types/api/mocks";
import {
- arePositionedGroupsEqual,
- getPositionedTimelineEventGroups,
+ arePositionedClustersEqual,
+ getPositionedTimelineEventClusters,
getTimelineEventGroupIconName,
} from "./utils";
@@ -15,7 +15,7 @@ const BOUNDS: ChartBoundsCoords = { top: 0, bottom: 100, left: 50, right: 450 };
const createChartInstance = (
pixelByDate: Record<string, number | number[]>,
): EChartsType =>
- // Unjustified type cast. FIXME
+ // the positioning code only calls convertToPixel, so a stub suffices
({
convertToPixel: (_finder: unknown, value: string) =>
pixelByDate[value] ?? NaN,
@@ -51,33 +51,50 @@ describe("TimelineEventsBand utils", () => {
});
});
- describe("getPositionedTimelineEventGroups", () => {
+ describe("getPositionedTimelineEventClusters", () => {
const timelineEventsModel: TimelineEventsModel = [
{
date: "2025-01-01T00:00:00Z",
- events: [createMockTimelineEvent({ id: 1, name: "In range" })],
+ groups: [
+ {
+ date: "2025-01-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 1, name: "In range" })],
+ },
+ ],
},
{
date: "2025-02-01T00:00:00Z",
- events: [
- createMockTimelineEvent({ id: 2, name: "Cluster a" }),
- createMockTimelineEvent({ id: 3, name: "Cluster b" }),
+ groups: [
+ {
+ date: "2025-02-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 2, name: "Cluster a" })],
+ },
+ {
+ date: "2025-02-02T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 3, name: "Cluster b" })],
+ },
],
},
{
date: "2025-03-01T00:00:00Z",
- events: [createMockTimelineEvent({ id: 4, name: "Out of range" })],
+ groups: [
+ {
+ date: "2025-03-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 4, name: "Out of range" })],
+ },
+ ],
},
];
- it("maps groups to pixel positions and drops out-of-range groups", () => {
+ it("maps clusters to member pixel positions and drops out-of-range clusters", () => {
const chartInstance = createChartInstance({
"2025-01-01T00:00:00Z": 120,
"2025-02-01T00:00:00Z": 300,
+ "2025-02-02T00:00:00Z": 320,
"2025-03-01T00:00:00Z": 999, // beyond bounds.right
});
- const positioned = getPositionedTimelineEventGroups({
+ const positioned = getPositionedTimelineEventClusters({
timelineEventsModel,
chartInstance,
plotBounds: BOUNDS,
@@ -85,15 +102,49 @@ describe("TimelineEventsBand utils", () => {
});
expect(positioned).toEqual([
- { group: timelineEventsModel[0], x: 120 },
- { group: timelineEventsModel[1], x: 300 },
+ { cluster: timelineEventsModel[0], memberXs: [120] },
+ { cluster: timelineEventsModel[1], memberXs: [300, 320] },
]);
});
- it("drops groups whose pixel position is NaN", () => {
+ it("falls back to the cluster anchor for members that cannot be positioned", () => {
+ const chartInstance = createChartInstance({
+ "2025-01-01T00:00:00Z": 120,
+ "2025-02-01T00:00:00Z": 300,
+ // no entry for the second member of the second cluster
+ });
+
+ const positioned = getPositionedTimelineEventClusters({
+ timelineEventsModel,
+ chartInstance,
+ plotBounds: BOUNDS,
+ xAxisIndex: 0,
+ });
+
+ expect(positioned[1].memberXs).toEqual([300, 300]);
+ });
+
+ it("clamps member positions into the plot bounds", () => {
+ const chartInstance = createChartInstance({
+ "2025-01-01T00:00:00Z": 120,
+ "2025-02-01T00:00:00Z": 440,
+ "2025-02-02T00:00:00Z": 470, // beyond bounds.right
+ });
+
+ const positioned = getPositionedTimelineEventClusters({
+ timelineEventsModel,
+ chartInstance,
+ plotBounds: BOUNDS,
+ xAxisIndex: 0,
+ });
+
+ expect(positioned[1].memberXs).toEqual([440, 450]);
+ });
+
+ it("drops clusters whose pixel position is NaN", () => {
const chartInstance = createChartInstance({});
- const positioned = getPositionedTimelineEventGroups({
+ const positioned = getPositionedTimelineEventClusters({
timelineEventsModel,
chartInstance,
plotBounds: BOUNDS,
@@ -110,7 +161,7 @@ describe("TimelineEventsBand utils", () => {
"2025-03-01T00:00:00Z": NaN,
});
- const positioned = getPositionedTimelineEventGroups({
+ const positioned = getPositionedTimelineEventClusters({
timelineEventsModel,
chartInstance,
plotBounds: BOUNDS,
@@ -118,30 +169,43 @@ describe("TimelineEventsBand utils", () => {
});
expect(positioned).toHaveLength(1);
- expect(positioned[0].x).toBe(200);
+ expect(positioned[0].memberXs).toEqual([200]);
});
});
- describe("arePositionedGroupsEqual", () => {
- const group = {
+ describe("arePositionedClustersEqual", () => {
+ const cluster = {
date: "2025-01-01T00:00:00Z",
- events: [createMockTimelineEvent({ id: 1 })],
+ groups: [
+ {
+ date: "2025-01-01T00:00:00Z",
+ events: [createMockTimelineEvent({ id: 1 })],
+ },
+ ],
};
- it("returns true for the same groups at the same positions", () => {
+ it("returns true for the same clusters at the same positions", () => {
expect(
- arePositionedGroupsEqual([{ group, x: 120 }], [{ group, x: 120 }]),
+ arePositionedClustersEqual(
+ [{ cluster, memberXs: [120] }],
+ [{ cluster, memberXs: [120] }],
+ ),
).toBe(true);
});
- it("returns false when a position changes", () => {
+ it("returns false when a member position changes", () => {
expect(
- arePositionedGroupsEqual([{ group, x: 120 }], [{ group, x: 121 }]),
+ arePositionedClustersEqual(
+ [{ cluster, memberXs: [120] }],
+ [{ cluster, memberXs: [121] }],
+ ),
).toBe(false);
});
- it("returns false when the number of groups changes", () => {
- expect(arePositionedGroupsEqual([{ group, x: 120 }], [])).toBe(false);
+ it("returns false when the number of clusters changes", () => {
+ expect(
+ arePositionedClustersEqual([{ cluster, memberXs: [120] }], []),
+ ).toBe(false);
});
});
});
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-models-and-option.ts b/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-models-and-option.ts
index 4cad3a0504d..eab173255ab 100644
--- a/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-models-and-option.ts
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-models-and-option.ts
@@ -39,7 +39,6 @@ export function useModelsAndOption(
gridSize,
}: VisualizationProps,
containerRef: React.RefObject<HTMLDivElement>,
- hoveredTimelineEventIds?: TimelineEventId[],
) {
const tc = useTranslateContent();
@@ -133,19 +132,6 @@ export function useModelsAndOption(
);
}, [chartModel, settings, card.display, containerRef]);
- const markedTimelineEventIds = useMemo(() => {
- if (
- card.display === "bar" ||
- hoveredTimelineEventIds == null ||
- hoveredTimelineEventIds.length === 0
- ) {
- return selectedTimelineEventIds;
- }
- return [
- ...new Set([...selectedTimelineEventIds, ...hoveredTimelineEventIds]),
- ];
- }, [selectedTimelineEventIds, hoveredTimelineEventIds, card.display]);
-
const option = useMemo(() => {
if (width === 0 || height === 0) {
return {};
@@ -164,7 +150,7 @@ export function useModelsAndOption(
chartLayout,
hasTimelineEvents,
timelineEventsModel,
- markedTimelineEventIds,
+ selectedTimelineEventIds,
settings,
shouldAnimate,
renderingContext,
@@ -177,7 +163,7 @@ export function useModelsAndOption(
chartLayout,
hasTimelineEvents,
timelineEventsModel,
- markedTimelineEventIds,
+ selectedTimelineEventIds,
settings,
width,
shouldAnimate,
@@ -191,7 +177,7 @@ export function useModelsAndOption(
chartLayout,
hasTimelineEvents,
timelineEventsModel,
- markedTimelineEventIds,
+ selectedTimelineEventIds,
settings,
width,
shouldAnimate,
@@ -212,7 +198,7 @@ export function useModelsAndOption(
chartLayout,
hasTimelineEvents,
timelineEventsModel,
- markedTimelineEventIds,
+ selectedTimelineEventIds,
settings,
renderingContext,
]);
diff --git a/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-timeline-events-hover.ts b/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-timeline-events-hover.ts
new file mode 100644
index 00000000000..ba3a3298679
--- /dev/null
+++ b/frontend/src/metabase/visualizations/visualizations/CartesianChart/use-timeline-events-hover.ts
@@ -0,0 +1,141 @@
+import { useDebouncedCallback } from "@mantine/hooks";
+import type { EChartsOption } from "echarts";
+import type { EChartsType } from "echarts/core";
+import { useEffect, useRef } from "react";
+
+import type { ChartLayout } from "metabase/visualizations/echarts/cartesian/layout/types";
+import type { BaseCartesianChartModel } from "metabase/visualizations/echarts/cartesian/model/types";
+import { getTimelineSelectionSeries } from "metabase/visualizations/echarts/cartesian/option";
+import { EMPTY_TIMELINE_SELECTION_SERIES } from "metabase/visualizations/echarts/cartesian/timeline-events/option";
+import type {
+ TimelineEventGroup,
+ TimelineEventsModel,
+} from "metabase/visualizations/echarts/cartesian/timeline-events/types";
+import type { RenderingContext } from "metabase/visualizations/types";
+import type { TimelineEventId } from "metabase-types/api";
+
+import { getClosestDatumIndex, getDataSeriesEChartsIndices } from "./utils";
+
+const MARKER_LINE_UPDATE_DELAY_MS = 100;
+
+interface UseTimelineEventsHoverParams {
+ chartRef: React.MutableRefObject<EChartsType | undefined>;
+ hoveredTimelineEventGroup: TimelineEventGroup | null;
+ chartModel: BaseCartesianChartModel;
+ chartLayout: ChartLayout;
+ option: EChartsOption;
+ timelineEventsModel: TimelineEventsModel | null;
+ renderingContext: RenderingContext;
+ display: string;
+ selectedTimelineEventIds?: TimelineEventId[];
+}
+
+// Reflects the hovered timeline event group on the chart: highlights the
+// closest data point and draws the marker line at the group's date.
+export function useTimelineEventsHover({
+ chartRef,
+ hoveredTimelineEventGroup,
+ chartModel,
+ chartLayout,
+ option,
+ timelineEventsModel,
+ renderingContext,
+ display,
+ selectedTimelineEventIds,
+}: UseTimelineEventsHoverParams) {
+ const selectedTimelineEventIdsRef = useRef(selectedTimelineEventIds);
+ selectedTimelineEventIdsRef.current = selectedTimelineEventIds;
+
+ const applyMarkerLineDebounced = useDebouncedCallback(
+ (applyMarkerLine: () => void) => applyMarkerLine(),
+ MARKER_LINE_UPDATE_DELAY_MS,
+ );
+
+ useEffect(() => {
+ const chart = chartRef.current;
+ if (chart == null || hoveredTimelineEventGroup == null) {
+ return;
+ }
+
+ const dataIndex = getClosestDatumIndex(
+ chartModel.transformedDataset,
+ hoveredTimelineEventGroup.date,
+ );
+ const seriesIndices = getDataSeriesEChartsIndices(
+ chartModel.seriesModels,
+ option,
+ );
+ const hasHighlight = dataIndex >= 0 && seriesIndices.length > 0;
+
+ if (hasHighlight) {
+ seriesIndices.forEach((seriesIndex) => {
+ chart.dispatchAction({
+ type: "highlight",
+ seriesIndex,
+ // ECharts quirk: with a scalar dataIndex the highlight action blurs
+ // the chart without emphasizing the datum
+ dataIndex: [dataIndex],
+ });
+ });
+ }
+
+ const showMarkerLine = display !== "bar" && timelineEventsModel != null;
+ const applyMarkerLine = (eventIds: TimelineEventId[]) => {
+ const series = getTimelineSelectionSeries(
+ timelineEventsModel,
+ eventIds,
+ chartModel,
+ chartLayout,
+ renderingContext,
+ );
+ chart.setOption({
+ series: [series ?? EMPTY_TIMELINE_SELECTION_SERIES],
+ });
+ };
+
+ const scheduleMarkerLine = (eventIds: TimelineEventId[]) => {
+ applyMarkerLineDebounced(() => {
+ if (!chart.isDisposed()) {
+ applyMarkerLine(eventIds);
+ }
+ });
+ };
+
+ if (showMarkerLine) {
+ const hoveredEventIds = hoveredTimelineEventGroup.events.map(
+ (event) => event.id,
+ );
+ scheduleMarkerLine([
+ ...new Set([
+ ...(selectedTimelineEventIdsRef.current ?? []),
+ ...hoveredEventIds,
+ ]),
+ ]);
+ }
+
+ return () => {
+ if (hasHighlight) {
+ seriesIndices.forEach((seriesIndex) => {
+ chart.dispatchAction({
+ type: "downplay",
+ seriesIndex,
+ dataIndex: [dataIndex],
+ });
+ });
+ }
+ if (showMarkerLine) {
+ scheduleMarkerLine(selectedTimelineEventIdsRef.current ?? []);
+ }
+ };
+ }, [
+ chartRef,
+ hoveredTimelineEventGroup,
+ chartModel,
+ option,
+ timelineEventsModel,
+ chartLayout,
+ renderingContext,
+ display,
+ applyMarkerLineDebounced,
+ ]);
+}
diff --git a/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-and-labels.json b/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-and-labels.json
index b7ba1c0c10c..003cced9861 100644
--- a/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-and-labels.json
+++ b/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-and-labels.json
@@ -1,1017 +1,602 @@
[
{
- "card": {
- "original_card_id": 455,
- "can_delete": false,
- "public_uuid": null,
- "parameter_usage_count": 0,
- "created_at": "2024-10-03T21:34:37.697381Z",
- "parameters": [],
- "metabase_version": "v0.1.35-SNAPSHOT (fc423b1)",
- "collection": {
- "authority_level": null,
- "description": null,
- "archived": false,
- "trashed_from_location": null,
- "slug": "sunburst",
- "archive_operation_id": null,
- "name": "Sunburst",
- "personal_owner_id": null,
- "type": null,
- "is_sample": false,
- "id": 32,
- "archived_directly": null,
- "entity_id": "yivDsLk9XUmdCWr0lt9GJ",
- "location": "/5/23/",
- "namespace": null,
- "is_personal": false,
- "created_at": "2024-08-25T18:16:32.499168Z"
- },
- "visualization_settings": {
- "table.pivot_column": "generation",
- "table.cell_column": "count",
- "pie.dimension": [
- "generation",
- "type_1",
- "type_2"
- ],
- "pie.percent_visibility": "both",
- "pie.show_labels": true
- },
- "last-edit-info": {
- "id": 1,
- "email": "[email protected]",
- "first_name": "Emmad",
- "last_name": "Usmani",
- "timestamp": "2024-10-03T21:34:37.969909Z"
+ "card": {
+ "original_card_id": 455,
+ "can_delete": false,
+ "public_uuid": null,
+ "parameter_usage_count": 0,
+ "created_at": "2024-10-03T21:34:37.697381Z",
+ "parameters": [],
+ "metabase_version": "v0.1.35-SNAPSHOT (fc423b1)",
+ "collection": {
+ "authority_level": null,
+ "description": null,
+ "archived": false,
+ "trashed_from_location": null,
+ "slug": "sunburst",
+ "archive_operation_id": null,
+ "name": "Sunburst",
+ "personal_owner_id": null,
+ "type": null,
+ "is_sample": false,
+ "id": 32,
+ "archived_directly": null,
+ "entity_id": "yivDsLk9XUmdCWr0lt9GJ",
+ "location": "/5/23/",
+ "namespace": null,
+ "is_personal": false,
+ "created_at": "2024-08-25T18:16:32.499168Z"
+ },
+ "visualization_settings": {
+ "table.pivot_column": "generation",
+ "table.cell_column": "count",
+ "pie.dimension": ["generation", "type_1", "type_2"],
+ "pie.percent_visibility": "both",
+ "pie.show_labels": true
+ },
+ "last-edit-info": {
+ "id": 1,
+ "email": "[email protected]",
+ "first_name": "Emmad",
+ "last_name": "Usmani",
+ "timestamp": "2024-10-03T21:34:37.969909Z"
+ },
+ "collection_preview": true,
+ "entity_id": "v3VeD5Yog4EQxFyZlQKh9",
+ "archived_directly": false,
+ "display": "pie",
+ "parameter_mappings": [],
+ "id": 455,
+ "dataset_query": {
+ "database": 2,
+ "type": "query",
+ "query": {
+ "aggregation": [["count"]],
+ "breakout": [
+ [
+ "field",
+ "generation",
+ {
+ "base-type": "type/BigInteger"
+ }
+ ],
+ [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ]
+ ],
+ "order-by": [["desc", ["aggregation", 0]]],
+ "source-table": "card__104",
+ "filter": [
+ "and",
+ [
+ "=",
+ [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "Water",
+ "Grass",
+ "Fire"
+ ],
+ [
+ "not-empty",
+ [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ]
+ ]
+ ]
+ }
+ },
+ "cache_ttl": null,
+ "embedding_params": null,
+ "made_public_by_id": null,
+ "updated_at": "2024-10-03T21:34:37.697381Z",
+ "moderation_reviews": [],
+ "can_restore": false,
+ "creator_id": 1,
+ "average_query_time": 490.6666666666667,
+ "type": "question",
+ "last_used_at": "2024-10-03T21:36:39.715109Z",
+ "dashboard_count": 1,
+ "last_query_start": "2024-10-03T21:41:44.035179Z",
+ "name": "Sunburst - Percentages and Labels on Chart - Poke Count by Gen, Type 1, Type 2 - Modified",
+ "query_type": "query",
+ "collection_id": 32,
+ "enable_embedding": false,
+ "database_id": 2,
+ "trashed_from_collection_id": null,
+ "can_write": true,
+ "initially_published_at": null,
+ "creator": {
+ "email": "[email protected]",
+ "first_name": "Emmad",
+ "last_login": "2024-09-27T17:38:30.264582Z",
+ "is_qbnewb": false,
+ "is_superuser": true,
+ "id": 1,
+ "last_name": "Usmani",
+ "date_joined": "2023-11-21T21:25:41.062104Z",
+ "common_name": "Emmad Usmani"
+ },
+ "result_metadata": [
+ {
+ "semantic_type": "type/Category",
+ "name": "generation",
+ "field_ref": [
+ "field",
+ "generation",
+ {
+ "base-type": "type/BigInteger"
+ }
+ ],
+ "effective_type": "type/BigInteger",
+ "id": 1503,
+ "visibility_type": "normal",
+ "display_name": "Generation",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 8,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 2.1045160333142734,
+ "q3": 5.716989271844637,
+ "max": 8,
+ "sd": 2.234937326790694,
+ "avg": 4.034046692607004
+ }
+ }
},
- "collection_preview": true,
- "entity_id": "v3VeD5Yog4EQxFyZlQKh9",
- "archived_directly": false,
- "display": "pie",
- "parameter_mappings": [],
- "id": 455,
- "dataset_query": {
- "database": 2,
- "type": "query",
- "query": {
- "aggregation": [
- [
- "count"
- ]
- ],
- "breakout": [
- [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ]
- ],
- "order-by": [
- [
- "desc",
- [
- "aggregation",
- 0
- ]
- ]
- ],
- "source-table": "card__104",
- "filter": [
- "and",
- [
- "=",
- [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "Water",
- "Grass",
- "Fire"
- ],
- [
- "not-empty",
- [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ]
- ]
- ]
+ "base_type": "type/BigInteger"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_1",
+ "field_ref": [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1475,
+ "visibility_type": "normal",
+ "display_name": "Type 1",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 18,
+ "nil%": 0
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 5.281128404669261
}
+ }
},
- "cache_ttl": null,
- "embedding_params": null,
- "made_public_by_id": null,
- "updated_at": "2024-10-03T21:34:37.697381Z",
- "moderation_reviews": [],
- "can_restore": false,
- "creator_id": 1,
- "average_query_time": 490.6666666666667,
- "type": "question",
- "last_used_at": "2024-10-03T21:36:39.715109Z",
- "dashboard_count": 1,
- "last_query_start": "2024-10-03T21:41:44.035179Z",
- "name": "Sunburst - Percentages and Labels on Chart - Poke Count by Gen, Type 1, Type 2 - Modified",
- "query_type": "query",
- "collection_id": 32,
- "enable_embedding": false,
- "database_id": 2,
- "trashed_from_collection_id": null,
- "can_write": true,
- "initially_published_at": null,
- "creator": {
- "email": "[email protected]",
- "first_name": "Emmad",
- "last_login": "2024-09-27T17:38:30.264582Z",
- "is_qbnewb": false,
- "is_superuser": true,
- "id": 1,
- "last_name": "Usmani",
- "date_joined": "2023-11-21T21:25:41.062104Z",
- "common_name": "Emmad Usmani"
+ "base_type": "type/Text"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_2",
+ "field_ref": [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1499,
+ "visibility_type": "normal",
+ "display_name": "Type 2",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 19,
+ "nil%": 0.4727626459143969
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 2.9474708171206228
+ }
+ }
},
- "result_metadata": [
- {
- "semantic_type": "type/Category",
- "name": "generation",
- "field_ref": [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- "effective_type": "type/BigInteger",
- "id": 1503,
- "visibility_type": "normal",
- "display_name": "Generation",
- "fingerprint": {
- "global": {
- "distinct-count": 8,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 2.1045160333142734,
- "q3": 5.716989271844637,
- "max": 8,
- "sd": 2.234937326790694,
- "avg": 4.034046692607004
- }
- }
- },
- "base_type": "type/BigInteger"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_1",
- "field_ref": [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1475,
- "visibility_type": "normal",
- "display_name": "Type 1",
- "fingerprint": {
- "global": {
- "distinct-count": 18,
- "nil%": 0
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 5.281128404669261
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_2",
- "field_ref": [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1499,
- "visibility_type": "normal",
- "display_name": "Type 2",
- "fingerprint": {
- "global": {
- "distinct-count": 19,
- "nil%": 0.4727626459143969
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 2.9474708171206228
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "display_name": "Count",
- "semantic_type": "type/Quantity",
- "field_ref": [
- "aggregation",
- 0
- ],
- "base_type": "type/BigInteger",
- "effective_type": "type/BigInteger",
- "name": "count",
- "fingerprint": {
- "global": {
- "distinct-count": 6,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 1,
- "q3": 2.2964690541943424,
- "max": 10,
- "sd": 1.2898977338673652,
- "avg": 1.8076923076923077
- }
- }
- }
+ "base_type": "type/Text"
+ },
+ {
+ "display_name": "Count",
+ "semantic_type": "type/Quantity",
+ "field_ref": ["aggregation", 0],
+ "base_type": "type/BigInteger",
+ "effective_type": "type/BigInteger",
+ "name": "count",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 6,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 1,
+ "q3": 2.2964690541943424,
+ "max": 10,
+ "sd": 1.2898977338673652,
+ "avg": 1.8076923076923077
}
+ }
+ }
+ }
+ ],
+ "can_run_adhoc_query": true,
+ "table_id": 156,
+ "source_card_id": 104,
+ "collection_position": null,
+ "view_count": 1,
+ "archived": false,
+ "description": null,
+ "cache_invalidated_at": null,
+ "displayIsLocked": true
+ },
+ "data": {
+ "rows": [
+ [1, "Grass", "Poison", 10],
+ [3, "Water", "Ground", 5],
+ [1, "Water", "Psychic", 4],
+ [3, "Water", "Dark", 4],
+ [1, "Fire", "Flying", 3],
+ [1, "Water", "Ice", 3],
+ [2, "Grass", "Flying", 3],
+ [3, "Fire", "Fighting", 3],
+ [3, "Fire", "Ground", 3],
+ [3, "Grass", "Dark", 3],
+ [3, "Water", "Grass", 3],
+ [4, "Grass", "Ice", 3],
+ [7, "Grass", "Fairy", 3],
+ [8, "Grass", "Dragon", 3],
+ [1, "Grass", "Psychic", 2],
+ [1, "Water", "Poison", 2],
+ [2, "Water", "Electric", 2],
+ [2, "Water", "Fairy", 2],
+ [2, "Water", "Ground", 2],
+ [3, "Water", "Flying", 2],
+ [4, "Fire", "Fighting", 2],
+ [4, "Grass", "Poison", 2],
+ [5, "Fire", "Fighting", 2],
+ [5, "Grass", "Fairy", 2],
+ [5, "Grass", "Poison", 2],
+ [5, "Grass", "Steel", 2],
+ [5, "Water", "Fighting", 2],
+ [5, "Water", "Flying", 2],
+ [5, "Water", "Ghost", 2],
+ [5, "Water", "Ground", 2],
+ [5, "Water", "Rock", 2],
+ [6, "Fire", "Flying", 2],
+ [6, "Fire", "Normal", 2],
+ [6, "Water", "Dark", 2],
+ [7, "Grass", "Flying", 2],
+ [7, "Water", "Bug", 2],
+ [7, "Water", "Fairy", 2],
+ [8, "Fire", "Bug", 2],
+ [1, "Fire", "Dragon", 1],
+ [1, "Fire", "Ghost", 1],
+ [1, "Grass", "Dragon", 1],
+ [1, "Water", "Dark", 1],
+ [1, "Water", "Fighting", 1],
+ [1, "Water", "Flying", 1],
+ [2, "Fire", "Flying", 1],
+ [2, "Fire", "Rock", 1],
+ [2, "Water", "Dragon", 1],
+ [2, "Water", "Flying", 1],
+ [2, "Water", "Poison", 1],
+ [2, "Water", "Psychic", 1],
+ [2, "Water", "Rock", 1],
+ [3, "Grass", "Dragon", 1],
+ [3, "Grass", "Fighting", 1],
+ [3, "Grass", "Flying", 1],
+ [3, "Grass", "Poison", 1],
+ [3, "Water", "Rock", 1],
+ [4, "Fire", "Steel", 1],
+ [4, "Grass", "Flying", 1],
+ [4, "Grass", "Ground", 1],
+ [4, "Water", "Dragon", 1],
+ [4, "Water", "Flying", 1],
+ [4, "Water", "Ground", 1],
+ [4, "Water", "Steel", 1],
+ [5, "Fire", "Psychic", 1],
+ [5, "Grass", "Fighting", 1],
+ [6, "Fire", "Psychic", 1],
+ [6, "Fire", "Water", 1],
+ [6, "Grass", "Fighting", 1],
+ [7, "Fire", "Dark", 1],
+ [7, "Fire", "Dragon", 1],
+ [7, "Fire", "Flying", 1],
+ [7, "Fire", "Ghost", 1],
+ [7, "Grass", "Ghost", 1],
+ [7, "Grass", "Steel", 1],
+ [7, "Water", "Psychic", 1],
+ [8, "Water", "Dragon", 1],
+ [8, "Water", "Ice", 1],
+ [8, "Water", "Rock", 1]
+ ],
+ "cols": [
+ {
+ "database_type": "int8",
+ "semantic_type": "type/Category",
+ "table_id": 156,
+ "name": "generation",
+ "source": "breakout",
+ "field_ref": [
+ "field",
+ "generation",
+ {
+ "base-type": "type/BigInteger"
+ }
],
- "can_run_adhoc_query": true,
+ "effective_type": "type/BigInteger",
+ "id": 1503,
+ "position": 5,
+ "visibility_type": "normal",
+ "display_name": "Generation",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 8,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 2.1045160333142734,
+ "q3": 5.716989271844637,
+ "max": 8,
+ "sd": 2.234937326790694,
+ "avg": 4.034046692607004
+ }
+ }
+ },
+ "base_type": "type/BigInteger"
+ },
+ {
+ "database_type": "varchar",
+ "semantic_type": "type/Category",
"table_id": 156,
- "source_card_id": 104,
- "collection_position": null,
- "view_count": 1,
- "archived": false,
- "description": null,
- "cache_invalidated_at": null,
- "displayIsLocked": true
- },
- "data": {
- "rows": [
- [
- 1,
- "Grass",
- "Poison",
- 10
- ],
- [
- 3,
- "Water",
- "Ground",
- 5
- ],
- [
- 1,
- "Water",
- "Psychic",
- 4
- ],
- [
- 3,
- "Water",
- "Dark",
- 4
- ],
- [
- 1,
- "Fire",
- "Flying",
- 3
- ],
- [
- 1,
- "Water",
- "Ice",
- 3
- ],
- [
- 2,
- "Grass",
- "Flying",
- 3
- ],
- [
- 3,
- "Fire",
- "Fighting",
- 3
- ],
- [
- 3,
- "Fire",
- "Ground",
- 3
- ],
- [
- 3,
- "Grass",
- "Dark",
- 3
- ],
- [
- 3,
- "Water",
- "Grass",
- 3
- ],
- [
- 4,
- "Grass",
- "Ice",
- 3
- ],
- [
- 7,
- "Grass",
- "Fairy",
- 3
- ],
- [
- 8,
- "Grass",
- "Dragon",
- 3
- ],
- [
- 1,
- "Grass",
- "Psychic",
- 2
- ],
- [
- 1,
- "Water",
- "Poison",
- 2
- ],
- [
- 2,
- "Water",
- "Electric",
- 2
- ],
- [
- 2,
- "Water",
- "Fairy",
- 2
- ],
- [
- 2,
- "Water",
- "Ground",
- 2
- ],
- [
- 3,
- "Water",
- "Flying",
- 2
- ],
- [
- 4,
- "Fire",
- "Fighting",
- 2
- ],
- [
- 4,
- "Grass",
- "Poison",
- 2
- ],
- [
- 5,
- "Fire",
- "Fighting",
- 2
- ],
- [
- 5,
- "Grass",
- "Fairy",
- 2
- ],
- [
- 5,
- "Grass",
- "Poison",
- 2
- ],
- [
- 5,
- "Grass",
- "Steel",
- 2
- ],
- [
- 5,
- "Water",
- "Fighting",
- 2
- ],
- [
- 5,
- "Water",
- "Flying",
- 2
- ],
- [
- 5,
- "Water",
- "Ghost",
- 2
- ],
- [
- 5,
- "Water",
- "Ground",
- 2
- ],
- [
- 5,
- "Water",
- "Rock",
- 2
- ],
- [
- 6,
- "Fire",
- "Flying",
- 2
- ],
- [
- 6,
- "Fire",
- "Normal",
- 2
- ],
- [
- 6,
- "Water",
- "Dark",
- 2
- ],
- [
- 7,
- "Grass",
- "Flying",
- 2
- ],
- [
- 7,
- "Water",
- "Bug",
- 2
- ],
- [
- 7,
- "Water",
- "Fairy",
- 2
- ],
- [
- 8,
- "Fire",
- "Bug",
- 2
- ],
- [
- 1,
- "Fire",
- "Dragon",
- 1
- ],
- [
- 1,
- "Fire",
- "Ghost",
- 1
- ],
- [
- 1,
- "Grass",
- "Dragon",
- 1
- ],
- [
- 1,
- "Water",
- "Dark",
- 1
- ],
- [
- 1,
- "Water",
- "Fighting",
- 1
- ],
- [
- 1,
- "Water",
- "Flying",
- 1
- ],
- [
- 2,
- "Fire",
- "Flying",
- 1
- ],
- [
- 2,
- "Fire",
- "Rock",
- 1
- ],
- [
- 2,
- "Water",
- "Dragon",
- 1
- ],
- [
- 2,
- "Water",
- "Flying",
- 1
- ],
- [
- 2,
- "Water",
- "Poison",
- 1
- ],
- [
- 2,
- "Water",
- "Psychic",
- 1
- ],
- [
- 2,
- "Water",
- "Rock",
- 1
- ],
- [
- 3,
- "Grass",
- "Dragon",
- 1
- ],
- [
- 3,
- "Grass",
- "Fighting",
- 1
- ],
- [
- 3,
- "Grass",
- "Flying",
- 1
- ],
- [
- 3,
- "Grass",
- "Poison",
- 1
- ],
- [
- 3,
- "Water",
- "Rock",
- 1
- ],
- [
- 4,
- "Fire",
- "Steel",
- 1
- ],
- [
- 4,
- "Grass",
- "Flying",
- 1
- ],
- [
- 4,
- "Grass",
- "Ground",
- 1
- ],
- [
- 4,
- "Water",
- "Dragon",
- 1
- ],
- [
- 4,
- "Water",
- "Flying",
- 1
- ],
- [
- 4,
- "Water",
- "Ground",
- 1
- ],
- [
- 4,
- "Water",
- "Steel",
- 1
- ],
- [
- 5,
- "Fire",
- "Psychic",
- 1
- ],
- [
- 5,
- "Grass",
- "Fighting",
- 1
- ],
- [
- 6,
- "Fire",
- "Psychic",
- 1
- ],
- [
- 6,
- "Fire",
- "Water",
- 1
- ],
- [
- 6,
- "Grass",
- "Fighting",
- 1
- ],
- [
- 7,
- "Fire",
- "Dark",
- 1
- ],
- [
- 7,
- "Fire",
- "Dragon",
- 1
- ],
- [
- 7,
- "Fire",
- "Flying",
- 1
- ],
- [
- 7,
- "Fire",
- "Ghost",
- 1
- ],
- [
- 7,
- "Grass",
- "Ghost",
- 1
- ],
- [
- 7,
- "Grass",
- "Steel",
- 1
- ],
- [
- 7,
- "Water",
- "Psychic",
- 1
- ],
- [
- 8,
- "Water",
- "Dragon",
- 1
- ],
- [
- 8,
- "Water",
- "Ice",
- 1
- ],
- [
- 8,
- "Water",
- "Rock",
- 1
- ]
+ "name": "type_1",
+ "source": "breakout",
+ "field_ref": [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
],
- "cols": [
+ "effective_type": "type/Text",
+ "id": 1475,
+ "position": 9,
+ "visibility_type": "normal",
+ "display_name": "Type 1",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 18,
+ "nil%": 0
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 5.281128404669261
+ }
+ }
+ },
+ "base_type": "type/Text"
+ },
+ {
+ "database_type": "varchar",
+ "semantic_type": "type/Category",
+ "table_id": 156,
+ "name": "type_2",
+ "source": "breakout",
+ "field_ref": [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1499,
+ "position": 10,
+ "visibility_type": "normal",
+ "display_name": "Type 2",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 19,
+ "nil%": 0.4727626459143969
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 2.9474708171206228
+ }
+ }
+ },
+ "base_type": "type/Text"
+ },
+ {
+ "database_type": "int8",
+ "semantic_type": "type/Quantity",
+ "name": "count",
+ "source": "aggregation",
+ "field_ref": ["aggregation", 0],
+ "effective_type": "type/BigInteger",
+ "aggregation_index": 0,
+ "display_name": "Count",
+ "base_type": "type/BigInteger"
+ }
+ ],
+ "native_form": {
+ "query": "SELECT \"source\".\"generation\" AS \"generation\", \"source\".\"type_1\" AS \"type_1\", \"source\".\"type_2\" AS \"type_2\", COUNT(*) AS \"count\" FROM (SELECT \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"_mb_row_id\" AS \"_mb_row_id\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"pokedex_number\" AS \"pokedex_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"name\" AS \"name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"german_name\" AS \"german_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"japanese_name\" AS \"japanese_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"generation\" AS \"generation\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"status\" AS \"status\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"species\" AS \"species\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_number\" AS \"type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_1\" AS \"type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_2\" AS \"type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"height_m\" AS \"height_m\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"weight_kg\" AS \"weight_kg\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"abilities_number\" AS \"abilities_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_1\" AS \"ability_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_2\" AS \"ability_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_hidden\" AS \"ability_hidden\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"total_points\" AS \"total_points\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"hp\" AS \"hp\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"attack\" AS \"attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"defense\" AS \"defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_attack\" AS \"sp_attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_defense\" AS \"sp_defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"speed\" AS \"speed\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"catch_rate\" AS \"catch_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_friendship\" AS \"base_friendship\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_experience\" AS \"base_experience\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"growth_rate\" AS \"growth_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_number\" AS \"egg_type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_1\" AS \"egg_type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_2\" AS \"egg_type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"percentage_male\" AS \"percentage_male\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_cycles\" AS \"egg_cycles\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_normal\" AS \"against_normal\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fire\" AS \"against_fire\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_water\" AS \"against_water\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_electric\" AS \"against_electric\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_grass\" AS \"against_grass\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ice\" AS \"against_ice\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fight\" AS \"against_fight\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_poison\" AS \"against_poison\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ground\" AS \"against_ground\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_flying\" AS \"against_flying\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_psychic\" AS \"against_psychic\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_bug\" AS \"against_bug\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_rock\" AS \"against_rock\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ghost\" AS \"against_ghost\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dragon\" AS \"against_dragon\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dark\" AS \"against_dark\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_steel\" AS \"against_steel\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fairy\" AS \"against_fairy\" FROM \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\") AS \"source\" WHERE ((\"source\".\"type_1\" = 'Water') OR (\"source\".\"type_1\" = 'Grass') OR (\"source\".\"type_1\" = 'Fire')) AND (\"source\".\"type_2\" IS NOT NULL) AND ((\"source\".\"type_2\" <> '') OR (\"source\".\"type_2\" IS NULL)) GROUP BY \"source\".\"generation\", \"source\".\"type_1\", \"source\".\"type_2\" ORDER BY \"count\" DESC, \"source\".\"generation\" ASC, \"source\".\"type_1\" ASC, \"source\".\"type_2\" ASC",
+ "params": null
+ },
+ "dataset": true,
+ "model": true,
+ "format-rows?": true,
+ "results_timezone": "America/Los_Angeles",
+ "results_metadata": {
+ "columns": [
+ {
+ "semantic_type": "type/Category",
+ "name": "generation",
+ "field_ref": [
+ "field",
+ "generation",
{
- "database_type": "int8",
- "semantic_type": "type/Category",
- "table_id": 156,
- "name": "generation",
- "source": "breakout",
- "field_ref": [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- "effective_type": "type/BigInteger",
- "id": 1503,
- "position": 5,
- "visibility_type": "normal",
- "display_name": "Generation",
- "fingerprint": {
- "global": {
- "distinct-count": 8,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 2.1045160333142734,
- "q3": 5.716989271844637,
- "max": 8,
- "sd": 2.234937326790694,
- "avg": 4.034046692607004
- }
- }
- },
- "base_type": "type/BigInteger"
+ "base-type": "type/BigInteger"
+ }
+ ],
+ "effective_type": "type/BigInteger",
+ "id": 1503,
+ "visibility_type": "normal",
+ "display_name": "Generation",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 8,
+ "nil%": 0
},
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 2.1045160333142734,
+ "q3": 5.716989271844637,
+ "max": 8,
+ "sd": 2.234937326790694,
+ "avg": 4.034046692607004
+ }
+ }
+ },
+ "base_type": "type/BigInteger"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_1",
+ "field_ref": [
+ "field",
+ "type_1",
{
- "database_type": "varchar",
- "semantic_type": "type/Category",
- "table_id": 156,
- "name": "type_1",
- "source": "breakout",
- "field_ref": [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1475,
- "position": 9,
- "visibility_type": "normal",
- "display_name": "Type 1",
- "fingerprint": {
- "global": {
- "distinct-count": 18,
- "nil%": 0
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 5.281128404669261
- }
- }
- },
- "base_type": "type/Text"
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1475,
+ "visibility_type": "normal",
+ "display_name": "Type 1",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 18,
+ "nil%": 0
},
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 5.281128404669261
+ }
+ }
+ },
+ "base_type": "type/Text"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_2",
+ "field_ref": [
+ "field",
+ "type_2",
{
- "database_type": "varchar",
- "semantic_type": "type/Category",
- "table_id": 156,
- "name": "type_2",
- "source": "breakout",
- "field_ref": [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1499,
- "position": 10,
- "visibility_type": "normal",
- "display_name": "Type 2",
- "fingerprint": {
- "global": {
- "distinct-count": 19,
- "nil%": 0.4727626459143969
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 2.9474708171206228
- }
- }
- },
- "base_type": "type/Text"
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1499,
+ "visibility_type": "normal",
+ "display_name": "Type 2",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 19,
+ "nil%": 0.4727626459143969
},
- {
- "database_type": "int8",
- "semantic_type": "type/Quantity",
- "name": "count",
- "source": "aggregation",
- "field_ref": [
- "aggregation",
- 0
- ],
- "effective_type": "type/BigInteger",
- "aggregation_index": 0,
- "display_name": "Count",
- "base_type": "type/BigInteger"
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 2.9474708171206228
+ }
}
- ],
- "native_form": {
- "query": "SELECT \"source\".\"generation\" AS \"generation\", \"source\".\"type_1\" AS \"type_1\", \"source\".\"type_2\" AS \"type_2\", COUNT(*) AS \"count\" FROM (SELECT \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"_mb_row_id\" AS \"_mb_row_id\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"pokedex_number\" AS \"pokedex_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"name\" AS \"name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"german_name\" AS \"german_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"japanese_name\" AS \"japanese_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"generation\" AS \"generation\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"status\" AS \"status\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"species\" AS \"species\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_number\" AS \"type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_1\" AS \"type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_2\" AS \"type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"height_m\" AS \"height_m\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"weight_kg\" AS \"weight_kg\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"abilities_number\" AS \"abilities_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_1\" AS \"ability_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_2\" AS \"ability_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_hidden\" AS \"ability_hidden\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"total_points\" AS \"total_points\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"hp\" AS \"hp\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"attack\" AS \"attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"defense\" AS \"defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_attack\" AS \"sp_attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_defense\" AS \"sp_defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"speed\" AS \"speed\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"catch_rate\" AS \"catch_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_friendship\" AS \"base_friendship\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_experience\" AS \"base_experience\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"growth_rate\" AS \"growth_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_number\" AS \"egg_type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_1\" AS \"egg_type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_2\" AS \"egg_type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"percentage_male\" AS \"percentage_male\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_cycles\" AS \"egg_cycles\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_normal\" AS \"against_normal\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fire\" AS \"against_fire\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_water\" AS \"against_water\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_electric\" AS \"against_electric\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_grass\" AS \"against_grass\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ice\" AS \"against_ice\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fight\" AS \"against_fight\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_poison\" AS \"against_poison\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ground\" AS \"against_ground\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_flying\" AS \"against_flying\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_psychic\" AS \"against_psychic\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_bug\" AS \"against_bug\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_rock\" AS \"against_rock\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ghost\" AS \"against_ghost\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dragon\" AS \"against_dragon\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dark\" AS \"against_dark\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_steel\" AS \"against_steel\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fairy\" AS \"against_fairy\" FROM \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\") AS \"source\" WHERE ((\"source\".\"type_1\" = 'Water') OR (\"source\".\"type_1\" = 'Grass') OR (\"source\".\"type_1\" = 'Fire')) AND (\"source\".\"type_2\" IS NOT NULL) AND ((\"source\".\"type_2\" <> '') OR (\"source\".\"type_2\" IS NULL)) GROUP BY \"source\".\"generation\", \"source\".\"type_1\", \"source\".\"type_2\" ORDER BY \"count\" DESC, \"source\".\"generation\" ASC, \"source\".\"type_1\" ASC, \"source\".\"type_2\" ASC",
- "params": null
- },
- "dataset": true,
- "model": true,
- "format-rows?": true,
- "results_timezone": "America/Los_Angeles",
- "results_metadata": {
- "columns": [
- {
- "semantic_type": "type/Category",
- "name": "generation",
- "field_ref": [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- "effective_type": "type/BigInteger",
- "id": 1503,
- "visibility_type": "normal",
- "display_name": "Generation",
- "fingerprint": {
- "global": {
- "distinct-count": 8,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 2.1045160333142734,
- "q3": 5.716989271844637,
- "max": 8,
- "sd": 2.234937326790694,
- "avg": 4.034046692607004
- }
- }
- },
- "base_type": "type/BigInteger"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_1",
- "field_ref": [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1475,
- "visibility_type": "normal",
- "display_name": "Type 1",
- "fingerprint": {
- "global": {
- "distinct-count": 18,
- "nil%": 0
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 5.281128404669261
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_2",
- "field_ref": [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1499,
- "visibility_type": "normal",
- "display_name": "Type 2",
- "fingerprint": {
- "global": {
- "distinct-count": 19,
- "nil%": 0.4727626459143969
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 2.9474708171206228
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "display_name": "Count",
- "semantic_type": "type/Quantity",
- "field_ref": [
- "aggregation",
- 0
- ],
- "base_type": "type/BigInteger",
- "effective_type": "type/BigInteger",
- "name": "count",
- "fingerprint": {
- "global": {
- "distinct-count": 6,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 1,
- "q3": 2.2964690541943424,
- "max": 10,
- "sd": 1.2898977338673652,
- "avg": 1.8076923076923077
- }
- }
- }
- }
- ]
+ },
+ "base_type": "type/Text"
},
- "insights": null
- }
+ {
+ "display_name": "Count",
+ "semantic_type": "type/Quantity",
+ "field_ref": ["aggregation", 0],
+ "base_type": "type/BigInteger",
+ "effective_type": "type/BigInteger",
+ "name": "count",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 6,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 1,
+ "q3": 2.2964690541943424,
+ "max": 10,
+ "sd": 1.2898977338673652,
+ "avg": 1.8076923076923077
+ }
+ }
+ }
+ }
+ ]
+ },
+ "insights": null
+ }
}
]
diff --git a/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-on-chart.json b/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-on-chart.json
index 176f86419b7..5d2a7e64a7f 100644
--- a/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-on-chart.json
+++ b/frontend/src/metabase/visualizations/visualizations/PieChart/stories-data/three-rings-percentages-on-chart.json
@@ -1,1017 +1,602 @@
[
{
- "card": {
- "original_card_id": 454,
- "can_delete": false,
- "public_uuid": null,
- "parameter_usage_count": 0,
- "created_at": "2024-10-03T21:34:23.611863Z",
- "parameters": [],
- "metabase_version": "v0.1.35-SNAPSHOT (fc423b1)",
- "collection": {
- "authority_level": null,
- "description": null,
- "archived": false,
- "trashed_from_location": null,
- "slug": "sunburst",
- "archive_operation_id": null,
- "name": "Sunburst",
- "personal_owner_id": null,
- "type": null,
- "is_sample": false,
- "id": 32,
- "archived_directly": null,
- "entity_id": "yivDsLk9XUmdCWr0lt9GJ",
- "location": "/5/23/",
- "namespace": null,
- "is_personal": false,
- "created_at": "2024-08-25T18:16:32.499168Z"
- },
- "visualization_settings": {
- "table.pivot_column": "generation",
- "table.cell_column": "count",
- "pie.dimension": [
- "generation",
- "type_1",
- "type_2"
- ],
- "pie.percent_visibility": "both",
- "pie.show_labels": false
- },
- "last-edit-info": {
- "id": 1,
- "email": "[email protected]",
- "first_name": "Emmad",
- "last_name": "Usmani",
- "timestamp": "2024-10-03T21:34:23.892642Z"
+ "card": {
+ "original_card_id": 454,
+ "can_delete": false,
+ "public_uuid": null,
+ "parameter_usage_count": 0,
+ "created_at": "2024-10-03T21:34:23.611863Z",
+ "parameters": [],
+ "metabase_version": "v0.1.35-SNAPSHOT (fc423b1)",
+ "collection": {
+ "authority_level": null,
+ "description": null,
+ "archived": false,
+ "trashed_from_location": null,
+ "slug": "sunburst",
+ "archive_operation_id": null,
+ "name": "Sunburst",
+ "personal_owner_id": null,
+ "type": null,
+ "is_sample": false,
+ "id": 32,
+ "archived_directly": null,
+ "entity_id": "yivDsLk9XUmdCWr0lt9GJ",
+ "location": "/5/23/",
+ "namespace": null,
+ "is_personal": false,
+ "created_at": "2024-08-25T18:16:32.499168Z"
+ },
+ "visualization_settings": {
+ "table.pivot_column": "generation",
+ "table.cell_column": "count",
+ "pie.dimension": ["generation", "type_1", "type_2"],
+ "pie.percent_visibility": "both",
+ "pie.show_labels": false
+ },
+ "last-edit-info": {
+ "id": 1,
+ "email": "[email protected]",
+ "first_name": "Emmad",
+ "last_name": "Usmani",
+ "timestamp": "2024-10-03T21:34:23.892642Z"
+ },
+ "collection_preview": true,
+ "entity_id": "V1t5ILXiehN_X8fq9-Zv4",
+ "archived_directly": false,
+ "display": "pie",
+ "parameter_mappings": [],
+ "id": 454,
+ "dataset_query": {
+ "database": 2,
+ "type": "query",
+ "query": {
+ "aggregation": [["count"]],
+ "breakout": [
+ [
+ "field",
+ "generation",
+ {
+ "base-type": "type/BigInteger"
+ }
+ ],
+ [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ]
+ ],
+ "order-by": [["desc", ["aggregation", 0]]],
+ "source-table": "card__104",
+ "filter": [
+ "and",
+ [
+ "=",
+ [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "Water",
+ "Grass",
+ "Fire"
+ ],
+ [
+ "not-empty",
+ [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ]
+ ]
+ ]
+ }
+ },
+ "cache_ttl": null,
+ "embedding_params": null,
+ "made_public_by_id": null,
+ "updated_at": "2024-10-03T21:34:23.611863Z",
+ "moderation_reviews": [],
+ "can_restore": false,
+ "creator_id": 1,
+ "average_query_time": 487.6666666666667,
+ "type": "question",
+ "last_used_at": "2024-10-03T21:37:56.715682Z",
+ "dashboard_count": 1,
+ "last_query_start": "2024-10-03T21:37:56.514755Z",
+ "name": "Sunburst - Percentages on Chart - Poke Count by Gen, Type 1, Type 2",
+ "query_type": "query",
+ "collection_id": 32,
+ "enable_embedding": false,
+ "database_id": 2,
+ "trashed_from_collection_id": null,
+ "can_write": true,
+ "initially_published_at": null,
+ "creator": {
+ "email": "[email protected]",
+ "first_name": "Emmad",
+ "last_login": "2024-09-27T17:38:30.264582Z",
+ "is_qbnewb": false,
+ "is_superuser": true,
+ "id": 1,
+ "last_name": "Usmani",
+ "date_joined": "2023-11-21T21:25:41.062104Z",
+ "common_name": "Emmad Usmani"
+ },
+ "result_metadata": [
+ {
+ "semantic_type": "type/Category",
+ "name": "generation",
+ "field_ref": [
+ "field",
+ "generation",
+ {
+ "base-type": "type/BigInteger"
+ }
+ ],
+ "effective_type": "type/BigInteger",
+ "id": 1503,
+ "visibility_type": "normal",
+ "display_name": "Generation",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 8,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 2.1045160333142734,
+ "q3": 5.716989271844637,
+ "max": 8,
+ "sd": 2.234937326790694,
+ "avg": 4.034046692607004
+ }
+ }
},
- "collection_preview": true,
- "entity_id": "V1t5ILXiehN_X8fq9-Zv4",
- "archived_directly": false,
- "display": "pie",
- "parameter_mappings": [],
- "id": 454,
- "dataset_query": {
- "database": 2,
- "type": "query",
- "query": {
- "aggregation": [
- [
- "count"
- ]
- ],
- "breakout": [
- [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ]
- ],
- "order-by": [
- [
- "desc",
- [
- "aggregation",
- 0
- ]
- ]
- ],
- "source-table": "card__104",
- "filter": [
- "and",
- [
- "=",
- [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "Water",
- "Grass",
- "Fire"
- ],
- [
- "not-empty",
- [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ]
- ]
- ]
+ "base_type": "type/BigInteger"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_1",
+ "field_ref": [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1475,
+ "visibility_type": "normal",
+ "display_name": "Type 1",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 18,
+ "nil%": 0
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 5.281128404669261
}
+ }
},
- "cache_ttl": null,
- "embedding_params": null,
- "made_public_by_id": null,
- "updated_at": "2024-10-03T21:34:23.611863Z",
- "moderation_reviews": [],
- "can_restore": false,
- "creator_id": 1,
- "average_query_time": 487.6666666666667,
- "type": "question",
- "last_used_at": "2024-10-03T21:37:56.715682Z",
- "dashboard_count": 1,
- "last_query_start": "2024-10-03T21:37:56.514755Z",
- "name": "Sunburst - Percentages on Chart - Poke Count by Gen, Type 1, Type 2",
- "query_type": "query",
- "collection_id": 32,
- "enable_embedding": false,
- "database_id": 2,
- "trashed_from_collection_id": null,
- "can_write": true,
- "initially_published_at": null,
- "creator": {
- "email": "[email protected]",
- "first_name": "Emmad",
- "last_login": "2024-09-27T17:38:30.264582Z",
- "is_qbnewb": false,
- "is_superuser": true,
- "id": 1,
- "last_name": "Usmani",
- "date_joined": "2023-11-21T21:25:41.062104Z",
- "common_name": "Emmad Usmani"
+ "base_type": "type/Text"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_2",
+ "field_ref": [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1499,
+ "visibility_type": "normal",
+ "display_name": "Type 2",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 19,
+ "nil%": 0.4727626459143969
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 2.9474708171206228
+ }
+ }
},
- "result_metadata": [
- {
- "semantic_type": "type/Category",
- "name": "generation",
- "field_ref": [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- "effective_type": "type/BigInteger",
- "id": 1503,
- "visibility_type": "normal",
- "display_name": "Generation",
- "fingerprint": {
- "global": {
- "distinct-count": 8,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 2.1045160333142734,
- "q3": 5.716989271844637,
- "max": 8,
- "sd": 2.234937326790694,
- "avg": 4.034046692607004
- }
- }
- },
- "base_type": "type/BigInteger"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_1",
- "field_ref": [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1475,
- "visibility_type": "normal",
- "display_name": "Type 1",
- "fingerprint": {
- "global": {
- "distinct-count": 18,
- "nil%": 0
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 5.281128404669261
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_2",
- "field_ref": [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1499,
- "visibility_type": "normal",
- "display_name": "Type 2",
- "fingerprint": {
- "global": {
- "distinct-count": 19,
- "nil%": 0.4727626459143969
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 2.9474708171206228
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "display_name": "Count",
- "semantic_type": "type/Quantity",
- "field_ref": [
- "aggregation",
- 0
- ],
- "base_type": "type/BigInteger",
- "effective_type": "type/BigInteger",
- "name": "count",
- "fingerprint": {
- "global": {
- "distinct-count": 6,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 1,
- "q3": 2.2964690541943424,
- "max": 10,
- "sd": 1.2898977338673652,
- "avg": 1.8076923076923077
- }
- }
- }
+ "base_type": "type/Text"
+ },
+ {
+ "display_name": "Count",
+ "semantic_type": "type/Quantity",
+ "field_ref": ["aggregation", 0],
+ "base_type": "type/BigInteger",
+ "effective_type": "type/BigInteger",
+ "name": "count",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 6,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 1,
+ "q3": 2.2964690541943424,
+ "max": 10,
+ "sd": 1.2898977338673652,
+ "avg": 1.8076923076923077
}
+ }
+ }
+ }
+ ],
+ "can_run_adhoc_query": true,
+ "table_id": 156,
+ "source_card_id": 104,
+ "collection_position": null,
+ "view_count": 1,
+ "archived": false,
+ "description": null,
+ "cache_invalidated_at": null,
+ "displayIsLocked": true
+ },
+ "data": {
+ "rows": [
+ [1, "Grass", "Poison", 10],
+ [3, "Water", "Ground", 5],
+ [1, "Water", "Psychic", 4],
+ [3, "Water", "Dark", 4],
+ [1, "Fire", "Flying", 3],
+ [1, "Water", "Ice", 3],
+ [2, "Grass", "Flying", 3],
+ [3, "Fire", "Fighting", 3],
+ [3, "Fire", "Ground", 3],
+ [3, "Grass", "Dark", 3],
+ [3, "Water", "Grass", 3],
+ [4, "Grass", "Ice", 3],
+ [7, "Grass", "Fairy", 3],
+ [8, "Grass", "Dragon", 3],
+ [1, "Grass", "Psychic", 2],
+ [1, "Water", "Poison", 2],
+ [2, "Water", "Electric", 2],
+ [2, "Water", "Fairy", 2],
+ [2, "Water", "Ground", 2],
+ [3, "Water", "Flying", 2],
+ [4, "Fire", "Fighting", 2],
+ [4, "Grass", "Poison", 2],
+ [5, "Fire", "Fighting", 2],
+ [5, "Grass", "Fairy", 2],
+ [5, "Grass", "Poison", 2],
+ [5, "Grass", "Steel", 2],
+ [5, "Water", "Fighting", 2],
+ [5, "Water", "Flying", 2],
+ [5, "Water", "Ghost", 2],
+ [5, "Water", "Ground", 2],
+ [5, "Water", "Rock", 2],
+ [6, "Fire", "Flying", 2],
+ [6, "Fire", "Normal", 2],
+ [6, "Water", "Dark", 2],
+ [7, "Grass", "Flying", 2],
+ [7, "Water", "Bug", 2],
+ [7, "Water", "Fairy", 2],
+ [8, "Fire", "Bug", 2],
+ [1, "Fire", "Dragon", 1],
+ [1, "Fire", "Ghost", 1],
+ [1, "Grass", "Dragon", 1],
+ [1, "Water", "Dark", 1],
+ [1, "Water", "Fighting", 1],
+ [1, "Water", "Flying", 1],
+ [2, "Fire", "Flying", 1],
+ [2, "Fire", "Rock", 1],
+ [2, "Water", "Dragon", 1],
+ [2, "Water", "Flying", 1],
+ [2, "Water", "Poison", 1],
+ [2, "Water", "Psychic", 1],
+ [2, "Water", "Rock", 1],
+ [3, "Grass", "Dragon", 1],
+ [3, "Grass", "Fighting", 1],
+ [3, "Grass", "Flying", 1],
+ [3, "Grass", "Poison", 1],
+ [3, "Water", "Rock", 1],
+ [4, "Fire", "Steel", 1],
+ [4, "Grass", "Flying", 1],
+ [4, "Grass", "Ground", 1],
+ [4, "Water", "Dragon", 1],
+ [4, "Water", "Flying", 1],
+ [4, "Water", "Ground", 1],
+ [4, "Water", "Steel", 1],
+ [5, "Fire", "Psychic", 1],
+ [5, "Grass", "Fighting", 1],
+ [6, "Fire", "Psychic", 1],
+ [6, "Fire", "Water", 1],
+ [6, "Grass", "Fighting", 1],
+ [7, "Fire", "Dark", 1],
+ [7, "Fire", "Dragon", 1],
+ [7, "Fire", "Flying", 1],
+ [7, "Fire", "Ghost", 1],
+ [7, "Grass", "Ghost", 1],
+ [7, "Grass", "Steel", 1],
+ [7, "Water", "Psychic", 1],
+ [8, "Water", "Dragon", 1],
+ [8, "Water", "Ice", 1],
+ [8, "Water", "Rock", 1]
+ ],
+ "cols": [
+ {
+ "database_type": "int8",
+ "semantic_type": "type/Category",
+ "table_id": 156,
+ "name": "generation",
+ "source": "breakout",
+ "field_ref": [
+ "field",
+ "generation",
+ {
+ "base-type": "type/BigInteger"
+ }
],
- "can_run_adhoc_query": true,
+ "effective_type": "type/BigInteger",
+ "id": 1503,
+ "position": 5,
+ "visibility_type": "normal",
+ "display_name": "Generation",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 8,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 2.1045160333142734,
+ "q3": 5.716989271844637,
+ "max": 8,
+ "sd": 2.234937326790694,
+ "avg": 4.034046692607004
+ }
+ }
+ },
+ "base_type": "type/BigInteger"
+ },
+ {
+ "database_type": "varchar",
+ "semantic_type": "type/Category",
"table_id": 156,
- "source_card_id": 104,
- "collection_position": null,
- "view_count": 1,
- "archived": false,
- "description": null,
- "cache_invalidated_at": null,
- "displayIsLocked": true
- },
- "data": {
- "rows": [
- [
- 1,
- "Grass",
- "Poison",
- 10
- ],
- [
- 3,
- "Water",
- "Ground",
- 5
- ],
- [
- 1,
- "Water",
- "Psychic",
- 4
- ],
- [
- 3,
- "Water",
- "Dark",
- 4
- ],
- [
- 1,
- "Fire",
- "Flying",
- 3
- ],
- [
- 1,
- "Water",
- "Ice",
- 3
- ],
- [
- 2,
- "Grass",
- "Flying",
- 3
- ],
- [
- 3,
- "Fire",
- "Fighting",
- 3
- ],
- [
- 3,
- "Fire",
- "Ground",
- 3
- ],
- [
- 3,
- "Grass",
- "Dark",
- 3
- ],
- [
- 3,
- "Water",
- "Grass",
- 3
- ],
- [
- 4,
- "Grass",
- "Ice",
- 3
- ],
- [
- 7,
- "Grass",
- "Fairy",
- 3
- ],
- [
- 8,
- "Grass",
- "Dragon",
- 3
- ],
- [
- 1,
- "Grass",
- "Psychic",
- 2
- ],
- [
- 1,
- "Water",
- "Poison",
- 2
- ],
- [
- 2,
- "Water",
- "Electric",
- 2
- ],
- [
- 2,
- "Water",
- "Fairy",
- 2
- ],
- [
- 2,
- "Water",
- "Ground",
- 2
- ],
- [
- 3,
- "Water",
- "Flying",
- 2
- ],
- [
- 4,
- "Fire",
- "Fighting",
- 2
- ],
- [
- 4,
- "Grass",
- "Poison",
- 2
- ],
- [
- 5,
- "Fire",
- "Fighting",
- 2
- ],
- [
- 5,
- "Grass",
- "Fairy",
- 2
- ],
- [
- 5,
- "Grass",
- "Poison",
- 2
- ],
- [
- 5,
- "Grass",
- "Steel",
- 2
- ],
- [
- 5,
- "Water",
- "Fighting",
- 2
- ],
- [
- 5,
- "Water",
- "Flying",
- 2
- ],
- [
- 5,
- "Water",
- "Ghost",
- 2
- ],
- [
- 5,
- "Water",
- "Ground",
- 2
- ],
- [
- 5,
- "Water",
- "Rock",
- 2
- ],
- [
- 6,
- "Fire",
- "Flying",
- 2
- ],
- [
- 6,
- "Fire",
- "Normal",
- 2
- ],
- [
- 6,
- "Water",
- "Dark",
- 2
- ],
- [
- 7,
- "Grass",
- "Flying",
- 2
- ],
- [
- 7,
- "Water",
- "Bug",
- 2
- ],
- [
- 7,
- "Water",
- "Fairy",
- 2
- ],
- [
- 8,
- "Fire",
- "Bug",
- 2
- ],
- [
- 1,
- "Fire",
- "Dragon",
- 1
- ],
- [
- 1,
- "Fire",
- "Ghost",
- 1
- ],
- [
- 1,
- "Grass",
- "Dragon",
- 1
- ],
- [
- 1,
- "Water",
- "Dark",
- 1
- ],
- [
- 1,
- "Water",
- "Fighting",
- 1
- ],
- [
- 1,
- "Water",
- "Flying",
- 1
- ],
- [
- 2,
- "Fire",
- "Flying",
- 1
- ],
- [
- 2,
- "Fire",
- "Rock",
- 1
- ],
- [
- 2,
- "Water",
- "Dragon",
- 1
- ],
- [
- 2,
- "Water",
- "Flying",
- 1
- ],
- [
- 2,
- "Water",
- "Poison",
- 1
- ],
- [
- 2,
- "Water",
- "Psychic",
- 1
- ],
- [
- 2,
- "Water",
- "Rock",
- 1
- ],
- [
- 3,
- "Grass",
- "Dragon",
- 1
- ],
- [
- 3,
- "Grass",
- "Fighting",
- 1
- ],
- [
- 3,
- "Grass",
- "Flying",
- 1
- ],
- [
- 3,
- "Grass",
- "Poison",
- 1
- ],
- [
- 3,
- "Water",
- "Rock",
- 1
- ],
- [
- 4,
- "Fire",
- "Steel",
- 1
- ],
- [
- 4,
- "Grass",
- "Flying",
- 1
- ],
- [
- 4,
- "Grass",
- "Ground",
- 1
- ],
- [
- 4,
- "Water",
- "Dragon",
- 1
- ],
- [
- 4,
- "Water",
- "Flying",
- 1
- ],
- [
- 4,
- "Water",
- "Ground",
- 1
- ],
- [
- 4,
- "Water",
- "Steel",
- 1
- ],
- [
- 5,
- "Fire",
- "Psychic",
- 1
- ],
- [
- 5,
- "Grass",
- "Fighting",
- 1
- ],
- [
- 6,
- "Fire",
- "Psychic",
- 1
- ],
- [
- 6,
- "Fire",
- "Water",
- 1
- ],
- [
- 6,
- "Grass",
- "Fighting",
- 1
- ],
- [
- 7,
- "Fire",
- "Dark",
- 1
- ],
- [
- 7,
- "Fire",
- "Dragon",
- 1
- ],
- [
- 7,
- "Fire",
- "Flying",
- 1
- ],
- [
- 7,
- "Fire",
- "Ghost",
- 1
- ],
- [
- 7,
- "Grass",
- "Ghost",
- 1
- ],
- [
- 7,
- "Grass",
- "Steel",
- 1
- ],
- [
- 7,
- "Water",
- "Psychic",
- 1
- ],
- [
- 8,
- "Water",
- "Dragon",
- 1
- ],
- [
- 8,
- "Water",
- "Ice",
- 1
- ],
- [
- 8,
- "Water",
- "Rock",
- 1
- ]
+ "name": "type_1",
+ "source": "breakout",
+ "field_ref": [
+ "field",
+ "type_1",
+ {
+ "base-type": "type/Text"
+ }
],
- "cols": [
+ "effective_type": "type/Text",
+ "id": 1475,
+ "position": 9,
+ "visibility_type": "normal",
+ "display_name": "Type 1",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 18,
+ "nil%": 0
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 5.281128404669261
+ }
+ }
+ },
+ "base_type": "type/Text"
+ },
+ {
+ "database_type": "varchar",
+ "semantic_type": "type/Category",
+ "table_id": 156,
+ "name": "type_2",
+ "source": "breakout",
+ "field_ref": [
+ "field",
+ "type_2",
+ {
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1499,
+ "position": 10,
+ "visibility_type": "normal",
+ "display_name": "Type 2",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 19,
+ "nil%": 0.4727626459143969
+ },
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 2.9474708171206228
+ }
+ }
+ },
+ "base_type": "type/Text"
+ },
+ {
+ "database_type": "int8",
+ "semantic_type": "type/Quantity",
+ "name": "count",
+ "source": "aggregation",
+ "field_ref": ["aggregation", 0],
+ "effective_type": "type/BigInteger",
+ "aggregation_index": 0,
+ "display_name": "Count",
+ "base_type": "type/BigInteger"
+ }
+ ],
+ "native_form": {
+ "query": "SELECT \"source\".\"generation\" AS \"generation\", \"source\".\"type_1\" AS \"type_1\", \"source\".\"type_2\" AS \"type_2\", COUNT(*) AS \"count\" FROM (SELECT \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"_mb_row_id\" AS \"_mb_row_id\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"pokedex_number\" AS \"pokedex_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"name\" AS \"name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"german_name\" AS \"german_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"japanese_name\" AS \"japanese_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"generation\" AS \"generation\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"status\" AS \"status\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"species\" AS \"species\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_number\" AS \"type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_1\" AS \"type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_2\" AS \"type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"height_m\" AS \"height_m\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"weight_kg\" AS \"weight_kg\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"abilities_number\" AS \"abilities_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_1\" AS \"ability_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_2\" AS \"ability_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_hidden\" AS \"ability_hidden\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"total_points\" AS \"total_points\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"hp\" AS \"hp\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"attack\" AS \"attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"defense\" AS \"defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_attack\" AS \"sp_attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_defense\" AS \"sp_defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"speed\" AS \"speed\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"catch_rate\" AS \"catch_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_friendship\" AS \"base_friendship\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_experience\" AS \"base_experience\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"growth_rate\" AS \"growth_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_number\" AS \"egg_type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_1\" AS \"egg_type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_2\" AS \"egg_type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"percentage_male\" AS \"percentage_male\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_cycles\" AS \"egg_cycles\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_normal\" AS \"against_normal\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fire\" AS \"against_fire\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_water\" AS \"against_water\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_electric\" AS \"against_electric\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_grass\" AS \"against_grass\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ice\" AS \"against_ice\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fight\" AS \"against_fight\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_poison\" AS \"against_poison\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ground\" AS \"against_ground\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_flying\" AS \"against_flying\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_psychic\" AS \"against_psychic\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_bug\" AS \"against_bug\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_rock\" AS \"against_rock\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ghost\" AS \"against_ghost\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dragon\" AS \"against_dragon\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dark\" AS \"against_dark\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_steel\" AS \"against_steel\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fairy\" AS \"against_fairy\" FROM \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\") AS \"source\" WHERE ((\"source\".\"type_1\" = 'Water') OR (\"source\".\"type_1\" = 'Grass') OR (\"source\".\"type_1\" = 'Fire')) AND (\"source\".\"type_2\" IS NOT NULL) AND ((\"source\".\"type_2\" <> '') OR (\"source\".\"type_2\" IS NULL)) GROUP BY \"source\".\"generation\", \"source\".\"type_1\", \"source\".\"type_2\" ORDER BY \"count\" DESC, \"source\".\"generation\" ASC, \"source\".\"type_1\" ASC, \"source\".\"type_2\" ASC",
+ "params": null
+ },
+ "dataset": true,
+ "model": true,
+ "format-rows?": true,
+ "results_timezone": "America/Los_Angeles",
+ "results_metadata": {
+ "columns": [
+ {
+ "semantic_type": "type/Category",
+ "name": "generation",
+ "field_ref": [
+ "field",
+ "generation",
{
- "database_type": "int8",
- "semantic_type": "type/Category",
- "table_id": 156,
- "name": "generation",
- "source": "breakout",
- "field_ref": [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- "effective_type": "type/BigInteger",
- "id": 1503,
- "position": 5,
- "visibility_type": "normal",
- "display_name": "Generation",
- "fingerprint": {
- "global": {
- "distinct-count": 8,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 2.1045160333142734,
- "q3": 5.716989271844637,
- "max": 8,
- "sd": 2.234937326790694,
- "avg": 4.034046692607004
- }
- }
- },
- "base_type": "type/BigInteger"
+ "base-type": "type/BigInteger"
+ }
+ ],
+ "effective_type": "type/BigInteger",
+ "id": 1503,
+ "visibility_type": "normal",
+ "display_name": "Generation",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 8,
+ "nil%": 0
},
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 2.1045160333142734,
+ "q3": 5.716989271844637,
+ "max": 8,
+ "sd": 2.234937326790694,
+ "avg": 4.034046692607004
+ }
+ }
+ },
+ "base_type": "type/BigInteger"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_1",
+ "field_ref": [
+ "field",
+ "type_1",
{
- "database_type": "varchar",
- "semantic_type": "type/Category",
- "table_id": 156,
- "name": "type_1",
- "source": "breakout",
- "field_ref": [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1475,
- "position": 9,
- "visibility_type": "normal",
- "display_name": "Type 1",
- "fingerprint": {
- "global": {
- "distinct-count": 18,
- "nil%": 0
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 5.281128404669261
- }
- }
- },
- "base_type": "type/Text"
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1475,
+ "visibility_type": "normal",
+ "display_name": "Type 1",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 18,
+ "nil%": 0
},
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 5.281128404669261
+ }
+ }
+ },
+ "base_type": "type/Text"
+ },
+ {
+ "semantic_type": "type/Category",
+ "name": "type_2",
+ "field_ref": [
+ "field",
+ "type_2",
{
- "database_type": "varchar",
- "semantic_type": "type/Category",
- "table_id": 156,
- "name": "type_2",
- "source": "breakout",
- "field_ref": [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1499,
- "position": 10,
- "visibility_type": "normal",
- "display_name": "Type 2",
- "fingerprint": {
- "global": {
- "distinct-count": 19,
- "nil%": 0.4727626459143969
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 2.9474708171206228
- }
- }
- },
- "base_type": "type/Text"
+ "base-type": "type/Text"
+ }
+ ],
+ "effective_type": "type/Text",
+ "id": 1499,
+ "visibility_type": "normal",
+ "display_name": "Type 2",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 19,
+ "nil%": 0.4727626459143969
},
- {
- "database_type": "int8",
- "semantic_type": "type/Quantity",
- "name": "count",
- "source": "aggregation",
- "field_ref": [
- "aggregation",
- 0
- ],
- "effective_type": "type/BigInteger",
- "aggregation_index": 0,
- "display_name": "Count",
- "base_type": "type/BigInteger"
+ "type": {
+ "type/Text": {
+ "percent-json": 0,
+ "percent-url": 0,
+ "percent-email": 0,
+ "percent-state": 0,
+ "average-length": 2.9474708171206228
+ }
}
- ],
- "native_form": {
- "query": "SELECT \"source\".\"generation\" AS \"generation\", \"source\".\"type_1\" AS \"type_1\", \"source\".\"type_2\" AS \"type_2\", COUNT(*) AS \"count\" FROM (SELECT \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"_mb_row_id\" AS \"_mb_row_id\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"pokedex_number\" AS \"pokedex_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"name\" AS \"name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"german_name\" AS \"german_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"japanese_name\" AS \"japanese_name\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"generation\" AS \"generation\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"status\" AS \"status\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"species\" AS \"species\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_number\" AS \"type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_1\" AS \"type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"type_2\" AS \"type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"height_m\" AS \"height_m\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"weight_kg\" AS \"weight_kg\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"abilities_number\" AS \"abilities_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_1\" AS \"ability_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_2\" AS \"ability_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"ability_hidden\" AS \"ability_hidden\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"total_points\" AS \"total_points\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"hp\" AS \"hp\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"attack\" AS \"attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"defense\" AS \"defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_attack\" AS \"sp_attack\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"sp_defense\" AS \"sp_defense\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"speed\" AS \"speed\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"catch_rate\" AS \"catch_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_friendship\" AS \"base_friendship\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"base_experience\" AS \"base_experience\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"growth_rate\" AS \"growth_rate\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_number\" AS \"egg_type_number\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_1\" AS \"egg_type_1\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_type_2\" AS \"egg_type_2\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"percentage_male\" AS \"percentage_male\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"egg_cycles\" AS \"egg_cycles\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_normal\" AS \"against_normal\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fire\" AS \"against_fire\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_water\" AS \"against_water\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_electric\" AS \"against_electric\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_grass\" AS \"against_grass\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ice\" AS \"against_ice\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fight\" AS \"against_fight\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_poison\" AS \"against_poison\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ground\" AS \"against_ground\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_flying\" AS \"against_flying\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_psychic\" AS \"against_psychic\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_bug\" AS \"against_bug\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_rock\" AS \"against_rock\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_ghost\" AS \"against_ghost\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dragon\" AS \"against_dragon\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_dark\" AS \"against_dark\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_steel\" AS \"against_steel\", \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\".\"against_fairy\" AS \"against_fairy\" FROM \"csv_upload_data\".\"csv_upload_pokedex_20231202112932\") AS \"source\" WHERE ((\"source\".\"type_1\" = 'Water') OR (\"source\".\"type_1\" = 'Grass') OR (\"source\".\"type_1\" = 'Fire')) AND (\"source\".\"type_2\" IS NOT NULL) AND ((\"source\".\"type_2\" <> '') OR (\"source\".\"type_2\" IS NULL)) GROUP BY \"source\".\"generation\", \"source\".\"type_1\", \"source\".\"type_2\" ORDER BY \"count\" DESC, \"source\".\"generation\" ASC, \"source\".\"type_1\" ASC, \"source\".\"type_2\" ASC",
- "params": null
- },
- "dataset": true,
- "model": true,
- "format-rows?": true,
- "results_timezone": "America/Los_Angeles",
- "results_metadata": {
- "columns": [
- {
- "semantic_type": "type/Category",
- "name": "generation",
- "field_ref": [
- "field",
- "generation",
- {
- "base-type": "type/BigInteger"
- }
- ],
- "effective_type": "type/BigInteger",
- "id": 1503,
- "visibility_type": "normal",
- "display_name": "Generation",
- "fingerprint": {
- "global": {
- "distinct-count": 8,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 2.1045160333142734,
- "q3": 5.716989271844637,
- "max": 8,
- "sd": 2.234937326790694,
- "avg": 4.034046692607004
- }
- }
- },
- "base_type": "type/BigInteger"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_1",
- "field_ref": [
- "field",
- "type_1",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1475,
- "visibility_type": "normal",
- "display_name": "Type 1",
- "fingerprint": {
- "global": {
- "distinct-count": 18,
- "nil%": 0
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 5.281128404669261
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "semantic_type": "type/Category",
- "name": "type_2",
- "field_ref": [
- "field",
- "type_2",
- {
- "base-type": "type/Text"
- }
- ],
- "effective_type": "type/Text",
- "id": 1499,
- "visibility_type": "normal",
- "display_name": "Type 2",
- "fingerprint": {
- "global": {
- "distinct-count": 19,
- "nil%": 0.4727626459143969
- },
- "type": {
- "type/Text": {
- "percent-json": 0,
- "percent-url": 0,
- "percent-email": 0,
- "percent-state": 0,
- "average-length": 2.9474708171206228
- }
- }
- },
- "base_type": "type/Text"
- },
- {
- "display_name": "Count",
- "semantic_type": "type/Quantity",
- "field_ref": [
- "aggregation",
- 0
- ],
- "base_type": "type/BigInteger",
- "effective_type": "type/BigInteger",
- "name": "count",
- "fingerprint": {
- "global": {
- "distinct-count": 6,
- "nil%": 0
- },
- "type": {
- "type/Number": {
- "min": 1,
- "q1": 1,
- "q3": 2.2964690541943424,
- "max": 10,
- "sd": 1.2898977338673652,
- "avg": 1.8076923076923077
- }
- }
- }
- }
- ]
+ },
+ "base_type": "type/Text"
},
- "insights": null
- }
+ {
+ "display_name": "Count",
+ "semantic_type": "type/Quantity",
+ "field_ref": ["aggregation", 0],
+ "base_type": "type/BigInteger",
+ "effective_type": "type/BigInteger",
+ "name": "count",
+ "fingerprint": {
+ "global": {
+ "distinct-count": 6,
+ "nil%": 0
+ },
+ "type": {
+ "type/Number": {
+ "min": 1,
+ "q1": 1,
+ "q3": 2.2964690541943424,
+ "max": 10,
+ "sd": 1.2898977338673652,
+ "avg": 1.8076923076923077
+ }
+ }
+ }
+ }
+ ]
+ },
+ "insights": null
+ }
}
]
diff --git a/frontend/src/metabase/visualizations/visualizations/Table/stories-data/grouped-orders.json b/frontend/src/metabase/visualizations/visualizations/Table/stories-data/grouped-orders.json
index c716a87cf01..f31e9a94bbf 100644
--- a/frontend/src/metabase/visualizations/visualizations/Table/stories-data/grouped-orders.json
+++ b/frontend/src/metabase/visualizations/visualizations/Table/stories-data/grouped-orders.json
@@ -20,11 +20,7 @@
"dataset_query": {
"query": {
"source-table": 2,
- "aggregation": [
- [
- "count"
- ]
- ],
+ "aggregation": [["count"]],
"breakout": [
[
"field",
@@ -174,10 +170,7 @@
"display_name": "Count",
"lib/desired-column-alias": "count",
"effective_type": "type/BigInteger",
- "field_ref": [
- "aggregation",
- 0
- ],
+ "field_ref": ["aggregation", 0],
"source": "aggregation",
"lib/source-column-alias": "count",
"lib/source": "source/aggregations",
@@ -204,11 +197,7 @@
"json_query": {
"query": {
"source-table": 2,
- "aggregation": [
- [
- "count"
- ]
- ],
+ "aggregation": [["count"]],
"breakout": [
[
"field",
@@ -348,10 +337,7 @@
"display_name": "Count",
"lib/desired-column-alias": "count",
"effective_type": "type/BigInteger",
- "field_ref": [
- "aggregation",
- 0
- ],
+ "field_ref": ["aggregation", 0],
"source": "aggregation",
"lib/source-column-alias": "count",
"lib/source": "source/aggregations",
@@ -486,10 +472,7 @@
"display_name": "Count",
"lib/desired-column-alias": "count",
"effective_type": "type/BigInteger",
- "field_ref": [
- "aggregation",
- 0
- ],
+ "field_ref": ["aggregation", 0],
"source": "aggregation",
"lib/source-column-alias": "count",
"lib/source": "source/aggregations",
@@ -504,1006 +487,206 @@
"download_perms": "full",
"results_timezone": "UTC",
"rows": [
- [
- "Aerodynamic Bronze Hat",
- 144,
- 96
- ],
- [
- "Aerodynamic Concrete Bench",
- 116,
- 88
- ],
- [
- "Aerodynamic Concrete Lamp",
- 197,
- 96
- ],
- [
- "Aerodynamic Copper Knife",
- 165,
- 120
- ],
- [
- "Aerodynamic Cotton Bottle",
- 47,
- 87
- ],
- [
- "Aerodynamic Cotton Lamp",
- 159,
- 70
- ],
- [
- "Aerodynamic Granite Bench",
- 125,
- 84
- ],
- [
- "Aerodynamic Granite Bottle",
- 67,
- 85
- ],
- [
- "Aerodynamic Leather Computer",
- 153,
- 78
- ],
- [
- "Aerodynamic Leather Toucan",
- 158,
- 90
- ],
- [
- "Aerodynamic Linen Coat",
- 7,
- 92
- ],
- [
- "Aerodynamic Paper Coat",
- 41,
- 103
- ],
- [
- "Aerodynamic Paper Computer",
- 15,
- 88
- ],
- [
- "Aerodynamic Rubber Bench",
- 73,
- 105
- ],
- [
- "Awesome Aluminum Keyboard",
- 89,
- 87
- ],
- [
- "Awesome Aluminum Table",
- 27,
- 70
- ],
- [
- "Awesome Bronze Plate",
- 94,
- 107
- ],
- [
- "Awesome Concrete Shoes",
- 14,
- 95
- ],
- [
- "Awesome Cotton Shoes",
- 130,
- 97
- ],
- [
- "Awesome Granite Car",
- 51,
- 93
- ],
- [
- "Awesome Iron Hat",
- 62,
- 96
- ],
- [
- "Awesome Plastic Watch",
- 74,
- 100
- ],
- [
- "Awesome Rubber Wallet",
- 42,
- 87
- ],
- [
- "Awesome Silk Car",
- 56,
- 102
- ],
- [
- "Awesome Steel Toucan",
- 181,
- 96
- ],
- [
- "Awesome Wool Bench",
- 145,
- 109
- ],
- [
- "Durable Aluminum Bag",
- 124,
- 89
- ],
- [
- "Durable Copper Clock",
- 97,
- 84
- ],
- [
- "Durable Cotton Bench",
- 101,
- 94
- ],
- [
- "Durable Cotton Shirt",
- 192,
- 83
- ],
- [
- "Durable Iron Knife",
- 95,
- 84
- ],
- [
- "Durable Leather Wallet",
- 170,
- 90
- ],
- [
- "Durable Marble Watch",
- 25,
- 91
- ],
- [
- "Durable Rubber Computer",
- 39,
- 88
- ],
- [
- "Durable Steel Toucan",
- 29,
- 96
- ],
- [
- "Durable Wool Toucan",
- 50,
- 104
- ],
- [
- "Enormous Aluminum Clock",
- 152,
- 89
- ],
- [
- "Enormous Aluminum Shirt",
- 4,
- 89
- ],
- [
- "Enormous Copper Shirt",
- 198,
- 83
- ],
- [
- "Enormous Cotton Pants",
- 141,
- 92
- ],
- [
- "Enormous Granite Bottle",
- 135,
- 96
- ],
- [
- "Enormous Granite Wallet",
- 63,
- 83
- ],
- [
- "Enormous Leather Wallet",
- 176,
- 89
- ],
- [
- "Enormous Marble Gloves",
- 110,
- 92
- ],
- [
- "Enormous Marble Shoes",
- 22,
- 100
- ],
- [
- "Enormous Marble Wallet",
- 5,
- 97
- ],
- [
- "Enormous Plastic Coat",
- 99,
- 93
- ],
- [
- "Enormous Steel Watch",
- 8,
- 92
- ],
- [
- "Enormous Wool Car",
- 17,
- 118
- ],
- [
- "Ergonomic Aluminum Plate",
- 26,
- 107
- ],
- [
- "Ergonomic Concrete Lamp",
- 186,
- 101
- ],
- [
- "Ergonomic Cotton Bag",
- 190,
- 96
- ],
- [
- "Ergonomic Granite Bottle",
- 137,
- 86
- ],
- [
- "Ergonomic Iron Watch",
- 171,
- 97
- ],
- [
- "Ergonomic Leather Pants",
- 163,
- 97
- ],
- [
- "Ergonomic Linen Toucan",
- 178,
- 88
- ],
- [
- "Ergonomic Marble Computer",
- 142,
- 98
- ],
- [
- "Ergonomic Marble Hat",
- 52,
- 90
- ],
- [
- "Ergonomic Paper Wallet",
- 30,
- 88
- ],
- [
- "Ergonomic Plastic Bench",
- 193,
- 99
- ],
- [
- "Ergonomic Rubber Bench",
- 111,
- 98
- ],
- [
- "Ergonomic Silk Coat",
- 11,
- 90
- ],
- [
- "Ergonomic Silk Keyboard",
- 32,
- 88
- ],
- [
- "Ergonomic Silk Table",
- 65,
- 107
- ],
- [
- "Ergonomic Wool Bag",
- 121,
- 92
- ],
- [
- "Fantastic Aluminum Bottle",
- 23,
- 82
- ],
- [
- "Fantastic Copper Hat",
- 187,
- 80
- ],
- [
- "Fantastic Leather Watch",
- 175,
- 94
- ],
- [
- "Fantastic Rubber Knife",
- 155,
- 83
- ],
- [
- "Fantastic Silk Bottle",
- 66,
- 93
- ],
- [
- "Fantastic Steel Knife",
- 106,
- 84
- ],
- [
- "Fantastic Wool Shirt",
- 105,
- 91
- ],
- [
- "Gorgeous Aluminum Plate",
- 128,
- 104
- ],
- [
- "Gorgeous Bronze Hat",
- 57,
- 102
- ],
- [
- "Gorgeous Concrete Chair",
- 48,
- 86
- ],
- [
- "Gorgeous Concrete Shoes",
- 44,
- 82
- ],
- [
- "Gorgeous Copper Knife",
- 162,
- 94
- ],
- [
- "Gorgeous Linen Bottle",
- 87,
- 106
- ],
- [
- "Gorgeous Linen Keyboard",
- 119,
- 91
- ],
- [
- "Gorgeous Marble Computer",
- 189,
- 98
- ],
- [
- "Gorgeous Marble Plate",
- 122,
- 87
- ],
- [
- "Gorgeous Paper Bag",
- 167,
- 97
- ],
- [
- "Gorgeous Wooden Car",
- 173,
- 93
- ],
- [
- "Heavy-Duty Copper Gloves",
- 156,
- 95
- ],
- [
- "Heavy-Duty Copper Toucan",
- 68,
- 103
- ],
- [
- "Heavy-Duty Copper Watch",
- 120,
- 96
- ],
- [
- "Heavy-Duty Cotton Bottle",
- 177,
- 81
- ],
- [
- "Heavy-Duty Linen Gloves",
- 191,
- 94
- ],
- [
- "Heavy-Duty Linen Toucan",
- 196,
- 101
- ],
- [
- "Heavy-Duty Rubber Bottle",
- 194,
- 84
- ],
- [
- "Heavy-Duty Rubber Gloves",
- 161,
- 92
- ],
- [
- "Heavy-Duty Silk Car",
- 96,
- 96
- ],
- [
- "Heavy-Duty Silk Chair",
- 86,
- 119
- ],
- [
- "Heavy-Duty Steel Watch",
- 82,
- 99
- ],
- [
- "Heavy-Duty Wooden Clock",
- 34,
- 89
- ],
- [
- "Incredible Aluminum Knife",
- 64,
- 79
- ],
- [
- "Incredible Aluminum Knife",
- 149,
- 95
- ],
- [
- "Incredible Bronze Pants",
- 16,
- 91
- ],
- [
- "Incredible Bronze Wallet",
- 154,
- 83
- ],
- [
- "Incredible Concrete Keyboard",
- 90,
- 91
- ],
- [
- "Incredible Concrete Watch",
- 195,
- 101
- ],
- [
- "Incredible Granite Toucan",
- 37,
- 102
- ],
- [
- "Incredible Linen Knife",
- 179,
- 105
- ],
- [
- "Incredible Plastic Chair",
- 84,
- 97
- ],
- [
- "Incredible Plastic Watch",
- 138,
- 90
- ],
- [
- "Incredible Silk Shoes",
- 49,
- 106
- ],
- [
- "Intelligent Bronze Knife",
- 54,
- 97
- ],
- [
- "Intelligent Granite Hat",
- 157,
- 98
- ],
- [
- "Intelligent Iron Shirt",
- 109,
- 109
- ],
- [
- "Intelligent Paper Car",
- 168,
- 82
- ],
- [
- "Intelligent Paper Hat",
- 75,
- 106
- ],
- [
- "Intelligent Steel Car",
- 200,
- 86
- ],
- [
- "Intelligent Wooden Gloves",
- 20,
- 97
- ],
- [
- "Lightweight Bronze Table",
- 83,
- 88
- ],
- [
- "Lightweight Copper Wallet",
- 180,
- 97
- ],
- [
- "Lightweight Granite Hat",
- 102,
- 82
- ],
- [
- "Lightweight Leather Bench",
- 151,
- 102
- ],
- [
- "Lightweight Leather Gloves",
- 38,
- 98
- ],
- [
- "Lightweight Linen Bottle",
- 88,
- 77
- ],
- [
- "Lightweight Linen Coat",
- 81,
- 103
- ],
- [
- "Lightweight Linen Hat",
- 160,
- 85
- ],
- [
- "Lightweight Marble Bag",
- 43,
- 87
- ],
- [
- "Lightweight Paper Bottle",
- 18,
- 87
- ],
- [
- "Lightweight Steel Knife",
- 100,
- 94
- ],
- [
- "Lightweight Steel Watch",
- 139,
- 99
- ],
- [
- "Lightweight Wool Bag",
- 21,
- 89
- ],
- [
- "Lightweight Wool Computer",
- 146,
- 107
- ],
- [
- "Lightweight Wool Plate",
- 107,
- 110
- ],
- [
- "Mediocre Aluminum Lamp",
- 183,
- 101
- ],
- [
- "Mediocre Aluminum Shirt",
- 78,
- 96
- ],
- [
- "Mediocre Cotton Coat",
- 35,
- 99
- ],
- [
- "Mediocre Cotton Toucan",
- 53,
- 95
- ],
- [
- "Mediocre Leather Coat",
- 199,
- 97
- ],
- [
- "Mediocre Leather Computer",
- 77,
- 114
- ],
- [
- "Mediocre Marble Lamp",
- 136,
- 80
- ],
- [
- "Mediocre Paper Car",
- 61,
- 96
- ],
- [
- "Mediocre Plastic Clock",
- 36,
- 86
- ],
- [
- "Mediocre Rubber Shoes",
- 55,
- 94
- ],
- [
- "Mediocre Silk Bottle",
- 98,
- 104
- ],
- [
- "Mediocre Wooden Bench",
- 123,
- 92
- ],
- [
- "Mediocre Wooden Table",
- 10,
- 114
- ],
- [
- "Mediocre Wool Toucan",
- 147,
- 117
- ],
- [
- "Practical Aluminum Coat",
- 131,
- 83
- ],
- [
- "Practical Aluminum Table",
- 172,
- 109
- ],
- [
- "Practical Bronze Computer",
- 9,
- 86
- ],
- [
- "Practical Bronze Watch",
- 127,
- 93
- ],
- [
- "Practical Copper Car",
- 93,
- 87
- ],
- [
- "Practical Granite Plate",
- 184,
- 85
- ],
- [
- "Practical Paper Bag",
- 134,
- 96
- ],
- [
- "Practical Plastic Keyboard",
- 114,
- 90
- ],
- [
- "Practical Silk Bottle",
- 182,
- 87
- ],
- [
- "Practical Silk Computer",
- 108,
- 95
- ],
- [
- "Practical Steel Table",
- 58,
- 105
- ],
- [
- "Practical Wool Hat",
- 126,
- 89
- ],
- [
- "Rustic Concrete Bottle",
- 19,
- 93
- ],
- [
- "Rustic Copper Hat",
- 166,
- 96
- ],
- [
- "Rustic Copper Knife",
- 85,
- 94
- ],
- [
- "Rustic Iron Bench",
- 143,
- 94
- ],
- [
- "Rustic Iron Keyboard",
- 174,
- 82
- ],
- [
- "Rustic Linen Keyboard",
- 46,
- 111
- ],
- [
- "Rustic Marble Bottle",
- 28,
- 76
- ],
- [
- "Rustic Paper Bench",
- 72,
- 104
- ],
- [
- "Rustic Paper Car",
- 60,
- 100
- ],
- [
- "Rustic Paper Wallet",
- 1,
- 93
- ],
- [
- "Rustic Rubber Clock",
- 31,
- 87
- ],
- [
- "Rustic Rubber Knife",
- 91,
- 82
- ],
- [
- "Rustic Silk Knife",
- 115,
- 96
- ],
- [
- "Rustic Silk Pants",
- 103,
- 97
- ],
- [
- "Sleek Aluminum Clock",
- 79,
- 96
- ],
- [
- "Sleek Aluminum Watch",
- 59,
- 100
- ],
- [
- "Sleek Bronze Lamp",
- 164,
- 101
- ],
- [
- "Sleek Copper Watch",
- 140,
- 83
- ],
- [
- "Sleek Granite Pants",
- 71,
- 99
- ],
- [
- "Sleek Leather Table",
- 113,
- 95
- ],
- [
- "Sleek Leather Toucan",
- 104,
- 109
- ],
- [
- "Sleek Marble Clock",
- 76,
- 93
- ],
- [
- "Sleek Marble Table",
- 185,
- 95
- ],
- [
- "Sleek Paper Toucan",
- 12,
- 79
- ],
- [
- "Sleek Plastic Shoes",
- 148,
- 85
- ],
- [
- "Sleek Steel Table",
- 132,
- 105
- ],
- [
- "Sleek Wool Wallet",
- 45,
- 103
- ],
- [
- "Sleek Wool Watch",
- 133,
- 79
- ],
- [
- "Small Concrete Knife",
- 117,
- 88
- ],
- [
- "Small Copper Clock",
- 80,
- 103
- ],
- [
- "Small Copper Plate",
- 40,
- 86
- ],
- [
- "Small Cotton Chair",
- 169,
- 117
- ],
- [
- "Small Granite Gloves",
- 92,
- 90
- ],
- [
- "Small Marble Hat",
- 6,
- 88
- ],
- [
- "Small Marble Knife",
- 129,
- 93
- ],
- [
- "Small Marble Shoes",
- 2,
- 98
- ],
- [
- "Small Plastic Computer",
- 33,
- 88
- ],
- [
- "Small Rubber Clock",
- 70,
- 79
- ],
- [
- "Small Wool Wallet",
- 112,
- 87
- ],
- [
- "Synergistic Copper Computer",
- 188,
- 82
- ],
- [
- "Synergistic Granite Chair",
- 3,
- 77
- ],
- [
- "Synergistic Leather Coat",
- 69,
- 105
- ],
- [
- "Synergistic Marble Keyboard",
- 24,
- 75
- ],
- [
- "Synergistic Rubber Shoes",
- 118,
- 105
- ],
- [
- "Synergistic Steel Chair",
- 13,
- 104
- ],
- [
- "Synergistic Wool Coat",
- 150,
- 103
- ]
+ ["Aerodynamic Bronze Hat", 144, 96],
+ ["Aerodynamic Concrete Bench", 116, 88],
+ ["Aerodynamic Concrete Lamp", 197, 96],
+ ["Aerodynamic Copper Knife", 165, 120],
+ ["Aerodynamic Cotton Bottle", 47, 87],
+ ["Aerodynamic Cotton Lamp", 159, 70],
+ ["Aerodynamic Granite Bench", 125, 84],
+ ["Aerodynamic Granite Bottle", 67, 85],
+ ["Aerodynamic Leather Computer", 153, 78],
+ ["Aerodynamic Leather Toucan", 158, 90],
+ ["Aerodynamic Linen Coat", 7, 92],
+ ["Aerodynamic Paper Coat", 41, 103],
+ ["Aerodynamic Paper Computer", 15, 88],
+ ["Aerodynamic Rubber Bench", 73, 105],
+ ["Awesome Aluminum Keyboard", 89, 87],
+ ["Awesome Aluminum Table", 27, 70],
+ ["Awesome Bronze Plate", 94, 107],
+ ["Awesome Concrete Shoes", 14, 95],
+ ["Awesome Cotton Shoes", 130, 97],
+ ["Awesome Granite Car", 51, 93],
+ ["Awesome Iron Hat", 62, 96],
+ ["Awesome Plastic Watch", 74, 100],
+ ["Awesome Rubber Wallet", 42, 87],
+ ["Awesome Silk Car", 56, 102],
+ ["Awesome Steel Toucan", 181, 96],
+ ["Awesome Wool Bench", 145, 109],
+ ["Durable Aluminum Bag", 124, 89],
+ ["Durable Copper Clock", 97, 84],
+ ["Durable Cotton Bench", 101, 94],
+ ["Durable Cotton Shirt", 192, 83],
+ ["Durable Iron Knife", 95, 84],
+ ["Durable Leather Wallet", 170, 90],
+ ["Durable Marble Watch", 25, 91],
+ ["Durable Rubber Computer", 39, 88],
+ ["Durable Steel Toucan", 29, 96],
+ ["Durable Wool Toucan", 50, 104],
+ ["Enormous Aluminum Clock", 152, 89],
+ ["Enormous Aluminum Shirt", 4, 89],
+ ["Enormous Copper Shirt", 198, 83],
+ ["Enormous Cotton Pants", 141, 92],
+ ["Enormous Granite Bottle", 135, 96],
+ ["Enormous Granite Wallet", 63, 83],
+ ["Enormous Leather Wallet", 176, 89],
+ ["Enormous Marble Gloves", 110, 92],
+ ["Enormous Marble Shoes", 22, 100],
+ ["Enormous Marble Wallet", 5, 97],
+ ["Enormous Plastic Coat", 99, 93],
+ ["Enormous Steel Watch", 8, 92],
+ ["Enormous Wool Car", 17, 118],
+ ["Ergonomic Aluminum Plate", 26, 107],
+ ["Ergonomic Concrete Lamp", 186, 101],
+ ["Ergonomic Cotton Bag", 190, 96],
+ ["Ergonomic Granite Bottle", 137, 86],
+ ["Ergonomic Iron Watch", 171, 97],
+ ["Ergonomic Leather Pants", 163, 97],
+ ["Ergonomic Linen Toucan", 178, 88],
+ ["Ergonomic Marble Computer", 142, 98],
+ ["Ergonomic Marble Hat", 52, 90],
+ ["Ergonomic Paper Wallet", 30, 88],
+ ["Ergonomic Plastic Bench", 193, 99],
+ ["Ergonomic Rubber Bench", 111, 98],
+ ["Ergonomic Silk Coat", 11, 90],
+ ["Ergonomic Silk Keyboard", 32, 88],
+ ["Ergonomic Silk Table", 65, 107],
+ ["Ergonomic Wool Bag", 121, 92],
+ ["Fantastic Aluminum Bottle", 23, 82],
+ ["Fantastic Copper Hat", 187, 80],
+ ["Fantastic Leather Watch", 175, 94],
+ ["Fantastic Rubber Knife", 155, 83],
+ ["Fantastic Silk Bottle", 66, 93],
+ ["Fantastic Steel Knife", 106, 84],
+ ["Fantastic Wool Shirt", 105, 91],
+ ["Gorgeous Aluminum Plate", 128, 104],
+ ["Gorgeous Bronze Hat", 57, 102],
+ ["Gorgeous Concrete Chair", 48, 86],
+ ["Gorgeous Concrete Shoes", 44, 82],
+ ["Gorgeous Copper Knife", 162, 94],
+ ["Gorgeous Linen Bottle", 87, 106],
+ ["Gorgeous Linen Keyboard", 119, 91],
+ ["Gorgeous Marble Computer", 189, 98],
+ ["Gorgeous Marble Plate", 122, 87],
+ ["Gorgeous Paper Bag", 167, 97],
+ ["Gorgeous Wooden Car", 173, 93],
+ ["Heavy-Duty Copper Gloves", 156, 95],
+ ["Heavy-Duty Copper Toucan", 68, 103],
+ ["Heavy-Duty Copper Watch", 120, 96],
+ ["Heavy-Duty Cotton Bottle", 177, 81],
+ ["Heavy-Duty Linen Gloves", 191, 94],
+ ["Heavy-Duty Linen Toucan", 196, 101],
+ ["Heavy-Duty Rubber Bottle", 194, 84],
+ ["Heavy-Duty Rubber Gloves", 161, 92],
+ ["Heavy-Duty Silk Car", 96, 96],
+ ["Heavy-Duty Silk Chair", 86, 119],
+ ["Heavy-Duty Steel Watch", 82, 99],
+ ["Heavy-Duty Wooden Clock", 34, 89],
+ ["Incredible Aluminum Knife", 64, 79],
+ ["Incredible Aluminum Knife", 149, 95],
+ ["Incredible Bronze Pants", 16, 91],
+ ["Incredible Bronze Wallet", 154, 83],
+ ["Incredible Concrete Keyboard", 90, 91],
+ ["Incredible Concrete Watch", 195, 101],
+ ["Incredible Granite Toucan", 37, 102],
+ ["Incredible Linen Knife", 179, 105],
+ ["Incredible Plastic Chair", 84, 97],
+ ["Incredible Plastic Watch", 138, 90],
+ ["Incredible Silk Shoes", 49, 106],
+ ["Intelligent Bronze Knife", 54, 97],
+ ["Intelligent Granite Hat", 157, 98],
+ ["Intelligent Iron Shirt", 109, 109],
+ ["Intelligent Paper Car", 168, 82],
+ ["Intelligent Paper Hat", 75, 106],
+ ["Intelligent Steel Car", 200, 86],
+ ["Intelligent Wooden Gloves", 20, 97],
+ ["Lightweight Bronze Table", 83, 88],
+ ["Lightweight Copper Wallet", 180, 97],
+ ["Lightweight Granite Hat", 102, 82],
+ ["Lightweight Leather Bench", 151, 102],
+ ["Lightweight Leather Gloves", 38, 98],
+ ["Lightweight Linen Bottle", 88, 77],
+ ["Lightweight Linen Coat", 81, 103],
+ ["Lightweight Linen Hat", 160, 85],
+ ["Lightweight Marble Bag", 43, 87],
+ ["Lightweight Paper Bottle", 18, 87],
+ ["Lightweight Steel Knife", 100, 94],
+ ["Lightweight Steel Watch", 139, 99],
+ ["Lightweight Wool Bag", 21, 89],
+ ["Lightweight Wool Computer", 146, 107],
+ ["Lightweight Wool Plate", 107, 110],
+ ["Mediocre Aluminum Lamp", 183, 101],
+ ["Mediocre Aluminum Shirt", 78, 96],
+ ["Mediocre Cotton Coat", 35, 99],
+ ["Mediocre Cotton Toucan", 53, 95],
+ ["Mediocre Leather Coat", 199, 97],
+ ["Mediocre Leather Computer", 77, 114],
+ ["Mediocre Marble Lamp", 136, 80],
+ ["Mediocre Paper Car", 61, 96],
+ ["Mediocre Plastic Clock", 36, 86],
+ ["Mediocre Rubber Shoes", 55, 94],
+ ["Mediocre Silk Bottle", 98, 104],
+ ["Mediocre Wooden Bench", 123, 92],
+ ["Mediocre Wooden Table", 10, 114],
+ ["Mediocre Wool Toucan", 147, 117],
+ ["Practical Aluminum Coat", 131, 83],
+ ["Practical Aluminum Table", 172, 109],
+ ["Practical Bronze Computer", 9, 86],
+ ["Practical Bronze Watch", 127, 93],
+ ["Practical Copper Car", 93, 87],
+ ["Practical Granite Plate", 184, 85],
+ ["Practical Paper Bag", 134, 96],
+ ["Practical Plastic Keyboard", 114, 90],
+ ["Practical Silk Bottle", 182, 87],
+ ["Practical Silk Computer", 108, 95],
+ ["Practical Steel Table", 58, 105],
+ ["Practical Wool Hat", 126, 89],
+ ["Rustic Concrete Bottle", 19, 93],
+ ["Rustic Copper Hat", 166, 96],
+ ["Rustic Copper Knife", 85, 94],
+ ["Rustic Iron Bench", 143, 94],
+ ["Rustic Iron Keyboard", 174, 82],
+ ["Rustic Linen Keyboard", 46, 111],
+ ["Rustic Marble Bottle", 28, 76],
+ ["Rustic Paper Bench", 72, 104],
+ ["Rustic Paper Car", 60, 100],
+ ["Rustic Paper Wallet", 1, 93],
+ ["Rustic Rubber Clock", 31, 87],
+ ["Rustic Rubber Knife", 91, 82],
+ ["Rustic Silk Knife", 115, 96],
+ ["Rustic Silk Pants", 103, 97],
+ ["Sleek Aluminum Clock", 79, 96],
+ ["Sleek Aluminum Watch", 59, 100],
+ ["Sleek Bronze Lamp", 164, 101],
+ ["Sleek Copper Watch", 140, 83],
+ ["Sleek Granite Pants", 71, 99],
+ ["Sleek Leather Table", 113, 95],
+ ["Sleek Leather Toucan", 104, 109],
+ ["Sleek Marble Clock", 76, 93],
+ ["Sleek Marble Table", 185, 95],
+ ["Sleek Paper Toucan", 12, 79],
+ ["Sleek Plastic Shoes", 148, 85],
+ ["Sleek Steel Table", 132, 105],
+ ["Sleek Wool Wallet", 45, 103],
+ ["Sleek Wool Watch", 133, 79],
+ ["Small Concrete Knife", 117, 88],
+ ["Small Copper Clock", 80, 103],
+ ["Small Copper Plate", 40, 86],
+ ["Small Cotton Chair", 169, 117],
+ ["Small Granite Gloves", 92, 90],
+ ["Small Marble Hat", 6, 88],
+ ["Small Marble Knife", 129, 93],
+ ["Small Marble Shoes", 2, 98],
+ ["Small Plastic Computer", 33, 88],
+ ["Small Rubber Clock", 70, 79],
+ ["Small Wool Wallet", 112, 87],
+ ["Synergistic Copper Computer", 188, 82],
+ ["Synergistic Granite Chair", 3, 77],
+ ["Synergistic Leather Coat", 69, 105],
+ ["Synergistic Marble Keyboard", 24, 75],
+ ["Synergistic Rubber Shoes", 118, 105],
+ ["Synergistic Steel Chair", 13, 104],
+ ["Synergistic Wool Coat", 150, 103]
]
}
}
diff --git a/frontend/src/metabase/visualizations/visualizations/Table/stories-data/orders-with-people.json b/frontend/src/metabase/visualizations/visualizations/Table/stories-data/orders-with-people.json
index 048847aa3cb..9a9458215c5 100644
--- a/frontend/src/metabase/visualizations/visualizations/Table/stories-data/orders-with-people.json
+++ b/frontend/src/metabase/visualizations/visualizations/Table/stories-data/orders-with-people.json
@@ -24015,11 +24015,7 @@
"name": "ID",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 37,
- null
- ],
+ "field_ref": ["field", 37, null],
"effective_type": "type/BigInteger",
"id": 37,
"visibility_type": "normal",
@@ -24034,11 +24030,7 @@
"name": "USER_ID",
"settings": null,
"fk_target_field_id": 46,
- "field_ref": [
- "field",
- 43,
- null
- ],
+ "field_ref": ["field", 43, null],
"effective_type": "type/Integer",
"id": 43,
"visibility_type": "normal",
@@ -24058,11 +24050,7 @@
"name": "PRODUCT_ID",
"settings": null,
"fk_target_field_id": 62,
- "field_ref": [
- "field",
- 40,
- null
- ],
+ "field_ref": ["field", 40, null],
"effective_type": "type/Integer",
"id": 40,
"visibility_type": "normal",
@@ -24082,11 +24070,7 @@
"name": "SUBTOTAL",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 44,
- null
- ],
+ "field_ref": ["field", 44, null],
"effective_type": "type/Float",
"id": 44,
"visibility_type": "normal",
@@ -24116,11 +24100,7 @@
"name": "TAX",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 38,
- null
- ],
+ "field_ref": ["field", 38, null],
"effective_type": "type/Float",
"id": 38,
"visibility_type": "normal",
@@ -24150,11 +24130,7 @@
"name": "TOTAL",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 42,
- null
- ],
+ "field_ref": ["field", 42, null],
"effective_type": "type/Float",
"id": 42,
"visibility_type": "normal",
@@ -24184,11 +24160,7 @@
"name": "DISCOUNT",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 36,
- null
- ],
+ "field_ref": ["field", 36, null],
"effective_type": "type/Float",
"id": 36,
"visibility_type": "normal",
@@ -24251,11 +24223,7 @@
"name": "QUANTITY",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 39,
- null
- ],
+ "field_ref": ["field", 39, null],
"effective_type": "type/Integer",
"id": 39,
"visibility_type": "normal",
@@ -24321,11 +24289,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 37,
- null
- ],
+ "field_ref": ["field", 37, null],
"effective_type": "type/BigInteger",
"nfc_path": null,
"parent_id": null,
@@ -24345,11 +24309,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": 46,
- "field_ref": [
- "field",
- 43,
- null
- ],
+ "field_ref": ["field", 43, null],
"effective_type": "type/Integer",
"nfc_path": null,
"parent_id": null,
@@ -24374,11 +24334,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": 62,
- "field_ref": [
- "field",
- 40,
- null
- ],
+ "field_ref": ["field", 40, null],
"effective_type": "type/Integer",
"nfc_path": null,
"parent_id": null,
@@ -24403,11 +24359,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 44,
- null
- ],
+ "field_ref": ["field", 44, null],
"effective_type": "type/Float",
"nfc_path": null,
"parent_id": null,
@@ -24442,11 +24394,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 38,
- null
- ],
+ "field_ref": ["field", 38, null],
"effective_type": "type/Float",
"nfc_path": null,
"parent_id": null,
@@ -24481,11 +24429,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 42,
- null
- ],
+ "field_ref": ["field", 42, null],
"effective_type": "type/Float",
"nfc_path": null,
"parent_id": null,
@@ -24520,11 +24464,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 36,
- null
- ],
+ "field_ref": ["field", 36, null],
"effective_type": "type/Float",
"nfc_path": null,
"parent_id": null,
@@ -24597,11 +24537,7 @@
"settings": null,
"source": "fields",
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 39,
- null
- ],
+ "field_ref": ["field", 39, null],
"effective_type": "type/Integer",
"nfc_path": null,
"parent_id": null,
@@ -24708,11 +24644,7 @@
"name": "ID",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 37,
- null
- ],
+ "field_ref": ["field", 37, null],
"effective_type": "type/BigInteger",
"id": 37,
"visibility_type": "normal",
@@ -24727,11 +24659,7 @@
"name": "USER_ID",
"settings": null,
"fk_target_field_id": 46,
- "field_ref": [
- "field",
- 43,
- null
- ],
+ "field_ref": ["field", 43, null],
"effective_type": "type/Integer",
"id": 43,
"visibility_type": "normal",
@@ -24751,11 +24679,7 @@
"name": "PRODUCT_ID",
"settings": null,
"fk_target_field_id": 62,
- "field_ref": [
- "field",
- 40,
- null
- ],
+ "field_ref": ["field", 40, null],
"effective_type": "type/Integer",
"id": 40,
"visibility_type": "normal",
@@ -24775,11 +24699,7 @@
"name": "SUBTOTAL",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 44,
- null
- ],
+ "field_ref": ["field", 44, null],
"effective_type": "type/Float",
"id": 44,
"visibility_type": "normal",
@@ -24809,11 +24729,7 @@
"name": "TAX",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 38,
- null
- ],
+ "field_ref": ["field", 38, null],
"effective_type": "type/Float",
"id": 38,
"visibility_type": "normal",
@@ -24843,11 +24759,7 @@
"name": "TOTAL",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 42,
- null
- ],
+ "field_ref": ["field", 42, null],
"effective_type": "type/Float",
"id": 42,
"visibility_type": "normal",
@@ -24877,11 +24789,7 @@
"name": "DISCOUNT",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 36,
- null
- ],
+ "field_ref": ["field", 36, null],
"effective_type": "type/Float",
"id": 36,
"visibility_type": "normal",
@@ -24944,11 +24852,7 @@
"name": "QUANTITY",
"settings": null,
"fk_target_field_id": null,
- "field_ref": [
- "field",
- 39,
- null
- ],
+ "field_ref": ["field", 39, null],
"effective_type": "type/Integer",
"id": 39,
"visibility_type": "normal",