cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
hogi
Level XII

Linking a Column Switcher to a graph removes entries from the list

Hi,

 

when a Column Switcher is linked to a graph, JMP seems to check for "already existing" columns in the graph and removes them from the list of entries of the column switcher.

 

Most of the time, this is a nice feature because it prevents collisions of the column switcher and already existing links between the graph and the column.

 

But sometimes there are cases where this feature hurts.

In the example below 3 columns are shared by the 2 column switchers for the X and Y axis of the plot - but the start values are automatically removed from the "other" column switcher.:

Holger_1-1656067795306.png

 

There can be still a collision for "weight". But if one tries to set both column switchers to "weight", this is automatically detected and prevented.Holger_0-1656067108104.png

 

So - here - the auto-removal is not as helpful as it is meant to be.

How to get the missing values back into the list?

A workaround is to start with meaningless start values of the graph (which can then be removed from the column switcher list) - and then alter the start values via JSL to more meaningful values.

 

Is there an easier way, e.g. a parameter for the LinkPlatform command to disable the auto-removal ?

 

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

new window("test",
	
	cs1=dt << Column Switcher(:sex, {:sex, :height, :weight});
	cs2=dt << Column Switcher(:height, {:sex, :height, :weight});
gb = Graph Builder(
	Size( 534, 460 ),
	Show Control Panel( 0 ),
	Variables( X( :sex ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 1 ) ) )
)
	
);

cs1 << Link Platform(gb );
cs2 << Link Platform(gb );

 

 

 

6 REPLIES 6
jthi
Super User

Re: Linking a Column Switcher to a graph removes entries from the list

I'm just wondering what you would like to happen if you have following situation:

  1. X-axis: height, Y-axis sex
  2. Column switcher which tries to have both of those
  3. You change value in column switcher. Which value should be updated and how?

Simple example where height will be removed, because we are initializing column switcher to X-axis with :sex and :height is removed because it is already on Y-axis.

 

Names Default To Here(1);

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

New Window("test", 
	gb = dt << Graph Builder(
		Size(534, 460),
		Show Control Panel(0),
		Variables(X(:sex), Y(:height)),
		Elements(Points(X, Y, Legend(1))),
	)
);
gb  << Column Switcher(:sex, {:sex, :height, :weight});

If one column switcher tries to change multiple elements in graph at the same time one of those will be removed and this will be printed to log with the removed column name:

Some chosen columns were used in the analysis. The following columns were dropped from the selection list to avoid inadvertent substitution.

height

 

-Jarmo
hogi
Level XII

Re: Linking a Column Switcher to a graph removes entries from the list

Hi Jamo.

 

Yes, your example is definitely one of the many cases where:

this is a nice feature because it prevents collisions of the column switcher and already existing links between the graph and the column.

 

I fully agree.

Most of the time the auto-removal feature helps, no question.

 

Most of the time, but not always.

 

For N>=2 column switchers and N>2 entries in the lists the user could cycle the column switchers endlessly through interesting versions of the dashboard.
And any collision is prevented by the "unable to switch" notice.

 

So, a parameter would be nice to enable or disable the feature.

hogi
Level XII

Re: Linking a Column Switcher to a graph removes entries from the list

This is the version with the dummy start values.

 

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

dt << new column("x");
dt << new column("y");

new window("test",
	
	cs1=dt << Column Switcher(:x, {:height, :weight, :sex});
	cs2=dt << Column Switcher(:y, {:height, :weight, :sex});
gb = Graph Builder(
	Size( 534, 460 ),
	Show Control Panel( 0 ),
	Variables( X( :x ), Y( :y ) ),
	Elements( Points( X, Y, Legend( 1 ) ) )
)
	
);

cs1 << Link Platform(gb );
cs2 << Link Platform(gb );
cs1 << Set Current("weight");
cs2 << Set Current("height");
mikedriscoll
Level VI

Re: Linking a Column Switcher to a graph removes entries from the list

In earlier versions of JMP, column switcher would switch out all instances of the chosen column. So if you had a fit y by x, if you selected a column for the vertical axis that was the same as 'x', then for all subsequently chosen columns, the x and y would both be replaced. In recent versions of JMP, they've prevented this with the alert you mention. The history behind it tells me column switcher is not tied to an axis or grouping value, rather it tries to replace all instances, and the new versions of JMP are just preventing the collisions. 

 

I get the same alert with the code you posted above.  If you need to do this, consider scripting something with two list boxes. When a different column is selected, delete the plot, get both x and y columns, and redraw the plot. you can use this as a reference.

hogi
Level XII

Re: Linking a Column Switcher to a graph removes entries from the list

By the way:
one has to take care to use dummy column names that are complicated enough. With "x" and "y" I had luck.
The below code ends with the warning:

Cannot find OutlineBox[ "Grweightph Builder" ] at {}

Seems that the first trigger of the ColumnSwitcher changed the "a" in the "Graph Builder" Outline Box code to "weight"


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

dt << new column("a");

new window("test",
	
	cs1=dt << Column Switcher(:a, { :weight, :sex});
gb = Graph Builder(
	Size( 534, 460 ),
	Show Control Panel( 0 ),
	Variables( X( :a ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
			SendToReport(
			Dispatch( {}, "Graph Builder", OutlineBox, Set Title( "test" ) )
)
	
));

cs1 << Link Platform(gb );
cs1 << Set Current("weight");
cs1 << Set Current("sex");
hogi
Level XII

Re: Linking a Column Switcher to a graph removes entries from the list

If more appearances of the string in the code are replaced than originally expected - does it also work with "inline" defined formulas?

e.g. can I use a  Column Switcher to change a cumulative probability plot ( X and Y axis) to another variable?


--> hm, unfortunately not. just the x axis is changed, the Formula used on the y axis stays the same

 

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

Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables(
		X( :height ),
		Y(
			Transform Column(
				"Cumulative Probability[height]",
				Formula( Col Rank( :height ) / (Col Number( :height ) + 1) )
			)
		)
	),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
	Column Switcher( :height, {:height, :weight} )
)