- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Hiding 'Where (...)' textboxes in graphics using JSL
Hello,
Is it possible to hide/remove the line of text with Where(col="x") as shown in the attached image using scripting? I'm new to JMP and haven't quite figured out all the ins and outs yet.
I have a set of stacked data where all of the metabolites/count labels (pH, osmo, etc) are in one column and all of the corresponding data is in another. In my case, the where() textbox is irrelevant since I've renamed my figure titles with the same label. I can manually hide the text box temporarily by right clicking when I view the image in JMP, but aren't sure how to hide it using JSL and keep it hidden when I export to html.
Here is an example script for one of my graphics:
Graph Builder(
Size( 531, 464 ),
Show Control Panel( 0 ),
Variables(
X( :Step ),
Y( :Name( "BR Metabolite/Count Data" ) ),
Overlay( :Run )
),
Elements(
Line( X, Y, Legend( 1 ) ),
Points( X, Y, Legend( 2 ), Jitter Limit( 0.2018 ) )
),
Where( :Name( "Metabolite/Count" ) == "pH" ),
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{Set Title( "pH" ), Image Export Display( Normal )}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "pH vs. Step" )}
),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "pH" )} )
)
);
Thank you for the help!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
Here is one way of handling it
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
New Window( "big class - Graph Builder", vlb = V List Box() );
gb1 = Graph Builder(
invisible,
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :age == 12 )
);
(Report( gb1 ) << top parent)[Text Box( 1 )] << delete;
vlb << append( Report( gb1 ) );
gb2 = Graph Builder(
invisible,
Variables( X( :weight ), Y( :height ) ),
Show Control Panel( 0 ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :age == 13 )
);
(Report( gb2 ) << top parent)[Text Box( 1 )] << delete;
vlb << append( Report( gb2 ) );
gb3 = Graph Builder(
invisible,
Variables( X( :weight ), Y( :height ) ),
Show Control Panel( 0 ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :age == 14 )
);
(Report( gb2 ) << top parent)[Text Box( 1 )] << delete;
vlb << append( Report( gb3 ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
This should work
gb = Graph Builder(
Size( 531, 464 ),
Show Control Panel( 0 ),
Variables(
X( :Step ),
Y( :Name( "BR Metabolite/Count Data" ) ),
Overlay( :Run )
),
Elements(
Line( X, Y, Legend( 1 ) ),
Points( X, Y, Legend( 2 ), Jitter Limit( 0.2018 ) )
),
Where( :Name( "Metabolite/Count" ) == "pH" ),
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{Set Title( "pH" ), Image Export Display( Normal )}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "pH vs. Step" )}
),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "pH" )} )
)
);
(Report( gb ) << top parent)[Text Box( 1 )] << delete;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
The use of the << Delete message in this case will affect the change that you want probably without repercussions. A safer change is available through the << Visibility message. Use the Collapse argument to make it invisible and not save its space in the window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
Thanks for your help.
It works great for a single figure, but isn't adding any of the modified figures to my vlistbox now. It always spits out a blank box when I try to combine them. I also tried <<visibility(1) and had the same results.
(Report( gb1 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb2 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb3 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb4 ) << top parent)[Text Box( 1 )] << delete;
//(Report( gb5 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb6 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb7 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb8 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb9 ) << top parent)[Text Box( 1 )] << delete;
(Report( gb10 ) << top parent)[Text Box( 1 )] << delete;
fig3 = expr(
New Window( "Production Bioreactor - Metabolites/Counts",
V List Box(gb1,gb2,gb3,gb4, gb6, gb7,gb8,gb9,gb10,gb11,gb12,gb13
)
));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
Without seeing your full script, it is pretty hard to determine where the issue is. My other question is, why are you doing all of the deletes at a single point in your code, rather than having the delete code at the point where the graph is being produced? Or are you using a By clause in your code, which changes the Display Tree structure to a completely different hierarchy from the single stand alone graph.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
No worries. Thanks for your help regardless. I'll mess around and see if I can get something to work.
Like I said, I'm new to JMP so not everything is streamlined very efficiently at this point. I was originally making all of my graphics directly inside of my vlistbox, but wasn't sure how to incorporate your line of code into that. So I pulled all my figures out of the vlistbox and added all of the delete lines separately.
I was using the By clause originally but ran into several issues adding the report to a web report. So I instead of save by-group script to clipboard, I used save script to scriptwindow (all objects) like example below:
Graph Builder(
Variables( X( :Passage Number ), Y( :Preculture Data ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
By( :Name( "Metabolite/Count" ) )
);
New Window( "PCstack - Graph Builder",
V List Box(
Graph Builder(
Variables( X( :Passage Number ), Y( :Preculture Data ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :Name( "Metabolite/Count" ) == "VCD at Split" )
),
Graph Builder(
Variables( X( :Passage Number ), Y( :Preculture Data ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :Name( "Metabolite/Count" ) == "Viability at Split" )
),
Graph Builder(
Variables( X( :Passage Number ), Y( :Preculture Data ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :Name( "Metabolite/Count" ) == "VCD at Inoc" )
),
Graph Builder(
Variables( X( :Passage Number ), Y( :Preculture Data ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :Name( "Metabolite/Count" ) == "PDL" )
),
Graph Builder(
Variables( X( :Passage Number ), Y( :Preculture Data ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :Name( "Metabolite/Count" ) == "PDT(h)" )
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
Here is one way of handling it
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
New Window( "big class - Graph Builder", vlb = V List Box() );
gb1 = Graph Builder(
invisible,
Size( 528, 456 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :age == 12 )
);
(Report( gb1 ) << top parent)[Text Box( 1 )] << delete;
vlb << append( Report( gb1 ) );
gb2 = Graph Builder(
invisible,
Variables( X( :weight ), Y( :height ) ),
Show Control Panel( 0 ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :age == 13 )
);
(Report( gb2 ) << top parent)[Text Box( 1 )] << delete;
vlb << append( Report( gb2 ) );
gb3 = Graph Builder(
invisible,
Variables( X( :weight ), Y( :height ) ),
Show Control Panel( 0 ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Where( :age == 14 )
);
(Report( gb2 ) << top parent)[Text Box( 1 )] << delete;
vlb << append( Report( gb3 ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Hiding 'Where (...)' textboxes in graphics using JSL
I found very neat solution online
dp = New Window("Graph Window", tb);
//delete all "Where" text on the chart
For( i = 1000, i > 0, i--,
try(
If( Contains( dp[Text Box( i )] << get text, "Where(:" ),
dp[Text Box( i )] << delete;
)
);
);
Hope this helps