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

keyboard shortcut: local data filter ?

Is there a Keyboard shortcut to add a local data filter to a GraphBuilder Plot?

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: keyboard shortcut: local data filter ?

You can assign your own shortcuts from View / Customize / Menus and Toolbars

jthi_0-1667722054063.png

 

And if you want it to work just for graph builder, then you can write your own JSL for it which would ignore other platforms

-Jarmo

View solution in original post

9 REPLIES 9
jthi
Super User

Re: keyboard shortcut: local data filter ?

You can assign your own shortcuts from View / Customize / Menus and Toolbars

jthi_0-1667722054063.png

 

And if you want it to work just for graph builder, then you can write your own JSL for it which would ignore other platforms

-Jarmo
hogi
Level XII

Re: keyboard shortcut: local data filter ?

Ah, 

Platform: Local Data Filter

thanks, very convenient

 

And for 

"Show control Panel" ? 

jthi
Super User

Re: keyboard shortcut: local data filter ?

No idea if there is JMP Built-In command for that, so you might have to write JSL to handle that and then build shortcut for it

-Jarmo
hogi
Level XII

Re: keyboard shortcut: local data filter ?

Ok, thanks

 

Names default to here(1);

gb= Current Report()["Graph Builder"] <<Get Scriptable Object; 

ib= Current Report()["Graph Builder",IfBox(1)];
if(ib << get,
gb << show control panel(0),
gb << show control panel(1))
jthi
Super User

Re: keyboard shortcut: local data filter ?

I think that should work great if the outline box title hasn't been changed. You might consider adding Try() to avoid JMP from throwing errors if no graph builder is open in the Current Report().

 

If you want to also manage situations where the outline box title has been changed, using XPath might the most robust option. With XPath you can look for Outline Boxes' helpKey attribute with value 'Graph Builder' and then use similar idea with << Get Scriptable Object

 

Local({first_gb},
	Try(
		first_gb = (Current Report() << XPath("//OutlineBox[@helpKey = 'Graph Builder']"))[1] << Get Scriptable Object;
		Report(first_gb)[IfBox(1)] << Set(!(Report(first_gb)[IfBox(1)] << get));
	);	
);

Also using Current Window() instead of Current Report() is an option, if you only want to change the Control Panel visibility on the currently active graph builder window (I think Current Report() would change the control panel even if the graph builder was behind data table for example).

 

-Jarmo
hogi
Level XII

Re: keyboard shortcut: local data filter ?

Cool, very robust!


Next Thing: Keyboard Shortcut for the Legend

Local( {first_gb},
	Try(
		first_gb = (Current Window() << XPath( "//OutlineBox[@helpKey = 'Graph Builder']" ))[1] << Get Scriptable Object;
		first_gb << show legend (!(Report(first_gb)[LegendBox( 1 )] << get width));

	)
);

 

why "Current Report"?
-> hm, debugging is  much easier

 

 

Toggling the IfBox value instead of sending the "Control Panel" command to the Graph Builder Object is clever (a whole new world of possibilities!)

Was there a specific reason to go from Report to Scriptable Object and then back to Report?
instead of

 

 

Local({first_gb},
	Try(
		first_gb = (Current Report() << XPath("//OutlineBox[@helpKey = 'Graph Builder']"))[1];
		first_gb[IfBox(1)] << Set(!(first_gb[IfBox(1)] << get));
	);	
);

 

jthi
Super User

Re: keyboard shortcut: local data filter ?

Was there a specific reason to go from Report to Scriptable Object and then back to Report?

No, I just used what first came to my mind and did work out.

-Jarmo
hogi
Level XII

Re: keyboard shortcut: local data filter ?

Oops, I just "realized" that 

gb << show control panel(1)

has more to do than just show the control panel 


so (final version):

Local({first_gb,newState},
	Try(
		first_gbr = (Current Report() << XPath("//OutlineBox[@helpKey = 'Graph Builder']"))[1] ;
		newState=!(first_gbr[IfBox(1)] << get);
		(first_gbr << Get Scriptable Object)<< Show Control Panel(newState);
	);	
);

 

View more...

show the control panel:

hogi_1-1668230959271.png

 

show control panel(1)
hogi_0-1668229730125.png

hogi
Level XII

Re: keyboard shortcut: local data filter ?

Here is an Add-In which adds Shortcut Icons to the Report Toolbar

- to open/close Control Panel

- to show/hide the legend

Graph Builder Toolbar 

 

hogi_0-1670489025090.png