Skip to content

Commit

Permalink
Tweaks to word cloud controls (apache#7212)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored and betodealmeida committed Apr 8, 2019
1 parent 5ef2712 commit 442cfc6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
17 changes: 17 additions & 0 deletions superset/assets/src/explore/controlPanels/WordCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import { t } from '@superset-ui/translation';
import { nonEmpty } from '../validators';

export default {
controlPanelSections: [
Expand All @@ -32,11 +33,27 @@ export default {
},
{
label: t('Options'),
expanded: true,
controlSetRows: [
['size_from', 'size_to'],
['rotation'],
['color_scheme'],
],
},
],
controlOverrides: {
series: {
validators: [nonEmpty],
clearable: false,
},
row_limit: {
default: 100,
},
size_from: {
default: 10,
},
size_to: {
default: 70,
},
},
};
9 changes: 5 additions & 4 deletions superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1300,10 +1300,11 @@ export const controls = {

rotation: {
type: 'SelectControl',
label: t('Rotation'),
label: t('Word Rotation'),
choices: formatSelectOptions(['random', 'flat', 'square']),
renderTrigger: true,
default: 'flat',
default: 'square',
clearable: false,
description: t('Rotation to apply to words in the cloud'),
},

Expand Down Expand Up @@ -1385,7 +1386,7 @@ export const controls = {
size_from: {
type: 'TextControl',
isInt: true,
label: t('Font Size From'),
label: t('Minimum Font Size'),
renderTrigger: true,
default: '20',
description: t('Font size for the smallest value in the list'),
Expand All @@ -1394,7 +1395,7 @@ export const controls = {
size_to: {
type: 'TextControl',
isInt: true,
label: t('Font Size To'),
label: t('Maximum Font Size'),
renderTrigger: true,
default: '150',
description: t('Font size for the biggest value in the list'),
Expand Down

0 comments on commit 442cfc6

Please sign in to comment.