<?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: Remove and add wrap variables in graph builder with JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/368514#M61843</link>
    <description>&lt;P&gt;Code snippet to add and remove a wrap variable. This came from the online discovery summit 2021 unsession JSL scripting.&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" );

//make initial graph
gb = Graph Builder(
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y ), Smoother( X, Y ) )
);

//get a reference to the grab builder box
gbb = Report( gb )[Graph Builder Box( 1 )];

Wait( 1 );

//add a wrap variable to demonstrate adding
gbb &amp;lt;&amp;lt; Add Variable( {:age, Role( "Wrap" )} );

Wait( 1 );

//remove wrap variable
gbb &amp;lt;&amp;lt; Remove Variable(  {:age, Role( "Wrap" )});

Wait( 1 );

//add graphics script
gbb[frame box( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	2,
	Description( "" ),
	If( Is Empty( g_x4 ),
		g_x4 = [52.92, 68.48, 70.56];
		g_y4 = [119.69, 139.30, 124.01];
	);
	Drag Line( g_x4, g_y4 );
);

//add wrap variable			
gbb &amp;lt;&amp;lt; Add Variable( {:age, Role( "Wrap" )} );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Script by&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;THX a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 08:50:36 GMT</pubDate>
    <dc:creator>Mauro_Gerber</dc:creator>
    <dc:date>2021-03-17T08:50:36Z</dc:date>
    <item>
      <title>Remove and add wrap variables in graph builder with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/366077#M61574</link>
      <description>&lt;P&gt;When I manually add a line in graph builder via the costume graph script function in the window and then wrap or group it with a nominal variable, the stacked windows will have the same costume line copied.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right click in the graph windows --&amp;gt; Customize --&amp;gt; click on the “+” button (add the “Script” entry) and add the line script (for example with the Samples --&amp;gt; “Drag Line” option).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I then save the script to the data table, every windows has now an entry to add the costume graph and can become very long. I would need to program a complicated for loop to add the graph code to each window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to make the same steps in JSL as by hand:&lt;/P&gt;&lt;P&gt;- create graph&lt;/P&gt;&lt;P&gt;- set costume line&lt;/P&gt;&lt;P&gt;- add the wrap column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:11:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/366077#M61574</guid>
      <dc:creator>Mauro_Gerber</dc:creator>
      <dc:date>2023-06-11T11:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Remove and add wrap variables in graph builder with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/366101#M61577</link>
      <description>&lt;P&gt;The following example uses the &amp;lt;&amp;lt;Add Graphics Script() message to add the Drag Line.&amp;nbsp;&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" );

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 2 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

Report( gb )[FrameBox( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	If( Is Empty( g_x1 ),
		g_x1 = [50.53, 66.28, 64.49];
		g_y1 = [102.99, 45.69, 106.10];
	);
	Drag Line( g_x1, g_y1 );
);

Report( gb )[Graph Builder Box( 1 )] &amp;lt;&amp;lt; Add Variable( {:age, Role( "Wrap" )} );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 15:01:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/366101#M61577</guid>
      <dc:creator>Wendy_Murphrey</dc:creator>
      <dc:date>2021-03-08T15:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Remove and add wrap variables in graph builder with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/368514#M61843</link>
      <description>&lt;P&gt;Code snippet to add and remove a wrap variable. This came from the online discovery summit 2021 unsession JSL scripting.&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" );

//make initial graph
gb = Graph Builder(
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y ), Smoother( X, Y ) )
);

//get a reference to the grab builder box
gbb = Report( gb )[Graph Builder Box( 1 )];

Wait( 1 );

//add a wrap variable to demonstrate adding
gbb &amp;lt;&amp;lt; Add Variable( {:age, Role( "Wrap" )} );

Wait( 1 );

//remove wrap variable
gbb &amp;lt;&amp;lt; Remove Variable(  {:age, Role( "Wrap" )});

Wait( 1 );

//add graphics script
gbb[frame box( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
	2,
	Description( "" ),
	If( Is Empty( g_x4 ),
		g_x4 = [52.92, 68.48, 70.56];
		g_y4 = [119.69, 139.30, 124.01];
	);
	Drag Line( g_x4, g_y4 );
);

//add wrap variable			
gbb &amp;lt;&amp;lt; Add Variable( {:age, Role( "Wrap" )} );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Script by&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;THX a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 08:50:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remove-and-add-wrap-variables-in-graph-builder-with-JSL/m-p/368514#M61843</guid>
      <dc:creator>Mauro_Gerber</dc:creator>
      <dc:date>2021-03-17T08:50:36Z</dc:date>
    </item>
  </channel>
</rss>

