@graph-render/types
v1.2.5
Published
<p> <a href="https://www.npmjs.com/package/@graph-render/types"><img src="https://img.shields.io/npm/v/@graph-render/types" alt="npm version" /></a> <a href="https://github.com/graph-render/graph-render/blob/main/LICENSE"><img src="https://img.shields
Readme
@graph-render/types
Shared TypeScript types for Graph Render packages.
Import these types in your application code, custom node renderers, or integrations to stay in sync with the types used internally by all Graph Render packages.
Install
yarn add @graph-render/typesWhat Is Included
NxGraphInput— the graph data format accepted by all Graph Render componentsGraphConfig,GraphViewport,GraphTheme— layout and rendering configurationPositionedNode,PositionedEdge— post-layout node and edge shapesVertexComponent,VertexComponentProps— custom React node renderer contractsSquashMatchMeta,SquashPlayer,SquashPositionedNode— tournament data typesStageView,StageBounds,StageViewportResult— stage navigation typesLayoutType,LayoutDirection,EdgeType,MatchStatus, and more enums
Example
import {
EdgeType,
LayoutType,
MatchStatus,
type NxGraphInput,
type SquashMatchMeta,
} from '@graph-render/types';
const match: SquashMatchMeta = {
players: [
{ name: 'Paul Coll', seed: 1 },
{ name: 'Ali Farag', seed: 2 },
],
sets: [
[11, 8],
[9, 11],
[11, 7],
],
status: MatchStatus.Completed,
};License
MIT — free for personal and commercial use. See LICENSE.
