JMP 테이블에 이미지를 추가하고 싶습니다. 데이터 포인트 위로 마우스를 가져가면 연결된 이미지를 볼 수 있습니다. 내 관심사는 내 테이블에 300,000개 이상의 행이 있고 각 행에 이미지를 추가하면 파일 크기가 관리할 수 없을 정도로 커질 수 있다는 것입니다. 그러나 많은 행이 동일한 이미지를 공유합니다. 최대 30,000개의 이미지만 있고 각 이미지는 최대 10개의 행에서 공유됩니다. 파일 크기를 늘리지 않고 이미지를 여러 행과 연결하는 효율적인 방법이 있습니까? (아니면 JMP가 자동으로 수행하는 것을 이미 알고 있습니까?)
참고로 이전에 JMP 테이블에 이미지를 추가하는 데 사용한 코드는 다음과 같습니다. 이 경우 모든 행이 고유한 이미지를 얻었습니다.
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);