cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Jackie_
Level VI

Change Gradient Max with Slider box

Hello,

 

Is there a way to vary the Max value of the gradient using the slider box?

 

Jackie__0-1723230134817.png

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Wafer Stacked.jmp" );
sliderValue = .6;
New Window( "", 
	
	
	H List Box(
		
		Panel Box( "Slider Box",
			tb = Text Box( "Gradient Maxium: " || Char( sliderValue ) ),
			sb = Slider Box( 0, 10, sliderValue, tb << Set Text( "Value: " || Char( sliderValue ) ) )
		), 	
		
		H List Box(
			Graph Builder(
				Size( 592, 569 ),
				Show Control Panel( 0 ),
				Variables( X( :X_Die ), Y( :Y_Die ), Color( :Defects ) ),
				Elements( Heatmap( X, Y, Legend( 5 ) ) ),
				SendToReport(
					Dispatch(
						{},
						"400",
						ScaleBox,
						{Legend Model( 5, Properties( 0, {gradient( {Min Lightness( 0 ), Width( 12 )} )}, Item ID( "Defects", 1 ) ) )}
					)
				)
			)
		)
	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Change Gradient Max with Slider box

You can

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Wafer Stacked.jmp");
sliderValue = 0.6;

nw = New Window("", 
	H List Box(
		Panel Box("Slider Box",
			sb = Slider Box(0, 10, sliderValue, 
				vals = [.] || Matrix(sliderValue);
				Eval(EvalExpr(
					item << Set Properties({gradient({Scale Values(Expr(vals))})})
				));
			)
		), 	
		H List Box(
			gb = dt << Graph Builder(
				Size(592, 569),
				Show Control Panel(0),
				Variables(X(:X_Die), Y(:Y_Die), Color(:Defects)),
				Elements(Heatmap(X, Y, Legend(5))),
				SendToReport(
					Dispatch({}, "400", ScaleBox,
						{Legend Model(
							5,
							Properties(
								0,
								{gradient({Min Lightness(0), Width(12)})},
								Item ID("Defects", 1)
							)
						)}
					)
				)
			)
		)
	)
);

server = gb << Get Legend Server;
item = server << Get Legend Item(5, 1);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Change Gradient Max with Slider box

You can

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Wafer Stacked.jmp");
sliderValue = 0.6;

nw = New Window("", 
	H List Box(
		Panel Box("Slider Box",
			sb = Slider Box(0, 10, sliderValue, 
				vals = [.] || Matrix(sliderValue);
				Eval(EvalExpr(
					item << Set Properties({gradient({Scale Values(Expr(vals))})})
				));
			)
		), 	
		H List Box(
			gb = dt << Graph Builder(
				Size(592, 569),
				Show Control Panel(0),
				Variables(X(:X_Die), Y(:Y_Die), Color(:Defects)),
				Elements(Heatmap(X, Y, Legend(5))),
				SendToReport(
					Dispatch({}, "400", ScaleBox,
						{Legend Model(
							5,
							Properties(
								0,
								{gradient({Min Lightness(0), Width(12)})},
								Item ID("Defects", 1)
							)
						)}
					)
				)
			)
		)
	)
);

server = gb << Get Legend Server;
item = server << Get Legend Item(5, 1);
-Jarmo
txnelson
Super User

Re: Change Gradient Max with Slider box

I believe you can do what you want by changing the Scale Values using a Set Gradient Scale Values message.  See the Scripting Index for description and examples.

Jim

Recommended Articles