@bruno00o/graph 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,7 +24,8 @@ Framework-agnostic, typed graph visualization rendered with WebGL2.
24
24
  - Declarative marks: map your fields to color, size, labels, arrows and dashes through shared scales, with types inferred from your data
25
25
  - Live sources: pass a TanStack DB collection as is, or anything with `subscribeChanges`, and only what changed is redrawn
26
26
  - Named states (selection, hover, focus and your own) resolved on the GPU
27
- - Parallel edges, self loops, drag, pan and zoom out of the box
27
+ - Images and icons clipped to the node shape, corner badges, parallel edges and self loops
28
+ - Drag, pan, zoom, multiple selection and lasso out of the box, plus keyboard navigation announced to screen readers
28
29
  - Themed with CSS variables, light and dark
29
30
  - A framework-agnostic core with a thin React adapter, plus TanStack DB and TanStack Query integrations
30
31
 
@@ -108,7 +109,7 @@ nodes(itemsCollection, { color: 'group', label: 'label' })
108
109
 
109
110
  ## Examples
110
111
 
111
- The [`examples`](./examples) folder holds runnable examples: vanilla and React graphs, parallel edges and loops, collaboration across tabs with TanStack DB, and neighborhood exploration with TanStack Query. Run them with `pnpm install && pnpm dev`.
112
+ The [`examples`](./examples) folder holds runnable examples: vanilla and React graphs, images and badges, parallel edges and loops, collaboration across tabs with TanStack DB, and neighborhood exploration with TanStack Query. Run them with `pnpm install && pnpm dev`.
112
113
 
113
114
  ## Get Involved
114
115
 
package/dist/db.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as GraphInstance } from "./mount-graph-B88WGOQu.js";
2
- import { O as Point, _ as Key, d as FieldOf } from "./types-D6b86Rt1.js";
1
+ import { i as GraphInstance } from "./mount-graph-DQLST9-_.js";
2
+ import { _ as Key, d as FieldOf, k as Point } from "./types-BaflHDaf.js";
3
3
  import { Collection, MutationFn, Strategy } from "@tanstack/db";
4
4
  export interface PersistPositionsOptions<T extends object, TKey extends string | number> {
5
5
  readonly collection: Collection<T, TKey>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as ResolvedTransitions, C as NodeMark, D as NumberScaleType, E as NumberScale, F as StateStyle, I as StateStyles, L as Style, M as SelectMode, N as SourceChange, O as Point, P as SourceSubscription, R as TransitionOptions, S as Mark, T as NodeShape, _ as Key, a as Channel, b as LabelOptions, c as EdgeDash, d as FieldOf, f as FreeState, g as InteractionOptions, h as GraphDefinitionOptions, i as BuiltInState, j as ScalesOptions, k as ResolvedInteraction, l as EdgeMark, m as GraphDefinition, n as Badge, o as ColorScale, p as GraphData, r as BadgeCorner, s as EdgeArrow, t as Accessor, u as EdgeOptions, v as KeyChannel, w as NodeOptions, x as LiveSource, y as KeyFieldOf, z as View } from "./types-D6b86Rt1.js";
2
- import { C as PositionOrigin, S as GraphTargetEvent, _ as GraphEventName, a as GraphSelection, b as GraphPositionEvent, c as GraphStore, d as ViewOptions, f as mountGraph, g as GraphEventHandler, h as GraphDragEvent, i as GraphPositions, l as GraphView, m as ElementKeysInput, n as GraphElement, o as GraphState, p as ElementKeys, r as GraphInstance, s as GraphStates, t as FitOptions, u as MountGraphOptions, v as GraphEvents, x as GraphTarget, y as GraphPointerEvent } from "./mount-graph-B88WGOQu.js";
1
+ import { A as ResolvedInteraction, B as View, C as NodeImage, D as NumberScale, E as NodeShape, F as SourceSubscription, I as StateStyle, L as StateStyles, M as ScalesOptions, N as SelectMode, O as NumberScaleType, P as SourceChange, R as Style, S as Mark, T as NodeOptions, _ as Key, a as Channel, b as LabelOptions, c as EdgeDash, d as FieldOf, f as FreeState, g as InteractionOptions, h as GraphDefinitionOptions, i as BuiltInState, j as ResolvedTransitions, k as Point, l as EdgeMark, m as GraphDefinition, n as Badge, o as ColorScale, p as GraphData, r as BadgeCorner, s as EdgeArrow, t as Accessor, u as EdgeOptions, v as KeyChannel, w as NodeMark, x as LiveSource, y as KeyFieldOf, z as TransitionOptions } from "./types-BaflHDaf.js";
2
+ import { C as GraphTarget, S as GraphPositionEvent, T as PositionOrigin, _ as GraphEventHandler, a as GraphPositions, b as GraphFocusEvent, c as GraphStates, d as MountGraphOptions, f as ViewOptions, g as GraphDragEvent, h as ElementKeysInput, i as GraphInstance, l as GraphStore, m as ElementKeys, n as GraphElement, o as GraphSelection, p as mountGraph, r as GraphFocus, s as GraphState, t as FitOptions, u as GraphView, v as GraphEventName, w as GraphTargetEvent, x as GraphPointerEvent, y as GraphEvents } from "./mount-graph-DQLST9-_.js";
3
3
  export declare function defineGraph<S extends string = never>(options: GraphDefinitionOptions<S>): GraphDefinition<S>;
4
4
  export declare function nodes<T>(data: LiveSource<T>, options?: NodeOptions<NoInfer<T>>): NodeMark<T>;
5
5
  export declare function nodes<T extends {
@@ -15,5 +15,5 @@ export declare function edges<T extends {
15
15
  export declare function edges<T>(data: Iterable<T>, options: EdgeOptions<NoInfer<T>> & {
16
16
  readonly key: KeyChannel<NoInfer<T>>;
17
17
  }): EdgeMark<T>;
18
- export { type Accessor, type Badge, type BadgeCorner, type BuiltInState, type Channel, type ColorScale, type EdgeArrow, type EdgeDash, type EdgeMark, type EdgeOptions, type ElementKeys, type ElementKeysInput, type FieldOf, type FitOptions, type FreeState, type GraphData, type GraphDefinition, type GraphDefinitionOptions, type GraphDragEvent, type GraphElement, type GraphEventHandler, type GraphEventName, type GraphEvents, type GraphInstance, type GraphPointerEvent, type GraphPositionEvent, type GraphPositions, type GraphSelection, type GraphState, type GraphStates, type GraphStore, type GraphTarget, type GraphTargetEvent, type GraphView, type InteractionOptions, type Key, type KeyChannel, type KeyFieldOf, type LabelOptions, type LiveSource, type Mark, type MountGraphOptions, type NodeMark, type NodeOptions, type NodeShape, type NumberScale, type NumberScaleType, type Point, type PositionOrigin, type ResolvedInteraction, type ResolvedTransitions, type ScalesOptions, type SelectMode, type SourceChange, type SourceSubscription, type StateStyle, type StateStyles, type Style, type TransitionOptions, type View, type ViewOptions, mountGraph };
18
+ export { type Accessor, type Badge, type BadgeCorner, type BuiltInState, type Channel, type ColorScale, type EdgeArrow, type EdgeDash, type EdgeMark, type EdgeOptions, type ElementKeys, type ElementKeysInput, type FieldOf, type FitOptions, type FreeState, type GraphData, type GraphDefinition, type GraphDefinitionOptions, type GraphDragEvent, type GraphElement, type GraphEventHandler, type GraphEventName, type GraphEvents, type GraphFocus, type GraphFocusEvent, type GraphInstance, type GraphPointerEvent, type GraphPositionEvent, type GraphPositions, type GraphSelection, type GraphState, type GraphStates, type GraphStore, type GraphTarget, type GraphTargetEvent, type GraphView, type InteractionOptions, type Key, type KeyChannel, type KeyFieldOf, type LabelOptions, type LiveSource, type Mark, type MountGraphOptions, type NodeImage, type NodeMark, type NodeOptions, type NodeShape, type NumberScale, type NumberScaleType, type Point, type PositionOrigin, type ResolvedInteraction, type ResolvedTransitions, type ScalesOptions, type SelectMode, type SourceChange, type SourceSubscription, type StateStyle, type StateStyles, type Style, type TransitionOptions, type View, type ViewOptions, mountGraph };
19
19
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as freeStateNames, r as maxFreeStates, t as mountGraph } from "./mount-graph-DYOgD_ql.js";
1
+ import { n as freeStateNames, r as maxFreeStates, t as mountGraph } from "./mount-graph-CzVfiIte.js";
2
2
  // src/define-graph.ts
3
3
  const defaultZoomSpeed = 1;
4
4
  const defaultPositionTransition = 120;