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

Migrating horizon controls #9368

Merged
merged 3 commits into from
Mar 26, 2020
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
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_ | |
| `include_series` | _N/A_ | |
| `instant_filtering` | _N/A_ | |
Expand Down Expand Up @@ -1183,7 +1182,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 @@ -1073,25 +1058,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