pict-provider-graphgeometry
v1.0.0
Published
Pure geometry math for graph canvases: shape primitives, edge centers, and port and anchor positioning. Extracted from pict-section-flow so the math is reusable and testable on its own.
Readme
pict-provider-graphgeometry
Pure, DOM-free geometry for graph canvases: node shapes and the anchor points
where edges attach to them. Extracted from pict-section-flow so the shape and
anchor math is reusable and testable on its own.
What is here
GraphGeometry- the dependency-free core: shape descriptors (rectangle, rounded rectangle, ellipse, circle, diamond, triangle) and the functions that resolve a connection anchor on a shape's perimeter (by side, by ratio, or to a target point). No DOM, no Fable - just math.- A thin Fable service wrapper (
PictProviderGraphGeometry) so apps that speak the service-provider pattern can register it and reach the same math through dependency injection. It only delegates to the core.
Usage
// Most consumers want the core directly:
const GraphGeometry = require('pict-provider-graphgeometry').GraphGeometry;
// Or register the Fable service wrapper for dependency injection:
const libGraphGeometry = require('pict-provider-graphgeometry');pict-section-flow's geometry provider and pict-provider-graphlayout's
edge-routing build on this core. Any host that wants the same shape and anchor
math without the flow view can use it the same way.
Status
Used in production by pict-section-flow. Pure functions with unit tests; the
public surface is the GraphGeometry core and the service wrapper.
License
MIT
