cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
anna_717
Level II

Make Filter Change Handler for Dashboard

Hi,

I have a dashboard with local data filter and a number of graph builder charts in tab page boxes.

I would like to resize the frameboxes in some of the charts when the local data filter selection is changed.

I have tried using the code below, but it gives an error: "The OwnerBox was deleted before the message << could be sent because the Graph Builder needed to recalculate first".

Can anyone suggest how to overcome this error?

 

Thanks

 

 

db_1 = db << Get Windows();

local_filter = ((db_1[1] << XPath( "//OutlineBox[text()='Local Data Filter']" )) << get scriptable object())[1];

update_chart = Function( {a},
	Wait( 1 );
	obj1 = db_1[1] << xpath( "//TabPageBox[contains(text(),'Weight')]//FrameBox" );
	obj1 << framesize( 300, 300 );
);

filter_handler = local_filter << Make Filter Change Handler( update_chart );T

This is the error message in the log:

The OwnerBox was deleted before the message << could be sent because the Graph Builder needed to recalculate first; the Graph Builder displaybox tree was recreated with new boxes. Use the <<report message to get the new displaybox tree from Graph Builder *after* changing the data table. Automatic Recalc recreates the displaytree after a data table change, just before it is needed -- such as <<report in access or evaluation of 'List' , {/*###*/DisplayBox[], DisplayBox[], DisplayBox[FrameBox], DisplayBox[FrameBox]}

 

This is an example using Big Class sample data:

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

db = JMP App(
	Set Name( "Dashboard" ),
	Set Description( "A dashboard with a single report" ),
	Auto Launch( 1 ),
	Snap To Grid( 1 ),
	Show Grid( 1 ),
	Show Properties( 0 ),
	Show Sources( 0 ),
	Group By Category( 0 ),
	Dashboard Mode( 1 ),
	Parameters,
	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Big Class.jmp" ),
			Set Label( "Big Class" ),
			Location( "Current Data Table" ),
			Invisible( 0 )
		)
	),
	Thumbnail(
		New Image(
			Char To Blob(
				"52947eJzFVvdTEwwSDVUIiIVIR1CKoReRpnQEgiRCaIqhCQSpIdSgNAEpoYn0jgY0KDFSBERCkUCkBYSPT3oAqWIIEED5BDydu5n7C25uZ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sGoRBwvzFgYlLxDFMo1Uotoajq6lXshFXyEi9zMG0qsSF/P10qqApx6qnqpZI5RaxKpJOTlxt4fNwZmo1ZG4QNu4qLEMke/sw+T6vNTbKeWIm5WAbIkVS4nx7aRBJZR7605xYzWJeJ3Arn6fybbzOl2Shy3FqfYovdnW8/B41wlDRSy5qJJNi775usdp5bLSGAiYylLRWk1CtMWzQxMBs2rgQeHcBEG0HiGtQuti6kSbUJe3zQ4EIHHUaRVFLJcov/eOkwbSNGO7jsOar4OHOF+wj/GrRf8qX2G8H87zNJf5nGsZTBv2sr53x8lOijojcqNVkl3d3cMBjNRwOjyfQtHIPynCyoAeunUGNZDwUTzp6Ydv/oBfwpyHWb62tgt/l+MuG2t",
				"base64compressed"
			),
			"png"
		)
	),
	Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.

)	),
	Allocate(
		Module1 = Plan(
			PreAllocate,
			Script(JSL Quote(				thisModuleInstance << Create Objects;				Try(MainTabPage << Set Scriptable Object(thisApplication));			
)			),
			Allocate(
				DataFilterContext1 = Data Filter Context Box();
				MainTabPage = Tab Page Box();
				Splitter1 = H Splitter Box();
				TabPage1 = Tab Page Box();
				Scroll1 = Scroll Box();
				DataFilter1 = DataTable1 <<
				Data Filter(
					Local,
					Add Filter( columns( :sex ), Where( :sex == {"F", "M"} ) )
				);
				Splitter2 = V Splitter Box();
				TabPage2 = Tab Page Box();
				Scroll2 = Scroll Box();
				Report1 = Platform(
					DataTable1,
					Tabulate(
						Show Control Panel( 0 ),
						Add Table(
							Column Table(
								Analysis Columns( :height ),
								Statistics( Mean, Std Dev )
							),
							Column Table(
								Analysis Columns( :weight ),
								Statistics( Mean, Std Dev )
							),
							Row Table( Grouping Columns( :sex, :age ) )
						),
						SendToReport(
							Dispatch(
								{},
								"",
								TextBox,
								{Set Base Font( "Heading" )}
							)
						)
					)
				);
				Splitter3 = H Splitter Box();
				TabList2 = Tab Box();
				TabPage3 = Tab Page Box();
				Scroll3 = Scroll Box();
				Report2 = Platform(
					DataTable1,
					Graph Builder(
						Size( 389, 236 ),
						Show Control Panel( 0 ),
						Fit to Window( "Off" ),
						Variables( X( :age ), Y( :weight ), Group X( :sex ) ),
						Elements(
							Points( X, Y, Legend( 20 ) ),
							Box Plot( X, Y, Legend( 21 ) )
						)
					)
				);
				TabList1 = Tab Box();
				TabPage4 = Tab Page Box();
				Scroll4 = Scroll Box();
				Report3 = Platform(
					DataTable1,
					Graph Builder(
						Size( 234, 204 ),
						Show Control Panel( 0 ),
						Fit to Window( "Off" ),
						Variables( X( :age ), Overlay( :sex ) ),
						Elements( Bar( X, Legend( 2 ) ) )
					)
				);
				TabPage5 = Tab Page Box();
				Scroll5 = Scroll Box();
				Report4 = Platform(
					DataTable1,
					Graph Builder(
						Size( 327, 204 ),
						Show Control Panel( 0 ),
						Fit to Window( "Off" ),
						Variables(
							X( :weight ),
							Y( :height ),
							Group X( :sex ),
							Color( :age )
						),
						Elements(
							Points( X, Y, Legend( 11 ) ),
							Smoother( X, Y, Legend( 12 ) )
						)
					)
				);
			),
			Organize(
				Reparent( Scroll5( Report4 ) );
				Reparent( TabPage5( Scroll5 ) );
				Reparent( TabList1( TabPage5 ) );
				Reparent( Scroll4( Report3 ) );
				Reparent( TabPage4( Scroll4 ) );
				Reparent( TabList1( TabPage4 ) );
				Reparent(
					TabList2(
						"Other charts",
						Tip( "" ),
						Icon( "" ),
						Closeable( 0 ),
						TabList1
					)
				);
				Reparent( Scroll3( Report2 ) );
				Reparent( TabPage3( Scroll3 ) );
				Reparent( TabList2( TabPage3 ) );
				Reparent( Splitter3( TabList2 ) );
				Reparent( Splitter2( Splitter3 ) );
				Reparent( Scroll2( Report1 ) );
				Reparent( TabPage2( Scroll2 ) );
				Reparent( Splitter2( TabPage2 ) );
				Reparent( Splitter1( Splitter2 ) );
				Reparent( Scroll1( DataFilter1 ) );
				Reparent( TabPage1( Scroll1 ) );
				Reparent( Splitter1( TabPage1 ) );
				Reparent( MainTabPage( Splitter1 ) );
				Reparent( DataFilterContext1( MainTabPage ) );
				Relocate( DataFilterContext1( 0, 0 ) );
			),
			Initialize(
				DataFilterContext1 << Background Color( "None" ),
				DataFilterContext1 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), DataFilterContext1 << Enabled( 1 ),
				DataFilterContext1 << Horizontal Alignment( "Default" ),
				DataFilterContext1 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				DataFilterContext1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), DataFilterContext1 << Text Color( "None" ),
				DataFilterContext1 << UI Only( 0 ),
				DataFilterContext1 << Vertical Alignment( "Default" ),
				DataFilterContext1 << Visibility( "Visible" ),
				DataFilterContext1 << Set Min Size( 356, 191 ),
				DataFilterContext1 << Set Max Size( 30000, 30000 ),
				DataFilterContext1 << Set Stretch( {"Neutral", "Neutral"} ),
				MainTabPage << Background Color( "None" ),
				MainTabPage << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), MainTabPage << Enabled( 1 ),
				MainTabPage << Horizontal Alignment( "Default" ),
				MainTabPage << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				MainTabPage << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), MainTabPage << Text Color( "None" ), MainTabPage << UI Only( 0 ),
				MainTabPage << Vertical Alignment( "Default" ),
				MainTabPage << Visibility( "Visible" ),
				MainTabPage << Set Min Size( 356, 191 ),
				MainTabPage << Set Max Size( 30000, 30000 ),
				MainTabPage << Set Stretch( {"Neutral", "Neutral"} ),
				MainTabPage << Title( "Dashboard" ), MainTabPage << Tip( "" ),
				MainTabPage << Icon( "" ), MainTabPage << Closeable( 0 ),
				MainTabPage << Moveable( 0 ), MainTabPage << Set Base Font( "Text" ),
				MainTabPage << Set Font Scale( 1 ),
				Splitter1 << Background Color( "None" ),
				Splitter1 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), Splitter1 << Enabled( 1 ),
				Splitter1 << Horizontal Alignment( "Default" ),
				Splitter1 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), Splitter1 << Text Color( "None" ), Splitter1 << UI Only( 0 ),
				Splitter1 << Vertical Alignment( "Default" ),
				Splitter1 << Visibility( "Visible" ), Splitter1 << Dockable( 1 ),
				Splitter1 << Set Width( 794 ), Splitter1 << Set Height( 529 ),
				Splitter1 << Set Sizes( {0.347197106690778, 0.652802893309222} ),
				Splitter1 << Set Min Size( 356, 165 ),
				Splitter1 << Set Max Size( 60015, 60067 ),
				Splitter1 << Set Stretch( {"Window", "Window"} ),
				Splitter1 << set horizontal( 1 ),
				TabPage1 << Background Color( "None" ),
				TabPage1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage1 << Enabled( 1 ),
				TabPage1 << Horizontal Alignment( "Default" ),
				TabPage1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabPage1 << Text Color( "None" ), TabPage1 << UI Only( 0 ),
				TabPage1 << Vertical Alignment( "Default" ),
				TabPage1 << Visibility( "Visible" ),
				TabPage1 << Set Min Size( 72, 62 ),
				TabPage1 << Set Max Size( 30000, 30000 ),
				TabPage1 << Set Stretch( {"Neutral", "Neutral"} ),
				TabPage1 << Title( "Local Data Filter" ), TabPage1 << Tip( "" ),
				TabPage1 << Icon( "Filter" ), TabPage1 << Closeable( 1 ),
				TabPage1 << Moveable( 1 ), TabPage1 << Set Base Font( "Text" ),
				TabPage1 << Set Font Scale( 1 ),
				Scroll1 << Background Color( "None" ),
				Scroll1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Enabled( 1 ),
				Scroll1 << Horizontal Alignment( "Default" ),
				Scroll1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Text Color( "None" ), Scroll1 << UI Only( 0 ),
				Scroll1 << User Resizable( {1, 1} ),
				Scroll1 << Vertical Alignment( "Default" ),
				Scroll1 << Visibility( "Visible" ),
				Scroll1 << Set Min Size( 72, 36 ),
				Scroll1 << Set Max Size( 30000, 30000 ),
				Scroll1 << Set Stretch( {"Window", "Window"} ),
				Scroll1 << Width( 275 ), Scroll1 << Height( 503 ),
				Scroll1 << Set Auto Scrollable( 1 ),
				Scroll1 << Set Scrollers( 1, 1 ), Scroll1 << Set Show Empty( 0 ),
				Scroll1 << Set Clip Printing( 0 ),
				DataFilter1 << Background Color( "None" ),
				DataFilter1 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), DataFilter1 << Enabled( 1 ),
				DataFilter1 << Horizontal Alignment( "Default" ),
				DataFilter1 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				DataFilter1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), DataFilter1 << Text Color( "None" ), DataFilter1 << UI Only( 0 ),
				DataFilter1 << Vertical Alignment( "Default" ),
				DataFilter1 << Visibility( "Visible" ),
				DataFilter1 << Set Min Size( 192, 164 ),
				DataFilter1 << Set Max Size( 30004, 164 ),
				DataFilter1 << Set Stretch( {"Neutral", "Neutral"} ),
				Splitter2 << Background Color( "None" ),
				Splitter2 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), Splitter2 << Enabled( 1 ),
				Splitter2 << Horizontal Alignment( "Default" ),
				Splitter2 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter2 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), Splitter2 << Text Color( "None" ), Splitter2 << UI Only( 0 ),
				Splitter2 << Vertical Alignment( "Default" ),
				Splitter2 << Visibility( "Visible" ), Splitter2 << Dockable( 1 ),
				Splitter2 << Set Width( 516 ), Splitter2 << Set Height( 529 ),
				Splitter2 << Set Sizes( {0.459409594095941, 0.540590405904059} ),
				Splitter2 << Set Min Size( 281, 165 ),
				Splitter2 << Set Max Size( 30012, 60067 ),
				Splitter2 << Set Stretch( {"Window", "Window"} ),
				Splitter2 << set horizontal( 0 ),
				TabPage2 << Background Color( "None" ),
				TabPage2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage2 << Enabled( 1 ),
				TabPage2 << Horizontal Alignment( "Default" ),
				TabPage2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage2 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabPage2 << Text Color( "None" ), TabPage2 << UI Only( 0 ),
				TabPage2 << Vertical Alignment( "Default" ),
				TabPage2 << Visibility( "Visible" ),
				TabPage2 << Set Min Size( 72, 62 ),
				TabPage2 << Set Max Size( 30000, 30000 ),
				TabPage2 << Set Stretch( {"Neutral", "Neutral"} ),
				TabPage2 << Title( "Tabulate" ), TabPage2 << Tip( "" ),
				TabPage2 << Icon( "Tabulate" ), TabPage2 << Closeable( 1 ),
				TabPage2 << Moveable( 1 ), TabPage2 << Set Base Font( "Text" ),
				TabPage2 << Set Font Scale( 1 ),
				Scroll2 << Background Color( "None" ),
				Scroll2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Enabled( 1 ),
				Scroll2 << Horizontal Alignment( "Default" ),
				Scroll2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Text Color( "None" ), Scroll2 << UI Only( 0 ),
				Scroll2 << User Resizable( {1, 1} ),
				Scroll2 << Vertical Alignment( "Default" ),
				Scroll2 << Visibility( "Visible" ),
				Scroll2 << Set Min Size( 72, 36 ),
				Scroll2 << Set Max Size( 30000, 30000 ),
				Scroll2 << Set Stretch( {"Window", "Window"} ),
				Scroll2 << Width( 516 ), Scroll2 << Height( 215 ),
				Scroll2 << Set Auto Scrollable( 1 ),
				Scroll2 << Set Scrollers( 1, 1 ), Scroll2 << Set Show Empty( 0 ),
				Scroll2 << Set Clip Printing( 0 ),
				Report1 << Background Color( "None" ),
				Report1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Enabled( 1 ),
				Report1 << Horizontal Alignment( "Default" ),
				Report1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Text Color( "None" ), Report1 << UI Only( 0 ),
				Report1 << Vertical Alignment( "Default" ),
				Report1 << Visibility( "Visible" ),
				Report1 << Set Min Size( 312, 296 ),
				Report1 << Set Max Size( 312, 296 ),
				Report1 << Set Stretch( {"Neutral", "Neutral"} ),
				Report1 << set horizontal( 0 ),
				Splitter3 << Background Color( "None" ),
				Splitter3 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), Splitter3 << Enabled( 1 ),
				Splitter3 << Horizontal Alignment( "Default" ),
				Splitter3 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter3 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), Splitter3 << Text Color( "None" ), Splitter3 << UI Only( 0 ),
				Splitter3 << Vertical Alignment( "Default" ),
				Splitter3 << Visibility( "Visible" ), Splitter3 << Dockable( 1 ),
				Splitter3 << Set Width( 516 ), Splitter3 << Set Height( 285 ),
				Splitter3 << Set Sizes( {1} ), Splitter3 << Set Min Size( 281, 100 ),
				Splitter3 << Set Max Size( 30012, 30064 ),
				Splitter3 << Set Stretch( {"Window", "Window"} ),
				Splitter3 << set horizontal( 1 ),
				TabList2 << Background Color( "None" ),
				TabList2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabList2 << Enabled( 1 ),
				TabList2 << Horizontal Alignment( "Default" ),
				TabList2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabList2 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabList2 << Text Color( "None" ), TabList2 << UI Only( 0 ),
				TabList2 << Vertical Alignment( "Default" ),
				TabList2 << Visibility( "Visible" ), TabList2 << Dockable( 0 ),
				TabList2 << Set Min Size( 281, 100 ),
				TabList2 << Set Max Size( 30012, 30064 ),
				TabList2 << Set Stretch( {"Neutral", "Neutral"} ),
				TabList2 << Set Selected( 2 ), TabList2 << Set Style( "Tab" ),
				TabList2 << Set Title Location( "Top" ),
				TabList2 << Set Overflow Enabled( 0 ),
				TabList2 << Set Tab Close( Empty() ),
				TabList2 << Set Tab Close Tip( "" ),
				TabList2 << Set Tab New( Empty() ),
				TabList2 << Set Tab New Tip( "" ),
				TabList2 << Set Tab New Icon( "" ), TabList2 << Show Tabs( 1 ),
				TabList2 << Set Tab Changed( Empty() ),
				TabPage3 << Background Color( "None" ),
				TabPage3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage3 << Enabled( 1 ),
				TabPage3 << Horizontal Alignment( "Default" ),
				TabPage3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage3 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabPage3 << Text Color( "None" ), TabPage3 << UI Only( 0 ),
				TabPage3 << Vertical Alignment( "Default" ),
				TabPage3 << Visibility( "Visible" ),
				TabPage3 << Set Min Size( 72, 36 ),
				TabPage3 << Set Max Size( 30000, 30000 ),
				TabPage3 << Set Stretch( {"Neutral", "Neutral"} ),
				TabPage3 << Title( "Age v Weight" ), TabPage3 << Tip( "" ),
				TabPage3 << Icon( "Trellis" ), TabPage3 << Closeable( 1 ),
				TabPage3 << Moveable( 1 ), TabPage3 << Set Base Font( "Text" ),
				TabPage3 << Set Font Scale( 1 ),
				Scroll3 << Background Color( "None" ),
				Scroll3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll3 << Enabled( 1 ),
				Scroll3 << Horizontal Alignment( "Default" ),
				Scroll3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll3 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll3 << Text Color( "None" ), Scroll3 << UI Only( 0 ),
				Scroll3 << User Resizable( {1, 1} ),
				Scroll3 << Vertical Alignment( "Default" ),
				Scroll3 << Visibility( "Visible" ),
				Scroll3 << Set Min Size( 72, 36 ),
				Scroll3 << Set Max Size( 30000, 30000 ),
				Scroll3 << Set Stretch( {"Window", "Window"} ),
				Scroll3 << Width( 510 ), Scroll3 << Height( 253 ),
				Scroll3 << Set Auto Scrollable( 1 ),
				Scroll3 << Set Scrollers( 1, 1 ), Scroll3 << Set Show Empty( 0 ),
				Scroll3 << Set Clip Printing( 0 ),
				Report2 << Background Color( "None" ),
				Report2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Enabled( 1 ),
				Report2 << Horizontal Alignment( "Default" ),
				Report2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Text Color( "None" ), Report2 << UI Only( 0 ),
				Report2 << Vertical Alignment( "Default" ),
				Report2 << Visibility( "Visible" ),
				Report2 << Set Min Size( 472, 253 ),
				Report2 << Set Max Size( 472, 253 ),
				Report2 << Set Stretch( {"Neutral", "Neutral"} ),
				Report2 << set horizontal( 0 ),
				TabList1 << Background Color( "None" ),
				TabList1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabList1 << Enabled( 1 ),
				TabList1 << Horizontal Alignment( "Default" ),
				TabList1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabList1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabList1 << Text Color( "None" ), TabList1 << UI Only( 0 ),
				TabList1 << Vertical Alignment( "Default" ),
				TabList1 << Visibility( "Visible" ), TabList1 << Dockable( 0 ),
				TabList1 << Set Min Size( 275, 68 ),
				TabList1 << Set Max Size( 30006, 30032 ),
				TabList1 << Set Stretch( {"Neutral", "Neutral"} ),
				TabList1 << Set Selected( 1 ), TabList1 << Set Style( "Tab" ),
				TabList1 << Set Title Location( "Top" ),
				TabList1 << Set Overflow Enabled( 0 ),
				TabList1 << Set Tab Close( Empty() ),
				TabList1 << Set Tab Close Tip( "" ),
				TabList1 << Set Tab New( Empty() ),
				TabList1 << Set Tab New Tip( "" ),
				TabList1 << Set Tab New Icon( "" ), TabList1 << Show Tabs( 1 ),
				TabList1 << Set Tab Changed( Empty() ),
				TabPage4 << Background Color( "None" ),
				TabPage4 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage4 << Enabled( 1 ),
				TabPage4 << Horizontal Alignment( "Default" ),
				TabPage4 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage4 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabPage4 << Text Color( "None" ), TabPage4 << UI Only( 0 ),
				TabPage4 << Vertical Alignment( "Default" ),
				TabPage4 << Visibility( "Visible" ),
				TabPage4 << Set Min Size( 72, 36 ),
				TabPage4 << Set Max Size( 30000, 30000 ),
				TabPage4 << Set Stretch( {"Neutral", "Neutral"} ),
				TabPage4 << Title( "Age count" ), TabPage4 << Tip( "" ),
				TabPage4 << Icon( "Trellis" ), TabPage4 << Closeable( 1 ),
				TabPage4 << Moveable( 1 ), TabPage4 << Set Base Font( "Text" ),
				TabPage4 << Set Font Scale( 1 ),
				Scroll4 << Background Color( "None" ),
				Scroll4 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll4 << Enabled( 1 ),
				Scroll4 << Horizontal Alignment( "Default" ),
				Scroll4 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll4 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll4 << Text Color( "None" ), Scroll4 << UI Only( 0 ),
				Scroll4 << User Resizable( {1, 1} ),
				Scroll4 << Vertical Alignment( "Default" ),
				Scroll4 << Visibility( "Visible" ),
				Scroll4 << Set Min Size( 72, 36 ),
				Scroll4 << Set Max Size( 30000, 30000 ),
				Scroll4 << Set Stretch( {"Window", "Window"} ),
				Scroll4 << Width( 504 ), Scroll4 << Height( 221 ),
				Scroll4 << Set Auto Scrollable( 1 ),
				Scroll4 << Set Scrollers( 1, 1 ), Scroll4 << Set Show Empty( 0 ),
				Scroll4 << Set Clip Printing( 0 ),
				Report3 << Background Color( "None" ),
				Report3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report3 << Enabled( 1 ),
				Report3 << Horizontal Alignment( "Default" ),
				Report3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report3 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report3 << Text Color( "None" ), Report3 << UI Only( 0 ),
				Report3 << Vertical Alignment( "Default" ),
				Report3 << Visibility( "Visible" ),
				Report3 << Set Min Size( 289, 221 ),
				Report3 << Set Max Size( 289, 221 ),
				Report3 << Set Stretch( {"Neutral", "Neutral"} ),
				Report3 << set horizontal( 0 ),
				TabPage5 << Background Color( "None" ),
				TabPage5 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage5 << Enabled( 1 ),
				TabPage5 << Horizontal Alignment( "Default" ),
				TabPage5 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage5 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				), TabPage5 << Text Color( "None" ), TabPage5 << UI Only( 0 ),
				TabPage5 << Vertical Alignment( "Default" ),
				TabPage5 << Visibility( "Visible" ),
				TabPage5 << Set Min Size( 72, 36 ),
				TabPage5 << Set Max Size( 30000, 30000 ),
				TabPage5 << Set Stretch( {"Neutral", "Neutral"} ),
				TabPage5 << Title( "Height v Weight" ), TabPage5 << Tip( "" ),
				TabPage5 << Icon( "Trellis" ), TabPage5 << Closeable( 1 ),
				TabPage5 << Moveable( 1 ), TabPage5 << Set Base Font( "Text" ),
				TabPage5 << Set Font Scale( 1 ),
				Scroll5 << Background Color( "None" ),
				Scroll5 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll5 << Enabled( 1 ),
				Scroll5 << Horizontal Alignment( "Default" ),
				Scroll5 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll5 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll5 << Text Color( "None" ), Scroll5 << UI Only( 0 ),
				Scroll5 << User Resizable( {1, 1} ),
				Scroll5 << Vertical Alignment( "Default" ),
				Scroll5 << Visibility( "Visible" ),
				Scroll5 << Set Min Size( 72, 36 ),
				Scroll5 << Set Max Size( 30000, 30000 ),
				Scroll5 << Set Stretch( {"Window", "Window"} ),
				Scroll5 << Width( 504 ), Scroll5 << Height( 221 ),
				Scroll5 << Set Auto Scrollable( 1 ),
				Scroll5 << Set Scrollers( 1, 1 ), Scroll5 << Set Show Empty( 0 ),
				Scroll5 << Set Clip Printing( 0 ),
				Report4 << Background Color( "None" ),
				Report4 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report4 << Enabled( 1 ),
				Report4 << Horizontal Alignment( "Default" ),
				Report4 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report4 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report4 << Text Color( "None" ), Report4 << UI Only( 0 ),
				Report4 << Vertical Alignment( "Default" ),
				Report4 << Visibility( "Visible" ),
				Report4 << Set Min Size( 414, 221 ),
				Report4 << Set Max Size( 414, 221 ),
				Report4 << Set Stretch( {"Neutral", "Neutral"} ),
				Report4 << set horizontal( 0 )
			)
		)
	),
	Initialize(
		Module1 << Auto Launch( 1 );
		Module1 << Set Module Type( "Report" );
		Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
	)
) << Run;


db_1 = db << Get Windows();

local_filter = ((db_1[1] << XPath( "//OutlineBox[text()='Local Data Filter']" )) << get scriptable object())[1];

update_chart = Function( {a},
	Wait( 1 );
	obj1 = db_1[1] << xpath( "//TabPageBox[contains(text(),'Weight')]//FrameBox" );
	obj1 << framesize( 300, 300 );
);

filter_handler = local_filter << Make Filter Change Handler( update_chart );
5 REPLIES 5

Re: Make Filter Change Handler for Dashboard

Hi @anna_717 ,

 

You can add an Eval(Eval Expr(.... to the final part of the script to force the JSL to evaluate the newly created display box - in the case of the dashboard the whole display tree is being re-written every time a filter change is applied - so the script gets confused with the object reference for obj1, the Eval term helps to force JMP to check that the term exists and properly references it.

 

db_1 = db << Get Windows();

local_filter = ((db_1[1] << XPath( "//OutlineBox[text()='Local Data Filter']" )) << get scriptable object())[1];

update_chart = Function( {a},
	eval(evalexpr(obj1 = db_1[1]<<xpath( "//TabPageBox[contains(text(),'Weight')]//FrameBox" );
	obj1 << framesize( 300, 300 );));
);

filter_handler = local_filter << Make Filter Change Handler( update_chart );
“All models are wrong, but some are useful”
anna_717
Level II

Re: Make Filter Change Handler for Dashboard

Hi Ben,

 

Thank you very much for your reply. The charts are now updating using "Eval(Eval Expr(....". 

However the function is being called whenever I move my cursor over a chart, not just changing the local data filter, which is crashing JMP when using my larger dataset. Is there any way to limit the function to being called only when the local data filter is changed?

 

Thanks

Re: Make Filter Change Handler for Dashboard

Hi @anna_717 ,

 

I believe this is due to the Filter Change Handler checking row states, so it is checking to see if the row is changed when you hover over a data point. I made an addition of write("Trigger") into the update_chart to see when it happened in the data set and it was when the mouse hovered over data points.

 

This has been an issue that has been Wishlisted to see if it can be changed - please add a comment to this so development can see.

 

I'm going to tag the author @jthi of the Wishlist item to see if he has some thoughts on some resolutions. 

 

Thanks,

Ben

“All models are wrong, but some are useful”
jthi
Super User

Re: Make Filter Change Handler for Dashboard

In this case it might be enough to check for -1 value of the a variable

update_chart = Function({a},
	If(a != -1,
		Eval(
			Eval Expr(
				obj1 = db_1[1] << xpath("//TabPageBox[contains(text(),'Weight')]//FrameBox");
				obj1 << framesize(300, 300);
			)
		);	
	);
);

If this won't work, you might need something more "smart" to check if it was local data filter or hover over which did trigger the filter change handler (like comparing filtered items or something similar).

-Jarmo

Re: Make Filter Change Handler for Dashboard

Hi @jthi ,

 

This is great, I'm just going to add context for your solution in case someone stumbles on to this page (and because I wanted to understand why it works).

 

When the mouse hovers over the data points on the graph, it will return '-1' as the value for [a] in the function of the Data Filter Change Handler, when you use the data filter, it will make the value of [a] the number of rows selected, so it will always be >0. 

 

Great solution!

 

Ben

“All models are wrong, but some are useful”

Recommended Articles