zettelkasten.dashboard.backend.routes.graph_data¶
zettelkasten.dashboard.backend.routes.graph_data ¶
Graph listing, graph-data, cluster, papers, and fulltext/pdf routes.
Split out of the former flat routes.py; behaviour is unchanged.
GraphDrilldownRequest ¶
Bases: BaseModel
POST body for a single-graph drill (Approach B: membership in the payload).
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
get_graph_data ¶
get_graph_data(name: str, max_nodes: int = Query(0, ge=0, description='LOD cap: 0 = full graph; >0 keeps the top-N nodes by link_count and collapses the rest'), bbox: str = Query(None, description="Viewport bbox 'x0,y0,x1,y1' in t-SNE space; with max_nodes>0, on-screen notes are kept in full detail (server-side viewport LOD)"), exclude_types: str = Query(None, description="Comma-separated note types to omit from the payload + LOD (e.g. 'quote'); they stay reachable via the note-detail API"), request: Request = None, response: Response = None) -> dict
Returns nodes and edges for the force-directed graph.
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
get_graph_clusters ¶
get_graph_clusters(name: str, granularity: int = Query(50, ge=10, le=90, description='Cluster granularity (10=few large, 90=many small)'), request: Request = None, response: Response = None) -> dict
Embedding-based semantic clusters for a single graph's notes.
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
get_graph_drilldown ¶
get_graph_drilldown(name: str, group_id: str = Query(..., description='The super-node id (or its group_id) to drill into'), member_ids: 'list[str] | None' = Query(None, description="Approach B: the drilled glyph's exact build-time member id set (from the LOD payload), so drill resolution needs no server store. Prefer the POST route for large sets."), request: Request = None, response: Response = None) -> dict
Recursive drill-down for a single-graph LOD super-node.
Given a collapsed super-node's id, returns that group's CONNECTED sub-graph:
its member notes PLUS their REAL edges (inter-member connectivity preserved,
never stripped), re-clustered into finer semantic sub-supers at the next
granularity tier — or the real members when the group is small / cannot
subdivide (leaf=True). Degrades to an empty sub-graph while embeddings are
warming (semantic grouping needs the cluster map).
When member_ids is supplied (Approach B) membership resolves directly from
that set with no server-side store lookup; otherwise it degrades to the
store/live re-derivation for back-compat with old clients.
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
post_graph_drilldown ¶
post_graph_drilldown(name: str, req: GraphDrilldownRequest, request: Request = None, response: Response = None) -> dict
POST twin of :func:get_graph_drilldown — carries the glyph's member_ids
in the body (preferred for large member sets that would bloat a query string).
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
get_project_clusters ¶
get_project_clusters(name: str, granularity: int = Query(50, ge=10, le=90, description='Cluster granularity (10=few large, 90=many small)'), request: Request = None, response: Response = None) -> dict
Embedding-based semantic clusters across all notes in a project.
Clusters the composite of every source's notes (plus connecting _cross
notes) so semantic colouring in project mode behaves like it does for a
single source.
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 | |
graph_papers ¶
graph_papers(name: str, budget: int = Query(12, ge=0, description='Max papers in the suggested set'), suggested_only: bool = Query(False, description='Return only the suggested set'), sort: str = Query('', description='importance|read_priority|interestingness|recency|influence|trajectory|type|title|author|date'), reverse: bool = Query(False, description='Reverse the resolved sort order'), as_of: str = Query('', description='Replay trends as of this year; empty = live')) -> dict
Papers view for a single source graph (its works, scored and situated).
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 | |
project_papers ¶
project_papers(name: str, budget: int = Query(12, ge=0, description='Max papers in the suggested set'), suggested_only: bool = Query(False, description='Return only the suggested set'), sort: str = Query('', description='importance|read_priority|interestingness|recency|influence|trajectory|type|title|author|date'), reverse: bool = Query(False, description='Reverse the resolved sort order'), as_of: str = Query('', description='Replay trends as of this year; empty = live')) -> dict
Papers view across a project: the works cited by any of its sources.
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 | |
graph_fulltext ¶
Extracted full text + saved highlights for a source's local Zotero PDF.
Source code in zettelkasten/dashboard/backend/routes/graph_data.py
graph_pdf ¶
Stream a source's local Zotero PDF bytes for an embedded viewer.