NPellet / visualizer

Other
43 stars 23 forks source link

spectraDisplayer / nmr1D and save state #929

Open lpatiny opened 8 years ago

lpatiny commented 8 years ago

jsGraph allows to save / reload zoom state in the spectrum.


var state = graphinstance.getAxisState();
  state.left[ 0 ] = [ 10, 20 ];
  graphinstance.setAxisState( state )

It would be nice that in spectraDisplayer and nmr1D this feature is available.

The idea is that the mouse over those module will catch the keyboards event and when you press a number (1 -> 9) the first time it saves the state, the second time it reloads the state ALT + number could force the saving of the state (and replacement of a previous state)

NPellet commented 8 years ago

Starting from v.1.14.10-1, you can use the helper functions:

(graph) graph.saveAxisState( {String,Number} stateName );
(graph) graph.recallAxisState( {String,Number} stateName );