[nvd3] fix bubble axis (#3332)

number of issues are addressed here:
* x axis formatting doesn't apply in bubble chart
* adding option to show/hide bounds of x and y axis
* with a flaky 'auto' margin mode, allow user to specify hard values or
  auto
* x label font-size was different than y axis
* show more options and reorg Control panels for Axes in `line` viz
This commit is contained in:
Maxime Beauchemin
2017-08-18 11:56:34 -07:00
committed by GitHub
parent e31ad22f50
commit a7ba6e4a5d
4 changed files with 72 additions and 23 deletions

View File

@@ -94,6 +94,7 @@ export const controls = {
y_axis_bounds: {
type: 'BoundsControl',
label: 'Y Axis Bounds',
renderTrigger: true,
default: [null, null],
description: (
'Bounds for the Y axis. When left empty, the bounds are ' +
@@ -414,7 +415,18 @@ export const controls = {
label: 'Bottom Margin',
choices: formatSelectOptions(['auto', 50, 75, 100, 125, 150, 200]),
default: 'auto',
description: 'Bottom marging, in pixels, allowing for more room for axis labels',
renderTrigger: true,
description: 'Bottom margin, in pixels, allowing for more room for axis labels',
},
left_margin: {
type: 'SelectControl',
freeForm: true,
label: 'Left Margin',
choices: formatSelectOptions(['auto', 50, 75, 100, 125, 150, 200]),
default: 'auto',
renderTrigger: true,
description: 'Left margin, in pixels, allowing for more room for axis labels',
},
granularity: {
@@ -1005,6 +1017,14 @@ export const controls = {
description: 'Whether to display the min and max values of the X axis',
},
y_axis_showminmax: {
type: 'CheckboxControl',
label: 'Y bounds',
renderTrigger: true,
default: true,
description: 'Whether to display the min and max values of the Y axis',
},
rich_tooltip: {
type: 'CheckboxControl',
label: 'Rich Tooltip',

View File

@@ -143,17 +143,24 @@ export const visTypes = {
controlSetRows: [
['color_scheme'],
['show_brush', 'show_legend'],
['rich_tooltip', null],
['show_markers', 'x_axis_showminmax'],
['rich_tooltip', 'show_markers'],
['line_interpolation', 'contribution'],
],
},
{
label: 'Axes',
label: 'X Axis',
controlSetRows: [
['x_axis_label', 'x_axis_format'],
['y_axis_label', 'y_axis_bounds'],
['y_axis_format', 'y_log_scale'],
['x_axis_label', 'bottom_margin'],
['x_axis_showminmax', 'x_log_scale'],
['x_axis_format', null],
],
},
{
label: 'Y Axis',
controlSetRows: [
['y_axis_label', 'left_margin'],
['y_axis_showminmax', 'y_log_scale'],
['y_axis_format', 'y_axis_bounds'],
],
},
sections.NVD3TimeSeries[1],
@@ -492,15 +499,17 @@ export const visTypes = {
{
label: 'X Axis',
controlSetRows: [
['x_axis_label', 'left_margin'],
['x', 'x_axis_format'],
['x_axis_label', 'x_log_scale'],
['x_log_scale', 'x_axis_showminmax'],
],
},
{
label: 'Y Axis',
controlSetRows: [
['y_axis_label', 'bottom_margin'],
['y', 'y_axis_format'],
['y_axis_label', 'y_log_scale'],
['y_log_scale', 'y_axis_showminmax'],
],
},
],