ExposoGraph.exporter¶
Export and parse the knowledge graph as interactive HTML, Plotly HTML, JS, JSON, and GEXF.
All engine-based export helpers accept a visibility argument so you can
export:
the full graph (
all)validated content only (
validated_only)exploratory content only (
exploratory_only)
Export the knowledge graph to HTML, Plotly HTML, JSON, graph-data.js, and GEXF.
- ExposoGraph.exporter.parse_graph_data_text(raw)[source]¶
Parse JS/HTML text that contains a
GRAPH_DATAobject assignment.Uses a JSON5 parser to handle unquoted keys, single-line comments, and trailing commas that are valid in JavaScript but not in JSON.
- Parameters:
raw (str)
- Return type:
- ExposoGraph.exporter.parse_graph_data_js(path)[source]¶
Parse a
graph-data.jsfile.- Parameters:
- Return type:
- ExposoGraph.exporter.parse_graph_html(path)[source]¶
Parse a standalone HTML graph export with embedded
GRAPH_DATA.- Parameters:
- Return type:
- ExposoGraph.exporter.parse_graph_artifact(path)[source]¶
Parse JSON, JS, or HTML graph artifacts.
- Parameters:
- Return type:
- ExposoGraph.exporter.to_graph_data_js(engine, path, *, visibility=GraphVisibility.ALL)[source]¶
Write a
graph-data.jsfile consumable by the D3 viewer.- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
- Return type:
- ExposoGraph.exporter.to_plotly_figure(engine, *, visibility=GraphVisibility.ALL, title=None)[source]¶
Build an interactive Plotly figure for the graph.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
title (str | None)
- Return type:
- ExposoGraph.exporter.to_plotly_html_string(engine, *, visibility=GraphVisibility.ALL, title=None, include_plotlyjs=True)[source]¶
Render a standalone Plotly HTML document.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
title (str | None)
- Return type:
- ExposoGraph.exporter.to_plotly_html(engine, path, *, visibility=GraphVisibility.ALL, title=None, include_plotlyjs=True)[source]¶
Write a standalone Plotly HTML file.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
title (str | None)
- Return type:
- ExposoGraph.exporter.to_interactive_html_string(engine, *, template_path=None, visibility=GraphVisibility.ALL)[source]¶
Render a self-contained interactive HTML document.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
- Return type:
- ExposoGraph.exporter.bundle_to_html_string(template_path, graph_data_path)[source]¶
Render a viewer bundle directory as a self-contained HTML document.
- ExposoGraph.exporter.to_interactive_html(engine, path, *, template_path=None, visibility=GraphVisibility.ALL)[source]¶
Write a standalone interactive HTML file with embedded graph data.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
- Return type:
- ExposoGraph.exporter.ensure_viewer_bundle(output_dir, *, template_dir=None)[source]¶
Ensure output_dir is a usable D3 viewer bundle directory.
When template_dir contains an
index.htmlfile, it is copied into the output directory if missing so the generatedgraph-data.jshas a viewer to pair with.
- ExposoGraph.exporter.export_viewer_bundle(engine, output_dir, *, template_dir=None, visibility=GraphVisibility.ALL)[source]¶
Write a complete viewer bundle directory.
The resulting folder contains
graph-data.jsand, when a template is available,index.html.- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
- Return type:
- ExposoGraph.exporter.to_json(engine, path, *, visibility=GraphVisibility.ALL)[source]¶
Write a plain JSON export.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
- Return type:
- ExposoGraph.exporter.to_gexf(engine, path, *, visibility=GraphVisibility.ALL)[source]¶
Write GEXF (Gephi) format.
Non-scalar node/edge attributes (lists, dicts) are serialized to JSON strings since GEXF only supports primitive attribute types.
- Parameters:
engine (GraphEngine)
visibility (GraphVisibility | str)
- Return type: