spatial_narrative/graph/mod.rs
1//! Graph representation of narratives.
2//!
3//! This module provides tools for representing narratives as
4//! directed graphs where events are nodes and relationships
5//! (temporal, spatial, thematic) are edges.
6//!
7//! # Example
8//!
9//! ```rust
10//! use spatial_narrative::graph::{NarrativeGraph, EdgeType};
11//! use spatial_narrative::core::{Event, Location, Timestamp};
12//!
13//! // Create events
14//! let e1 = Event::new(Location::new(40.7, -74.0), Timestamp::now(), "Event 1");
15//! let e2 = Event::new(Location::new(40.7, -74.0), Timestamp::now(), "Event 2");
16//!
17//! // Build graph
18//! let mut graph = NarrativeGraph::new();
19//! let n1 = graph.add_event(e1);
20//! let n2 = graph.add_event(e2);
21//! graph.connect(n1, n2, EdgeType::Temporal);
22//!
23//! assert_eq!(graph.node_count(), 2);
24//! assert_eq!(graph.edge_count(), 1);
25//! ```
26
27mod narrative_graph;
28
29pub use narrative_graph::{
30 DotOptions, EdgeType, EdgeWeight, NarrativeGraph, NodeId, PathInfo, SubgraphResult,
31};