Quiero agregar imágenes a mi tabla JMP, de modo que cuando pase el mouse sobre un punto de datos, pueda ver la imagen asociada. Mi preocupación es que mi tabla tiene más de 300 000 filas, y creo que si agrego una imagen a cada fila, el tamaño del archivo puede volverse inmanejable. Sin embargo, muchas filas compartirán la misma imagen: solo hay ~30,000 imágenes, y cada imagen se comparte entre ~10 filas. ¿Existe una forma eficiente de asociar una imagen con varias filas sin aumentar el tamaño del archivo? (¿O JMP ya sabría hacerlo automáticamente?)
Como referencia, aquí está el código que usé anteriormente para agregar imágenes a una tabla JMP, aunque en ese caso cada fila obtenía una imagen distinta.
Names Default to Here(1);
// run the script on the currently-selected data table
dt = Current Data Table();
// point to the directory where your thumbnail images are stored
// this script assumes the image names follow the pattern "0001.jpg", "0002.jpg", etc.
BaseImageDirectory = "C:\Users\user\Downloads\thumbnails\";
// create a column called "pics" to put the images
CurrentColumnNames = dt << get column names(string);
if (!contains(CurrentColumnNames, "pics"), New Column("pics", Expression));
// iterate through each row in the data table to add the images
For Each Row(
// look for a column called "image_directory" and take the name of the lowest-level subdirectory
Directory = word(-1, :image_directory, "\");
// zero-pad the image number to four digits (e.g. image_number 1 becomes 0001)
ImageID = Repeat( "0", 4 - Length( Char( :image_number ) ) ) || Char( :image_number );
// look for a file name like 0001.jpg in a folder with a name matching "image_directory"
ThumbnailFile = BaseImageDirectory || Directory || "\" || ImageID || ".jpg";
Eval(Eval Expr(tp = ThumbnailFile));
// insert the image into the column "pics"
Try(dt:pics = new image(tp));
);
// set "pics" as a label so it shows up when you hover over any data point
dt:pics << label(1);