Commit 5f7932b85283b7b17f7a79a13844bb0cb3146902
1 parent
b350c87a
Exists in
master
and in
19 other branches
Done
Showing
7 changed files
with
90 additions
and
60 deletions
Show diff stats
generic_data/defaultValues.json
@@ -52,6 +52,7 @@ | @@ -52,6 +52,7 @@ | ||
52 | "axis":{ | 52 | "axis":{ |
53 | "scale":"linear", | 53 | "scale":"linear", |
54 | "tickPosition":"outwards", | 54 | "tickPosition":"outwards", |
55 | + "tickTimeUnit":"default", | ||
55 | "color":"#000000", | 56 | "color":"#000000", |
56 | "thickness":1, | 57 | "thickness":1, |
57 | "legend":{ | 58 | "legend":{ |
generic_data/defaultValuesConfig.json
@@ -69,6 +69,13 @@ | @@ -69,6 +69,13 @@ | ||
69 | { "key": "outwards", "value": "Outwards" } | 69 | { "key": "outwards", "value": "Outwards" } |
70 | ], | 70 | ], |
71 | 71 | ||
72 | + "availableTicksTimeUnits": [ | ||
73 | + { "key": "default", "value": "Second(s)" }, | ||
74 | + { "key": "min", "value": "Minute(s)" }, | ||
75 | + { "key": "hour", "value": "Hour(s)" }, | ||
76 | + { "key": "day", "value": "Days(s)" } | ||
77 | + ], | ||
78 | + | ||
72 | "availableTimeAxisFormats": [ | 79 | "availableTimeAxisFormats": [ |
73 | { "key": "dd/mm/yy", "value": "dd/mm/yy" }, | 80 | { "key": "dd/mm/yy", "value": "dd/mm/yy" }, |
74 | { "key": "ddd/yy", "value": "ddd/yy" }, | 81 | { "key": "ddd/yy", "value": "ddd/yy" }, |
generic_data/defaultValuesLinks.json
@@ -96,6 +96,11 @@ | @@ -96,6 +96,11 @@ | ||
96 | "type":"combobox", | 96 | "type":"combobox", |
97 | "store":"availableTicksPositions" | 97 | "store":"availableTicksPositions" |
98 | }, | 98 | }, |
99 | + "plot.axis.tickTimeUnit": | ||
100 | + { | ||
101 | + "type":"combobox", | ||
102 | + "store":"availableTicksTimeUnits" | ||
103 | + }, | ||
99 | "plot.axis.timeFormat": | 104 | "plot.axis.timeFormat": |
100 | { | 105 | { |
101 | "type":"combobox", | 106 | "type":"combobox", |
js/app/models/PlotObjects/PlotAxisObject.js
@@ -18,42 +18,43 @@ Ext.define('amdaPlotObj.PlotAxisObject', { | @@ -18,42 +18,43 @@ Ext.define('amdaPlotObj.PlotAxisObject', { | ||
18 | idProperty: 'id', | 18 | idProperty: 'id', |
19 | 19 | ||
20 | fields : [ | 20 | fields : [ |
21 | - {name: 'id', type: 'string'}, | ||
22 | - //axis-type can be : time, y-left, y-right, x, color, epoch | ||
23 | - {name: 'axis-type', type: 'string'}, | ||
24 | - {name: 'axis-reverse', type: 'boolean'}, | ||
25 | - {name: 'axis-scale', type: 'string'}, | ||
26 | - {name: 'axis-range-min', type: 'float'}, | ||
27 | - {name: 'axis-range-max', type: 'float'}, | ||
28 | - {name: 'axis-range-extend', type: 'boolean'}, | ||
29 | - {name: 'axis-color', type: 'string'}, | ||
30 | - {name: 'axis-thickness', type: 'int'}, | ||
31 | - {name: 'axis-tick-showmarks', type: 'boolean'}, | ||
32 | - {name: 'axis-grid-specify-ticks-number', type: 'boolean'}, | ||
33 | - {name: 'axis-grid-specify-ticks-spacing', type: 'boolean'}, | ||
34 | - {name: 'axis-tick-position', type: 'string'}, | ||
35 | - {name: 'axis-grid-minor', type: 'boolean'}, | ||
36 | - {name: 'axis-grid-major', type: 'boolean'}, | ||
37 | - {name:'axis-grid-minor-number',type:'int'}, | ||
38 | - {name:'axis-grid-major-number',type:'int'}, | ||
39 | - {name:'axis-grid-major-space',type:'float'}, | ||
40 | - {name:'axis-grid-minor-space',type:'float'}, | ||
41 | - {name: 'axis-legend-activated', type: 'boolean'}, | ||
42 | - {name: 'axis-legend-text', type: 'string'}, | ||
43 | - {name: 'axis-legend-color', type: 'string'}, | ||
44 | - {name: 'axis-legend-font-activated', type: 'boolean'}, | ||
45 | - {name: 'axis-legend-font-name', type: 'string'}, | ||
46 | - {name: 'axis-legend-font-size', type: 'int'}, | ||
47 | - {name: 'axis-legend-font-bold', type: 'boolean'}, | ||
48 | - {name: 'axis-legend-font-italic', type: 'boolean'}, | ||
49 | - //only used for time axis | ||
50 | - {name: 'axis-time-format', type: 'string'}, | ||
51 | - //only used for epoch axis | ||
52 | - {name: 'axis-epoch-normalized', type: 'boolean'}, | ||
53 | - //only used for color axis | ||
54 | - {name: 'axis-color-map', type: 'string'}, | ||
55 | - {name: 'axis-color-minval', type: 'string'}, | ||
56 | - {name: 'axis-color-maxval', type: 'string'} | 21 | + {name: 'id', type: 'string'}, |
22 | + //axis-type can be : time, y-left, y-right, x, color, epoch | ||
23 | + {name: 'axis-type', type: 'string'}, | ||
24 | + {name: 'axis-reverse', type: 'boolean'}, | ||
25 | + {name: 'axis-scale', type: 'string'}, | ||
26 | + {name: 'axis-range-min', type: 'float'}, | ||
27 | + {name: 'axis-range-max', type: 'float'}, | ||
28 | + {name: 'axis-range-extend', type: 'boolean'}, | ||
29 | + {name: 'axis-color', type: 'string'}, | ||
30 | + {name: 'axis-thickness', type: 'int'}, | ||
31 | + {name: 'axis-tick-showmarks', type: 'boolean'}, | ||
32 | + {name: 'axis-grid-specify-ticks-number', type: 'boolean'}, | ||
33 | + {name: 'axis-grid-specify-ticks-spacing', type: 'boolean'}, | ||
34 | + {name: 'axis-tick-time-unit', type: 'string'}, | ||
35 | + {name: 'axis-tick-position', type: 'string'}, | ||
36 | + {name: 'axis-grid-minor', type: 'boolean'}, | ||
37 | + {name: 'axis-grid-major', type: 'boolean'}, | ||
38 | + {name:'axis-grid-minor-number',type:'int'}, | ||
39 | + {name:'axis-grid-major-number',type:'int'}, | ||
40 | + {name:'axis-grid-major-space',type:'float'}, | ||
41 | + {name:'axis-grid-minor-space',type:'float'}, | ||
42 | + {name: 'axis-legend-activated', type: 'boolean'}, | ||
43 | + {name: 'axis-legend-text', type: 'string'}, | ||
44 | + {name: 'axis-legend-color', type: 'string'}, | ||
45 | + {name: 'axis-legend-font-activated', type: 'boolean'}, | ||
46 | + {name: 'axis-legend-font-name', type: 'string'}, | ||
47 | + {name: 'axis-legend-font-size', type: 'int'}, | ||
48 | + {name: 'axis-legend-font-bold', type: 'boolean'}, | ||
49 | + {name: 'axis-legend-font-italic', type: 'boolean'}, | ||
50 | + //only used for time axis | ||
51 | + {name: 'axis-time-format', type: 'string'}, | ||
52 | + //only used for epoch axis | ||
53 | + {name: 'axis-epoch-normalized', type: 'boolean'}, | ||
54 | + //only used for color axis | ||
55 | + {name: 'axis-color-map', type: 'string'}, | ||
56 | + {name: 'axis-color-minval', type: 'string'}, | ||
57 | + {name: 'axis-color-maxval', type: 'string'} | ||
57 | ], | 58 | ], |
58 | 59 | ||
59 | associations : [ | 60 | associations : [ |
@@ -98,6 +99,7 @@ Ext.define('amdaPlotObj.PlotAxisObject', { | @@ -98,6 +99,7 @@ Ext.define('amdaPlotObj.PlotAxisObject', { | ||
98 | this.set('axis-grid-minor', false); | 99 | this.set('axis-grid-minor', false); |
99 | this.set('axis-grid-specify-ticks-number', false); | 100 | this.set('axis-grid-specify-ticks-number', false); |
100 | this.set('axis-grid-specify-ticks-spacing', false); | 101 | this.set('axis-grid-specify-ticks-spacing', false); |
102 | + this.set('axis-tick-time-unit',amdaDefaultValues.plot.axis.tickTimeUnit); | ||
101 | this.set('axis-grid-major', false); | 103 | this.set('axis-grid-major', false); |
102 | this.set('axis-legend-activated', true); | 104 | this.set('axis-legend-activated', true); |
103 | this.set('axis-legend-text', ''); | 105 | this.set('axis-legend-text', ''); |
@@ -142,6 +144,7 @@ Ext.define('amdaPlotObj.PlotAxisObject', { | @@ -142,6 +144,7 @@ Ext.define('amdaPlotObj.PlotAxisObject', { | ||
142 | axisValues['axis-grid-minor-space']=this.get('axis-grid-minor-space'); | 144 | axisValues['axis-grid-minor-space']=this.get('axis-grid-minor-space'); |
143 | axisValues['axis-grid-major-space']=this.get('axis-grid-major-space'); | 145 | axisValues['axis-grid-major-space']=this.get('axis-grid-major-space'); |
144 | axisValues['axis-grid-specify-ticks-spacing']=this.get('axis-grid-specify-ticks-spacing'); | 146 | axisValues['axis-grid-specify-ticks-spacing']=this.get('axis-grid-specify-ticks-spacing'); |
147 | + axisValues['axis-tick-time-unit']= this.get('axis-tick-time-unit'); | ||
145 | axisValues['axis-legend-activated'] = this.get('axis-legend-activated'); | 148 | axisValues['axis-legend-activated'] = this.get('axis-legend-activated'); |
146 | axisValues['axis-legend-text'] = this.get('axis-legend-text'); | 149 | axisValues['axis-legend-text'] = this.get('axis-legend-text'); |
147 | axisValues['axis-legend-color'] = this.get('axis-legend-color'); | 150 | axisValues['axis-legend-color'] = this.get('axis-legend-color'); |
js/app/views/PlotComponents/PlotBaseAxisForm.js
@@ -15,9 +15,28 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { | @@ -15,9 +15,28 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { | ||
15 | showColorOption : true, | 15 | showColorOption : true, |
16 | showRangeOptions : true, | 16 | showRangeOptions : true, |
17 | showTickGridOptions : true, | 17 | showTickGridOptions : true, |
18 | - showTicksNumber: false, | ||
19 | - showTicksSpacing:false, | 18 | + showTicksNumber: false, |
19 | + showTicksSpacing:false, | ||
20 | + showTicksTimeSpacingCombo:false, | ||
20 | 21 | ||
22 | + setObject: function (object) { | ||
23 | + this.callParent(arguments); | ||
24 | + this.updateOptions(); | ||
25 | + }, | ||
26 | + | ||
27 | + updateOptions : function(){ | ||
28 | + var isShowTicksSpacingVisible = this.object.get('axis-grid-specify-ticks-spacing'); | ||
29 | + var isShowTicksNumberVisible = this.object.get('axis-grid-specify-ticks-number'); | ||
30 | + | ||
31 | + var isTImeUnitVisible = this.showTicksTimeSpacingCombo && isShowTicksSpacingVisible ; | ||
32 | + | ||
33 | + this.getForm( ).findField('axis-grid-minor-space').setVisible( isShowTicksSpacingVisible ); | ||
34 | + this.getForm( ).findField('axis-grid-major-space').setVisible( isShowTicksSpacingVisible ); | ||
35 | + this.getForm( ).findField('axis-grid-minor-number').setVisible( isShowTicksNumberVisible); | ||
36 | + this.getForm( ).findField('axis-grid-major-number').setVisible(isShowTicksNumberVisible); | ||
37 | + this.getForm( ).findField('axis-tick-time-unit').setVisible( isTImeUnitVisible ); | ||
38 | + }, | ||
39 | + | ||
21 | getFormItems: function() { | 40 | getFormItems: function() { |
22 | var me = this; | 41 | var me = this; |
23 | var rangeItems = [ | 42 | var rangeItems = [ |
@@ -31,36 +50,28 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { | @@ -31,36 +50,28 @@ Ext.define('amdaPlotComp.PlotBaseAxisForm', { | ||
31 | this.addColorsPicker('axis-legend-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'auto'), | 50 | this.addColorsPicker('axis-legend-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'auto'), |
32 | this.addStandardFont('axis-legend-font') | 51 | this.addStandardFont('axis-legend-font') |
33 | ]; | 52 | ]; |
34 | - var manageTicksNumber = function (name, newValue, oldValue){ | ||
35 | - | ||
36 | - me.getForm( ).findField('axis-grid-minor-number').setVisible( newValue); | ||
37 | - me.getForm( ).findField('axis-grid-major-number').setVisible( newValue); | ||
38 | - if(newValue){ | ||
39 | - me.getForm( ).findField('axis-grid-specify-ticks-spacing').setValue(!newValue); | ||
40 | - } | ||
41 | - | ||
42 | - }; | ||
43 | - var manageTicksSpacing = function (name, newValue, oldValue){ | ||
44 | - me.getForm( ).findField('axis-grid-minor-space').setVisible( newValue ); | ||
45 | - me.getForm( ).findField('axis-grid-major-space').setVisible( newValue ); | ||
46 | - if(newValue){ | ||
47 | - me.getForm( ).findField('axis-grid-specify-ticks-number').setValue(!newValue); | ||
48 | - } | ||
49 | - }; | 53 | + var manageTicksFields= function (name, newValue, oldValue){ |
54 | + if(newValue){ | ||
55 | + if(name === 'axis-grid-specify-ticks-spacing') | ||
56 | + me.getForm( ).findField('axis-grid-specify-ticks-number').setValue(!newValue); | ||
57 | + else | ||
58 | + me.getForm( ).findField('axis-grid-specify-ticks-spacing').setValue(!newValue); | ||
59 | + } | ||
60 | + me.updateOptions(); | ||
61 | + }; | ||
50 | 62 | ||
51 | var tickGridItems = [ | 63 | var tickGridItems = [ |
52 | this.addStandardCombo('axis-tick-position', 'Ticks position', amdaDefaultConfigs.availableTicksPositions), | 64 | this.addStandardCombo('axis-tick-position', 'Ticks position', amdaDefaultConfigs.availableTicksPositions), |
53 | this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'), | 65 | this.addStandardCheck('axis-tick-showmarks', 'Show tick marks'), |
54 | this.addStandardCheck('axis-grid-major', 'Show major grid'), | 66 | this.addStandardCheck('axis-grid-major', 'Show major grid'), |
55 | this.addStandardCheck('axis-grid-minor', 'Show minor grid')]; | 67 | this.addStandardCheck('axis-grid-minor', 'Show minor grid')]; |
56 | - tickGridItems.push(this.addStandardCheck('axis-grid-specify-ticks-number', 'Specify ticks number', manageTicksNumber)); | 68 | + tickGridItems.push(this.addStandardCheck('axis-grid-specify-ticks-number', 'Specify ticks number', manageTicksFields)); |
57 | tickGridItems.push(this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 1, Number.MAX_VALUE,true,true)); | 69 | tickGridItems.push(this.addStandardInteger('axis-grid-major-number', 'Nb of Major Ticks', 1, Number.MAX_VALUE,true,true)); |
58 | tickGridItems.push(this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 1, Number.MAX_VALUE,true,true)); | 70 | tickGridItems.push(this.addStandardInteger('axis-grid-minor-number', 'Nb of Minor Ticks', 1, Number.MAX_VALUE,true,true)); |
59 | - tickGridItems.push(this.addStandardCheck('axis-grid-specify-ticks-spacing', 'Specify ticks spacing',manageTicksSpacing)); | 71 | + tickGridItems.push(this.addStandardCheck('axis-grid-specify-ticks-spacing', 'Specify ticks spacing',manageTicksFields)); |
72 | + tickGridItems.push(this.addStandardCombo('axis-tick-time-unit', 'Time unit', amdaDefaultConfigs.availableTicksTimeUnits)); | ||
60 | tickGridItems.push(this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true,true)); | 73 | tickGridItems.push(this.addStandardFloat2('axis-grid-major-space', ' Major Ticks Space', 0, Number.MAX_VALUE,true,true)); |
61 | tickGridItems.push(this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true,true)); | 74 | tickGridItems.push(this.addStandardFloat2('axis-grid-minor-space', ' Minor Ticks Space', 0, Number.MAX_VALUE,true,true)); |
62 | - | ||
63 | - | ||
64 | var axisItems = []; | 75 | var axisItems = []; |
65 | if (this.showScaleOption) | 76 | if (this.showScaleOption) |
66 | axisItems.push(this.addStandardCombo('axis-scale', 'Scale', amdaDefaultConfigs.availableAxisScales)); | 77 | axisItems.push(this.addStandardCombo('axis-scale', 'Scale', amdaDefaultConfigs.availableAxisScales)); |
js/app/views/PlotComponents/PlotEpochAxisForm.js
@@ -13,7 +13,8 @@ Ext.define('amdaPlotComp.PlotEpochAxisForm', { | @@ -13,7 +13,8 @@ Ext.define('amdaPlotComp.PlotEpochAxisForm', { | ||
13 | 13 | ||
14 | showScaleOption : false, | 14 | showScaleOption : false, |
15 | showRangeOptions : false, | 15 | showRangeOptions : false, |
16 | - showTicksNumberSpacing : false, | 16 | + showTicksNumberSpacing : false, |
17 | + showTicksTimeSpacingCombo :true, | ||
17 | 18 | ||
18 | getFormItems: function() { | 19 | getFormItems: function() { |
19 | var epochItems = [ | 20 | var epochItems = [ |
js/app/views/PlotComponents/PlotTimeAxisForm.js
@@ -13,9 +13,11 @@ Ext.define('amdaPlotComp.PlotTimeAxisForm', { | @@ -13,9 +13,11 @@ Ext.define('amdaPlotComp.PlotTimeAxisForm', { | ||
13 | 13 | ||
14 | showScaleOption : false, | 14 | showScaleOption : false, |
15 | showRangeOptions : false, | 15 | showRangeOptions : false, |
16 | - showTicksNumberSpacing : false, | 16 | + showTicksNumberSpacing : false, |
17 | + showTicksTimeSpacingCombo :true, | ||
17 | 18 | ||
18 | getFormItems: function() { | 19 | getFormItems: function() { |
20 | + | ||
19 | var timeItems = [ | 21 | var timeItems = [ |
20 | this.addStandardCombo('axis-time-format', 'Time Format', amdaDefaultConfigs.availableTimeAxisFormats) | 22 | this.addStandardCombo('axis-time-format', 'Time Format', amdaDefaultConfigs.availableTimeAxisFormats) |
21 | ]; | 23 | ]; |