mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(word cloud): series label format fixed for custom sql queries (#23517)
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user