Metadata-Version: 2.4
Name: streamlit-graph-canvas
Version: 0.1.0rc2
Summary: A domain-neutral, schema-driven graph canvas for Streamlit.
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
License-File: THIRD_PARTY_LICENSES.md
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: packaging>=26.0
Requires-Dist: streamlit>=1.62.0
Requires-Dist: pillow>=12.3.0,<13 ; extra == 'atlas'
Requires-Dist: networkx>=3.6.1 ; extra == 'networkx'
Requires-Dist: opentelemetry-api>=1.30,<2 ; extra == 'otel'
Requires-Python: >=3.12
Project-URL: Documentation, https://github.com/chtaylo3/streamlit-graph-canvas
Project-URL: Repository, https://github.com/chtaylo3/streamlit-graph-canvas
Provides-Extra: atlas
Provides-Extra: networkx
Provides-Extra: otel
Description-Content-Type: text/markdown

# streamlit-graph-canvas

A domain-neutral, schema-driven graph canvas for Streamlit. The core package
owns validated graph models, deterministic ELK layout, bounded serialization,
the Streamlit Components v2 bridge, explicit PRIMS, JavaScript, and raster
renderer transports, and static PNG sprite delivery through bounded atlas
pages.

```python
from streamlit_graph_canvas import (
    EdgeType,
    GraphData,
    GraphSchema,
    Node,
    NodeType,
    validate,
)

schema = GraphSchema(
    node_types={"service": NodeType("service")},
    edge_types={"calls": EdgeType("calls")},
)
graph = GraphData(nodes=(Node("api", "service", "API"),), edges=())
validate(schema, graph)
```

Applications render with `graph_canvas(graph, schema, key="graph")`; graph is
the first positional argument and schema is the second. Optional renderer
packages are inert until explicitly passed through `enable_renderers()`.

Static sprites do not use renderer packages or `enable_renderers()`. Construct
a `SpriteCatalog` of `StaticSprite` entries, declare a `SpriteBinding` on the
node type, assign a `SpriteRef` to a node, and pass `sprite_catalog=` to
`graph_canvas()`. The light PNG is required and is the default; a dark PNG is
optional, with deterministic dark-to-light fallback. `PngImage.from_file()`
and `PngImage.from_bytes()` keep paths and source bytes on the server. Core
preserves alpha, supports `contain`, `cover`, and `fill`, and packs static and
procedural raster tiles into immutable multi-sprite pages whose real crop
coordinates are sent with each resolved node layer.

The supported Python surface is exported from `streamlit_graph_canvas`;
package submodules are implementation details. See the project documentation
for the static-sprite quick start, wire protocol, CSP, dependency, and beta
compatibility contracts.

The compatibility matrix tests Python 3.12 through 3.14. Node.js 24.x is used
to build the packaged frontend and is not required when running an installed
wheel.

Application authors: see the [app-developer guide](https://chtaylo3.github.io/streamlit-graph-canvas/app-developer-guide.html)
for configuration, budgets, callbacks, and troubleshooting, and the
[interaction diagram](https://chtaylo3.github.io/streamlit-graph-canvas/diagrams/app-interactions.html)
for local versus server-side behavior. Use documentation matching your installed
release; repository main may contain unreleased APIs.
