cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Kwangki
Level III

Missing Local Data Filter in "Save Interactive HTML()" Script

In the case of graph builder which has Local Data Filter, there is no local data filter with below script.

 

obj << Save Interactive HTML( "Test.html" );

 

With "File > Publish", the html file has local data filter correctly but Save Interactive HTML() script did not. Is there any other script which generate html file with local data filter?

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Missing Local Filter in "Save Interactive HTML()" Script

You need to Save the Graph Builder Top Report to capture the local filter.

Try this example:

 

Names Default to Here(1);

dt = Open( "$Sample_Data/Big Class.jmp");
dt << New Column("Seq", numeric, <<set each value( row()) );
gb = dt << Graph Builder(
 Size( 528, 454 ),
 Show Control Panel( 0 ),
 Variables( X( :Seq ), Y( :height ) ),
 Elements(
 Points( X, Y, Legend( 3 ) ),
 Smoother( X, Y, Legend( 4 ) ),
 Line( X, Y, Legend( 5 ) )
 ),
 SendToReport(
 Dispatch(
 {},
 "400",
 ScaleBox,
 {Legend Model(
 4,
 Properties( 0, {Line Color( -13977687 )}, Item ID( "Smooth", 1 ) )
 ), Legend Model(
 5,
 Properties( 0, {Line Color( -3780931 )}, Item ID( "height", 1 ) )
 )}
 )
 )
);

//--- Add a Local Data Filter with Default Options ----
gb << Local Data Filter(
 Mode( Show( 1 ), Include(1) ), 
 Add Filter( columns( :height ), Where( :height >= 53 & :height <= 70 ) )
 );

gb << Bring Window to Front;
Wait(0);
/* This next block of code demonstrates how to reference a JMP platform with 
 an associated Data Filter.
*/ 

//--- Get the container of the platform. ---
tr = gb << Top Report; 

tr << Save Interactive HTML("c:\temp\BCexample.html");  

 

View solution in original post

7 REPLIES 7
txnelson
Super User

Re: Missing Local Filter in "Save Interactive HTML()" Script

What version of JMP are you using?  Local Data filter with Interactive HTML was not available until JMP 14

Jim
Kwangki
Level III

Re: Missing Local Filter in "Save Interactive HTML()" Script

I have used JMP 14. JMP 14 also did not generate Local Data Filter.

gzmorgan0
Super User (Alumni)

Re: Missing Local Filter in "Save Interactive HTML()" Script

You need to Save the Graph Builder Top Report to capture the local filter.

Try this example:

 

Names Default to Here(1);

dt = Open( "$Sample_Data/Big Class.jmp");
dt << New Column("Seq", numeric, <<set each value( row()) );
gb = dt << Graph Builder(
 Size( 528, 454 ),
 Show Control Panel( 0 ),
 Variables( X( :Seq ), Y( :height ) ),
 Elements(
 Points( X, Y, Legend( 3 ) ),
 Smoother( X, Y, Legend( 4 ) ),
 Line( X, Y, Legend( 5 ) )
 ),
 SendToReport(
 Dispatch(
 {},
 "400",
 ScaleBox,
 {Legend Model(
 4,
 Properties( 0, {Line Color( -13977687 )}, Item ID( "Smooth", 1 ) )
 ), Legend Model(
 5,
 Properties( 0, {Line Color( -3780931 )}, Item ID( "height", 1 ) )
 )}
 )
 )
);

//--- Add a Local Data Filter with Default Options ----
gb << Local Data Filter(
 Mode( Show( 1 ), Include(1) ), 
 Add Filter( columns( :height ), Where( :height >= 53 & :height <= 70 ) )
 );

gb << Bring Window to Front;
Wait(0);
/* This next block of code demonstrates how to reference a JMP platform with 
 an associated Data Filter.
*/ 

//--- Get the container of the platform. ---
tr = gb << Top Report; 

tr << Save Interactive HTML("c:\temp\BCexample.html");  

 

Kwangki
Level III

Re: Missing Local Filter in "Save Interactive HTML()" Script

Thank you for your good solution.

Though I do not fully understand what you mean now. I could generate the correct graph builder html file and I will try to know JMP Script more and more.

gzmorgan0
Super User (Alumni)

Re: Missing Local Filter in "Save Interactive HTML()" Script

To really customize JMP results, two important skills are:

  • navigating and referencing JMP reports, and
  • JSL DisplayBox scripting/messages.

Mutiple chapters of our book* present navigation, interactive reports, dialogs, etc. I cannot reproduce all of that here, but let me give you a critical skill for navigation, Show Tree Structure.  Right click on any disclosure icon in a JMP report, then select Edit, then select the last item, Show Tree Structure. This creates a New Window displaying the underlying structure of any report. Highlighting an item in the report highlights the corresponding DisplayBox in the tree structure window; and vice versa, highlighting something in the tree structure window highlights the corresponding display in the report window.

 

That is not the entire story. JMP report structure allows users to add custom display boxes, so there are hidden containers.  Each window has a ListBox that contains all display boxes [that is, if the scripter doesn't mess it up ... our book shows an example of what not to do.] 

 

See the screen shot below that captures the report window of the graph builder and the local data filter with a window of its tree structure window where some disclosure icons are closed.

 

Note the red star in the upper left corner.  I added that. This red star marks a spot above the disclosure icon of the Data Filter.

 

Run the script I previously sent, and place your mouse at that location and press keys Ctrl+Shift+ Right Click [ I do not know the equivalents for a Mac]. A little gray button with Show Tree Stucture will appear; click on it to create the tree structure. Click on the disclosure icons for BorderBox(1) and OutlineBox(2): Graph Builder.  Now look at the tree structure. As mentioned above all display boxes are contained within ListBox(1). The key feature is that when a Local Data Filter is added to a platform like GraphBuilder or Bivariate, etc., the platform is nested within a Data Filter Context Box. This allows JMP to filter only for this platform and no others, unless a platform is added to that Data Filter Context Box.

 

That might have be too many details if you are just learning JSL. The big take away is that tr = gb << Top Report, returns a handle to ListBox(1) of that window.  And tr << Save Interactive HTML will now capture both the local filter and Graph Builder.

 

Read more below picture.

image.png

I had not scripted with a Data Filter until writing up examples for our book.  So when I try something new, like adding a local data filter, I always find an area outside of my display and use the Ctrl+Shift+Right Click and click on Show Tree Structure to learn the boxes that are used. Then I look up the messages I can send to them (their methods).

 

You can learn more about navigating and customizing a JMP report in the JMP Scripting Guide or *JSL Companion, Applications of the JMP Scrpting Language, 2nd edition

 

 

WebDesignesCrow
Super User

Re: Missing Local Filter in "Save Interactive HTML()" Script

Very informative. Thank you for sharing

josh
Level I

Re: Missing Local Filter in "Save Interactive HTML()" Script

Received the following message when attempting to use the Local Data Filter List Display within GB script, and when attempting to script default Local Data Filter as a separate statement as described in example code below,

 

Interactive HTML: Controls are not interactive.

Interactive HTML: Unsupported display type: ListBoxBox

 

Are there consideration beyond the script below to interactively filter JMP output via html? Also- is there a point and click process within GB to capture the local filter and output html?

 

My goal is to create a output of 30+ graphs to link or to paste into a viewable word format. The wrap functionality does not appear feasible due to different Y-Axis mins/max across each of the graphs. Thanks- Josh