Graphs embedded in panel challenges

I have created cool GUI which is panel with two graphs in it and bunch of controls. Makes it easy to control that user can see the graphs and cannot loose them. 

I got myself in the pickle as I need to store copies of those graphs for users. Basically, I need to be able to :

1. insert the copy of graphs in notebook (e.g.:    Notebook $nbl scaling={50,50}, picture={$GraphName, 2, 1 }

2. Offer user way to export tiff/jpg file

3. Offer user to save the graph as pxp file 

Now, I found here in the discussion how to make copy of such graph using recreation macro and that will work just fine for me. But is there simpler way? Manipulation of embedded graphs seems to be still challenge for me. 

 

I believe the philosophy behind graphs embedded in control panels is that they are part of a UI, and as such, not fully functional as polished display objects. I know this is pretty restrictive, but the architecture of control panels was designed for certain things.

I think the solution you have is the only practical one. Another possibility would be to simply use the code that creates the subwindow graphs and with a bit of conditional code it would probably work to create a stand-alone graph. I don't know if this is sufficient, but might be a start:

Function CreateSubGraph(Variable doStandalone)
    if (doStandalone)
        Display
    else
        Display/HOST=mySpiffyPanel
    endif
    ... etc. ...

 

Jan

I might propose a modification as per John's statements. Refactor your code to put the graphs in a split window display and attach the panel to the side of the graph. See the layout that I am using in the Image Tools Package as an example. The image and the histograms are two separate graphs. Actually, the histograms are embedded in a panel (and this approach is creating exactly the same problem as you face). When the panel is attached to the side, the graph and the panel do not get "lost from each other".

For the case that you need to move graphs to notebooks either as reports or as documents, you might consider my LogBook Package. It gives a general-purpose approach to documenting the progress of an experiment, allowing a user to collect the current core content  of an experiment (graphs, panels, comments) with "a click of a button".

For the case that you need to store a graph as its own pxp, you might consider my SnapIt! Package. Some of its advantages are mentioned in the description.