From 61b7e9e463013f5bc0105720c7f59f98ba66711f Mon Sep 17 00:00:00 2001 From: Conglei Date: Wed, 12 Sep 2018 23:12:04 -0700 Subject: [PATCH] [bug fix] Fixed adhoc metric is not working for WordCloud (#5877) * fixed adhoc metric * change rotate default to flat (cherry picked from commit 85692612d6f1438d8b19f51aefae92a240bc3cf3) (cherry picked from commit 19aaee21e9e9c25ea0b1318bed711288a5a359c8) --- superset/assets/src/explore/controls.jsx | 2 +- superset/assets/src/visualizations/word_cloud.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/assets/src/explore/controls.jsx b/superset/assets/src/explore/controls.jsx index ab4020ff1996..3632e8dc7997 100644 --- a/superset/assets/src/explore/controls.jsx +++ b/superset/assets/src/explore/controls.jsx @@ -1307,7 +1307,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'), }, diff --git a/superset/assets/src/visualizations/word_cloud.js b/superset/assets/src/visualizations/word_cloud.js index 75d68e9c60cf..5ef73e79cc27 100644 --- a/superset/assets/src/visualizations/word_cloud.js +++ b/superset/assets/src/visualizations/word_cloud.js @@ -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)