<?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: Get the title from a Graph Builder Panel in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818582#M99696</link>
    <description>&lt;P&gt;If you check the XML for single GraphBuilderGroupBox you can see that you are looking for the value from XML&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;"&amp;lt;GraphBuilderGroupBox width=\!"570\!" height=\!"24\!" selected=\!"true\!"&amp;gt;age = 12&amp;lt;/GraphBuilderGroupBox&amp;gt;"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And you can get that value using XPath&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;gbb_texts = (Report(gb) &amp;lt;&amp;lt; XPath("(//GraphBuilderGroupBox/text())"));&lt;BR /&gt;// {"age = 12", "age = 13", "age = 14", "age = 15", "age = 16", "age = 17"}&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And if you just want to get the first one, you can limit the index already in XPath (like you have done) and then take first index from that as &amp;lt;&amp;lt; XPath will return a list (I would most likely skip XPath index in this case, as you still have to use JMP's index)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gbb_text = (Report(gb) &amp;lt;&amp;lt; XPath("((//GraphBuilderGroupBox/text()))[1]"))[1];&lt;BR /&gt;// or gbb_text = (Report(gb) &amp;lt;&amp;lt; XPath("(//GraphBuilderGroupBox)[1]/text()"))[1];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with just JMP index&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gbb_text= (Report(gb) &amp;lt;&amp;lt; XPath("//GraphBuilderGroupBox/text()"))[1];&lt;/CODE&gt;&lt;/PRE&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(
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Page(:age), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);

group_texts = (Report(gb) &amp;lt;&amp;lt; XPath("//GraphBuilderGroupBox/text()"));
// {"age = 12", "age = 13", "age = 14", "age = 15", "age = 16", "age = 17"}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Nov 2024 14:03:51 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-11-23T14:03:51Z</dc:date>
    <item>
      <title>Get the title from a Graph Builder Panel</title>
      <link>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818485#M99691</link>
      <description>&lt;P&gt;I could use some help on why I can't get the title of the 1st panel in this Graph builder&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_0-1732311827428.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70540iAE4F4EBA905D31C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1732311827428.png" alt="shampton82_0-1732311827428.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;report=current report();
test=(report&amp;lt;&amp;lt; XPath("(//OutlineBox[text()='Graph Builder']//GraphBuilderGroupBox)[2]"))&amp;lt;&amp;lt;get title;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for any suggestions!&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 21:44:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818485#M99691</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2024-11-22T21:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get the title from a Graph Builder Panel</title>
      <link>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818572#M99695</link>
      <description>&lt;P&gt;Ah, interesting. I never noticed - or cared:&lt;BR /&gt;With some Xpath Parsers, one already gets the content of the node&lt;BR /&gt;&lt;A href="https://www.w3schools.com/xml/xpath_examples.asp" target="_blank" rel="noopener"&gt;https://www.w3schools.com/xml/xpath_examples.asp&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;A href="http://xpather.com/" target="_blank" rel="noopener"&gt;http://xpather.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;E.g. after pasting the result of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;xml= current report() &amp;lt;&amp;lt; Get XML;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;into&amp;nbsp;&lt;A href="http://xpather.com/" target="_blank" rel="noopener"&gt;http://xpather.com/&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and searching for&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(//OutlineBox[text()='Graph Builder']//GraphBuilderGroupBox)[2]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;one gets: "age = 13"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1732472523457.png" style="width: 873px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70565i33E33D4131C2B365/image-dimensions/873x214?v=v2" width="873" height="214" role="button" title="hogi_0-1732472523457.png" alt="hogi_0-1732472523457.png" /&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;JMP and others&amp;nbsp;&lt;BR /&gt;&lt;A href="https://www.freeformatter.com/xpath-tester.html" target="_blank" rel="noopener"&gt;https://www.freeformatter.com/xpath-tester.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://magictool.ai/tool/xpath-tester/de/" target="_blank" rel="noopener"&gt;https://magictool.ai/tool/xpath-tester/de/&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;A href="http://xpather.com/" target="_blank" rel="noopener"&gt;http://xpather.com/&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;(setting: node)&lt;/SPAN&gt;&lt;BR /&gt;return the surrounding "object".&lt;/P&gt;&lt;P&gt;So, one has to retrieve the content of the node in a separate step ...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I guess there is an easier way than this one ...&lt;BR /&gt;Till somebody posts it, you can use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;report=current report();
test=(report&amp;lt;&amp;lt; XPath("(//OutlineBox[text()='Graph Builder']//GraphBuilderGroupBox)[2]"))[1];
xml= test &amp;lt;&amp;lt; Get XML;
Regex (xml, "&amp;gt;(.*?)&amp;lt;\/GraphBuilderGroupBox&amp;gt;", "\1")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;by the way - thank you for the trick:&amp;nbsp;&lt;BR /&gt;direct indexing via [2] is possible&amp;nbsp;in XPath - cool, thanks!!!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1732473096200.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70566i829E7698456BAD5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1732473096200.png" alt="hogi_1-1732473096200.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2024 18:47:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818572#M99695</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-11-24T18:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get the title from a Graph Builder Panel</title>
      <link>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818582#M99696</link>
      <description>&lt;P&gt;If you check the XML for single GraphBuilderGroupBox you can see that you are looking for the value from XML&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;"&amp;lt;GraphBuilderGroupBox width=\!"570\!" height=\!"24\!" selected=\!"true\!"&amp;gt;age = 12&amp;lt;/GraphBuilderGroupBox&amp;gt;"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And you can get that value using XPath&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;gbb_texts = (Report(gb) &amp;lt;&amp;lt; XPath("(//GraphBuilderGroupBox/text())"));&lt;BR /&gt;// {"age = 12", "age = 13", "age = 14", "age = 15", "age = 16", "age = 17"}&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And if you just want to get the first one, you can limit the index already in XPath (like you have done) and then take first index from that as &amp;lt;&amp;lt; XPath will return a list (I would most likely skip XPath index in this case, as you still have to use JMP's index)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gbb_text = (Report(gb) &amp;lt;&amp;lt; XPath("((//GraphBuilderGroupBox/text()))[1]"))[1];&lt;BR /&gt;// or gbb_text = (Report(gb) &amp;lt;&amp;lt; XPath("(//GraphBuilderGroupBox)[1]/text()"))[1];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with just JMP index&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gbb_text= (Report(gb) &amp;lt;&amp;lt; XPath("//GraphBuilderGroupBox/text()"))[1];&lt;/CODE&gt;&lt;/PRE&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(
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Page(:age), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);

group_texts = (Report(gb) &amp;lt;&amp;lt; XPath("//GraphBuilderGroupBox/text()"));
// {"age = 12", "age = 13", "age = 14", "age = 15", "age = 16", "age = 17"}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 14:03:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818582#M99696</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-23T14:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get the title from a Graph Builder Panel</title>
      <link>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818587#M99700</link>
      <description>&lt;P&gt;Woot woot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&amp;nbsp; As usual, fast and amazing help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason for the ask was that I need to have different axis settings for different panels but since the # of panels change the hard coding of the axis range from the saved script Graph Builder makes (e.g. Scalebox(2)) causes the charts to be all messed up on later times when I run it. So I can now use this code to loop through the panels, check what is there, and then set the axis min and max correctly.&amp;nbsp; Still a lot of painful coding to do but at least now I have a path!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 17:03:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-the-title-from-a-Graph-Builder-Panel/m-p/818587#M99700</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2024-11-23T17:03:05Z</dc:date>
    </item>
  </channel>
</rss>

