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

feat: improvements to "big number" visualization #7003

Merged
merged 3 commits into from
Mar 19, 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
58 changes: 58 additions & 0 deletions superset/assets/backendSync.json
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,64 @@
"default": "150",
"description": "Font size for the biggest value in the list"
},
"header_font_size": {
"type": "SelectControl",
"label": "Header Font Size",
"renderTrigger": true,
"clearable": false,
"default": 0.3,
"options": [
{
"label": "Tiny",
"value": 0.125
khtruong marked this conversation as resolved.
Show resolved Hide resolved
},
{
"label": "Small",
"value": 0.2
},
{
"label": "Normal",
"value": 0.3
},
{
"label": "Large",
"value": 0.4
},
{
"label": "Huge",
"value": 0.5
}
]
},
"subheader_font_size": {
"type": "SelectControl",
"label": "Subheader Font Size",
"renderTrigger": true,
"clearable": false,
"default": 0.125,
"options": [
{
"label": "Tiny",
"value": 0.125
},
{
"label": "Small",
"value": 0.2
},
{
"label": "Normal",
"value": 0.3
},
{
"label": "Large",
"value": 0.4
},
{
"label": "Huge",
"value": 0.5
}
]
},
"instant_filtering": {
"type": "CheckboxControl",
"label": "Instant Filtering",
Expand Down
13 changes: 12 additions & 1 deletion superset/assets/src/explore/controlPanels/BigNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@ export default {
],
},
{
label: t('Chart Options'),
label: t('Options'),
expanded: true,
controlSetRows: [
['compare_lag', 'compare_suffix'],
['y_axis_format', null],
['show_trend_line', 'start_y_axis_at_zero'],
],
},
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [
['color_picker', null],
['header_font_size'],
['subheader_font_size'],
],
},
],
controlOverrides: {
y_axis_format: {
label: t('Number format'),
},
header_font_size: {
label: t('Big Number Font Size'),
},
},
};
13 changes: 12 additions & 1 deletion superset/assets/src/explore/controlPanels/BigNumberTotal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,28 @@ export default {
],
},
{
label: t('Chart Options'),
label: t('Options'),
expanded: true,
controlSetRows: [
['subheader'],
['y_axis_format'],
],
},
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [
['header_font_size'],
['subheader_font_size'],
],
},
],
controlOverrides: {
y_axis_format: {
label: t('Number format'),
},
header_font_size: {
label: t('Big Number Font Size'),
},
},
};
62 changes: 62 additions & 0 deletions superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,68 @@ export const controls = {
description: t('Font size for the biggest value in the list'),
},

header_font_size: {
type: 'SelectControl',
label: t('Header Font Size'),
renderTrigger: true,
clearable: false,
default: 0.3,
// Values represent the percentage of space a header should take
options: [
{
label: t('Tiny'),
value: 0.125,
},
{
label: t('Small'),
value: 0.2,
},
{
label: t('Normal'),
value: 0.3,
},
{
label: t('Large'),
value: 0.4,
},
{
label: t('Huge'),
value: 0.5,
},
],
},

subheader_font_size: {
type: 'SelectControl',
label: t('Subheader Font Size'),
renderTrigger: true,
clearable: false,
default: 0.125,
// Values represent the percentage of space a subheader should take
options: [
{
label: t('Tiny'),
value: 0.125,
},
{
label: t('Small'),
value: 0.2,
},
{
label: t('Normal'),
value: 0.3,
},
{
label: t('Large'),
value: 0.4,
},
{
label: t('Huge'),
value: 0.5,
},
],
},

instant_filtering: {
type: 'CheckboxControl',
label: t('Instant Filtering'),
Expand Down