<?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: JSL loop to create multiple graphs with dynamic range slider boxes at once? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434363#M68414</link>
    <description>&lt;P&gt;OP, this can be relatively easily done, but I don't think many people will want to help you with this as you're asking too much and seem to be too inexperienced to really understand it all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some things to look into while you're filling out your experience level here is the following&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;JSL doesn't really do much automatic scope control -- in particular, it doesn't remember scope states and hierarchies for functions and such -- if you're used to Python for example, then JSL will be quite frustrating and cause you great pains until you internalize this and start doing all of your own scope control&lt;/LI&gt;&lt;LI&gt;For multiple&amp;nbsp;&lt;EM&gt;interactive&lt;/EM&gt;&amp;nbsp;and mostly identical elements (like graphs with slider boxes, where only the graph X/Y / Grouping are changing), expressions will not serve you well.&amp;nbsp; Use instead a function generator or something as you will need to distinguish the slider boxes and which object they link to.&amp;nbsp; Of course this can be done with expressions, but in general it is the more complicated setup with only negligible speed gains in most circumstances&lt;/LI&gt;&lt;LI&gt;Start small, with only one graph and one rangeSliderBox.&amp;nbsp; Learn how to link them using explicit scoping&lt;/LI&gt;&lt;LI&gt;You will need a separate data table for each plot as a table can only have one row state per row&lt;OL&gt;&lt;LI&gt;With this, if you create multiple sub-tables for each plot, it would be best to make them invisible to prevent the user being flooded with data tables.&amp;nbsp; But keep in mind that data table&amp;nbsp;&lt;STRONG&gt;are never implicitly deleted by JMP&lt;/STRONG&gt;.&amp;nbsp; You need to tie the closing of the window to the cleanup of the script -- close all relevant data tables and delete any namespaces used for scoping.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Many people on the community pages here are willing to help but questions should be small and succinct.&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Tue, 09 Nov 2021 00:27:36 GMT</pubDate>
    <dc:creator>ErraticAttack</dc:creator>
    <dc:date>2021-11-09T00:27:36Z</dc:date>
    <item>
      <title>JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/433818#M68365</link>
      <description>&lt;P&gt;I have a code "sample.jsl" which has a loop to create a bi-var plot for each column. I am trying to add a range slider box to this loop so that once I run the script it creates one graph for all the columns with separate range slider box for each graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The limits for all the x-axis columns are in "limits.jmp" and the datafile is "Data.jmp". The code "sample.jsl" creates one graph each for all the parameters at once. I want to modifly the code so that it also adds a range slider box to all the graphs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The range slider box should have the upper control limits (ucl) and lcl as the two dynamic sliders.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this code which creates the range slider box but it just works for a single graph. I need a script which creates all the graphs together with the dynamic range slider boxes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thanks in advance&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=""&gt;myFinalDisplay = expr(
	
	myLimitCol = column(dt, "ColA");  //new
	myLimitMin = colMinimum(myLimitCol); show(myLimitMin); //new
	myLimitMax = colMaximum(myLimitCol); show(myLimitMax);  //new
	mylcl = globalLCL["ColA];  
	myucl = globalUCL["ColA]; 

	myGbDispObj = dt &amp;lt;&amp;lt; Bivariate(
	Size( 550, 400 ),
	Y( "res" ),
	X( "ColA" ),
	Automatic Recalc( 1 ),
	Histogram Borders( 1 ),
	Summary Statistics( 1 ),
	Fit Spline( 2, {Line Color( {212, 73, 88} )} ),
	SendToReport(	
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Row Legend(
				"Grouping",
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Solid" ),
				Continuous Scale( 1 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		),
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Add Ref Line({mylcl, myucl}, "Solid", "Light YellowGreen", "", 1, 0.20 )}
		),			
		Dispatch( {}, "Summary Statistics", OutlineBox, {Close( 1 )} )
	)
);

	myTbLo = textBox(Char(round(myLimitMin, 2)) || " (OOC = " || char(0.00, 10, 2) || "%)");
	myTbHi = textBox(Char(round(myLimitMax, 2)) || " (OOC = " || char(0.00, 10, 2) || "%)");
	
	mySbDispObj = rangeSliderBox();
	mySbDispObj = rangeSliderBox(
		myLimitMin,
		myLimitMax,
		mylcl,
		myucl,
					
		//script

		mySelectedLower = mySbDispObj &amp;lt;&amp;lt; getLower;
		mySelectedUpper = mySbDispObj &amp;lt;&amp;lt; getUpper;
		
		myGbDispObj &amp;lt;&amp;lt; Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
		myGbDispObj &amp;lt;&amp;lt; Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
		
		rUpper = dt &amp;lt;&amp;lt; Get Rows Where( myLimitCol[] &amp;gt; mySelectedUpper );
		OOC_valUpper = (N Items(rUpper) / Col Number( Column(dt, "ColA") ))*100;
		myTbHi &amp;lt;&amp;lt; setText(Char(round(mySelectedUpper, 1)) || " (OOC = " || char(OOC_valUpper, 10, 2) || "%)");

		rLower = dt &amp;lt;&amp;lt; Get Rows Where( myLimitCol[] &amp;lt; mySelectedLower );
		OOC_valLower = (N Items(rLower) / Col Number( Column(dt,  "ColA") ))*100;
		myTbLo &amp;lt;&amp;lt; setText(Char(round(mySelectedLower, 1)) || " (OOC = " || char(OOC_valLower, 10, 2) || "%)");
	);
	mySbDispObj &amp;lt;&amp;lt; Set Width( 275 );
		
	myLayout = vListBox(
		myGbDispObj,
		hListBox(myTbLo, spacerBox(size(50,0)), myTbHi),
		mySbDispObj
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:19:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/433818#M68365</guid>
      <dc:creator>ankitgssingh</dc:creator>
      <dc:date>2023-06-11T11:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/433869#M68369</link>
      <description>&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 23:31:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/433869#M68369</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-11-07T23:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434117#M68389</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;I think the message you posted is not being displayed?&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 08 Nov 2021 15:08:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434117#M68389</guid>
      <dc:creator>ankitgssingh</dc:creator>
      <dc:date>2021-11-08T15:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434123#M68393</link>
      <description>&lt;P&gt;You might try creating a window first with an empty list box where you want the graphs to go, and then append your graphs to that list box using a for loop.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 15:23:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434123#M68393</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-11-08T15:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434191#M68397</link>
      <description>&lt;P&gt;The graphs are working fine and appending into the new window. But I am not able to add&amp;nbsp; a range slider box() object to each of the graphs created using the loop;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 16:44:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434191#M68397</guid>
      <dc:creator>ankitgssingh</dc:creator>
      <dc:date>2021-11-08T16:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434192#M68398</link>
      <description>&lt;P&gt;Here's an example of it affecting some reference lines with a sliderbox for each list. It doesn't delete the previous reference line so you'd have to figure out how you want to do that if that's what you're going for.&amp;nbsp;&amp;nbsp;&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");
summarize(dt, ages = By(:age)); // just some list

nw = new window("Some box");
for(i=1, i&amp;lt;=nitems(ages), i++, 
	olb = outlinebox("Age = " || char(ages[i]), 
		hlistbox(
			rsb = rangesliderbox(colmin(:height), colmax(:height), colquantile(:height, .25), colquantile(:height, .75)), 
			gb = dt &amp;lt;&amp;lt; Graph Builder(
				Show Control Panel( 0 ),
				Variables( X( :weight ), Y( :height ) ),
				where(char(:age) == ages[i])
			);
		)
	);
	(gb&amp;lt;&amp;lt;Parent)[Textbox(1)] &amp;lt;&amp;lt; Delete(); // delete the where textbox()
	nw &amp;lt;&amp;lt; append(olb);
	self = rsb;
	rsb &amp;lt;&amp;lt; Set Function(
		Function({self}, 
			{DEFAULT LOCAL}, 
			gb_report = (self &amp;lt;&amp;lt; Parent())[OutlineBox(1)]; // getting the graph builder report
			gb = gb_report &amp;lt;&amp;lt; Get Scriptable Object(); // in case you want to send stuff to the actual platform
			axis = gb_report[axisbox(2)]; // get the axis
			upper = self &amp;lt;&amp;lt; Get upper();
			lower = self &amp;lt;&amp;lt; Get Lower();
			axis &amp;lt;&amp;lt; Add Ref Line(lower, "Dashed", "blue", "LCL", 4);
			axis &amp;lt;&amp;lt; Add Ref Line(upper, "Dashed", "blue", "UCL", 4);
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Nov 2021 16:50:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434192#M68398</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2021-11-08T16:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434363#M68414</link>
      <description>&lt;P&gt;OP, this can be relatively easily done, but I don't think many people will want to help you with this as you're asking too much and seem to be too inexperienced to really understand it all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some things to look into while you're filling out your experience level here is the following&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;JSL doesn't really do much automatic scope control -- in particular, it doesn't remember scope states and hierarchies for functions and such -- if you're used to Python for example, then JSL will be quite frustrating and cause you great pains until you internalize this and start doing all of your own scope control&lt;/LI&gt;&lt;LI&gt;For multiple&amp;nbsp;&lt;EM&gt;interactive&lt;/EM&gt;&amp;nbsp;and mostly identical elements (like graphs with slider boxes, where only the graph X/Y / Grouping are changing), expressions will not serve you well.&amp;nbsp; Use instead a function generator or something as you will need to distinguish the slider boxes and which object they link to.&amp;nbsp; Of course this can be done with expressions, but in general it is the more complicated setup with only negligible speed gains in most circumstances&lt;/LI&gt;&lt;LI&gt;Start small, with only one graph and one rangeSliderBox.&amp;nbsp; Learn how to link them using explicit scoping&lt;/LI&gt;&lt;LI&gt;You will need a separate data table for each plot as a table can only have one row state per row&lt;OL&gt;&lt;LI&gt;With this, if you create multiple sub-tables for each plot, it would be best to make them invisible to prevent the user being flooded with data tables.&amp;nbsp; But keep in mind that data table&amp;nbsp;&lt;STRONG&gt;are never implicitly deleted by JMP&lt;/STRONG&gt;.&amp;nbsp; You need to tie the closing of the window to the cleanup of the script -- close all relevant data tables and delete any namespaces used for scoping.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Many people on the community pages here are willing to help but questions should be small and succinct.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 09 Nov 2021 00:27:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434363#M68414</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2021-11-09T00:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434364#M68415</link>
      <description>&lt;P&gt;seems clear enough to me&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 00:28:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434364#M68415</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2021-11-09T00:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: JSL loop to create multiple graphs with dynamic range slider boxes at once?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434926#M68448</link>
      <description>&lt;P&gt;Thank you for explaining this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I am experienced in python and new to jsl. Learning on the go.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 15:22:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-loop-to-create-multiple-graphs-with-dynamic-range-slider/m-p/434926#M68448</guid>
      <dc:creator>ankitgssingh</dc:creator>
      <dc:date>2021-11-10T15:22:13Z</dc:date>
    </item>
  </channel>
</rss>

