<?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 correctly use Graph Builder and Slider box in different windows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78452#M36415</link>
    <description>&lt;P&gt;I would use graph builder in combination with slider to change the appearance of the plot.&amp;nbsp;In the example below&amp;nbsp;I create a window with a map and a slider box to change interactively the scale of the colors. I would&amp;nbsp;use the script to create different windows (of course, even with different variables, but in the example this stuff is not needed).&amp;nbsp;It works just for the last created window, despite I try to assign the variables using namespaces. I tried different way but all unsuccessfully. Can anyone help?&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);
dtable= Open("$SAMPLE_DATA/SAT.jmp");
name="Map";
For(k=1, k&amp;lt;=10, k++,
    If(Namespace Exists(Eval("ns" || name || Char(k))),
        //If(k = 10,
        // hanlde the max number of allowed namespaces
        //);
      ,
    name= name || char(k);
    nsRef = New Namespace(Eval("ns" || name ));
    Break();
      )
);
　
nsRef &amp;lt;&amp;lt; Insert("column", "% Taking (2004)");
nsRef &amp;lt;&amp;lt; Insert("min", col min(column(dtable, "% Taking (2004)")));
nsRef &amp;lt;&amp;lt; Insert("max", col max(column(dtable, "% Taking (2004)")));
nsRef &amp;lt;&amp;lt; Insert("slmin", col min(column(dtable, "% Taking (2004)")));
nsRef &amp;lt;&amp;lt; Insert("slmax", col max(column(dtable, "% Taking (2004)")));
　
datacolumn=column(dtable, nsRef:column );
　
nsRef &amp;lt;&amp;lt; Insert("slider1",
    slider box(nsRef:min,nsRef:max,nsRef:slmax,
        title= Current Window() &amp;lt;&amp;lt; Get Window Title;
        ns = NameSpace(Eval("ns" || title));
             slmin=ns:slmin;
                slmax=ns:slmax;
        scale=Matrix( {slmin,slmax} );
             scale=scale`;
        ns:gb &amp;lt;&amp;lt;SendToReport( 
                       Dispatch({},"400",
                       ScaleBox,
                           {Legend Model( 3,
                           Properties(0,{gradient( {Scale Values( scale ), Width( 12 )} )})
                            )}
                      )
               );
        );
);
 
new window(name,
nsRef &amp;lt;&amp;lt; Insert("gb",
          Graph Builder(
             Show Control Panel( 0 ),
             Variables( Color( datacolumn ), Shape( :State ) ),
             Elements(
                                  Map Shapes(
                      Legend( 2 ),
                      Summary Statistic( "Mean" ),
                      Show Missing Shapes( 0 )
                                 )
                          ),
                          SendToReport(
                                 Dispatch({},"",
                               ScaleBox,
                   {Scale( "Geodesic" ), Min( -137.654643872302 ), Max( -63.2427990180921 ),
                   Inc( 10 ), Minor Ticks( 0 )}
 
                                ),
                                Dispatch({},"",
                     ScaleBox( 2 ),
                     {Scale( "Geodesic" ), Min( 16.7170042692343 ), Max( 80.0833409028976 ),
                     Inc( 10 ), Minor Ticks( 0 )}
                          )
                     )
               ),
 ),
H List Box(
Text Box("scale: max"),
      nsRef:slider1,
),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 13:44:14 GMT</pubDate>
    <dc:creator>antonio-domenic</dc:creator>
    <dc:date>2018-10-09T13:44:14Z</dc:date>
    <item>
      <title>how correctly use Graph Builder and Slider box in different windows</title>
      <link>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78452#M36415</link>
      <description>&lt;P&gt;I would use graph builder in combination with slider to change the appearance of the plot.&amp;nbsp;In the example below&amp;nbsp;I create a window with a map and a slider box to change interactively the scale of the colors. I would&amp;nbsp;use the script to create different windows (of course, even with different variables, but in the example this stuff is not needed).&amp;nbsp;It works just for the last created window, despite I try to assign the variables using namespaces. I tried different way but all unsuccessfully. Can anyone help?&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);
dtable= Open("$SAMPLE_DATA/SAT.jmp");
name="Map";
For(k=1, k&amp;lt;=10, k++,
    If(Namespace Exists(Eval("ns" || name || Char(k))),
        //If(k = 10,
        // hanlde the max number of allowed namespaces
        //);
      ,
    name= name || char(k);
    nsRef = New Namespace(Eval("ns" || name ));
    Break();
      )
);
　
nsRef &amp;lt;&amp;lt; Insert("column", "% Taking (2004)");
nsRef &amp;lt;&amp;lt; Insert("min", col min(column(dtable, "% Taking (2004)")));
nsRef &amp;lt;&amp;lt; Insert("max", col max(column(dtable, "% Taking (2004)")));
nsRef &amp;lt;&amp;lt; Insert("slmin", col min(column(dtable, "% Taking (2004)")));
nsRef &amp;lt;&amp;lt; Insert("slmax", col max(column(dtable, "% Taking (2004)")));
　
datacolumn=column(dtable, nsRef:column );
　
nsRef &amp;lt;&amp;lt; Insert("slider1",
    slider box(nsRef:min,nsRef:max,nsRef:slmax,
        title= Current Window() &amp;lt;&amp;lt; Get Window Title;
        ns = NameSpace(Eval("ns" || title));
             slmin=ns:slmin;
                slmax=ns:slmax;
        scale=Matrix( {slmin,slmax} );
             scale=scale`;
        ns:gb &amp;lt;&amp;lt;SendToReport( 
                       Dispatch({},"400",
                       ScaleBox,
                           {Legend Model( 3,
                           Properties(0,{gradient( {Scale Values( scale ), Width( 12 )} )})
                            )}
                      )
               );
        );
);
 
new window(name,
nsRef &amp;lt;&amp;lt; Insert("gb",
          Graph Builder(
             Show Control Panel( 0 ),
             Variables( Color( datacolumn ), Shape( :State ) ),
             Elements(
                                  Map Shapes(
                      Legend( 2 ),
                      Summary Statistic( "Mean" ),
                      Show Missing Shapes( 0 )
                                 )
                          ),
                          SendToReport(
                                 Dispatch({},"",
                               ScaleBox,
                   {Scale( "Geodesic" ), Min( -137.654643872302 ), Max( -63.2427990180921 ),
                   Inc( 10 ), Minor Ticks( 0 )}
 
                                ),
                                Dispatch({},"",
                     ScaleBox( 2 ),
                     {Scale( "Geodesic" ), Min( 16.7170042692343 ), Max( 80.0833409028976 ),
                     Inc( 10 ), Minor Ticks( 0 )}
                          )
                     )
               ),
 ),
H List Box(
Text Box("scale: max"),
      nsRef:slider1,
),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 13:44:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78452#M36415</guid>
      <dc:creator>antonio-domenic</dc:creator>
      <dc:date>2018-10-09T13:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: how correctly use Graph Builder and Slider box in different windows</title>
      <link>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78507#M36431</link>
      <description>&lt;P&gt;You are movng in the correct direction. You do need a local space, and depending upon the task here are several options, that I would recommend:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Since you are only changing the legend, and each GB will be in a separate window, a simple method to do this is to use the window scope, window namespace &lt;STRONG&gt;window:slider1 = SliderBox()&lt;/STRONG&gt;. See the attached script.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;If only the legend is being changed and if you have multiple GBs in the window, use a&amp;nbsp; &lt;STRONG&gt;&amp;lt;&amp;lt;Set Function( Function())&lt;/STRONG&gt; for the slider box that uses a relative reference to the corresponding GB. If the GB, and HListBox(TextBox, Sliderbox) are nested in a VListBox the function would be something like&amp;nbsp; (this&amp;lt;&amp;lt; parent)&amp;lt;&amp;lt;parent to get to theVListBox then you can use messages to get to the legendbox and make the changes.&amp;nbsp; I like to use Xpath(). This type of coding is a little trickier.&lt;/LI&gt;&lt;LI&gt;Suppose you have multiple GBs with different Y's&amp;nbsp; but same X. If you wanted to limit X&amp;nbsp; or exclude a row for Y1 but not Y2, then each GB should have its own &lt;STRONG&gt;Data Filter Context Box()&lt;/STRONG&gt;, local data filter.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Hopefully, the attached script that uses window scoping will meet your&amp;nbsp; current need.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 21:41:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78507#M36431</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-10-09T21:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: how correctly use Graph Builder and Slider box in different windows</title>
      <link>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78556#M36460</link>
      <description>excellent!! simple and effective. I appreciate your additional suggestions.&lt;BR /&gt;Thanks a lot!</description>
      <pubDate>Wed, 10 Oct 2018 12:50:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-correctly-use-Graph-Builder-and-Slider-box-in-different/m-p/78556#M36460</guid>
      <dc:creator>antonio-domenic</dc:creator>
      <dc:date>2018-10-10T12:50:22Z</dc:date>
    </item>
  </channel>
</rss>

