Interactive HTML with filterI am able to create an interactive HTML using "save Interactive HTML". However, when I add a filter, it does not create the filter in the HTML, just gives me the plot. Is there something I am missing?
My sample code:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
a = Variability Chart(
Y( :height ),
X( :age ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Std Dev Chart( 0 ),
Points Jittered( 1 ),
AIAG Labels( 0 ),
SendToReport(
Dispatch( {}, "Variability Gauge", OutlineBox, {Set Title( "VariabilityChart" )} ),
Dispatch( {}, "Variability Chart for height", OutlineBox, {Set Title( "" )} ),
Dispatch( {"Variability Chart for height"}, "Variability Chart", FrameBox, {Frame Size( 845, 274 )} )
),
Local Data Filter(
Add Filter( columns( :Name( "SEX" ) ), Display( :Name( "SEX" ), Size( 278, 165 ), List Display ) )
)
);
a << Save Interactive HTML( path || "Filter.html" );
This is what I want

This is what I get

Re: Interactive HTML with filterJust to underline what John said: This way of using local data filter will only have the show functionality, it does not recalculate the resulting graphs or statistics, like lines or profiler or mean .... If that is what you need JMP live is the right tool to go for when publishing to the web.
Thanks John for this example!Re: Interactive HTML with filterThose are great examples, Byron!
Re: Interactive HTML with filterThanks to @gzmorgan0 for supplying an answer here:
https://community.jmp.com/t5/Discussions/Missing-Local-Data-Filter-in-quot-Save-Interactive-HTML-quot/td-p/58163
Just replace:
a << Save Interactive HTML( path || "Filter.html" );
with
tr = a << Top Report;
tr << Save Interactive HTML( path || "Filter.html" );
Note that when saved this way rather than published to JMP Live or JMP Public, the Local Data Filter will act as though you turned off the Include option.

So you might as well turn it off in the script by adding Mode( include( 0 )) to the Local Data Filter definition as shown here:
Local Data Filter(
Width( 278 ),
Mode( Include( 0 ) ),
Add Filter(
columns( :sex ),
Where( :sex == "M" ),
Display( :sex, Size( 272, 168 ), Height( 168 ), "List Display" )
)
),
I hope that helps.
~John
Re: Interactive HTML with filterIf I run this script
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
vc = dt << Variability Chart(
Y( :NPN1 ),
X( :lot_id, :SITE ),
Local Data Filter(
Add Filter( columns( :wafer ), Display( :wafer, Size( 161, 255 ), Height( 255 ) ) )
)
)
)
);
and then interactively go to
File=>Save As
and save the file as an Interactive HTML With Data, or if one goes to
File=> Export=> HTML with Data
I get the following HTML

But I can not find a JSL function that can do the same.
Re: Interactive HTML with filterThe problem is that putting a filter into the HTML, and making it work would require the html to recalculate the data for the graph. If you happened to have JMP Live, then you could publish this figure to the JMP Live server, and then when you change the filter, an instance of JMP on the Live server would do this for you.
kind of like this:
Example HTML figure with a filter
Another approach is to make tabs with each level of the filter
kind of like this:
figure with tab boxes
note: the tab boxes are over the run chart at the bottom of the "dashboard".