<?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: How to stretch GB to fill all available space? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550564#M76664</link>
    <description>&lt;P&gt;Other option would be also to create the graph builder directly inside the new window&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("DEMO",
	Add Rows(10),
	New Column("Category", Character, "Nominal", Set Values({"A", "A", "A", "A", "A", "B", "B", "B", "B", "B"})),
	New Column("X", Character, "Nominal", Set Values({"AA", "AD", "AC", "AD", "AC", "BD", "BF", "BF", "BD", "BS"})),
	New Column("Y_veryLongName_toMake_Tabulat_Large",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([12, 32, 42, 23, 21, 12, 34, 53, 23, 12])
	)
);

tab = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel(0),
	Add Table(
		Column Table(Analysis Columns(:Y_veryLongName_toMake_Tabulat_Large), Statistics(Sum, Mean)),
		Row Table(Grouping Columns(:Category, :X))
	)
);

gb_expr = Expr(
	gb = dt &amp;lt;&amp;lt; Graph Builder(
	//Size( 528, 464 ),
		Show Control Panel(0),
		Variables(X(:Category), X(:X, Position(1)), Y(:Y_veryLongName_toMake_Tabulat_Large), Color(:Category)),
		Elements(Points(X(1), X(2), Y, Legend(9)))
	)
);


rtab = tab &amp;lt;&amp;lt; Report;
lb = Lineup Box(N Col(3), rtab, rtab, rtab, Unlineup Box(gb_expr));
nw = New Window("DEMO", Show Menu(0), Show Toolbars(0), lb);

gb &amp;lt;&amp;lt; Auto Stretching("On");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Sep 2022 05:08:51 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-09-29T05:08:51Z</dc:date>
    <item>
      <title>How to stretch GB to fill all available space?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550505#M76661</link>
      <description>&lt;P&gt;Let's say I have a 3 column Line Up box with some display boxes, and then as a second row I have an Unlineup Box with a Graph Builder inside.&lt;/P&gt;&lt;P&gt;Example can be seen by running this script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "DEMO",
	Add Rows( 10 ),
	New Column( "Category",
		Character,
		"Nominal",
		Set Values( {"A", "A", "A", "A", "A", "B", "B", "B", "B", "B"} )
	),
	New Column( "X",
		Character,
		"Nominal",
		Set Values( {"AA", "AD", "AC", "AD", "AC", "BD", "BF", "BF", "BD", "BS"} )
	),
	New Column( "Y_veryLongName_toMake_Tabulat_Large",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [12, 32, 42, 23, 21, 12, 34, 53, 23, 12] )
	)
);


tab = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel( 0 ),
	Add Table(
		Column Table(
			Analysis Columns( :Y_veryLongName_toMake_Tabulat_Large ),
			Statistics( Sum, Mean )
		),
		Row Table( Grouping Columns( :Category, :X ) )
	)
);

gb = dt &amp;lt;&amp;lt; Graph Builder(
	//Size( 528, 464 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Category ),
		X( :X, Position( 1 ) ),
		Y( :Y_veryLongName_toMake_Tabulat_Large ),
		Color( :Category )
	),
	Elements( Points( X( 1 ), X( 2 ), Y, Legend( 9 ) ) )
);


rtab = tab &amp;lt;&amp;lt; Report;
rgb = gb &amp;lt;&amp;lt; Report;

lb = LineUp Box(NCol(3), rtab, rtab, rtab, Unlineup Box(rgb) );

nw = New Window("DEMO", Show Menu(0), Show Toolbars(0), lb);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So this is how it looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-09-28 15_53_40-Window.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45883iEDB30439957F900E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-28 15_53_40-Window.png" alt="2022-09-28 15_53_40-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, I want that Graph Builder to fill all the horizontal space. I don't know the size of that space, so I don't want to specify it directly, I just want it to fill all the space whatever is available.&lt;/P&gt;&lt;P&gt;I tried using Set Auto Stretching (1,0) on rgb, but it didn't help much.&lt;/P&gt;&lt;P&gt;Experimentally, I found out, that if I go to properties and change Stretching for X from Neutral to Fill for EACH AND EVERY BOX from Frame Box all the way to Outline Box, like that:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-09-28 16_00_55-Window.png" style="width: 292px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45885i45640EFD5D23BC38/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-28 16_00_55-Window.png" alt="2022-09-28 16_00_55-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then it looks like I want it to look:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-09-28 15_53_24-Window.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45884i96290F1DA9D75B4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-09-28 15_53_24-Window.png" alt="2022-09-28 15_53_24-Window.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1. Is this the only way?&lt;/P&gt;&lt;P&gt;2. If it is - how to script it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update: I guess I should be able to use XPath with ancestor-or-self (or in simpler variant just ancestor below), but I can't get it to work.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rgb &amp;lt;&amp;lt; Xpath("//FrameBox/ancestor")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 15:59:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550505#M76661</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T15:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to stretch GB to fill all available space?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550512#M76662</link>
      <description>&lt;P&gt;Ok, I tried to more things:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rgb &amp;lt;&amp;lt; Fit To Window("On");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This one did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rgb[FrameBox(1)] &amp;lt;&amp;lt; Set Auto Stretching(1,0);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This one, where I apply Auto Stretching to FrameBox, not the whole report - did work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The questions that I bumped into in the process still stands: What is the proper syntax for XPath Axes? Like, ancestor, child, ancestor-or-self, etc....&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 23:40:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550512#M76662</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-09-28T23:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to stretch GB to fill all available space?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550564#M76664</link>
      <description>&lt;P&gt;Other option would be also to create the graph builder directly inside the new window&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("DEMO",
	Add Rows(10),
	New Column("Category", Character, "Nominal", Set Values({"A", "A", "A", "A", "A", "B", "B", "B", "B", "B"})),
	New Column("X", Character, "Nominal", Set Values({"AA", "AD", "AC", "AD", "AC", "BD", "BF", "BF", "BD", "BS"})),
	New Column("Y_veryLongName_toMake_Tabulat_Large",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([12, 32, 42, 23, 21, 12, 34, 53, 23, 12])
	)
);

tab = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel(0),
	Add Table(
		Column Table(Analysis Columns(:Y_veryLongName_toMake_Tabulat_Large), Statistics(Sum, Mean)),
		Row Table(Grouping Columns(:Category, :X))
	)
);

gb_expr = Expr(
	gb = dt &amp;lt;&amp;lt; Graph Builder(
	//Size( 528, 464 ),
		Show Control Panel(0),
		Variables(X(:Category), X(:X, Position(1)), Y(:Y_veryLongName_toMake_Tabulat_Large), Color(:Category)),
		Elements(Points(X(1), X(2), Y, Legend(9)))
	)
);


rtab = tab &amp;lt;&amp;lt; Report;
lb = Lineup Box(N Col(3), rtab, rtab, rtab, Unlineup Box(gb_expr));
nw = New Window("DEMO", Show Menu(0), Show Toolbars(0), lb);

gb &amp;lt;&amp;lt; Auto Stretching("On");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Sep 2022 05:08:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550564#M76664</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-29T05:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to stretch GB to fill all available space?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550570#M76665</link>
      <description>&lt;P&gt;Well, it's a good way of doing that, except in my use case this script runs on many tables that a user consecutively loads, and this window nw gets those Line Up Boxes appended one after another. With each next table the previous one closes, so I cannot have live graphs, I need to have reports that would stay after the rtable is closed.&lt;/P&gt;&lt;P&gt;I tried running this expression:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb_expr = Expr(
	(gb = dt &amp;lt;&amp;lt; Graph Builder(
	//Size( 528, 464 ),
		Show Control Panel(0),
		Variables(X(:Category), X(:X, Position(1)), Y(:Y_veryLongName_toMake_Tabulat_Large), Color(:Category)),
		Elements(Points(X(1), X(2), Y, Legend(9)))
	))&amp;lt;&amp;lt;Report
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but it didn't work. Any idea how to modify it so that Graph Builder wouldn't disappear from the window if I close the table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 05:53:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/550570#M76665</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-09-29T05:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to stretch GB to fill all available space?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/551256#M76715</link>
      <description>&lt;P&gt;I think it works if you set Auto Stretching on the Frame Box after the report is cloned:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lb = LineUp Box(NCol(3), rtab, rtab, rtab, Unlineup Box(rgb) );
lb[FrameBox(1)] &amp;lt;&amp;lt; Set Auto Stretching(1,0);
nw = New Window("DEMO", Show Menu(0), Show Toolbars(0), lb);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Stretching properties are usually cleared when boxes are cloned, because behaviors do not always translate when the layout changes.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 13:21:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-stretch-GB-to-fill-all-available-space/m-p/551256#M76715</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2022-09-30T13:21:47Z</dc:date>
    </item>
  </channel>
</rss>

