cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Buldozer
Level II

Removing the Outline Box within dispatch command

Hi , i am building 1Click in jmp and when i create an bivariate graphite it creates Boxes like the those

Buldozer_1-1712855672196.png

 

i manage to remove them (collapse) but the problem is that because it is 1Click it comes back again when i do changes like filtering because in the bivariate graph set to : Automatic Recalc( 1 )

 

so i want to remove it from the dispatch so every time it recalcs it removes it, it works with the picture box but not with Outline box, because it looks like it is asking for the box naming instead of outlinebox number, any Idea  

Buldozer_2-1712855819493.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Removing the Outline Box within dispatch command

I ran your code under both JMP 18 and JMP 14.  I see the legend expanding under 14, but under 18 it runs without error.  The obvious suggestion is to upgrade.  

What you might try is to completely delete the graph each time you adjust it from your check boxes

Jim

View solution in original post

8 REPLIES 8
hogi
Level XII

Re: Removing the Outline Box within dispatch command

A quick and dirty way to remove/hide OutlineBoxes: collapse them *) and delete the title.

If you just delete the title - without collapsing it first - you might already guess it: it just deletes the title

 

*)To collapse all OutlineBoxes at once, press the CTRL key while clicking on the gray triangle.

 

 

 

txnelson
Super User

Re: Removing the Outline Box within dispatch command

Try something like this.  It uses Add Graphics Script to handle the collapsing of the outline boxes

Names Default To Here( 1 );

dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

biv = Bivariate(
	Y( :height ),
	X( :weight ),
	Fit Spline( 10000, {Line Color( {212, 73, 88} )} ),
	Fit Spline( 1, {Line Color( {61, 174, 70} )} ),
	Automatic Recalc( 1 )
);

Report( biv )[framebox( 1 )] << add graphics script(
	oboxes = biv << xpath( "//OutlineBox" );
	For Each( {box}, oboxes,
		If( Contains( box << get title, "Smoothing Spline" ),
			box << visibility( "collapse" )
		)
	);
);
Jim
Buldozer
Level II

Re: Removing the Outline Box within dispatch command

Hi, thanks for the reply

tried your code (as is...) did not do anything

txnelson
Super User

Re: Removing the Outline Box within dispatch command

What version of JMP are you using?

When the code is run, it produces the below output

txnelson_0-1712936054957.png

The Add Graphics Scrip is executed when ever the output is changed.  It was my interpretation that what you need is to close the Outline Boxes associated with the Spline fits.  That is what the code does.  Even when a filter is applied, etc, the Outline Boxes remain collapsed.

Are you getting any error messages in the log?

Jim
Buldozer
Level II

Re: Removing the Outline Box within dispatch command

Hi,  , i am using JMP14

In  Log this is what i see

 

Name Unresolved: For Each in access or evaluation of 'For Each' , For Each(
{box},
oboxes,
If( Contains( box << get title, "Smoothing Spline" ),
box << visibility( "collapse" )
)
) /*###*/

txnelson
Super User

Re: Removing the Outline Box within dispatch command

The For Each() function was introduced in JMP 16.

Here is a modified version of the JSL that removes the For Each() and replaces it with a For() loop.  I tested it is JMP 14 and it works as expected.

Names Default To Here( 1 );

dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

biv = Bivariate(
	Y( :height ),
	X( :weight ),
	Fit Spline( 10000, {Line Color( {212, 73, 88} )} ),
	Fit Spline( 1, {Line Color( {61, 174, 70} )} ),
	Automatic Recalc( 1 )
);

Report( biv )[framebox( 1 )] <<
add graphics script(
	oboxes = biv << xpath( "//OutlineBox" );
	For( i = 1, i <= N Items( oboxes ), i++,
		box = oboxes[i];
		If( Contains( box << get title, "Smoothing Spline" ),
			box << visibility( "collapse" )
		);
	);
);
Jim
Buldozer
Level II

Re: Removing the Outline Box within dispatch command

Thanks , this is working, but ... Mabey you can help with the following:

 

i have this code , when i play with the legend buttons only all is working, but when i start using the filter it opens a bunch  of border boxes.. i believe it comes from "automatic recalc"  and for some reason the border boxes are stuck in memory...

have any idea how to solve this?

//obj << show tree structure
//Report( obj )[Outline Box( 1)] << Delete;
//Begin Script;
 
CreateTrendPlot = Function( {}, 
    // Create and return the trend plot with legend
	obj = Bivariate(
		Y( :height ),
		X( :weight ),
		Automatic Recalc( 1 ),
		Group By( :sex ),
		Fit Spline( 0.1, standardized ), 
 
		SendToReport(
			Dispatch( {}, "Bivar Plot", FrameBox,
				{Row Legend(
					age,
					Color( 0 ),
					Color Theme( "" ),
					Marker( 0 ),
					Marker Theme( "" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				), Row Legend(
					age,
					Color( 0 ),
					Color Theme( "" ),
					Marker( 0 ),
					Marker Theme( "" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			),
			Dispatch( {}, "", Picture Box( 3 ), {Visibility( "Collapse" )} ),
			Dispatch( {}, "", Picture Box( 2 ), {Visibility( "Collapse" )} )
		)
	)
 
);
 
CreateVarPlot = Function( {},
	obj2 = Variability Chart(
		Y( :height ),
		X( :age, :sex ),
		Connect Cell Means( 1 ),
		Show Group Means( 1 ),
		Show Grand Mean( 1 ),
		Show Grand Median( 1 ),
		Std Dev Chart( 0 ),
		Points Jittered( 1 ),
		Show Box Plots( 1 ),
		Mean Diamonds( 1 ),
		SendToReport(
			Dispatch( {}, "2", ScaleBox,
				{Min( 5000 ), Max( 2000 ), Inc( 100 ), Minor Ticks( 1 ),
				Add Ref Line( 0, "Dotted", "Medium Light Gray", "", 1 ),
				Add Ref Line( 3200, "Solid", "Black", "TGT", 4 ), Add Ref Line(
					4200, "Dashed", "Medium Dark Red", "UCL", 4
				), Add Ref Line( 2200, "Dashed", "Medium Dark Red", "LCL", 4 )}
			),
			Dispatch( {""}, "", NomAxisBox, {Rotated Tick Labels( 0 )} )
		)
	)
);
 
 
 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
color = {"age", "sex"};
marks = {"age", "sex"};
boxPlot = {"age", "sex", "name"};
// Initial nlevels is the number of levels of 'age', as it is the first by-group used.
 
cur_col = "age";
cur_mar = "age";
// Creating the legend. For each selection, the previous spline fits are removed, then
// new ones are generated.
color_legend = Panel Box( "Choose Color",
	legend1 = Radio Box(
		color,
		<<Set Function(
			Function( {self},
				Report( obj )[Border Box( 2 )] << Delete;
				Report( obj )[Border Box( 2 )] << Delete;
				cur_col = self << Get Selected;
				Report( obj )[FrameBox( 1 )] << {Row Legend(
					Eval( cur_col ),
					color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 0 ),
					Marker Theme( "" )
				), Row Legend(
					Eval( cur_mar ),
					color( 0 ),
					Color Theme( "" ),
					Marker( 1 ),
					Marker Theme( "Standard" )
				)};
			)
		)
	), 
 
);
mark_legend = Panel Box( "Choose Mark",
	legend1 = Radio Box(
		color,
		<<Set Function(
			Function( {self},
				Report( obj )[Border Box( 2 )] << Delete;
				Report( obj )[Border Box( 2 )] << Delete;
				cur_mar = self << Get Selected;
				Report( obj )[FrameBox( 1 )] << {Row Legend(
					Eval( cur_col ),
					color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 0 ),
					Marker Theme( "" )
				), Row Legend(
					Eval( cur_mar ),
					color( 0 ),
					Color Theme( "" ),
					Marker( 1 ),
					Marker Theme( "Standard" )
				)};
			)
		)
	), 
 
);
 
box_list = Panel Box( "BoxPlots",
	boxes = Check Box(
		boxPlot,
		<<Set Function(
			Function( {self},
				cur_bp = self << Get Selected;
 
			)
 
		)
	)
);
 
// Fitting the initial Bivariate fit with 'age' as the by-group, adding the legend
// to control the selections.
nw = New Window( "Bivariate",
	H List Box(
		V List Box(
			dt << Data Filter(
				Location( {0, 0} ),
				Mode( Show( 1 ), Include( 1 ) ),
				Add Filter( columns( :sex ), Display( :sex, Size( 160, 60 ), List Display ) )
			),
			color_legend,
			mark_legend
		),
		CreateTrendPlot(),
		CreateVarPlot(),
		box_list
	)
);
 
//Report(obj)[Outline Box(3)] << Visibility("collapse");
 
Report( obj )[framebox( 1 )] << add graphics script(
	oboxes = obj << xpath( "//OutlineBox" );
	For( i = 1, i <= N Items( oboxes ), i++,
		box = oboxes[i];
		If( Contains( box << get title, "Smoothing Spline" ),
			box << visibility( "collapse" )
		);
	);
);
 

 

txnelson
Super User

Re: Removing the Outline Box within dispatch command

I ran your code under both JMP 18 and JMP 14.  I see the legend expanding under 14, but under 18 it runs without error.  The obvious suggestion is to upgrade.  

What you might try is to completely delete the graph each time you adjust it from your check boxes

Jim