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);私なら、一意の各イメージの 1 つのコピーを 1 つのデータ テーブルに配置し、大規模なデータ テーブルをイメージ テーブルにリンクして仮想テーブルを作成し、重複を回避します。
他のオプションとしては、ホバー ラベルを使用し、必要な場合にのみ画像をロードすることもできます。 この場合、データ テーブルへのパスを保存し、ホバー ラベルを使用してそれらのパスに基づいてパスをロードできます。