<?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: Show labels for selected rows only in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762981#M94372</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;It doesn't work with the code I provided or when using similar idea on your data (for me it works using JMP17.2/JMP18.0 on Windows 10)?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Your simple function using &lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;lt; run formulas&lt;/FONT&gt; doesn't work for me in JMP 17.2/18.0 on Mac OS 13.6.7.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2024 08:36:15 GMT</pubDate>
    <dc:creator>matth1</dc:creator>
    <dc:date>2024-06-10T08:36:15Z</dc:date>
    <item>
      <title>Show labels for selected rows only</title>
      <link>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762560#M94213</link>
      <description>&lt;P&gt;In Graph Builder, I want to show a data label (not a hover label) for selected rows only. As a demo, I tried the following code:&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" );
Try(
	Show( dt:Selected Name ),
	dt &amp;lt;&amp;lt; New Column( "Selected Name",
		Character,
		Set Formula( If( Selected( Row State( Row() ) ) == 1, :name ) )
	)
);
dt:Name &amp;lt;&amp;lt; Label( 0 );
dt &amp;lt;&amp;lt; Clear Row States &amp;lt;&amp;lt; Select All Rows &amp;lt;&amp;lt; Label &amp;lt;&amp;lt; Clear Select;
dt:Selected Name &amp;lt;&amp;lt; Label( 1 );
// The following doesn't work as expected
gb1 = dt &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder", FrameBox,
			{Marker Size( 5 ), Marker Drawing Mode( "Normal" )}
		)
	)
);
nw1 = New Window( "DTB", dtb1 = Data Table Box( dt ) );
dtb1 &amp;lt;&amp;lt; set selectable rows();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I select a row in the data table, or from the table box, or by selecting the data point in the Graph Builder, it should show the label in :Selected Name. However, it always seems to be one selected point behind! For example, I select KATIE and the data point is highlighted but there's no label. Then if I select LOUISE, the data point for that row is highlighted, but the data point for KATIE is now labelled!&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="matth1_0-1717576334539.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64887iE7B9EE357EB35233/image-size/medium?v=v2&amp;amp;px=400" role="button" title="matth1_0-1717576334539.png" alt="matth1_0-1717576334539.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="matth1_1-1717576383440.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64888i39BD97A30BA4046F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="matth1_1-1717576383440.png" alt="matth1_1-1717576383440.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if I click LOUISE again, it becomes correctly labelled:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="matth1_2-1717576419863.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64889i5A569D32F4D20981/image-size/medium?v=v2&amp;amp;px=400" role="button" title="matth1_2-1717576419863.png" alt="matth1_2-1717576419863.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Finally, if I deselect all rows then the last label remains visible.&lt;/P&gt;&lt;P&gt;Interestingly, if I use the following code to put the table box and graph builder in the same window, and select rows from the table box or the Graph Builder plot, it works as expected, with the label only showing for the selected rows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; clear select;
nw2 = New Window( "Demo",
	H List Box(
		dtb2 = Data Table Box( dt ),
		gb2 = dt &amp;lt;&amp;lt; Graph Builder(
			Show Control Panel( 0 ),
			Variables( X( :height ), Y( :weight ) ),
			Elements( Points( X, Y, Legend( 3 ) ) ),
			SendToReport(
				Dispatch( {}, "Graph Builder", FrameBox,
					{Marker Size( 5 ), Marker Drawing Mode( "Normal" )}
				)
			)
		)
	)
);
dtb2 &amp;lt;&amp;lt; set selectable rows();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there a better way for doing what I'm attempting?&lt;/P&gt;&lt;P&gt;I see this behaviour on JMP 17.2 and JMP 18.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 08:43:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762560#M94213</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2024-06-05T08:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Show labels for selected rows only</title>
      <link>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762570#M94215</link>
      <description>&lt;P&gt;I think you might have to use something to cause a small delay. One option is row state handler (these can be very unreliable) + run formulas&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Try(
	Show(dt:Selected Name),
	dt &amp;lt;&amp;lt; New Column("Selected Name",
		Character,
		Set Formula(If(Selected(Row State(Row())) == 1, :name))
	)
);
dt:Name &amp;lt;&amp;lt; Label(0);
dt &amp;lt;&amp;lt; Clear Row States &amp;lt;&amp;lt; Select All Rows &amp;lt;&amp;lt; Label &amp;lt;&amp;lt; Clear Select;
dt:Selected Name &amp;lt;&amp;lt; Label(1);
// The following doesn't work as expected
gb1 = dt &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel(0),
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y, Legend(3))),
	SendToReport(
		Dispatch({}, "Graph Builder", FrameBox, {Marker Size(5), Marker Drawing Mode("Normal")})
	)
);
nw1 = New Window("DTB", dtb1 = Data Table Box(dt));
dtb1 &amp;lt;&amp;lt; set selectable rows();

f = Function({a},
	dt &amp;lt;&amp;lt; run formulas;
);
rs = dtb1 &amp;lt;&amp;lt; Make RowState Handler(f);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jun 2024 11:27:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762570#M94215</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-05T11:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Show labels for selected rows only</title>
      <link>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762746#M94254</link>
      <description>&lt;P&gt;Thanks for the suggestion! Unfortunately it didn't work for me as is, but the following does:&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;f = Function({a},
	rr = dt &amp;lt;&amp;lt; get selected rows;
	dt &amp;lt;&amp;lt; clear select;
	wait(0);
	dt &amp;lt;&amp;lt; select rows( rr );
	rs = dt &amp;lt;&amp;lt; Make Row State Handler(f);
);
rs = dt &amp;lt;&amp;lt; Make Row State Handler(f);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, it feels like a horrible workaround. The &lt;FONT face="courier new,courier"&gt;Make Row State Handler&lt;/FONT&gt; statement inside the function seems to be necessary because after the first call of &lt;FONT face="courier new,courier"&gt;f()&lt;/FONT&gt; the handler gets forgotten (not sure I understand what's happening here!).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 10:15:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762746#M94254</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2024-06-06T10:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Show labels for selected rows only</title>
      <link>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762779#M94268</link>
      <description>&lt;P&gt;It doesn't work with the code I provided or when using similar idea on your data (for me it works using JMP17.2/JMP18.0 on Windows 10)?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 16:54:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762779#M94268</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-06-06T16:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Show labels for selected rows only</title>
      <link>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762981#M94372</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;It doesn't work with the code I provided or when using similar idea on your data (for me it works using JMP17.2/JMP18.0 on Windows 10)?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Your simple function using &lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;lt; run formulas&lt;/FONT&gt; doesn't work for me in JMP 17.2/18.0 on Mac OS 13.6.7.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 08:36:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Show-labels-for-selected-rows-only/m-p/762981#M94372</guid>
      <dc:creator>matth1</dc:creator>
      <dc:date>2024-06-10T08:36:15Z</dc:date>
    </item>
  </channel>
</rss>

