mirror of https://github.com/apache/superset.git
[bug fix] Fixed adhoc metric is not working for WordCloud (#5877)
* fixed adhoc metric * change rotate default to flat
This commit is contained in:
parent
10836ce53c
commit
85692612d6
|
@ -1313,7 +1313,7 @@ export const controls = {
|
|||
label: t('Rotation'),
|
||||
choices: formatSelectOptions(['random', 'flat', 'square']),
|
||||
renderTrigger: true,
|
||||
default: 'square',
|
||||
default: 'flat',
|
||||
description: t('Rotation to apply to words in the cloud'),
|
||||
},
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ function wordCloud(element, props) {
|
|||
|
||||
const chart = d3.select(element);
|
||||
const size = [width, height];
|
||||
const rotationFn = ROTATION[rotation] || ROTATION.random;
|
||||
const rotationFn = ROTATION[rotation] || ROTATION.flat;
|
||||
|
||||
const scale = d3.scale.linear()
|
||||
.range(sizeRange)
|
||||
|
@ -88,7 +88,7 @@ function transform(data, formData) {
|
|||
|
||||
const transformedData = data.map(datum => ({
|
||||
text: datum[series],
|
||||
size: datum[metric],
|
||||
size: datum[metric.label || metric],
|
||||
}));
|
||||
|
||||
return transformedData;
|
||||
|
|
Loading…
Reference in New Issue