Skip to content

Commit

Permalink
Migrating horizon controls (#9368)
Browse files Browse the repository at this point in the history
* migrating unique controls

* linting ✨
  • Loading branch information
rusackas authored Mar 26, 2020
1 parent b12188e commit 9fcdc93
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 37 deletions.
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,6 @@ Note the `y_axis_format` is defined under various section for some charts.
| `flt_op_1` | _N/A_ | |
| `goto_dash` | _N/A_ | |
| `grid_size` | _N/A_ | |
| `horizon_color_scale` | _N/A_ | |
| `import_time` | _N/A_ | |
| `instant_filtering` | _N/A_ | |
| `js_agg_function` | _N/A_ | |
Expand Down Expand Up @@ -1182,7 +1181,6 @@ Note the `y_axis_format` is defined under various section for some charts.
| `schema` | _N/A_ | |
| `select_country` | _N/A_ | |
| `series` | _N/A_ | |
| `series_height` | _N/A_ | |
| `show_bar_value` | _N/A_ | |
| `show_brush` | _N/A_ | |
| `show_bubbles` | _N/A_ | |
Expand Down
44 changes: 43 additions & 1 deletion superset-frontend/src/explore/controlPanels/Horizon.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,56 @@
*/
import { t } from '@superset-ui/translation';
import { NVD3TimeSeries } from './sections';
import { formatSelectOptions } from '../../modules/utils';

export default {
controlPanelSections: [
NVD3TimeSeries[0],
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [['series_height', 'horizon_color_scale']],
controlSetRows: [
[
{
name: 'series_height',
config: {
type: 'SelectControl',
renderTrigger: true,
freeForm: true,
label: t('Series Height'),
default: '25',
choices: formatSelectOptions([
'10',
'25',
'40',
'50',
'75',
'100',
'150',
'200',
]),
description: t('Pixel height of each series'),
},
},
{
name: 'horizon_color_scale',
config: {
type: 'SelectControl',
renderTrigger: true,
label: t('Value Domain'),
choices: [
['series', 'series'],
['overall', 'overall'],
['change', 'change'],
],
default: 'series',
description: t(
'series: Treat each series independently; overall: All series use the same scale; change: Show changes compared to the first data point in each series',
),
},
},
],
],
},
],
};
34 changes: 0 additions & 34 deletions superset-frontend/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,21 +381,6 @@ export const controls = {
),
},

horizon_color_scale: {
type: 'SelectControl',
renderTrigger: true,
label: t('Value Domain'),
choices: [
['series', 'series'],
['overall', 'overall'],
['change', 'change'],
],
default: 'series',
description: t(
'series: Treat each series independently; overall: All series use the same scale; change: Show changes compared to the first data point in each series',
),
},

autozoom: {
type: 'CheckboxControl',
label: t('Auto Zoom'),
Expand Down Expand Up @@ -1065,25 +1050,6 @@ export const controls = {
description: t('Suffix to apply after the percentage display'),
},

series_height: {
type: 'SelectControl',
renderTrigger: true,
freeForm: true,
label: t('Series Height'),
default: '25',
choices: formatSelectOptions([
'10',
'25',
'40',
'50',
'75',
'100',
'150',
'200',
]),
description: t('Pixel height of each series'),
},

x_axis_format: {
type: 'SelectControl',
freeForm: true,
Expand Down

0 comments on commit 9fcdc93

Please sign in to comment.