@@ -29,6 +29,9 @@ function GraphConfigurationDialog(dialog, onSave) {
2929 elem = $ (
3030 '<li class="config-graph-field">'
3131 + '<select class="form-control"><option value="">(choose a field)</option></select>'
32+ + '<input name="smoothing" class="form-control" type="text"></input>'
33+ + '<input name="power" class="form-control" type="text"></input>'
34+ + '<input name="scale" class="form-control" type="text"></input>'
3235 + '<button type="button" class="btn btn-default btn-sm">Remove</button>'
3336 + '</li>'
3437 ) ,
@@ -40,6 +43,17 @@ function GraphConfigurationDialog(dialog, onSave) {
4043 select . append ( renderFieldOption ( offeredFieldNames [ i ] , selectedFieldName ) ) ;
4144 }
4245
46+ // the smoothing is in uS rather than %, scale the value somewhere between 0 and 10000uS
47+ $ ( 'input[name=smoothing]' , elem ) . val ( ( field . smoothing != null ) ?( field . smoothing / 100 ) + '%' :'30%' ) ;
48+ if ( field . curve != null ) {
49+ $ ( 'input[name=power]' , elem ) . val ( ( field . curve . power != null ) ?( field . curve . power * 100 ) + '%' :'100%' ) ;
50+ $ ( 'input[name=scale]' , elem ) . val ( ( field . curve . outputRange != null ) ?( field . curve . outputRange * 100 ) + '%' :'100%' ) ;
51+ } else
52+ {
53+ $ ( 'input[name=power]' , elem ) . val ( '100%' ) ;
54+ $ ( 'input[name=scale]' , elem ) . val ( '100%' ) ;
55+ }
56+
4357 return elem ;
4458 }
4559
@@ -57,6 +71,18 @@ function GraphConfigurationDialog(dialog, onSave) {
5771 + '<input class="form-control" type="text" placeholder="Axis label">'
5872 + '</div>'
5973 + '</div>'
74+ + '<div class="form-group form-group-sm">'
75+ + '<div class="col-sm-10">'
76+ + '<table>'
77+ + '<tr>'
78+ + '<th name="field"></th>'
79+ + '<th name="smoothing">Smooth</th>'
80+ + '<th name="expo">Expo</th>'
81+ + '<th name="zoom">Zoom</th>'
82+ + '</tr>'
83+ + '</table>'
84+ + '</div>'
85+ + '</div>'
6086 + '<div class="form-group form-group-sm">'
6187 + '<label class="col-sm-2 control-label">Fields</label>'
6288 + '<div class="col-sm-10">'
@@ -162,8 +188,13 @@ function GraphConfigurationDialog(dialog, onSave) {
162188
163189 $ ( ".config-graph-field" , this ) . each ( function ( ) {
164190 field = {
165- name : $ ( "select" , this ) . val ( )
166- } ;
191+ name : $ ( "select" , this ) . val ( ) ,
192+ smoothing : parseInt ( $ ( "input[name=smoothing]" , this ) . val ( ) ) * 100 , // Value 0-100% = 0-10000uS (higher values are more smooth, 30% is typical)
193+ curve : {
194+ power : parseInt ( $ ( "input[name=power]" , this ) . val ( ) ) / 100.0 , // Value 0-100% = 0-1.0 (lower values exagerate center values - expo)
195+ outputRange : parseInt ( $ ( "input[name=scale]" , this ) . val ( ) ) / 100.0 // Value 0-100% = 0-1.0 (higher values > 100% zoom in graph vertically)
196+ }
197+ }
167198
168199 if ( field . name . length > 0 ) {
169200 graph . fields . push ( field ) ;
0 commit comments