<?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 Graph Builder - adding interactive reference lines in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/225335#M44758</link>
    <description>&lt;P&gt;When using graph builder, it allows you to "highlight" or "select" a specific data subset within the legend. The corresponding output on the graph builder and data table will also highlight themselves. When a subset of data is selected, the other subsets fade into the background or increase their transparency in an interactive manner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I have add reference lines that correspond to a selected data set behave interactively in the same way? And can I have these lines automatically color themselves as they do when I drop a nominal column into the legend field?&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 20:57:26 GMT</pubDate>
    <dc:creator>JMPNovice</dc:creator>
    <dc:date>2019-09-10T20:57:26Z</dc:date>
    <item>
      <title>Graph Builder - adding interactive reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/225335#M44758</link>
      <description>&lt;P&gt;When using graph builder, it allows you to "highlight" or "select" a specific data subset within the legend. The corresponding output on the graph builder and data table will also highlight themselves. When a subset of data is selected, the other subsets fade into the background or increase their transparency in an interactive manner.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I have add reference lines that correspond to a selected data set behave interactively in the same way? And can I have these lines automatically color themselves as they do when I drop a nominal column into the legend field?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 20:57:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/225335#M44758</guid>
      <dc:creator>JMPNovice</dc:creator>
      <dc:date>2019-09-10T20:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder - adding interactive reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/225440#M44768</link>
      <description>&lt;P&gt;Here's some starter JSL.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

oldselection = [];// don't update when nothing changes by comparing old to new

f = Function( {a}, // this callback tells which points are changing selected state
	// and may send between 1 and N row numbers in the matrix a. 
	// this example will ignore a and just ask the table about the range of the currently
	// selected points.
	{subset, hmin, hmax, wmin, wmax, newselection}, // local variables
	newselection = dt &amp;lt;&amp;lt; getselectedrows; // compare to previous selection...
	If( Try( N Rows( newselection ) != N Rows( oldselection ) | Any( newselection != oldselection ), 1 ),
		oldselection = newselection; // remember the new selection for next time
		dtSubset = dt &amp;lt;&amp;lt; subset( SelctedRows( 1 ), LinkToOriginalDataTable( 1 ), invisible ); // make a subset of the selection to summarize
		dtSummary = dtSubset &amp;lt;&amp;lt; Summary( Min( :height ), Min( :weight ), Max( :height ), Max( :weight ), Freq( "None" ), Weight( "None" ) );
		Close( dtSubset, "nosave" ); // done with the subset, use the summary...
		hmin = dtSummary:name( "Min(Height)" )[1]; // capture the range of the selected axis
		hmax = dtSummary:name( "Max(Height)" )[1];
		wmin = dtSummary:name( "Min(Weight)" )[1];
		wmax = dtSummary:name( "Max(Weight)" )[1];
		Close( dtSummary, "nosave" ); // done with the summary, use the captured values...
		// remove 2 old reflines first, from each axis, then add 2 new ones
		// remove the old ref lines from the weight axis (1==horizontal)
		Report( gb )[axisbox( 1 )] &amp;lt;&amp;lt; removerefline( (Report( gb )[axisbox( 1 )] &amp;lt;&amp;lt; getscript)["addrefline"] );
		Report( gb )[axisbox( 1 )] &amp;lt;&amp;lt; removerefline( (Report( gb )[axisbox( 1 )] &amp;lt;&amp;lt; getscript)["addrefline"] );
		// remove the old ref lines from the height axis (2==vertical)
		Report( gb )[axisbox( 2 )] &amp;lt;&amp;lt; removerefline( (Report( gb )[axisbox( 2 )] &amp;lt;&amp;lt; getscript)["addrefline"] );
		Report( gb )[axisbox( 2 )] &amp;lt;&amp;lt; removerefline( (Report( gb )[axisbox( 2 )] &amp;lt;&amp;lt; getscript)["addrefline"] );
		// add the new ref lines...extend the bounding box by .5 for the integer height/weight (not required)
		Report( gb )[axisbox( 1 )] &amp;lt;&amp;lt; addrefline( wmin - .5, "solid", "red", "a", 2 );
		Report( gb )[axisbox( 1 )] &amp;lt;&amp;lt; addrefline( wmax + .5, "solid", "green", "b", 2 );
		Report( gb )[axisbox( 2 )] &amp;lt;&amp;lt; addrefline( hmin - .5, "solid", "blue", "c", 1 );
		Report( gb )[axisbox( 2 )] &amp;lt;&amp;lt; addrefline( hmax + .5, "solid", "black", "d", 1 );

	);
);

rs = dt &amp;lt;&amp;lt; make row state handler( f );

gb = Graph Builder(
	Size( 416, 300 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ),
	SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "" )} ), Dispatch( {}, "graph title", TextEditBox, {Set Text( "Demo" )} ) )
);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The JSL installs a RowState handler function in the data table; that function is notified when the table's row state data changes (when a row is selected/hidden/excluded, or the marker style or color changes.) The function calculates the min and max values of the selected columns and removes old ref lines and adds new ref lines.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The a-b-c-d ref lines are interactively tracking the rectangular point selection" style="width: 417px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/19258iE20E1555ECE55D11/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="The a-b-c-d ref lines are interactively tracking the rectangular point selection" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The a-b-c-d ref lines are interactively tracking the rectangular point selection&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It flashes as it updates because the display redraws when each refline is added or removed; it may get too slow with large data that takes too long to redraw the graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 19:34:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/225440#M44768</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-09-11T19:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder - adding interactive reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/672240#M86002</link>
      <description>&lt;P&gt;Indexing the list via&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;["addrefline"] &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;- nice trick :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does it work?&lt;BR /&gt;&lt;BR /&gt;It finds the first Symbol (independent of upper/lower case &amp;amp; spaces) - and returns the first argument?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 17:39:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/672240#M86002</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-08-29T17:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder - adding interactive reference lines</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/672393#M86008</link>
      <description>&lt;P&gt;Yes. Not well documented, but very useful with modal dialog &amp;lt;&amp;lt;ReturnResult. It is a sequential search, not as good as an associative array. comments in &lt;LI-MESSAGE title="Modal Dialogs" uid="436177" url="https://community.jmp.com/t5/Uncharted/Modal-Dialogs/m-p/436177#U436177" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; 2/5 down from top.&lt;/P&gt;
&lt;P&gt;axisbox&amp;lt;&amp;lt;getscript returns a list of function-call-like elements, and as you point out (I just noticed too) only the first value can be retrieved.&lt;/P&gt;
&lt;P&gt;Sorry, that JSL deserved better comments!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 22:37:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-adding-interactive-reference-lines/m-p/672393#M86008</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-08-29T22:37:45Z</dc:date>
    </item>
  </channel>
</rss>

