Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: prepare control panel configs for separation into plugins #8222

Merged
merged 3 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions superset/assets/src/explore/controlPanels/PairedTtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,53 @@
* under the License.
*/
import { t } from '@superset-ui/translation';
import { NVD3TimeSeries } from './sections';

export default {
requiresTime: true,
controlPanelSections: [
NVD3TimeSeries[0],
{
label: t('Query'),
expanded: true,
controlSetRows: [
['metrics'],
['adhoc_filters'],
['groupby'],
['limit', 'timeseries_limit_metric'],
['order_desc', 'contribution'],
['row_limit', null],
],
},
{
label: t('Paired t-test'),
expanded: false,
controlSetRows: [
['significance_level'],
['pvalue_precision'],
['liftvalue_precision'],
[{
name: 'significance_level',
config: {
type: 'TextControl',
label: t('Significance Level'),
default: 0.05,
description: t('Threshold alpha level for determining significance'),
},
}],
[{
name: 'pvalue_precision',
config: {
type: 'TextControl',
label: t('p-value precision'),
default: 6,
description: t('Number of decimal places with which to display p-values'),
},
}],
[{
name: 'liftvalue_precision',
config: {
type: 'TextControl',
label: t('Lift percent precision'),
default: 4,
description: t('Number of decimal places with which to display lift values'),
},
}],
],
},
],
Expand Down
45 changes: 37 additions & 8 deletions superset/assets/src/explore/controlPanels/WordCloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,43 @@ export default {
label: t('Options'),
expanded: true,
controlSetRows: [
['size_from', 'size_to'],
['rotation'],
[{
name: 'size_from',
config: {
type: 'TextControl',
isInt: true,
label: t('Minimum Font Size'),
renderTrigger: true,
default: 10,
description: t('Font size for the smallest value in the list'),
},
}, {
name: 'size_to',
config: {
type: 'TextControl',
isInt: true,
label: t('Maximum Font Size'),
renderTrigger: true,
default: 70,
description: t('Font size for the biggest value in the list'),
},
}],
[{
name: 'rotation',
config: {
type: 'SelectControl',
label: t('Word Rotation'),
choices: [
['random', 'random'],
['flat', 'flat'],
['square', 'square'],
],
renderTrigger: true,
default: 'square',
clearable: false,
description: t('Rotation to apply to words in the cloud'),
},
}],
['color_scheme', 'label_colors'],
],
},
Expand All @@ -49,11 +84,5 @@ export default {
row_limit: {
default: 100,
},
size_from: {
default: 10,
},
size_to: {
default: 70,
},
},
};
28 changes: 26 additions & 2 deletions superset/assets/src/explore/controlPanels/WorldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,22 @@ export default {
expanded: true,
controlSetRows: [
['entity'],
['country_fieldtype'],
[{
name: 'country_fieldtype',
config: {
type: 'SelectControl',
label: t('Country Field Type'),
default: 'cca2',
choices: [
['name', 'Full name'],
['cioc', 'code International Olympic Committee (cioc)'],
['cca2', 'code ISO 3166-1 alpha-2 (cca2)'],
['cca3', 'code ISO 3166-1 alpha-3 (cca3)'],
],
description: t('The country code standard that Superset should expect ' +
'to find in the [country] column'),
},
}],
['metric'],
['adhoc_filters'],
['row_limit'],
Expand All @@ -34,7 +49,16 @@ export default {
{
label: t('Bubbles'),
controlSetRows: [
['show_bubbles'],
[{
name: 'show_bubbles',
config: {
type: 'CheckboxControl',
label: t('Show Bubbles'),
default: false,
renderTrigger: true,
description: t('Whether to display bubbles on top of countries'),
},
}],
['secondary_metric'],
['max_bubble_size'],
],
Expand Down
70 changes: 0 additions & 70 deletions superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -591,19 +591,6 @@ export const controls = {
].map(s => [s, s]),
description: t('The name of the country that Superset should display'),
},
country_fieldtype: {
type: 'SelectControl',
label: t('Country Field Type'),
default: 'cca2',
choices: [
['name', 'Full name'],
['cioc', 'code International Olympic Committee (cioc)'],
['cca2', 'code ISO 3166-1 alpha-2 (cca2)'],
['cca3', 'code ISO 3166-1 alpha-3 (cca3)'],
],
description: t('The country code standard that Superset should expect ' +
'to find in the [country] column'),
},

freq: {
type: 'SelectControl',
Expand Down Expand Up @@ -1311,16 +1298,6 @@ export const controls = {
description: t('Pick your favorite markup language'),
},

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

line_interpolation: {
type: 'SelectControl',
label: t('Line Style'),
Expand Down Expand Up @@ -1396,24 +1373,6 @@ export const controls = {
]),
},

size_from: {
type: 'TextControl',
isInt: true,
label: t('Minimum Font Size'),
renderTrigger: true,
default: '20',
description: t('Font size for the smallest value in the list'),
},

size_to: {
type: 'TextControl',
isInt: true,
label: t('Maximum Font Size'),
renderTrigger: true,
default: '150',
description: t('Font size for the biggest value in the list'),
},

header_font_size: {
type: 'SelectControl',
label: t('Header Font Size'),
Expand Down Expand Up @@ -1584,14 +1543,6 @@ export const controls = {
description: t('Whether to color +/- values'),
},

show_bubbles: {
type: 'CheckboxControl',
label: t('Show Bubbles'),
default: false,
renderTrigger: true,
description: t('Whether to display bubbles on top of countries'),
},

show_legend: {
type: 'CheckboxControl',
label: t('Legend'),
Expand Down Expand Up @@ -2114,27 +2065,6 @@ export const controls = {
}),
},

significance_level: {
type: 'TextControl',
label: t('Significance Level'),
default: 0.05,
description: t('Threshold alpha level for determining significance'),
},

pvalue_precision: {
type: 'TextControl',
label: t('p-value precision'),
default: 6,
description: t('Number of decimal places with which to display p-values'),
},

liftvalue_precision: {
type: 'TextControl',
label: t('Lift percent precision'),
default: 4,
description: t('Number of decimal places with which to display lift values'),
},

column_collection: {
type: 'CollectionControl',
label: t('Time Series Columns'),
Expand Down