<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dynamically change Dispatch() options sent to GraphBuilder in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313646#M56597</link>
    <description>&lt;P&gt;Two terms&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;platform object: the logic behind graph builder. It is not visible.&lt;/LI&gt;&lt;LI&gt;report surface display box tree: the output from graph builder. A visible graph, sliders, buttons.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Mark is correct; the dispatch syntax was created for machines, not humans. The Dispatch message contains information the platform object uses to find a display box in the report.&amp;nbsp; If you need to use it, the &lt;EM&gt;SendToReport&lt;/EM&gt; dispatches must be sent like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/big class.jmp" );
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 512, 442 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ), 
//	SendToReport(
//		Dispatch( {}, "weight", ScaleBox, {Scale( "Log" ), Format( "Best", 6 ), Min( 60 ), Max( 200 ), Inc( 1 ), Minor Ticks( 1 )} ),
//		Dispatch( {}, "height", ScaleBox, {Format( "Engineering", 12 )} )
//	)
);

newFormat = {"Percent", "Engineering", "Best"};
newScale = {"Linear", "Log", "Linear"};
newInc = {10, 1, 20};

For( i = 1, i &amp;lt;= N Items( newFormat ), i += 1,
	Wait( 1 ); // wait only needed for the demo!
	gb &amp;lt;&amp;lt; Dispatch( {}, "weight", ScaleBox, {Scale( newScale[i] ), Format( "Best", 6 ), 
			Min( 60 ), Max( 200 ), Inc( newInc[i] ), Minor Ticks( 0 )} );
	gb &amp;lt;&amp;lt; Dispatch( {}, "height", ScaleBox, {Format( newFormat[i], 12 )} );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;gb&lt;/STRONG&gt;&lt;/EM&gt; is the platform object that the &lt;EM&gt;&amp;lt;&amp;lt;Dispatch&lt;/EM&gt; message is sent to. Don't send the &lt;EM&gt;&amp;lt;&amp;lt;Dispatch&lt;/EM&gt; message to the report surface. &lt;EM&gt;SendToReport(...)&lt;/EM&gt; is telling the platform object to dispatch messages into the report tree.&lt;/P&gt;&lt;P&gt;Mark suggests using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb rep = gb &amp;lt;&amp;lt; Report;
gb rep[AxisBox(2)] &amp;lt;&amp;lt; Format( Engineering, 12 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In all of the above, &lt;STRONG&gt;&lt;EM&gt;gb&lt;/EM&gt;&lt;/STRONG&gt; is the graph builder platform object. In Mark's example, &lt;EM&gt;&lt;STRONG&gt;gb rep&lt;/STRONG&gt;&lt;/EM&gt; is the display box report tree that belongs to the graph builder platform object. Sending the &lt;EM&gt;&amp;lt;&amp;lt;report&lt;/EM&gt; message to the &lt;EM&gt;&lt;STRONG&gt;gb&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;platform object retrieves the root of the display box tree (the report surface, the visible part). Subscripting the root returns a more specific subtree of the display box tree:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb rep[AxisBox(2)]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That's what Mark wants to send the Format message to. One way to get that subscript is using Show Tree Structure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Show Tree Structure: right-click on the open-close triangle." style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27017i603FDD13DF8BC11D/image-size/large?v=v2&amp;amp;px=999" role="button" title="ShowTreeStructure.png" alt="Show Tree Structure: right-click on the open-close triangle." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Show Tree Structure: right-click on the open-close triangle.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The report and the tree structure windows are linked; I clicked on the height axis. The height axis and its info in the tree structure both high-lighted. AxisBox(2) is the second axis box in the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Sep 2020 11:40:58 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2020-09-27T11:40:58Z</dc:date>
    <item>
      <title>dynamically change Dispatch() options sent to GraphBuilder</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313424#M56586</link>
      <description>&lt;P&gt;I am needing to change some of the options sent to the Graph Builder depending on the options in the script.&amp;nbsp; I can't figure out how to get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script works to make the graph Scale("Log"), Format("Engineering", 12):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
		Variables(
			X( :Split ),
			X( :Wafer, Position( 1 ) ),
			Y( As Column( analysisTests[i] ) ),
			Color( :Split )
		),
		Elements(
			Points( X( 1 ), X( 2 ), Y, Legend( 21 ) ),
			Box Plot( X( 1 ), X( 2 ), Y, Legend( 22 ) )
		),
		SendToReport(
			Dispatch(
				{},
				analysisTests[i],
				ScaleBox,
				{Scale("Log"), Format("Engineering", 12)}
			),
			Dispatch(
				{},
				"graph title",
				TextEditBox,
				{Set Text( title )}
			)
		)
	)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I try and send that information like this it doesn't work, even though it looks the same to me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ScaleboxVariables = {};&lt;BR /&gt;if(log != 0,  
		ScaleboxVariables = Insert(ScaleboxVariables, Expr(Scale("Log")) );
		ScaleboxVariables = Insert(ScaleboxVariables, Expr(Format( "Engineering", 12 )) );
	);

Dispatch(
				{},
				analysisTests[i],
				ScaleBox,
				ScaleboxVariables 
			),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with this would be appreciated!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:06:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313424#M56586</guid>
      <dc:creator>Lindeman1arr</dc:creator>
      <dc:date>2023-06-11T11:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically change Dispatch() options sent to GraphBuilder</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313543#M56591</link>
      <description>&lt;P&gt;As I have said in answer to many other discussions here, the Send to Report argument was developed so that JMP can save customizations when you save a script. It was not developed for us. There are better ways. Send the Format message directly to the axis box. Like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 454 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

gb rep = gb &amp;lt;&amp;lt; Report;

gb rep[AxisBox(2)] &amp;lt;&amp;lt; Format( Engineering, 12 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Sep 2020 13:22:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313543#M56591</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-09-26T13:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically change Dispatch() options sent to GraphBuilder</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313544#M56592</link>
      <description>&lt;P&gt;To add to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp;all of the messages and functions that can be passed to the various display objects in the output from JMP platforms are described with examples in the Scripting Index.&amp;nbsp; .&amp;nbsp; The output from the various JMP Platforms are displayed in structures filled with objects, called Display Trees. Therefore, I also suggest that you read the section in the Scripting Guide on Display Trees.&amp;nbsp; It will open a whole new world of the marvelous things one is able to do with the output from JMP Platforms.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 13:47:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313544#M56592</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-26T13:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically change Dispatch() options sent to GraphBuilder</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313646#M56597</link>
      <description>&lt;P&gt;Two terms&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;platform object: the logic behind graph builder. It is not visible.&lt;/LI&gt;&lt;LI&gt;report surface display box tree: the output from graph builder. A visible graph, sliders, buttons.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Mark is correct; the dispatch syntax was created for machines, not humans. The Dispatch message contains information the platform object uses to find a display box in the report.&amp;nbsp; If you need to use it, the &lt;EM&gt;SendToReport&lt;/EM&gt; dispatches must be sent like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$sample_data/big class.jmp" );
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 512, 442 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ), 
//	SendToReport(
//		Dispatch( {}, "weight", ScaleBox, {Scale( "Log" ), Format( "Best", 6 ), Min( 60 ), Max( 200 ), Inc( 1 ), Minor Ticks( 1 )} ),
//		Dispatch( {}, "height", ScaleBox, {Format( "Engineering", 12 )} )
//	)
);

newFormat = {"Percent", "Engineering", "Best"};
newScale = {"Linear", "Log", "Linear"};
newInc = {10, 1, 20};

For( i = 1, i &amp;lt;= N Items( newFormat ), i += 1,
	Wait( 1 ); // wait only needed for the demo!
	gb &amp;lt;&amp;lt; Dispatch( {}, "weight", ScaleBox, {Scale( newScale[i] ), Format( "Best", 6 ), 
			Min( 60 ), Max( 200 ), Inc( newInc[i] ), Minor Ticks( 0 )} );
	gb &amp;lt;&amp;lt; Dispatch( {}, "height", ScaleBox, {Format( newFormat[i], 12 )} );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;gb&lt;/STRONG&gt;&lt;/EM&gt; is the platform object that the &lt;EM&gt;&amp;lt;&amp;lt;Dispatch&lt;/EM&gt; message is sent to. Don't send the &lt;EM&gt;&amp;lt;&amp;lt;Dispatch&lt;/EM&gt; message to the report surface. &lt;EM&gt;SendToReport(...)&lt;/EM&gt; is telling the platform object to dispatch messages into the report tree.&lt;/P&gt;&lt;P&gt;Mark suggests using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb rep = gb &amp;lt;&amp;lt; Report;
gb rep[AxisBox(2)] &amp;lt;&amp;lt; Format( Engineering, 12 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In all of the above, &lt;STRONG&gt;&lt;EM&gt;gb&lt;/EM&gt;&lt;/STRONG&gt; is the graph builder platform object. In Mark's example, &lt;EM&gt;&lt;STRONG&gt;gb rep&lt;/STRONG&gt;&lt;/EM&gt; is the display box report tree that belongs to the graph builder platform object. Sending the &lt;EM&gt;&amp;lt;&amp;lt;report&lt;/EM&gt; message to the &lt;EM&gt;&lt;STRONG&gt;gb&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;platform object retrieves the root of the display box tree (the report surface, the visible part). Subscripting the root returns a more specific subtree of the display box tree:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb rep[AxisBox(2)]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That's what Mark wants to send the Format message to. One way to get that subscript is using Show Tree Structure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Show Tree Structure: right-click on the open-close triangle." style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27017i603FDD13DF8BC11D/image-size/large?v=v2&amp;amp;px=999" role="button" title="ShowTreeStructure.png" alt="Show Tree Structure: right-click on the open-close triangle." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Show Tree Structure: right-click on the open-close triangle.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The report and the tree structure windows are linked; I clicked on the height axis. The height axis and its info in the tree structure both high-lighted. AxisBox(2) is the second axis box in the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Sep 2020 11:40:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/313646#M56597</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-09-27T11:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: dynamically change Dispatch() options sent to GraphBuilder</title>
      <link>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/314586#M56654</link>
      <description>Thanks Mark, that was very helpful. I have been building the graphs I need in graph builder, then copying the script JMP generates for it and then editing that with my own variables and just not getting it to work. Your solution worked great and helped me understand the process better for all the different changes I want to implement.</description>
      <pubDate>Tue, 29 Sep 2020 15:22:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/dynamically-change-Dispatch-options-sent-to-GraphBuilder/m-p/314586#M56654</guid>
      <dc:creator>Lindeman1arr</dc:creator>
      <dc:date>2020-09-29T15:22:27Z</dc:date>
    </item>
  </channel>
</rss>

