<?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: Using functions within Graph Builder Dispatch in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36396#M21383</link>
    <description>&lt;P&gt;Thanks Jim for the thorough response. I figured I would have to pass it as text and parse it somehow but I certainly didnt anticipate it being so ugly! Oh well, I guess this is the price I pay for having such a niche requirement. This is perfect for me though. As long as I can hide most of the ugly code in the master function Im happy as my goal is for that to be left alone by the end user. I'm very much a taker in the community at the moment but I hope I can repay the help by contributing back as I get some more experience with the scripting in JMP.&lt;/P&gt;</description>
    <pubDate>Sun, 26 Feb 2017 21:46:42 GMT</pubDate>
    <dc:creator>kevinwtbolger</dc:creator>
    <dc:date>2017-02-26T21:46:42Z</dc:date>
    <item>
      <title>Using functions within Graph Builder Dispatch</title>
      <link>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36391#M21379</link>
      <description>&lt;P&gt;I am building a tool for some custom graphs. I want the tool to be easily modified by users that I share it with. To reduce the barrier for entry I would like to use sub-functions which I call within a master function. Each sub function would represent a smaller part of the overall main function.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My question: Is it possoble to replace the arguments of 'Dispatch' within the graph builder as a function? Or is there another standard approach to creating smaller sub functions that I am not aware of.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 18:28:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36391#M21379</guid>
      <dc:creator>kevinwtbolger</dc:creator>
      <dc:date>2017-02-26T18:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions within Graph Builder Dispatch</title>
      <link>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36393#M21380</link>
      <description>&lt;P&gt;If you look at:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index==&amp;gt;Graph Builder&lt;/P&gt;
&lt;P&gt;you will see all of the various components that can be manipulated in Graph Builder, by passing requests to the platform.&amp;nbsp; All of these can be put into user build functions.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="graph builder help.PNG" style="width: 920px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5345i5852C53FC050A59C/image-size/large?v=v2&amp;amp;px=999" role="button" title="graph builder help.PNG" alt="graph builder help.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 19:20:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36393#M21380</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-26T19:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions within Graph Builder Dispatch</title>
      <link>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36394#M21381</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply. However I'll try make my problem a little clearer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets say within Graph Builder in my JSL script, I have some code block such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(... etc&lt;/PRE&gt;&lt;P&gt;In this perhaps for example I am customising the color of lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for me to create a function in another JSL Script such as:&lt;/P&gt;&lt;PRE&gt;myDispatch=Function(
	{},
	
	Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(.... etc&lt;/PRE&gt;&lt;P&gt;and then within the JSL script, in place of the dispatch function, I would have myDispatch().&lt;/P&gt;&lt;P&gt;I have tried this, and while it doesnt log any errors, it does not apply my function (ie the graph just uses the default line colors etc and ignores my function). I cant get it to work without explicitly typing the arguments within the Graph Builder itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 20:23:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36394#M21381</guid>
      <dc:creator>kevinwtbolger</dc:creator>
      <dc:date>2017-02-26T20:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions within Graph Builder Dispatch</title>
      <link>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36395#M21382</link>
      <description>&lt;P&gt;Here is some code that accomplishes what you want, but it isn't very pretty.&amp;nbsp; What you want is to be able to do code generation with substitution, and that isn't handled very well in JMP.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
myfunc = Function( {},
	return =
	"\[Dispatch(
				{},
				"2",
				ScaleBox,
				{Min( 92.9916666666667 ), Max( 127 ), Inc( 5 ), Minor Ticks( 1 ),
				Add Ref Line( 118.356215277778, "Solid", "Black", "", 1 )}
			)]\"
);


Eval(
	Substitute(
			Expr(
				Bivariate( Y( :NPN1 ), X( :PNP1 ), SendToReport( __dispatch__ ) )
			),
		Expr( __dispatch__ ), Parse( myfunc )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;JMP can handle replacement of components within the platform structure, such as passing in a minimum value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

mymin = 80;

Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	SendToReport(
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Min( Eval( mymin ) ), Max( 127 ), Inc( 5 ), Minor Ticks( 1 ),
			Add Ref Line( 118.356215277778, "Solid", "Black", "", 1 )}
		)
	)
	
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or what I believe is the prefered method, which is to generate the default graph, and then set the parameters after the generation, where a call to a function could be used to conditionally set the items desired;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

myfunc = function({},
	Report( biv )[Axis Box( 1 )] &amp;lt;&amp;lt; Min( 80 );
);

biv = Bivariate(
	Y( :NPN1 ),
	X( :PNP1 ),
	SendToReport(
		Dispatch(
			{},
			"2",
			ScaleBox,
			{Min( 92.9916666666667 ), Max( 127 ), Inc( 5 ), Minor Ticks( 1 ),
			Add Ref Line( 118.356215277778, "Solid", "Black", "", 1 )}
		)
	)
);

myfunc;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Feb 2017 21:24:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36395#M21382</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-26T21:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using functions within Graph Builder Dispatch</title>
      <link>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36396#M21383</link>
      <description>&lt;P&gt;Thanks Jim for the thorough response. I figured I would have to pass it as text and parse it somehow but I certainly didnt anticipate it being so ugly! Oh well, I guess this is the price I pay for having such a niche requirement. This is perfect for me though. As long as I can hide most of the ugly code in the master function Im happy as my goal is for that to be left alone by the end user. I'm very much a taker in the community at the moment but I hope I can repay the help by contributing back as I get some more experience with the scripting in JMP.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2017 21:46:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-functions-within-Graph-Builder-Dispatch/m-p/36396#M21383</guid>
      <dc:creator>kevinwtbolger</dc:creator>
      <dc:date>2017-02-26T21:46:42Z</dc:date>
    </item>
  </channel>
</rss>

