File size: 350 Bytes
ff4e0c4
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def link_clusters_to_timeline(results, clusters):
    """
    Build index maps so timeline & clusters can cross-highlight
    """
    doc_index = {}
    for idx, r in enumerate(results):
        doc_index[r["id"]] = {
            "index": idx,
            "date": r.get("date"),
            "cluster": r.get("cluster"),
        }
    return doc_index