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
hogi
Level XII

How to set the degree of "faded" for "unselected faded"

Hi,

 

when data points in a graph are selected, the other data points get faded (by default and if the marker selection mode is set so; other options are also possible).

Faded means "same color, but not so intense".

 

Is there an option to define the degree of "faded"?

When the graph gets exported to "interactive html", the unselected points are "just" white

- but actually, this makes it much easier to distinguish between selected and unselected data points.

Sometimes more and sometimes less fading is preferred, so would be great if there is already an option to set the degree of "faded" ...

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: degree of "faded" for "unselected faded"

Another way to react to row state changes is to create new columns with formulas that use the row states.  Then you can use these columns in Graph Builder (or other platform) and they will react to the changing formulas.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "sexformula",
	Character,
	"Nominal",
	Formula( If( Selected(), "Selected", :sex ) )
);
dt << Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ), Color( :sexformula ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				3,
				Properties(
					2,
					{Line Color( 1 ), Marker Size( 6 )},
					Item ID( "Selected", 1 )
				)
			)}
		)
	)
);

View solution in original post

ErraticAttack
Level VI

Re: degree of "faded" for "unselected faded"

Maybe I'm missing something with the other posts, but can you not just set the level in the JMP Preferences?

ErraticAttach_0-1648070151476.png

 

Jordan

View solution in original post

9 REPLIES 9
dale_lehman
Level VII

Re: degree of "faded" for "unselected faded"

You might try Color or Mark by Column (under the red arrow in the data table rows) and use a continuous column. The colors will vary according to that column's values (they are binned).  I don't know if they will show up if you are excluding (but not hiding) any rows, but I think this may be what you want.

Georg
Level VII

Re: degree of "faded" for "unselected faded"

I don't think that this can be set, and I would not use it the way you describe.

There are a lot other possibilities to mark rows/points, eg. by color, marker, size, label, position in graph ... Do you really need another dimension?

A workaround (to get functionality you want) may be, that you put in a formula that converts the colors of the non selected to a more degraded, and that you define that as the color row state.

Georg
hogi
Level XII

Re: degree of "faded" for "unselected faded"

 Hi @Georg,
this could work.
How do I trigger execution of the jsl code after selecting the data points?


hogi
Level XII

Re: degree of "faded" for "unselected faded"

Hi,

 

@danschikore gave me the hint to use a row state handler. -> cool functionality, thanks
Now I can trigger a function f by any data point selection:

 

dt << make row state handler( f );

 

But as so often in life, you solve 1 problem and there 2 new ones:

 

a) the GraphBuilder color setting overrides the row color setting
-> is there a setting to make the row color setting override the GraphBuilder color?

 

and much more severe:

b) the row state handler reacts on any change of the row state - unfortunately also my new "label" and "color" changes.
and the log tells me that "row states should not be changed by Row State Handler".
Is there a way to just react on "selection" changes and not on all the row state changes?

Holger_0-1647972407023.png

 

 

 

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
f = Function( {a}, 
	selected = dt << Get selected Rows();
	if(N Row(selected)>0,
		print("change size & font");
		rs = dt << get row states;
		bits0 = (mod(rs, 2)==1); 			//select
		bits1 = (mod(floor(rs/2),2)==1)*2;	//exclude
		bits2 = (mod(floor(rs/4),2)==1)*4;	//hide
		highlight = 200;				 // large dot, label (keep the automatic color)
		faded = 8192;					//light gray --> unfortunately, no effect
		setStates = bits0 + bits1 + bits2 + highlight * bits0 + faded *(1-bits0);
		show(rs, bits0,bits1,bits2,setStates);
		dt << Set Row States (setStates);
		);
 );
 
dt <<  Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ),  Color( :sex ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
 
 
rs = dt << make row state handler( f );

 

 

 

Re: degree of "faded" for "unselected faded"

Another way to react to row state changes is to create new columns with formulas that use the row states.  Then you can use these columns in Graph Builder (or other platform) and they will react to the changing formulas.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "sexformula",
	Character,
	"Nominal",
	Formula( If( Selected(), "Selected", :sex ) )
);
dt << Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ), Color( :sexformula ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				3,
				Properties(
					2,
					{Line Color( 1 ), Marker Size( 6 )},
					Item ID( "Selected", 1 )
				)
			)}
		)
	)
);
hogi
Level XII

Re: degree of "faded" for "unselected faded"

Very smooth approach!
A dynamic column formula - cool.
That gives a lot of flexibility - and so easy

 

hogi
Level XII

Re: degree of "faded" for "unselected faded"

This could be a possible implementation of the idea:
when data points get selected, the selcted ones get bigger and nicely visible, un-selected data points get smaller and faded.

By the way, there seems to be still some error in my code:
after selecting and deselecting data points, the additional column bounces back to "M"/"F" (like expected), but the formatting changed a bit.

setting on my computer (v 16.2.0, win) at the end:

			{Legend Model(
				3,
				Properties(0,{Line Color( 3 ), Marker Size( 6 ), Transparency( 0.3 )},Item ID( "F", 1 )),
				Properties(1,{Line Color( 21 ), Marker( "FilledCircle" ), Marker Size( 6 )},Item ID( "M", 1 )),
				....

 

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << New Column( "sexformula",
	Character,
	"Nominal",
	Formula( If( N items(dt << get selected rows)==0 ,:sex ,If(Selected(),Concat(:sex," (selected)"), Concat(:sex," -" ))) ));
new window("test",
H list Box (
dt << Graph Builder(
	Show Control Panel( 0 ),
	Shol Legend(0),
	Variables( X( :name ), Y( :weight ) ),
	Elements( Bar( X, Y, Legend( 5 ) ) )
);
dt << Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ), Color( :sexformula ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				3,
				Properties( 0, {Line Color( 3  ),Marker Size( 6 ),Transparency(1),Marker("Dot")}, Item ID( "F", 1 )),
				Properties( 1, {Line Color( 21 ),Marker Size( 6 ),Transparency(1),Marker("Dot")}, Item ID( "M", 1 )),
				Properties( -1, {Line Color( 3  ),Marker Size( 3 ),Transparency(0.3),Marker("Dot")}, Item ID( "F -", 1 )),
				Properties( -1, {Line Color( 21 ),Marker Size( 3 ),Transparency(0.3),Marker("Dot")}, Item ID( "M -", 1 )),
				Properties( -1, {Line Color( 3  ),Marker Size( 10 ),Transparency(1),Marker( "FilledCircle" )},Item ID( "F (selected)", 1)),
				Properties( -1, {Line Color( 21 ),Marker Size( 10 ),Transparency(1),Marker( "FilledCircle" )},Item ID( "M (selected)", 1))
			)}
		)
	)
)))

 

ErraticAttack
Level VI

Re: degree of "faded" for "unselected faded"

Maybe I'm missing something with the other posts, but can you not just set the level in the JMP Preferences?

ErraticAttach_0-1648070151476.png

 

Jordan
hogi
Level XII

Re: degree of "faded" for "unselected faded"

You are right.
Actually, the direct answer to my question