Skip to content

Commit

Permalink
Wikipedia interactive example; start interactive sizing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Feb 13, 2024
1 parent d423023 commit 3978a20
Show file tree
Hide file tree
Showing 3 changed files with 1,627 additions and 0 deletions.
1,592 changes: 1,592 additions & 0 deletions doc/interactive_sizing_options.ipynb

Large diffs are not rendered by default.

Binary file added doc/wikipedia_marker_size_array.npy
Binary file not shown.
35 changes: 35 additions & 0 deletions examples/plot_interactive_wikipedia.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import numpy as np
import datamapplot

wikipedia_data_map = np.load("/Users/leland/PycharmProjects/datamapplot/examples/wikipedia_layered_data_map.npy")
wikipedia_label_layers = []
for i in range(6):
wikipedia_label_layers.append(
np.load(f"/Users/leland/PycharmProjects/datamapplot/examples/wikipedia_layer{i}_cluster_labels.npy", allow_pickle=True)
)
wikipedia_hover_text = [
x.strip()
for x in open(
"/Users/leland/PycharmProjects/datamapplot/examples/wikipedia_large_hover_text.txt",
mode="r"
)
]
wikipedia_marker_size_array = np.load("../doc/wikipedia_marker_size_array.npy")

plot = datamapplot.create_interactive_plot(
wikipedia_data_map,
wikipedia_label_layers[0],
wikipedia_label_layers[1],
wikipedia_label_layers[3],
wikipedia_label_layers[5],
hover_text = wikipedia_hover_text,
title="Map of Wikipedia",
sub_title="Paragraphs from articles on Simple Wikipedia embedded with Cohere embed",
logo="https://asset.brandfetch.io/idfDTLvPCK/idyv4d98RT.png",
font_family="Marcellus SC",
background_color="#eae6de",
marker_size_array=wikipedia_marker_size_array,
cluster_boundary_polygons=True,
initial_zoom_fraction=0.4,
)
plot

0 comments on commit 3978a20

Please sign in to comment.