Skip to content

Latest commit

 

History

History
151 lines (93 loc) · 9.78 KB

File metadata and controls

151 lines (93 loc) · 9.78 KB

@statelyai/graph

0.11.0

Minor Changes

  • 88d0dbd Thanks @davidkpiano! - Add format support metadata as a published subpath, tighten schema drift checks, and modularize the algorithms entrypoint. This also adds benchmark coverage and CI checks for generated schema artifacts across multiple Node versions.

0.10.0

Minor Changes

  • bfb5f0b Thanks @davidkpiano! - Clean up and simplify type definitions:

    • Remove GraphEntityConfig; merged into GraphEntity
    • Export VisualGraphFormatConverter from main entry
    • Rename Positioned export to EntityRect
    • Simplify VisualNode, VisualEdge, VisualPort to use property narrowing instead of Omit
    • Fix Graph<any, E>Graph<N, E> on exported APIs for better generic propagation
    • Normalize label to string | null on both GraphNode and GraphEdge (node label default changed from '' to null)

Patch Changes

0.9.0

Minor Changes

  • 0fb9433 Thanks @davidkpiano! - Add entity equivalence functions: areEntitiesEqual, isLayoutEqual, isNonLayoutEqual, and LAYOUT_KEYS.

  • 6d2465d Thanks @davidkpiano! - Add centrality, community detection, connectivity, and isomorphism algorithms.

0.8.0

Minor Changes

  • 8b97c9b Thanks @davidkpiano! - Add port support for nodes and edges, enabling dataflow/node-editor graphs (Node-RED, Unreal Blueprints, ComfyUI).

    • Add GraphEntityConfig, GraphEntity, VisualGraphEntity base interfaces (DRY shared props for nodes, edges, ports)
    • Add PortConfig<P>, GraphPort<P>, VisualPort<P> types with generic data parameter
    • Add P (port data) as 4th generic to Graph<N, E, G, P> and all related types
    • Add ports?: PortConfig[] on NodeConfig, ports?: GraphPort[] on GraphNode
    • Add sourcePort? / targetPort? (port name strings) on EdgeConfig and GraphEdge
    • Add createGraphPort() factory
    • Add port validation: duplicate port names rejected, addEdge/updateEdge validate port existence
    • Add port queries: getPort(), getPorts(), getEdgesByPort()
    • ELK adapter: round-trip ports (name ↔ ELK port id, direction ↔ org.eclipse.elk.port.side)
    • xyflow adapter: sourcePortsourceHandle, targetPorttargetHandle

0.7.0

Minor Changes

  • 976a7e6 Thanks @davidkpiano! - - Make Graph.initialNodeId, GraphNode.label, and GraphEdge.label optional on resolved types for easier consumer usage
    • Add createGraphNode() and createGraphEdge() helpers that resolve defaults from config

0.6.0

Minor Changes

  • 3115609 Thanks @davidkpiano! - Make edge.label nullable

  • 54023f4 Thanks @davidkpiano! - Add edge weights, A* pathfinding, subgraph extraction, and graph reversal.

    • weight?: number on edges; algorithms default to (e) => e.weight ?? 1 with BFS fast path when unweighted
    • getAStarPath(graph, { from, to, heuristic }) for heuristic-guided shortest paths
    • getSubgraph(graph, nodeIds) returns induced subgraph with internal edges
    • reverseGraph(graph, filterEdge?) flips edge directions
    • Remove stale TODO for Mermaid sequence blocks (already implemented)
  • 8f9912d Thanks @davidkpiano! - Add walk generators and coverage utilities for model-based testing.

    • genRandomWalk(), genWeightedRandomWalk(), genQuickRandomWalk(), genPredefinedWalk() — step-by-step graph traversal generators that yield GraphStep, with optional seed for deterministic replay
    • Composable stop conditions: takeSteps(), takeUntilNode(), takeUntilEdge(), takeUntilNodeCoverage(), takeUntilEdgeCoverage()
    • getCoverage() computes node/edge coverage stats from a walk
    • filter option for edge guards, onStep callback for actions — keeps graph JSON-serializable

Patch Changes

  • 22f77a5 Thanks @davidkpiano! - Fix schema and GraphML serialization drift, optimize weighted graph algorithms, and make genSimplePaths() truly lazy.

    • add weight to EdgeSchema and tighten schema drift tests against the runtime graph types
    • preserve graph, node, and edge metadata in GraphML round-trips, including initialNodeId, direction, style, geometry, and edge weight
    • use a heap-backed priority queue for weighted shortest paths, A*, and Prim MST
    • refactor genSimplePaths() to yield incrementally instead of collecting all paths before returning

0.5.0

Minor Changes

Patch Changes

0.4.0

Minor Changes

  • e268990 Thanks @davidkpiano! - Make parentId, initialNodeId, and shape optional on GraphNode. These fields are no longer defaulted to null/'rectangle' by createGraph/createVisualGraph, they are simply omitted when not provided.

    Add empty string validation for node/edge IDs, parentId, sourceId, and targetId.

  • 55462e6 Thanks @davidkpiano! - Add xyflow (React Flow / Svelte Flow) format converter with toXYFlow() and fromXYFlow() for converting between VisualGraph and xyflow node/edge structures. Uses @xyflow/system as an optional peer dependency for types. Also adds VisualGraphFormatConverter type for visual-first format converters.

0.3.1

Patch Changes

0.3.0

Minor Changes

  • #5 25ab36a Thanks @davidkpiano! - - Add DOT format (@statelyai/graph/dot)

    • Add Mermaid formatters: flowchart, sequence, state, class diagram, ER, mindmap, block
    • Add getRelativeDistanceMap and getRelativeDistance (queries)
    • Restructure formats into per-format subpackages with READMEs
  • #3 bcf8c48 Thanks @davidkpiano! - Add format converters for JGF, Cytoscape.js JSON, D3 force JSON, GEXF, GML, and TGF

    • New GraphFormatConverter<TSerial> interface and createFormatConverter() factory
    • 6 new format modules with bidirectional to*/from* functions: toJGF/fromJGF, toCytoscapeJSON/fromCytoscapeJSON, toD3Graph/fromD3Graph, toGEXF/fromGEXF, toGML/fromGML, toTGF/fromTGF
    • Input validation with descriptive error messages on all from* functions
    • End-to-end integration tests with real Cytoscape.js and D3 force libraries
    • cytoscape and d3-force added as optional peer dependencies

0.2.0

Minor Changes

  • 4f02507 Thanks @davidkpiano! - Remove toGraphML, fromGraphML, GraphSchema, NodeSchema, and EdgeSchema from the main barrel export to avoid pulling in optional peer deps (fast-xml-parser, zod) during SSR.

    Use subpath imports instead:

    • @statelyai/graph/formats/graphml
    • @statelyai/graph/schemas