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

* move paired t-test

* fix: remove nvd3sections

* move more controls
This commit is contained in:
Krist Wongsuphasawat 2019-09-13 15:52:51 -07:00 committed by GitHub
parent 1522d3fbaa
commit bf7ce62166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 102 additions and 85 deletions

View File

@ -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'),
},
}],
],
},
],

View File

@ -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'],
],
},
@ -49,11 +84,5 @@ export default {
row_limit: {
default: 100,
},
size_from: {
default: 10,
},
size_to: {
default: 70,
},
},
};

View File

@ -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'],
@ -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'],
],

View File

@ -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',
@ -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'),
@ -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'),
@ -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'),
@ -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'),