You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2023/03/30 09:05:07 UTC
[superset] branch master updated: fix(word cloud): series label format fixed for custom sql queries (#23517)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 41ad9442c0 fix(word cloud): series label format fixed for custom sql queries (#23517)
41ad9442c0 is described below
commit 41ad9442c07690786b8b398b91f07df6235812e3
Author: ashgorithm <30...@users.noreply.github.com>
AuthorDate: Thu Mar 30 14:34:57 2023 +0530
fix(word cloud): series label format fixed for custom sql queries (#23517)
---
.../plugin-chart-word-cloud/src/legacyPlugin/transformProps.ts | 7 ++++---
.../plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts | 4 ++--
superset-frontend/plugins/plugin-chart-word-cloud/src/types.ts | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/transformProps.ts b/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/transformProps.ts
index aec557d616..0b5a36b999 100644
--- a/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/transformProps.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { ChartProps } from '@superset-ui/core';
+import { ChartProps, getColumnLabel } from '@superset-ui/core';
import { WordCloudProps, WordCloudEncoding } from '../chart/WordCloud';
import { LegacyWordCloudFormData } from './types';
@@ -47,10 +47,11 @@ export default function transformProps(chartProps: ChartProps): WordCloudProps {
} = formData as LegacyWordCloudFormData;
const metricLabel = getMetricLabel(metric);
+ const seriesLabel = getColumnLabel(series);
const encoding: Partial<WordCloudEncoding> = {
color: {
- field: series,
+ field: seriesLabel,
scale: {
scheme: colorScheme,
},
@@ -68,7 +69,7 @@ export default function transformProps(chartProps: ChartProps): WordCloudProps {
type: 'quantitative',
},
text: {
- field: series,
+ field: seriesLabel,
},
};
diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts b/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts
index 6101d14a0f..2cdc348126 100644
--- a/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts
+++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/legacyPlugin/types.ts
@@ -17,13 +17,13 @@
* under the License.
*/
-import { QueryFormData } from '@superset-ui/core';
+import { QueryFormColumn, QueryFormData } from '@superset-ui/core';
import { RotationType } from '../chart/WordCloud';
export type LegacyWordCloudFormData = QueryFormData & {
colorScheme: string;
rotation?: RotationType;
- series: string;
+ series: QueryFormColumn;
sizeFrom?: number;
sizeTo: number;
};
diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/types.ts b/superset-frontend/plugins/plugin-chart-word-cloud/src/types.ts
index 324db12778..fef33bb56c 100644
--- a/superset-frontend/plugins/plugin-chart-word-cloud/src/types.ts
+++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/types.ts
@@ -17,12 +17,12 @@
* under the License.
*/
-import { QueryFormData } from '@superset-ui/core';
+import { QueryFormColumn, QueryFormData } from '@superset-ui/core';
import { WordCloudVisualProps } from './chart/WordCloud';
// FormData for wordcloud contains both common properties of all form data
// and properties specific to wordcloud visualization
export type WordCloudFormData = QueryFormData &
WordCloudVisualProps & {
- series: string;
+ series: QueryFormColumn;
};