cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
bobmorrane
Level V

fit multiple display boxes to window

Hello,

 

 

I made a script that arranges multiple graphs in a tree of three levels of nested tab boxes. After sorting my initial issue of the script crashing JMP on every single run (I was sending a display box into the wrong type of box I think), I am now trying to polish it.

What I would like to do is to have all my graphs fit to the size of the window. I have noticed that for some reason, I can't resize graphs manually in my final window. As the various graphs get displayed in the window (<<append message), I can see how they all fit together. They all fit nicely in my window until one graph that is larger than the others sort of sets a new standard and they all get bigger and my beautiful layout falls apart.

 

Is there an easy way to set the graphs/ the display boxes so that everything automatically resizes to the window size ?

 

~~Bob~~
2 REPLIES 2

Re: fit multiple display boxes to window

First, please do send the crashing script to Tech Support - even when the script is not doing things the recommended way, we would like to fix any mishandling that leads to a crash.

 

Stretchable displays have many considerations - it would be helpful to know how you are creating the stretchable content.  Platforms like Graph Builder have built-in settings like Fit To Window("On"), while for custom content you may be using something like frameBox<<Set Auto Stretching(1,1).  If you have an example that you can attach, that would be ideal.

 

Even when content is stretchable, the window will still measure all of the boxes and size the window large enough to contain everything (if possible, otherwise it may have to scroll).  When adding stretchable content you may want to set the initial size to something small if you don't want the new object to cause a change in the window size.  You may also find it useful to call <<Set Min Size() or <<Set Max Size() on the stretchable content - this can change the behavior of stretching when the window is made larger or smaller.

 

Another thing that you may want to look into is the use of Splitter Box.  Splitter Box can help to keep stretching in sync between multiple stretchable objects, and lets you define the initial size of the content.  This is counter to the comment above about the window growing large enough to contain the content - Splitter is more forceful about maintaining a size and forcing the child boxes to adjust.

 

Names Default To Here(1);
dt=Open("$SAMPLE_DATA/Big Class.jmp");
New Window( "stretch",
	H Splitter Box(Size(900,600),
		<<Sizes({.3,.7}),
		
		V Splitter Box(
			dt<<Bivariate(
				Y( :weight ),
				X( :height ),
				SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 201, 170 ), Set Auto Stretching( 1, 1 ), Set Min Size( 50, 50 )} ) )
			), 

			dt<<Oneway(
				Y( :height ),
				X( :sex ),
				SendToReport(
					Dispatch( {}, "Oneway Plot", FrameBox, {Frame Size( 214, 172 ), Set Auto Stretching( 1, 1 ), Set Min Size( 50, 50 )} )
				)
			)
		), 

		dt<<Graph Builder(
			Show Control Panel( 0 ),
			Fit To Window("On"),
			Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
			Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
		)
	)
);
bobmorrane
Level V

Re: fit multiple display boxes to window

Hi @danschikore ,

 

thanks for the information. I have tried using Splitter box and that made things better. It's, not yet the perfetcly polished script that I would like to deliver but alas I am too short on time to perfect it.

 

 

For information, here is the model of script I used  :

win = New Window( "My tabbed graphs", 

	Data Filter Context Box(
		V Splitter Box(
			Size( 1800, 1000 ), 	
			<<Sizes( {.2, .8} ),
			H Splitter Box( my_filter = my_custom_filter_function(),
 Tb1 = Tab Box() )
		)
	)
	
);

Later on in the script, I have a loop that generates graphs from a list of parameters. It then pushes it to the main window with the append message:

 

tpb2 = Tab Page Box( Title( My_List[i] ), Tb2 = Tab Box() );
tb2<<append (my_custom_graphs_function);

tb1<<append (tpb2);

Originally I used V List Box instead of V Splitter box. I also fiddled with the graphs sizes in my_custom_graph_function, which is essentially just a graph builder function.

 

 

 

 

 

 

 

 

~~Bob~~