Spaces:
Sleeping
Sleeping
| """Shared schema for the network-family D3 templates | |
| (network_force_graph, network_arc_diagram, network_chord, network_adjacency_matrix). | |
| Not registered itself — imported by each network template module. | |
| """ | |
| from __future__ import annotations | |
| from pydantic import BaseModel, Field | |
| class GraphNode(BaseModel): | |
| id: str | |
| group: str = "" | |
| class GraphLink(BaseModel): | |
| source: str | |
| target: str | |
| value: float = 1 | |
| class GraphData(BaseModel): | |
| title: str = "" | |
| nodes: list[GraphNode] | |
| links: list[GraphLink] | |