You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by as...@apache.org on 2026/02/17 12:33:11 UTC
(superset) 01/02: fix(bugs): fixing bugs for world map chart
This is an automated email from the ASF dual-hosted git repository.
asoare pushed a commit to branch alexandrusoare/fix/world-map
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 97fad0bb8ba08da66f9d988ab68fed309933420c
Author: alexandrusoare <al...@gmail.com>
AuthorDate: Tue Feb 17 14:18:38 2026 +0200
fix(bugs): fixing bugs for world map chart
---
.../plugins/legacy-plugin-chart-world-map/src/WorldMap.ts | 12 +++++++-----
.../src/dashboard/components/SliceHeader/index.tsx | 6 +++++-
.../src/dashboard/components/gridComponents/Chart/Chart.tsx | 2 ++
superset-frontend/src/explore/components/ChartPills.tsx | 6 +++++-
.../components/useExploreAdditionalActionsMenu/index.tsx | 2 ++
5 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.ts b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.ts
index f5c873b2ef2..d9a0311de88 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.ts
+++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.ts
@@ -244,11 +244,13 @@ function WorldMap(element: HTMLElement, props: WorldMapProps): void {
},
];
}
- onContextMenu(pointerEvent.clientX, pointerEvent.clientY, {
- drillToDetail: drillToDetailFilters,
- crossFilter: getCrossFilterDataMask(source),
- drillBy: { filters: drillByFilters, groupbyFieldName: 'entity' },
- });
+ if (onContextMenu) {
+ onContextMenu(pointerEvent.clientX, pointerEvent.clientY, {
+ drillToDetail: drillToDetailFilters,
+ crossFilter: getCrossFilterDataMask(source),
+ drillBy: { filters: drillByFilters, groupbyFieldName: 'entity' },
+ });
+ }
};
const map = new Datamap({
diff --git a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx
index a0a6f702a4a..77da178b246 100644
--- a/superset-frontend/src/dashboard/components/SliceHeader/index.tsx
+++ b/superset-frontend/src/dashboard/components/SliceHeader/index.tsx
@@ -205,7 +205,11 @@ const SliceHeader = forwardRef<HTMLDivElement, SliceHeaderProps>(
const sqlRowCount =
countFromSecondQuery != null
? countFromSecondQuery
- : Number(firstQueryResponse?.sql_rowcount ?? 0);
+ : Number(
+ firstQueryResponse?.sql_rowcount ??
+ firstQueryResponse?.rowcount ??
+ 0,
+ );
const canExplore = !editMode && supersetCanExplore;
const showRowLimitWarning =
diff --git a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx
index c67e3b7cc19..ebe2a5acd7a 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx
@@ -497,6 +497,8 @@ const Chart = (props: ChartProps) => {
} else if ((queriesResponse?.[0] as JsonObject)?.sql_rowcount != null) {
actualRowCount = (queriesResponse![0] as JsonObject)
.sql_rowcount as number;
+ } else if ((queriesResponse?.[0] as JsonObject)?.rowcount != null) {
+ actualRowCount = (queriesResponse![0] as JsonObject).rowcount as number;
} else {
actualRowCount = (exportFormData as JsonObject)?.row_limit as
| number
diff --git a/superset-frontend/src/explore/components/ChartPills.tsx b/superset-frontend/src/explore/components/ChartPills.tsx
index a3d26de0a57..7794cf147d5 100644
--- a/superset-frontend/src/explore/components/ChartPills.tsx
+++ b/superset-frontend/src/explore/components/ChartPills.tsx
@@ -77,7 +77,11 @@ export const ChartPills = forwardRef(
const actualRowCount =
isTableChart && countFromSecondQuery != null
? countFromSecondQuery
- : Number(firstQueryResponse?.sql_rowcount ?? 0);
+ : Number(
+ firstQueryResponse?.sql_rowcount ??
+ firstQueryResponse?.rowcount ??
+ 0,
+ );
return (
<div ref={ref}>
diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx
index 1fbf54ede75..db491c134ba 100644
--- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx
+++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.tsx
@@ -311,6 +311,8 @@ export const useExploreAdditionalActionsMenu = (
actualRowCount = queriesResponse[1].data[0].rowcount;
} else if (queriesResponse && queriesResponse[0]?.sql_rowcount != null) {
actualRowCount = queriesResponse[0].sql_rowcount;
+ } else if (queriesResponse && queriesResponse[0]?.rowcount != null) {
+ actualRowCount = queriesResponse[0].rowcount;
} else {
actualRowCount = latestQueryFormData?.row_limit;
}