<?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 How to dynamically create and address namespaces? Independent handles on multiple GB plots. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900232#M106022</link>
    <description>&lt;P&gt;All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't wrap my head around this problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to put handles on my GB plots. I have multiple GB plots in one window. The variables in the handles script cross-talk. I need to either use new variables in each script, or create a new namespace for each graphics script (seems the way to go for me). But then again - as soon as I create a namespace, I address it through a reference variable - which gets overwritten each time I create a new namespace.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the example below I just use different variable names, but it needs to be&amp;nbsp; created dynamically and addressed properly.&lt;/P&gt;
&lt;P&gt;I remember there was some trick using something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ns = Namespace( Expr( ns &amp;lt;&amp;lt; Get Name ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I'm not sure if it is applicable in this case and to be frankly I'm not sure I understand how and why it's working where I'm currently using it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
lub = Lineup Box( N Col( 2 ) );



ns1 = New Namespace(
	"height"
);
ns1:_x_location_ = 2;
ns1:_y_location_ = 50;
lub &amp;lt;&amp;lt; Append(Graph Builder(
	Size( 528, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :height ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 6 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "" ),
				Handle(
					ns1:_x_location_,
					ns1:_y_location_,
					ns1:_x_location_ = x;
					ns1:_y_location_ = y;
				)
			)}
		)
	)
);
);

ns2 = New Namespace(
	"weight"
);
ns2:_x_location_ = 2;
ns2:_y_location_ = 50;
lub &amp;lt;&amp;lt; Append(Graph Builder(
	Size( 528, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 6 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "" ),
				Handle(
					ns2:_x_location_,
					ns2:_y_location_,
					ns2:_x_location_ = x;
					ns2:_y_location_ = y;
				)
			)}
		)
	)
);
);
win = New Window( "Independent Handles Example",lub);&lt;/CODE&gt;&lt;/PRE&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>Sat, 13 Sep 2025 17:53:35 GMT</pubDate>
    <dc:creator>miguello</dc:creator>
    <dc:date>2025-09-13T17:53:35Z</dc:date>
    <item>
      <title>How to dynamically create and address namespaces? Independent handles on multiple GB plots.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900232#M106022</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't wrap my head around this problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to put handles on my GB plots. I have multiple GB plots in one window. The variables in the handles script cross-talk. I need to either use new variables in each script, or create a new namespace for each graphics script (seems the way to go for me). But then again - as soon as I create a namespace, I address it through a reference variable - which gets overwritten each time I create a new namespace.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the example below I just use different variable names, but it needs to be&amp;nbsp; created dynamically and addressed properly.&lt;/P&gt;
&lt;P&gt;I remember there was some trick using something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ns = Namespace( Expr( ns &amp;lt;&amp;lt; Get Name ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I'm not sure if it is applicable in this case and to be frankly I'm not sure I understand how and why it's working where I'm currently using it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
lub = Lineup Box( N Col( 2 ) );



ns1 = New Namespace(
	"height"
);
ns1:_x_location_ = 2;
ns1:_y_location_ = 50;
lub &amp;lt;&amp;lt; Append(Graph Builder(
	Size( 528, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :height ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 6 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "" ),
				Handle(
					ns1:_x_location_,
					ns1:_y_location_,
					ns1:_x_location_ = x;
					ns1:_y_location_ = y;
				)
			)}
		)
	)
);
);

ns2 = New Namespace(
	"weight"
);
ns2:_x_location_ = 2;
ns2:_y_location_ = 50;
lub &amp;lt;&amp;lt; Append(Graph Builder(
	Size( 528, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 6 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "" ),
				Handle(
					ns2:_x_location_,
					ns2:_y_location_,
					ns2:_x_location_ = x;
					ns2:_y_location_ = y;
				)
			)}
		)
	)
);
);
win = New Window( "Independent Handles Example",lub);&lt;/CODE&gt;&lt;/PRE&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>Sat, 13 Sep 2025 17:53:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900232#M106022</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-13T17:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically create and address namespaces? Independent handles on multiple GB plots.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900242#M106023</link>
      <description>&lt;P&gt;I think you could just skip namespaces (in this case) and utilize Context Box&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
lub = Lineup Box(N Col(2));

lub &amp;lt;&amp;lt; Append(
	cb1 = Context Box(
		box:_x_location_ = 2;
		box:_y_location_ = 50;,
		Graph Builder(
			Size(528, 450),
			Show Control Panel(0),
			Variables(X(:age), Y(:height), Overlay(:sex)),
			Elements(Points(X, Y, Legend(6))),
			SendToReport(
				Dispatch({}, "Graph Builder", FrameBox,
					{Add Graphics Script(
						2,
						Description(""),
						Handle(
							box:_x_location_,
							box:_y_location_,
							box:_x_location_ = x;
							box:_y_location_ = y;
						)
					)}
				)
			)
		)
	)
);

lub &amp;lt;&amp;lt; Append(
	cb2 = Context Box(
		box:_x_location_ = 2;
		box:_y_location_ = 50;,
		Graph Builder(
			Size(528, 450),
			Show Control Panel(0),
			Variables(X(:age), Y(:weight), Overlay(:sex)),
			Elements(Points(X, Y, Legend(6))),
			SendToReport(
				Dispatch({}, "Graph Builder", FrameBox,
					{Add Graphics Script(
						2,
						Description(""),
						Handle(
							box:_x_location_,
							box:_y_location_,
							box:_x_location_ = x;
							box:_y_location_ = y;
						)
					)}
				)
			)
		)
	)
);

win = New Window("Independent Handles Example", lub);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Sep 2025 18:19:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900242#M106023</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-13T18:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically create and address namespaces? Independent handles on multiple GB plots.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900243#M106024</link>
      <description>&lt;P&gt;So if I'm dynamically creating these GBs and adding them to my Line Up Box, this Context Box should isolate variables inside itself just like {Default Local} does that inside a function? Let me try that.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2025 18:42:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900243#M106024</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-13T18:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically create and address namespaces? Independent handles on multiple GB plots.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900245#M106025</link>
      <description>&lt;P&gt;Nope, doesn't work. Handles do not behave independently. I move the handle on Plot 1, as soon as I click on Plot 2 handle there jumps to the location where the handle is on Plot 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
lub = Lineup Box( N Col( 2 ) );




lub &amp;lt;&amp;lt; Append(
	Context Box(
		_x_location_ = 2;
		_y_location_ = 50;

		Graph Builder(
			Size( 528, 450 ),
			Show Control Panel( 0 ),
			Variables( X( :age ), Y( :height ), Overlay( :sex ) ),
			Elements( Points( X, Y, Legend( 6 ) ) ),
			SendToReport(
				Dispatch(
					{},
					"Graph Builder",
					FrameBox,
					{Add Graphics Script(
						2,
						Description( "" ),
						Handle(
							_x_location_,
							_y_location_,
							_x_location_ = x;
							_y_location_ = y;
						)
					)}
				)
			)
		);
	)
);



lub &amp;lt;&amp;lt; Append(
	Context Box(
		_x_location_ = 2;
		_y_location_ = 50;

		Graph Builder(
			Size( 528, 450 ),
			Show Control Panel( 0 ),
			Variables( X( :age ), Y( :weight ), Overlay( :sex ) ),
			Elements( Points( X, Y, Legend( 6 ) ) ),
			SendToReport(
				Dispatch(
					{},
					"Graph Builder",
					FrameBox,
					{Add Graphics Script(
						2,
						Description( "" ),
						Handle(
							_x_location_,
							_y_location_,
							_x_location_ = x;
							_y_location_ = y;
						)
					)}
				)
			)
		);
	)
);
win = New Window( "Independent Handles Example", lub );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2025 19:10:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900245#M106025</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-13T19:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically create and address namespaces? Independent handles on multiple GB plots.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900246#M106026</link>
      <description>&lt;P&gt;Compare our scripts and you will most definitely notice a difference (just having Context Box isn't enough, you also have to utilize it).&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2025 19:12:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900246#M106026</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-13T19:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically create and address namespaces? Independent handles on multiple GB plots.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900248#M106027</link>
      <description>&lt;P&gt;Oops, sorry... :)&lt;/img&gt; My bad :)&lt;/img&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When correctly written, it DOES work. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2025 20:13:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-dynamically-create-and-address-namespaces-Independent/m-p/900248#M106027</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-09-13T20:13:24Z</dc:date>
    </item>
  </channel>
</rss>

