Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use regular form definitions for all nvd3 charts
- Loading branch information
Showing
24 changed files
with
315 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 9 additions & 68 deletions
77
config/plugins/visualizations/charts/static/charts/forms/default.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
config/plugins/visualizations/charts/static/charts/forms/inputs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
define( [], function() { | ||
return { | ||
axisLabel : function( prefix ) { | ||
return { | ||
name : 'label', | ||
label : prefix.toUpperCase() + '-Axis label', | ||
help : 'Provide a label for the axis.', | ||
type : 'text', | ||
value : prefix.toUpperCase() + '-axis', | ||
placeholder : 'Axis label' | ||
} | ||
}, | ||
axisPrecision : function() { | ||
return { name : 'precision', | ||
label : 'Axis tick format', | ||
help : 'Select the tick format for the axis.', | ||
type : 'select', | ||
value : '1', | ||
data : [ { label : '0.00001', value : '5' }, | ||
{ label : '0.0001', value : '4' }, | ||
{ label : '0.001', value : '3' }, | ||
{ label : '0.01', value : '2' }, | ||
{ label : '0.1', value : '1' }, | ||
{ label : '1', value : '0' } ] } | ||
}, | ||
axisType : function( prefix, options ) { | ||
options = options || {}; | ||
return { | ||
type : 'conditional', | ||
test_param : { | ||
name : 'type', | ||
label : prefix.toUpperCase() + '-Axis value type', | ||
type : 'select', | ||
value : options.value || 'auto', | ||
help : 'Select the value type of the axis.', | ||
data : [ { value : 'hide', label : '-- Do not show values --' }, | ||
{ value : 'auto', label : 'Auto' }, | ||
{ value : 'f', label : 'Float' }, | ||
{ value : 'd', label : 'Integer' }, | ||
{ value : 'e', label : 'Exponent' }, | ||
{ value : 'p', label : 'Percent' }, | ||
{ value : 's', label : 'SI-prefix' } ] | ||
}, | ||
cases : [ { value : 'hide' }, | ||
{ value : 'auto' }, | ||
{ value : 'f', inputs: [ this.axisPrecision() ] }, | ||
{ value : 'd' }, | ||
{ value : 'e', inputs: [ this.axisPrecision() ] }, | ||
{ value : 'p', inputs: [ this.axisPrecision() ] }, | ||
{ value : 's' } ] | ||
} | ||
}, | ||
boolean : function( label, help, value ) { | ||
return { label : label, | ||
help : help, | ||
type : 'select', | ||
display : 'radiobutton', | ||
value : value || 'true', | ||
data : [ { label : 'Yes', value : 'true' }, | ||
{ label : 'No', value : 'false' } ] } | ||
} | ||
} | ||
}); |
40 changes: 18 additions & 22 deletions
40
config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
define(['plugin/charts/nvd3/common/config'], function(nvd3_config) { | ||
|
||
return $.extend(true, {}, nvd3_config, { | ||
title : 'Horizontal', | ||
category : 'Bar diagrams', | ||
settings : { | ||
x_axis_type : { | ||
init : 'hide' | ||
} | ||
}, | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
define( [ 'plugin/charts/nvd3/common/config', 'plugin/charts/forms/inputs' ], function( nvd3_config, Inputs ) { | ||
return $.extend( true, {}, nvd3_config, { | ||
title : 'Horizontal', | ||
category : 'Bar diagrams', | ||
settings : { | ||
x_axis_type : Inputs.axisType( 'x', { value: 'hide' } ) | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
} | ||
} | ||
} | ||
}); | ||
|
||
}); | ||
}); |
40 changes: 18 additions & 22 deletions
40
config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
define(['plugin/charts/nvd3/common/config'], function(nvd3_config) { | ||
|
||
return $.extend(true, {}, nvd3_config, { | ||
title : 'Stacked horizontal', | ||
category : 'Bar diagrams', | ||
settings : { | ||
x_axis_type : { | ||
init : 'hide' | ||
} | ||
}, | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
define( [ 'plugin/charts/nvd3/common/config', 'plugin/charts/forms/inputs' ], function( nvd3_config, Inputs ) { | ||
return $.extend( true, {}, nvd3_config, { | ||
title : 'Stacked horizontal', | ||
category : 'Bar diagrams', | ||
settings : { | ||
x_axis_type : Inputs.axisType( 'x', { value: 'hide' } ) | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
} | ||
} | ||
} | ||
}); | ||
|
||
}); | ||
}); |
36 changes: 17 additions & 19 deletions
36
config/plugins/visualizations/charts/static/charts/nvd3/line/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
define(['plugin/charts/nvd3/common/config'], function(nvd3_config) { | ||
|
||
return $.extend(true, {}, nvd3_config, { | ||
title : 'Line chart', | ||
category : 'Others', | ||
zoomable : true, | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
define( [ 'plugin/charts/nvd3/common/config' ], function( nvd3_config ) { | ||
return $.extend( true, {}, nvd3_config, { | ||
title : 'Line chart', | ||
category : 'Others', | ||
zoomable : true, | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
} | ||
} | ||
} | ||
}); | ||
|
||
}); | ||
}); |
36 changes: 17 additions & 19 deletions
36
config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
define(['plugin/charts/nvd3/common/config'], function(nvd3_config) { | ||
|
||
return $.extend(true, {}, nvd3_config, { | ||
title : 'Line with focus', | ||
category : 'Others', | ||
zoomable : 'native', | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
define( [ 'plugin/charts/nvd3/common/config' ], function( nvd3_config ) { | ||
return $.extend( true, {}, nvd3_config, { | ||
title : 'Line with focus', | ||
category : 'Others', | ||
zoomable : 'native', | ||
columns : { | ||
x : { | ||
title : 'Values for x-axis', | ||
is_label : true, | ||
is_auto : true, | ||
is_unique : true | ||
}, | ||
y : { | ||
title : 'Values for y-axis', | ||
is_numeric : true | ||
} | ||
} | ||
} | ||
}); | ||
|
||
}); | ||
}); |
Oops, something went wrong.