Taking a similar approach to @ian_jmp below is a simple example of script that displays an image based upon a data filter selection, but does not use a JMP platform such as Bivariate or Graph Builder. It just simply displays an image.
Names Default To Here( 1 );
path = "c:\users\???\pictures"; // set the path to your image directory
// Filter out all non jpg files
files = Filter Each( {file}, Files In Directory( path ), Word( -1, file, "." ) == "jpg" );
// I create a dummy data table to use for an example
ob = {"A", "B", "C"};
dt = New Table( "Pictures", invisible,
add rows( N Items( files ) ),
New Column( "Obj", character, set each value( ob[Mod( Row(), 3 ) + 1] ) ),
New Column( "type", nominal, set each value( Col Cumulative Sum( 1, :obj ) ) ),
New Column( "ImagePath", character, set each value( files[Row()] ) )
);
:ImagePath << hide;
// Here is the working code that can be used against a data table that matches
// the example data table created above
// It uses a Make Row State Handler to handle the changing of images when
// the data filter values change
nw = New Window( "Example",
hlb = H List Box(
dt << Data Filter(
Location( {928, 247} ),
Mode( Include( 1 ) ),
Add Filter( columns( :Obj, :type ), Display( :type, N Items( 8 ) ) )
),
pb = Graph Box( Frame Size( 600, 600 ) )
)
);
pb( report )[axisbox( 2 )] << delete;
pb( report )[axisbox( 1 )] << delete;
theFunction = Function( {a},
If( N Rows( dt << get selected rows ) == 1,
Try( pb << delete );
hlb << append( pb = Picture Box( Open( path || "\" || dt:ImagePath[(dt << get selected rows)[1]], jpg ) ) );
pb << set height( 600 );
pb << set width( 600 );
,
Try( pb << delete );
hlb << append( pb = Graph Box( Frame Size( 600, 600 ) ) );
pb( report )[axisbox( 2 )] << delete;
pb( report )[axisbox( 1 )] << delete;
)
);
rs = dt << make row state handler( theFunction );
Jim