<?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: Is it possible to execute a script by clicking a curve in the graph via JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442596#M69086</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-12-06_155053.png" style="width: 729px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38160i7F581577794FAEDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-12-06_155053.png" alt="2021-12-06_155053.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 07:53:06 GMT</pubDate>
    <dc:creator>lwx228</dc:creator>
    <dc:date>2021-12-06T07:53:06Z</dc:date>
    <item>
      <title>Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442569#M69081</link>
      <description>&lt;P&gt;For example, I made a graph of the script below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Students2.JMP" );
dt &amp;lt;&amp;lt; Sort( By( 1 ), Order( Ascending ), replacetable( 1 ) );
New Column( "A" );
Column( "A" ) &amp;lt;&amp;lt; Formula( If( Row() == 1 | name != Lag( name, 1 ), 1, If( Lag( A, 1 ) &amp;lt; 6, Lag( A, 1 ) + 1 ) ) );
dt &amp;lt;&amp;lt; run formulas;
Column( "A" ) &amp;lt;&amp;lt; deleteFormula;
dt &amp;lt;&amp;lt; Sort( By( "A" ), Order( DEscending ), replacetable( 1 ) );
dt &amp;lt;&amp;lt; delete rows( N Rows( Loc( dt[0, "A"] &amp;gt; 0 ) ) + 1 :: N Row( dt ) );
dt &amp;lt;&amp;lt; Sort( By( 1, "A" ), Order( Ascending, Ascending ), replacetable( 1 ) );

p1 = Graph Builder(
	Size( 528, 454 ),
	Show Control Panel( 0 ),
	Variables( X( :A ), Y( :height ), Overlay( :name ) ),
	Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Click any conditional curve in the graph, and automatically run the specified "D :\&lt;/img&gt; A.jsl"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-12-06_145432.png" style="width: 784px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38156i0B274808892D3345/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-12-06_145432.png" alt="2021-12-06_145432.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:06:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442569#M69081</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2023-06-09T18:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442589#M69082</link>
      <description>&lt;P&gt;This "D:\A.JSL"、I mainly achieve the following functions:&lt;BR /&gt;Click on the selected curve to get the "name".Use this name to get the "age" of the name in another table"Students1.JMP".Create new table "new.jmp"&lt;BR /&gt;Draw the diagram as above.&lt;/P&gt;&lt;P&gt;Finally, the two graphs and each data table are used to generate a dashboard.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-12-06_143907.png" style="width: 706px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38157i99B218B4D151B0AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-12-06_143907.png" alt="2021-12-06_143907.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 07:09:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442589#M69082</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-12-06T07:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442590#M69083</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;JMP has similar module function, can realize the following process operation: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;by clicking the selected curve, get the "name".&lt;/SPAN&gt;&lt;SPAN class=""&gt;Use this name to get the age of the name in the other table students1.jmp.&lt;/SPAN&gt;&lt;SPAN class=""&gt;A new data table is generated with the selected name alone and the "height" in Table 2 and the "age" in Table 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;d1 = Open( "$SAMPLE_DATA/Students1.JMP" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;Thanks Experts!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 07:17:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442590#M69083</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-12-06T07:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442591#M69084</link>
      <description>&lt;P&gt;Maybe using Row State Handler on the original data table could work? Or if you can "skip" the clicking part then you could possibly use hover labels.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 07:26:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442591#M69084</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-12-06T07:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442594#M69085</link>
      <description>&lt;P class=""&gt;Thank you very much! But I still haven't found a way.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-12-06_154617.png" style="width: 757px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38159iBD47578535DD6229/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-12-06_154617.png" alt="2021-12-06_154617.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 07:47:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442594#M69085</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-12-06T07:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442596#M69086</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-12-06_155053.png" style="width: 729px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38160i7F581577794FAEDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-12-06_155053.png" alt="2021-12-06_155053.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 07:53:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442596#M69086</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-12-06T07:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442597#M69087</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;In my implementation application, the data is not in the same file.&lt;/SPAN&gt;&lt;SPAN class=""&gt;So I don't know how to use something like this drill-down function.&lt;EM&gt;&lt;SPAN class=""&gt;&lt;A target="_blank"&gt;thanks&lt;/A&gt; &lt;A target="_blank"&gt;a&lt;/A&gt; &lt;A target="_blank"&gt;lot&lt;/A&gt;&lt;/SPAN&gt; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 08:28:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442597#M69087</guid>
      <dc:creator>lwx228</dc:creator>
      <dc:date>2021-12-06T08:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to execute a script by clicking a curve in the graph via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442637#M69091</link>
      <description>&lt;P&gt;Perhaps I'm missing some nuance of what's needed. But building on the suggestion from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;, you can do this kind of thing (where, once you have the current row selection 'doSomething' can be made to do whatever JSL is capable of):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Original code . . .
dt = Open( "$SAMPLE_DATA/Students2.JMP" );
dt &amp;lt;&amp;lt; Sort( By( 1 ), Order( Ascending ), replacetable( 1 ) );
New Column( "A" );
Column( "A" ) &amp;lt;&amp;lt; Formula( If( Row() == 1 | name != Lag( name, 1 ), 1, If( Lag( A, 1 ) &amp;lt; 6, Lag( A, 1 ) + 1 ) ) );
dt &amp;lt;&amp;lt; run formulas;
Column( "A" ) &amp;lt;&amp;lt; deleteFormula;
dt &amp;lt;&amp;lt; Sort( By( "A" ), Order( DEscending ), replacetable( 1 ) );
dt &amp;lt;&amp;lt; delete rows( N Rows( Loc( dt[0, "A"] &amp;gt; 0 ) ) + 1 :: N Row( dt ) );
dt &amp;lt;&amp;lt; Sort( By( 1, "A" ), Order( Ascending, Ascending ), replacetable( 1 ) );

gb = dt &amp;lt;&amp;lt;
Graph Builder(
	Size( 528, 454 ),
	Show Control Panel( 0 ),
	Variables( X( :A ), Y( :height ), Overlay( :name ) ),
	Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);

// New code  . . .

// Row state handler function to do something
doSomething = Function({x}, {Default Local},
						// 'x' is a column vector of row states that have just CHANGED. We just need those that are now selected . . .
						selectedRows = [];
						For( i = 1, i &amp;lt;= NRow(x), i++, If( Selected( Row State( x[i] ) ), selectedRows = VConcat(selectedRows, x[i]) ));
						Print(x);
						Print(selectedRows);
						);
// Assign the handler to the table
rsh = dt &amp;lt;&amp;lt; MakeRowStateHandler(doSomething);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 11:18:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-it-possible-to-execute-a-script-by-clicking-a-curve-in-the/m-p/442637#M69091</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-12-06T11:18:42Z</dc:date>
    </item>
  </channel>
</rss>

