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

Skip Filter for Data Filter Context Boxes?

Hover Label Graphlets are a nice alternative to Data Filter Context Boxes.

With Data Filter Context Boxes, a user can select the data points which are displayed in another graph.

Similarly, when a user hovers over a a data point, the Graphlet in the Hover Label just shows a plot which is restricted to the rows corresponding to the data point.

 

For Hover Labels, there is the Skip Filter option which allows the user to open the row selection.
e.g. by selecting sex as Skip Filter, one can generate a hover label for male and female 14 years old students, although the user just hovered over 14 years old male:

hogi_0-1701640888469.png

 

Is there a similar Skip Filter option for Data Filter Context Boxes (~  Dashboards with Filter By )?

hogi_1-1701641092781.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Skip Filter for Data Filter Context Boxes?

Hi @hogi - this is an example from the scripting index, using the `Data Filter Source Box << Set Row States()` message.  Within the Data Filter Source Box, only the select row states is preserved - the remaining states come from the source data table.  The rows that you select in the Data Filter Source Box will be seen as included by the other reports within the Data Filter Context Box.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			dfsb = Data Filter Source Box(
				Graph Builder(
					Size( 208, 207 ),
					Show Control Panel( 0 ),
					Show Legend( 0 ),
					Variables( X( :age ) ),
					Elements( Bar( X, Legend( 3 ) ) ),
					SendToReport(
						Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} )
					)
				)
			),
			Platform(
				Current Data Table(),
				Bubble Plot( X( :weight ), Y( :height ), Sizes( :age ), Title Position( 0, 0 ) )
			)
		)
	)
);
Wait( 1 );
rs = dt << Get Row States();
rows14 = dt << Get Rows Where( :age == 14 );
rs[rows14] = 1;
dfsb << Set Row States( dt, rs );

View solution in original post

4 REPLIES 4

Re: Skip Filter for Data Filter Context Boxes?

I think one distinction between the two drill-down methods is that Hover Labels are based on selecting a single element in a graph, while the selection filter (DataFilterContextBox + DataFilterSourceBox) uses the aggregate selection in the graph.  So you are free to select multiple components in the source graph:

danschikore_0-1701694712648.png

The selection filter works by row-states alone - it does not really have knowledge of the underlying display segs, or that the data is partitioned by age/sex.

hogi
Level XII

Re: Skip Filter for Data Filter Context Boxes?

Hi @danschikore - and is there a possibility to script it?

e.g. 

myRows= (myDataFilterSourceBox << ...) << get selected rows();
edit - see below ...
myRows = myDataFilterSourceBox << get row states();

myages= associative array(dt[myRows,"age"]) << get keys(); ldf2 << change ...

 

Re: Skip Filter for Data Filter Context Boxes?

Hi @hogi - this is an example from the scripting index, using the `Data Filter Source Box << Set Row States()` message.  Within the Data Filter Source Box, only the select row states is preserved - the remaining states come from the source data table.  The rows that you select in the Data Filter Source Box will be seen as included by the other reports within the Data Filter Context Box.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			dfsb = Data Filter Source Box(
				Graph Builder(
					Size( 208, 207 ),
					Show Control Panel( 0 ),
					Show Legend( 0 ),
					Variables( X( :age ) ),
					Elements( Bar( X, Legend( 3 ) ) ),
					SendToReport(
						Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} )
					)
				)
			),
			Platform(
				Current Data Table(),
				Bubble Plot( X( :weight ), Y( :height ), Sizes( :age ), Title Position( 0, 0 ) )
			)
		)
	)
);
Wait( 1 );
rs = dt << Get Row States();
rows14 = dt << Get Rows Where( :age == 14 );
rs[rows14] = 1;
dfsb << Set Row States( dt, rs );
hogi
Level XII

Re: Skip Filter for Data Filter Context Boxes?

Wonderful, thanks @danschikore 
I will use it a hundred times and more!

 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			dfsb = Data Filter Source Box(
				gb = Graph Builder(
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :age ), Y( :sex ) ),
	Elements( Heatmap( X, Y, Legend( 4 ) ) )
)
			),
Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 11 ) ), Smoother( X, Y, Legend( 12 ) ) )
)
		)
	)
);
Wait( 1 );

t0=hptime();
f= Function({x},
	rs = dfsb << Get Row States();
	myrows = loc(rs,0);
	myages= associative array(dt[myrows,"age"]) << get keys;
	myrows = dt << get rows where(:age == myages[1]);
	rs[1::Nitems(rs)]=0;
	rs[myrows] = 1;
	dfsb << Set Row States( dt,rs );	
	Print(rs);
	rsh = dfsb << Make RowState Handler (dt,f); // sometimes I have to set the rowstate handler again - loop detection?
);

rsh = dfsb << Make RowState Handler (dt,f);