Re: [Jmol-users] Question: What is the preferred way to save JSmol state and orientation?

2014-02-05 Thread Robert Hanson
PNGJ is not designed to save any settings other than those that are
specifically necessary to define a state. So no user variables, no overall
preferences. You could save a message in the state by using the message
command, I suppose, but that would have to be a message that was visible to
the user. Oh, and perhaps in some relatively unused variable such as

set nmrpredictformat testing messages here

This would be human- or machine-readable in the state associated with the
PNGJ file if reopened by Jmol.

Although, come to think of it, I think I will remove that from the state.
So don't consider this method supported!


Bob



On Mon, Feb 3, 2014 at 11:44 AM, Alexander Rose alexander.r...@weirdbyte.de
 wrote:

 Hi,

 I am also quite interested in that.

  Can I save my app's private UI state (preferences, etc) as a variable
  or static function in JSmol so that PNGJ will write it to the .png
  file?

 As far as I know user defined variables or functions (from jmolscript)
 are not saved within the Jmol state.

 The idea I have in the back of my mind is to use a file format Jmol
 understands
 and have my data (your private state) piggybacking in that file. May be as
 a
 comment in some file or in a jmol script file. Though I have not tried
 anything
 yet.

 I would welcome a solution supported by Jmol itself.

  (I can imagine the user saving the PNGJ .png file to (say) a Google
  Drive repository.)
 
  Can I get the PNGJ output as as a JSON object to save in browser's
  localStorage and use with a Jmol script load ...?
  (I can imagine using the browser's localStorage as a way for the user
  to pick up working on something that hadn't yet been saved to (say)
  the Google Drive repository.
 

 Apparently you can save blobs in localStorage [1]. YOu can of course also
 save your private state in localStorage along side of the PNGJ but then you
 do not have everything in a self-contained file.


 Best
 Alexander


 [1]
 https://hacks.mozilla.org/2012/02/saving-images-and-files-in-localstorage/


 --
 Managing the Performance of Cloud-Based Applications
 Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
 Read the Whitepaper.

 http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Question: What is the preferred way to save JSmol state and orientation?

2014-02-05 Thread Charles Harrison Shubert
Hi Bob,

I guess I would have been surprised if a backdoor existed.  Thanks for thinking 
about this.

—Chuck

On Feb 5, 2014, at 4:45 PM, Robert Hanson 
hans...@stolaf.edumailto:hans...@stolaf.edu wrote:

PNGJ is not designed to save any settings other than those that are 
specifically necessary to define a state. So no user variables, no overall 
preferences. You could save a message in the state by using the message 
command, I suppose, but that would have to be a message that was visible to the 
user. Oh, and perhaps in some relatively unused variable such as

set nmrpredictformat testing messages here

This would be human- or machine-readable in the state associated with the PNGJ 
file if reopened by Jmol.

Although, come to think of it, I think I will remove that from the state. So 
don't consider this method supported!


Bob



On Mon, Feb 3, 2014 at 11:44 AM, Alexander Rose 
alexander.r...@weirdbyte.demailto:alexander.r...@weirdbyte.de wrote:
Hi,

I am also quite interested in that.

 Can I save my app’s private UI state (preferences, etc) as a variable
 or static function in JSmol so that PNGJ will write it to the .png
 file?

As far as I know user defined variables or functions (from jmolscript)
are not saved within the Jmol state.

The idea I have in the back of my mind is to use a file format Jmol understands
and have my data (your private state) piggybacking in that file. May be as a
comment in some file or in a jmol script file. Though I have not tried anything
yet.

I would welcome a solution supported by Jmol itself.

 (I can imagine the user saving the PNGJ .png file to (say) a Google
 Drive repository.)

 Can I get the PNGJ output as as a JSON object to save in browser’s
 localStorage and use with a Jmol script “load …”?
 (I can imagine using the browser’s localStorage as a way for the user
 to pick up working on something that hadn’t yet been saved to (say)
 the Google Drive repository.


Apparently you can save blobs in localStorage [1]. YOu can of course also
save your private state in localStorage along side of the PNGJ but then you
do not have everything in a self-contained file.


Best
Alexander


[1] https://hacks.mozilla.org/2012/02/saving-images-and-files-in-localstorage/

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.netmailto:Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users



--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Question: What is the preferred way to save JSmol state and orientation?

2014-02-03 Thread Charles Harrison Shubert
Hi Bob and Paul,

Thanks for your replies (both are very helpful).

The PNGJ functionality looks great!

Can I save my app’s private UI state (preferences, etc) as a variable or static 
function in JSmol so that PNGJ will write it to the .png file?
(I can imagine the user saving the PNGJ .png file to (say) a Google Drive 
repository.)

Can I get the PNGJ output as as a JSON object to save in browser’s localStorage 
and use with a Jmol script “load …”?
(I can imagine using the browser’s localStorage as a way for the user to pick 
up working on something that hadn’t yet been saved to (say) the Google Drive 
repository.

Thanks,

—Chuck

On Feb 1, 2014, at 5:17 PM, Robert Hanson 
hans...@stolaf.edumailto:hans...@stolaf.edu wrote:

very best way is to have the user save a PNGJ file --

write PNGJ ?.png

and then have them drag-drop it back into Jmol when they want to restore it.




On Fri, Jan 31, 2014 at 3:41 PM, Paul Pillot 
paul.pil...@ac-orleans-tours.frmailto:paul.pil...@ac-orleans-tours.fr wrote:
Hi Chuck,
have you tried « get property stateInfo » ? It should restore everything 
including orientation, zoom, etc…
Paul

Le 31 janv. 2014 à 16:32, Charles Harrison Shubert 
cshub...@mit.edumailto:cshub...@mit.edu a écrit :

 Hi,

 When my users open my app, I'd like for JSmol to be in the same state that 
 they left it in. My users can generate quite a bit of JSmol script. 
 Currently, I'm using the browser's localStorage to store app state in a JSON 
 object.

 What would be the preferred way to extract JSmol state including rendering, 
 orientation, zoom, etc, to save for my user's next visit?  I can imagine 
 accumulating the user's JSmol script, saving it, and using it to restore 
 JSmol, but I'm not sure how to save the orientation.

 I'd appreciate any thoughts that you have on this.

 Thanks,

 --Chuck


 --
 WatchGuard Dimension instantly turns raw network data into actionable
 security intelligence. It gives you real-time visual feedback on key
 security issues and trends.  Skip the complicated setup - simply import
 a virtual appliance and go from zero to informed in seconds.
 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.netmailto:Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users


--
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.netmailto:Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users



--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

--
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Question: What is the preferred way to save JSmol state and orientation?

2014-02-03 Thread Alexander Rose
Hi,

I am also quite interested in that.

 Can I save my app’s private UI state (preferences, etc) as a variable
 or static function in JSmol so that PNGJ will write it to the .png
 file?

As far as I know user defined variables or functions (from jmolscript) 
are not saved within the Jmol state.

The idea I have in the back of my mind is to use a file format Jmol understands
and have my data (your private state) piggybacking in that file. May be as a
comment in some file or in a jmol script file. Though I have not tried anything
yet.

I would welcome a solution supported by Jmol itself.

 (I can imagine the user saving the PNGJ .png file to (say) a Google
 Drive repository.)
 
 Can I get the PNGJ output as as a JSON object to save in browser’s
 localStorage and use with a Jmol script “load …”?
 (I can imagine using the browser’s localStorage as a way for the user
 to pick up working on something that hadn’t yet been saved to (say)
 the Google Drive repository.
 

Apparently you can save blobs in localStorage [1]. YOu can of course also
save your private state in localStorage along side of the PNGJ but then you
do not have everything in a self-contained file.


Best
Alexander


[1] https://hacks.mozilla.org/2012/02/saving-images-and-files-in-localstorage/

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Question: What is the preferred way to save JSmol state and orientation?

2014-02-01 Thread Robert Hanson
very best way is to have the user save a PNGJ file --

write PNGJ ?.png

and then have them drag-drop it back into Jmol when they want to restore it.




On Fri, Jan 31, 2014 at 3:41 PM, Paul Pillot 
paul.pil...@ac-orleans-tours.fr wrote:

 Hi Chuck,
 have you tried  get property stateInfo  ? It should restore everything
 including orientation, zoom, etc...
 Paul

 Le 31 janv. 2014 à 16:32, Charles Harrison Shubert cshub...@mit.edu a
 écrit :

  Hi,
 
  When my users open my app, I'd like for JSmol to be in the same state
 that they left it in. My users can generate quite a bit of JSmol script.
 Currently, I'm using the browser's localStorage to store app state in a
 JSON object.
 
  What would be the preferred way to extract JSmol state including
 rendering, orientation, zoom, etc, to save for my user's next visit?  I can
 imagine accumulating the user's JSmol script, saving it, and using it to
 restore JSmol, but I'm not sure how to save the orientation.
 
  I'd appreciate any thoughts that you have on this.
 
  Thanks,
 
  --Chuck
 
 
 
 --
  WatchGuard Dimension instantly turns raw network data into actionable
  security intelligence. It gives you real-time visual feedback on key
  security issues and trends.  Skip the complicated setup - simply import
  a virtual appliance and go from zero to informed in seconds.
 
 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
  ___
  Jmol-users mailing list
  Jmol-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/jmol-users



 --
 WatchGuard Dimension instantly turns raw network data into actionable
 security intelligence. It gives you real-time visual feedback on key
 security issues and trends.  Skip the complicated setup - simply import
 a virtual appliance and go from zero to informed in seconds.

 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Question: What is the preferred way to save JSmol state and orientation?

2014-01-31 Thread Paul Pillot
Hi Chuck,
have you tried « get property stateInfo » ? It should restore everything 
including orientation, zoom, etc…
Paul

Le 31 janv. 2014 à 16:32, Charles Harrison Shubert cshub...@mit.edu a écrit :

 Hi,
 
 When my users open my app, I'd like for JSmol to be in the same state that 
 they left it in. My users can generate quite a bit of JSmol script. 
 Currently, I'm using the browser's localStorage to store app state in a JSON 
 object.
 
 What would be the preferred way to extract JSmol state including rendering, 
 orientation, zoom, etc, to save for my user's next visit?  I can imagine 
 accumulating the user's JSmol script, saving it, and using it to restore 
 JSmol, but I'm not sure how to save the orientation.
 
 I'd appreciate any thoughts that you have on this.
 
 Thanks,
 
 --Chuck
 
 
 --
 WatchGuard Dimension instantly turns raw network data into actionable 
 security intelligence. It gives you real-time visual feedback on key
 security issues and trends.  Skip the complicated setup - simply import
 a virtual appliance and go from zero to informed in seconds.
 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users


--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users