WizMap requires two specific JSON files to function: one for the contour plot/summaries (grid_dict) and one for the raw data (data_list).
- Prepare Coordinates: Project your high-dimensional embeddings into 2D space (e.g., using UMAP) and extract the
xs and ys coordinates. - Prepare Content: Create a list of JSON strings (
json_strings) where each string contains the metadata for a single point (e.g., text, image URLs, or links). - Configure Content: Use
wizmap.JsonPointContentConfig to map your JSON keys to WizMap's internal display logic (e.g., defining which key holds the tooltip text or the image URL). - Generate and Save: Use
wizmap.generate_grid_dict and wizmap.generate_data_list to create the required structures, then save them using wizmap.save_json_files.
# 1. Define content configuration
json_point_content_config = wizmap.JsonPointContentConfig(
groupLabels=None,
textKey="t",
imageKey="i",
imageURLPrefix="https://example.com/images/",
largeImageKey="li",
largeImageURLPrefix="https://example.com/images/",
linkFieldKeys=["github"],
)
# 2. Generate the data structures
data_list = wizmap.generate_data_list(xs, ys, json_strings)
grid_dict = wizmap.generate_grid_dict(
xs=xs,
ys=ys,
texts=json_strings,
title="My Dataset",
json_point_content_config=json_point_content_config,
)
# 3. Save to disk
wizmap.save_json_files(data_list, grid_dict, output_dir="./")