@cosmos.gl/deck-layers 3.5.0-beta.2 → 3.5.1

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.
@@ -1,56 +1,140 @@
1
- import { CompositeLayer, Accessor, Color, DefaultProps, GetPickingInfoParams, Layer, LayerContext, LayerProps, PickingInfo, Unit, UpdateParameters } from '@deck.gl/core';
2
- import { GraphSimulation, GraphSimulationConfig } from '@cosmos.gl/graph';
1
+ import { Layer, Accessor, BinaryAttribute, Color, DefaultProps, GetPickingInfoParams, LayerContext, LayerProps, PickingInfo, UpdateParameters } from '@deck.gl/core';
2
+ import { Graph, GraphConfig } from '@cosmos.gl/graph';
3
3
  /**
4
- * Points input: an array to run accessors over (picking returns the original
5
- * objects), or the cosmos-native binary form — a point count plus optional
6
- * `[x0, y0, x1, y1, …]` initial positions. Points without given positions are
7
- * seeded randomly inside the simulation space.
4
+ * Binary styling channels for binary points, keyed by the accessor each one
5
+ * replaces. Colors are RGBA per point, 4 values each: a `Uint8Array` in
6
+ * 0..255 (deck's convention) is converted, a `Float32Array` is cosmos's own
7
+ * 0..1 and is handed over as it is. Sizes are one value per point, handed
8
+ * over as they are. Values are read tightly packed; `offset` and `stride` are
9
+ * not honoured.
10
+ */
11
+ export type CosmosPointAttributes = {
12
+ getPointColor?: BinaryAttribute;
13
+ getPointSize?: BinaryAttribute;
14
+ };
15
+ /**
16
+ * Points input: an array to run accessors over, or the cosmos-native binary
17
+ * form — a point count plus optional `[x0, y0, x1, y1, …]` initial positions
18
+ * and binary styling channels. Points without given positions are seeded
19
+ * randomly inside the simulation space.
8
20
  */
9
21
  export type CosmosGraphPoints<PointDataT> = readonly PointDataT[] | {
10
22
  length: number;
11
23
  initialPositions?: Float32Array;
12
- /** Optional binary styling channels, keyed by accessor name (`getPointColor`, `getPointSize`). */
13
- attributes?: Record<string, unknown>;
24
+ attributes?: CosmosPointAttributes;
14
25
  };
15
26
  /**
16
- * Links input: an array to run accessors over, or the cosmos-native
17
- * `[source0, target0, source1, target1, …]` array of point indices.
18
- * An array link whose source or target does not resolve to a point is dropped
19
- * from both the simulation and the rendering, with one warning per data change.
27
+ * Binary styling channels for binary links, keyed by the accessor each one
28
+ * replaces, with the same conventions as `CosmosPointAttributes`: colors a
29
+ * `Uint8Array` in 0..255 or a `Float32Array` in 0..1, widths one per link.
30
+ */
31
+ export type CosmosLinkAttributes = {
32
+ getLinkColor?: BinaryAttribute;
33
+ getLinkWidth?: BinaryAttribute;
34
+ };
35
+ /**
36
+ * Links input: an array to run accessors over, the cosmos-native
37
+ * `[source0, target0, source1, target1, …]` array of point indices, or that
38
+ * array as `pairs` with binary styling channels beside it. An array link whose
39
+ * source or target does not resolve to a point is dropped, with one warning
40
+ * per data change; a pair that names no point is skipped by the engine and
41
+ * keeps its index.
42
+ */
43
+ export type CosmosGraphLinks<LinkDataT> = readonly LinkDataT[] | Float32Array | {
44
+ pairs: Float32Array;
45
+ attributes?: CosmosLinkAttributes;
46
+ };
47
+ /**
48
+ * The cosmos.gl config keys deck owns in this embedding — the canvas, the view
49
+ * and its zoom, the frame loop, the pointer and its callbacks. The layer strips
50
+ * them from `config`: deck's view state, controller, event callbacks and
51
+ * `useDevicePixels` are the way to those things.
52
+ */
53
+ export declare const DECK_OWNED_CONFIG_KEYS: readonly ["enableRenderLoop", "backgroundColor", "pixelRatio", "showFPSMonitor", "attribution", "hoveredPointCursor", "hoveredLinkCursor", "initialZoomLevel", "enableZoom", "enableSimulationDuringZoom", "enableDrag", "fitViewOnInit", "fitViewDelay", "fitViewPadding", "fitViewDuration", "fitViewByPointsInRect", "fitViewByPointIndices", "simulationRepulsionFromMouse", "enableRightClickRepulsion", "onClick", "onPointClick", "onLinkClick", "onBackgroundClick", "onContextMenu", "onPointContextMenu", "onLinkContextMenu", "onBackgroundContextMenu", "onMouseMove", "onPointMouseOver", "onPointMouseOut", "onLinkMouseOver", "onLinkMouseOut", "onZoomStart", "onZoom", "onZoomEnd", "onDragStart", "onDrag", "onDragEnd"];
54
+ /**
55
+ * cosmos.gl's configuration as the layer takes it: every key of `GraphConfig`
56
+ * except the ones deck owns (`DECK_OWNED_CONFIG_KEYS`). Rendering keys work as
57
+ * in cosmos.gl, because cosmos.gl does the rendering. The transition keys have
58
+ * no effect: a headless `Graph` applies data changes at once.
59
+ */
60
+ export type CosmosGraphLayerConfig = Omit<GraphConfig, (typeof DECK_OWNED_CONFIG_KEYS)[number]>;
61
+ /**
62
+ * What `onGraphDataLoaded` reports: the graph, what the load replaced, and how
63
+ * your data maps to the graph's point and link indices. Per-point and per-link
64
+ * arrays you hand the graph (`setLinkStrength`, `setPointShapes`,
65
+ * `setPointClusters`, …) follow those indices. `links` and `pointIndexById`
66
+ * are the layer's own state: read or copy them, never mutate them.
67
+ */
68
+ export type CosmosGraphDataLoadedInfo<LinkDataT = unknown> = {
69
+ /** The graph the data was loaded into: layer-created or provided. */
70
+ graph: Graph;
71
+ /**
72
+ * The point positions were replaced, and with them possibly the point count.
73
+ * Per-point arrays sent before this load may no longer line up.
74
+ */
75
+ pointsLoaded: boolean;
76
+ /**
77
+ * The links were replaced. Per-link arrays sent before this load may no longer
78
+ * line up: the engine reuses the last one it was sent whenever its length
79
+ * matches the new link count, in the old order.
80
+ */
81
+ linksLoaded: boolean;
82
+ /**
83
+ * Point `i` is always entry `i` of `points` (or pair `i` of `initialPositions`).
84
+ * With array points and `getPointId`, this maps each id to its index; a repeated
85
+ * id maps to its last point. Otherwise `null`.
86
+ */
87
+ pointIndexById: ReadonlyMap<string | number, number> | null;
88
+ /**
89
+ * Array links: the links the graph holds, in its order — link `i` is
90
+ * `info.links[i]`. Links whose endpoints name no point are not among them, so
91
+ * an index into your `links` array can differ. Binary links, or no `links`
92
+ * prop: `null`, and link `i` is pair `i` of your pair array.
93
+ */
94
+ links: readonly LinkDataT[] | null;
95
+ };
96
+ /**
97
+ * Picking info from a CosmosGraphLayer: which kind of element was hit, with `index`
98
+ * counting within that kind (point `i` or link `i`), and `object` the original record
99
+ * for array data.
20
100
  */
21
- export type CosmosGraphLinks<LinkDataT> = readonly LinkDataT[] | Float32Array;
22
- /** Picking info from a CosmosGraphLayer: which kind of element was hit. */
23
101
  export type CosmosGraphPickingInfo = PickingInfo & {
24
102
  elementType?: 'point' | 'link';
25
103
  };
26
104
  export type CosmosGraphLayerProps<PointDataT = unknown, LinkDataT = unknown> = CosmosGraphLayerOwnProps<PointDataT, LinkDataT> & LayerProps;
27
105
  type CosmosGraphLayerOwnProps<PointDataT, LinkDataT> = {
28
- /** One entry per point — an array of your objects, or `{ length, initialPositions? }`. */
29
- points: CosmosGraphPoints<PointDataT>;
30
- /** One entry per link — an array of your objects, or a flat point-index pair array. */
106
+ /**
107
+ * One entry per point — an array of your objects, or `{ length, initialPositions?, attributes? }`.
108
+ * The layer loads them, with `links` and the styling accessors, into the graph. Omit it to
109
+ * draw the data the graph already holds instead: the layer then writes nothing into the
110
+ * graph, styling accessors included — the mode for an application-loaded `graph`.
111
+ */
112
+ points?: CosmosGraphPoints<PointDataT> | null;
113
+ /** One entry per link — an array of your objects, or a flat point-index pair array. Ignored without `points`. */
31
114
  links?: CosmosGraphLinks<LinkDataT> | null;
32
115
  /**
33
116
  * Stable point id accessor. When provided (with array points), link
34
117
  * accessors may return ids instead of point indices.
35
118
  */
36
119
  getPointId?: Accessor<PointDataT, string | number> | null;
37
- /** Initial `[x, y]` position accessor for array points; points it leaves undefined are seeded randomly. */
38
- getPointPosition?: Accessor<PointDataT, readonly [number, number] | null | undefined> | null;
39
120
  /**
40
- * Point diameter accessor, in `pointSizeUnits`; `0` hides the point.
41
- * @default 4
121
+ * Initial `[x, y]` position accessor for array points, in cosmos space
122
+ * coordinates; points it leaves undefined are seeded randomly.
42
123
  */
43
- getPointSize?: Accessor<PointDataT, number>;
124
+ getPointPosition?: Accessor<PointDataT, readonly [number, number] | null | undefined> | null;
44
125
  /**
45
- * Point RGBA color accessor, channels in 0..255.
46
- * @default [74, 92, 191, 230]
126
+ * Point size accessor, in cosmos.gl's units: pixels at zoom 1, scaled with the view
127
+ * when `config.scalePointsOnZoom` is on, times `config.pointSizeScale`. `0` hides the point.
128
+ * Unset, every point draws `config.pointDefaultSize`.
129
+ * @default null
47
130
  */
48
- getPointColor?: Accessor<PointDataT, Color>;
131
+ getPointSize?: Accessor<PointDataT, number> | null;
49
132
  /**
50
- * The units of the point diameter.
51
- * @default 'pixels'
133
+ * Point RGBA color accessor, channels in 0..255 (deck's convention; converted for cosmos).
134
+ * Unset, every point draws `config.pointDefaultColor`.
135
+ * @default null
52
136
  */
53
- pointSizeUnits?: Unit;
137
+ getPointColor?: Accessor<PointDataT, Color> | null;
54
138
  /**
55
139
  * Source accessor for array links: a point index, or a point id when
56
140
  * `getPointId` is set.
@@ -64,30 +148,27 @@ type CosmosGraphLayerOwnProps<PointDataT, LinkDataT> = {
64
148
  */
65
149
  getLinkTarget?: Accessor<LinkDataT, string | number>;
66
150
  /**
67
- * Link RGBA color accessor, channels in 0..255.
68
- * @default [94, 115, 194, 64]
151
+ * Link RGBA color accessor, channels in 0..255. Unset, every link draws
152
+ * `config.linkDefaultColor`.
153
+ * @default null
69
154
  */
70
- getLinkColor?: Accessor<LinkDataT, Color>;
155
+ getLinkColor?: Accessor<LinkDataT, Color> | null;
71
156
  /**
72
- * Link width accessor, in `linkWidthUnits`.
73
- * @default 1
157
+ * Link width accessor, in cosmos.gl's units (see `config.scaleLinksOnZoom`, `config.linkWidthScale`).
158
+ * Unset, every link draws `config.linkDefaultWidth`.
159
+ * @default null
74
160
  */
75
- getLinkWidth?: Accessor<LinkDataT, number>;
161
+ getLinkWidth?: Accessor<LinkDataT, number> | null;
76
162
  /**
77
- * The units of the link width.
78
- * @default 'pixels'
79
- */
80
- linkWidthUnits?: Unit;
81
- /**
82
- * Lets pointer drags grab a point: pinned on drag start, moved with the
83
- * pointer, released per `unpinOnDragEnd`. View panning is suppressed while
84
- * a point is grabbed.
163
+ * Lets pointer drags grab a point: pinned on drag start, moved with the pointer,
164
+ * released per `unpinOnDragEnd`. View panning is suppressed while a point is
165
+ * grabbed. Needs `pickable`.
85
166
  * @default false
86
167
  */
87
168
  enablePointDrag?: boolean;
88
169
  /**
89
- * Simulation alpha to restart with when a drag starts, so the graph
90
- * responds to the moving point; `null` leaves the simulation untouched.
170
+ * Simulation alpha to restart with when a drag starts, so the graph responds
171
+ * to the moving point; `null` leaves the simulation untouched.
91
172
  * @default 0.1
92
173
  */
93
174
  dragReheatAlpha?: number | null;
@@ -102,67 +183,185 @@ type CosmosGraphLayerOwnProps<PointDataT, LinkDataT> = {
102
183
  onPointDrag?: ((info: CosmosGraphPickingInfo) => void) | null;
103
184
  /** Called when a point drag ends. */
104
185
  onPointDragEnd?: ((info: CosmosGraphPickingInfo) => void) | null;
105
- /** Simulation configuration, passed through to `GraphSimulation` (forces, spaceSize, callbacks). */
106
- simulationConfig?: GraphSimulationConfig;
107
186
  /**
108
- * Called once with the layer-owned `GraphSimulation` — the escape hatch for
109
- * advanced control (pause, pinning, sparse position writes).
187
+ * cosmos.gl's configuration — forces, space size, rendering options such as
188
+ * `curvedLinks`, `pointDefaultShape`, `linkDefaultArrows`, the simulation
189
+ * callbacks — passed to the layer-created `Graph`. A key left out goes back
190
+ * to the engine default. Ignored when `graph` is provided.
191
+ */
192
+ config?: CosmosGraphLayerConfig;
193
+ /**
194
+ * An application-owned headless `Graph` to draw instead of creating one:
195
+ * `new Graph(null, config, devicePromise)` with the device from deck's
196
+ * `onDeviceInitialized`. The layer steps it while it runs (`pause()` it to
197
+ * take over stepping, then `deck.redraw()` after each manual `step()`) and
198
+ * draws it; it never configures or destroys it — `config` and
199
+ * `onGraphCreated` apply only to a layer-created graph, and teardown is the
200
+ * application's, before `deck.finalize()`.
201
+ *
202
+ * `points` decides who loads the data. Given, the layer loads `points`,
203
+ * `links` and the styling accessors into the graph once the device check has
204
+ * passed, over whatever it held. Omitted, the layer draws the graph's own
205
+ * data and writes nothing. Several layers may draw one graph — it steps once
206
+ * per frame however many draw it — as long as at most one of them loads data.
207
+ */
208
+ graph?: Graph | null;
209
+ /**
210
+ * Called once with the layer-created `Graph` — the whole cosmos.gl API for
211
+ * what the props do not cover: pause, pin, reheat, shapes, clusters, trackers,
212
+ * sparse position writes. Not called for a provided `graph`.
110
213
  */
111
- onSimulationCreated?: ((simulation: GraphSimulation) => void) | null;
214
+ onGraphCreated?: ((graph: Graph) => void) | null;
215
+ /**
216
+ * Called after each load of `points` or `links` into the graph, once the
217
+ * graph holds the new data — and, with both load flags `false`, when only the
218
+ * id map changed. Use it to send what lines up with the graph's indices —
219
+ * link strengths, shapes, arrows, clusters, pins — again after a reload:
220
+ * `info.pointIndexById` and `info.links` map your data to those indices.
221
+ * Not called when the layer draws a graph's own data (no `points`).
222
+ *
223
+ * The first call comes when the graph is ready (and again after a `graph`
224
+ * swap), later ones during deck's layer update. Calls on `info.graph` are
225
+ * fine in either; defer anything that changes layer props. A throw goes to
226
+ * deck's `onError`, and the load stands.
227
+ */
228
+ onGraphDataLoaded?: ((info: CosmosGraphDataLoadedInfo<LinkDataT>) => void) | null;
112
229
  };
113
230
  /** The slice of a deck gesture event the drag handlers need. */
114
231
  type DragGestureEvent = {
115
232
  stopImmediatePropagation?: () => void;
116
233
  };
117
234
  /**
118
- * The batteries-included cosmos.gl graph layer: give it points and links, and
119
- * it owns the rest. The layer creates a `GraphSimulation` on deck's device,
120
- * ingests the data, advances the simulation once per animation frame from
121
- * deck's shared timeline while it runs (deck goes idle when it settles — no
122
- * `_animate` required), renders through `CosmosLinksLayer` + `CosmosPointsLayer`
123
- * (positions stay GPU-resident), and destroys the simulation when the layer is
124
- * removed. Picking reports `elementType: 'point' | 'link'` alongside the index
125
- * and, for array data, the original object.
235
+ * The cosmos.gl graph layer: give it points and links, and cosmos.gl lays them
236
+ * out and draws them under deck's camera. The layer creates a headless `Graph`
237
+ * on deck's device (or draws the application's, via `graph`), loads the data —
238
+ * or, without `points`, leaves the graph's own data alone — advances the
239
+ * simulation once per animation frame from deck's shared timeline while it runs
240
+ * (deck goes idle when it settles), hands deck's view to cosmos.gl before each
241
+ * draw and records cosmos.gl's own point and link draws into deck's render
242
+ * pass. Everything cosmos.gl renders is available through `config` and the
243
+ * `Graph` handle: shapes, arrows, dashes, curves, greyout, rings.
244
+ *
245
+ * The view: cosmos.gl's is a uniform scale plus a translation with y up, so
246
+ * the layer draws under an `OrthographicView({ flipY: false })` or a map view
247
+ * at pitch 0 and bearing 0, with `modelMatrix` placing the space in the world.
248
+ * A rotated, pitched or y-down view is reported once and not drawn.
249
+ *
250
+ * Picking is deck's: in deck's pick pass cosmos.gl draws its picking colors
251
+ * (an index per point and per link, hard-edged), so `pickable` gives hover and
252
+ * click with `info.elementType`, `info.index` and, for array data, `info.object`.
253
+ * `autoHighlight` lights the hovered point or link with cosmos.gl's own hover
254
+ * ring and hovered-link width (`config.hoveredPointRingColor`,
255
+ * `config.hoveredLinkWidthIncrease`, `config.hoveredLinkColor`) and leaves focus
256
+ * to the application; `highlightColor` is not used.
257
+ * `enablePointDrag` grabs a point and moves it, on a map as well.
126
258
  */
127
- export declare class CosmosGraphLayer<PointDataT = unknown, LinkDataT = unknown> extends CompositeLayer<Required<CosmosGraphLayerOwnProps<PointDataT, LinkDataT>>> {
259
+ export declare class CosmosGraphLayer<PointDataT = unknown, LinkDataT = unknown> extends Layer<Required<CosmosGraphLayerOwnProps<PointDataT, LinkDataT>>> {
128
260
  static layerName: string;
129
261
  static defaultProps: DefaultProps<CosmosGraphLayerProps<unknown, unknown>>;
130
262
  state: {
131
- simulation?: GraphSimulation;
263
+ graph?: Graph;
264
+ /** The `graph` prop this state was built from; `null` when the layer created its own. */
265
+ providedGraph: Graph | null;
132
266
  isReady: boolean;
267
+ /** `points` changed before the graph was ready: load them once it is. */
268
+ isIngestPending: boolean;
133
269
  pointCount: number;
134
- pointsData: readonly PointDataT[] | {
135
- length: number;
136
- attributes?: Record<string, unknown>;
137
- };
138
- linksData: readonly LinkDataT[] | {
139
- length: number;
140
- attributes: Record<string, unknown>;
141
- } | null;
142
- /** Array links only: the resolved `[source, target]` point-index pairs, one per entry of `linksData`. */
143
- linkIndices: Float32Array | null;
270
+ linkCount: number;
271
+ /**
272
+ * Load mode: what the graph holds, so a channel reloads only when its own input
273
+ * changes and a restyle leaves the layout alone. `loadedPositions` is the
274
+ * `initialPositions` array, `SEEDED`, or the points array; `loadedPairs` the pair
275
+ * array sent last; `idToIndex` the id map of the loaded points; `keptLinks` the
276
+ * array links the graph holds, in its order.
277
+ */
278
+ hasLoaded: boolean;
279
+ loadedPositions?: unknown;
280
+ loadedPairs?: Float32Array | null;
281
+ idToIndex?: Map<string | number, number> | null;
282
+ keptLinks: readonly LinkDataT[] | null;
283
+ /** The view was found unsupported and said so; said once. */
284
+ viewWarned?: boolean;
285
+ linksWarned?: boolean;
144
286
  draggedPointIndex: number | null;
287
+ /**
288
+ * This layer's last auto-highlight write was a hover. Several layers may draw one
289
+ * graph, and the hover lives on the graph: only the layer holding it clears it.
290
+ */
291
+ holdsHover: boolean;
145
292
  animationHandle?: number;
146
293
  };
147
294
  get isLoaded(): boolean;
148
295
  initializeState(): void;
149
296
  updateState(params: UpdateParameters<this>): void;
150
- renderLayers(): Layer[] | null;
297
+ draw(opts: {
298
+ shaderModuleProps?: {
299
+ picking?: {
300
+ isActive?: number | boolean;
301
+ };
302
+ };
303
+ parameters?: {
304
+ blendColor?: number[];
305
+ };
306
+ }): void;
307
+ getPickingInfo({ info }: GetPickingInfoParams): CosmosGraphPickingInfo;
151
308
  onDragStart(info: PickingInfo, event: DragGestureEvent): boolean;
152
309
  onDrag(info: PickingInfo, event: DragGestureEvent): boolean;
153
310
  onDragEnd(info: PickingInfo, event: DragGestureEvent): boolean;
154
- getPickingInfo(params: GetPickingInfoParams): CosmosGraphPickingInfo;
155
- /** The whole simulation space; lets deck's viewport helpers frame the graph. */
311
+ /** The whole simulation space, in space coordinates; lets deck's viewport helpers frame the graph. */
156
312
  getBounds(): [number[], number[]] | null;
157
313
  finalizeState(context: LayerContext): void;
314
+ /** No deck attributes: cosmos.gl holds every channel and draws them itself. */
315
+ protected _getAttributeManager(): null;
158
316
  /**
159
- * Points and links have separate index spaces, so the same picking color
160
- * exists in both sublayers: highlight only the sublayer that was hovered
161
- * and clear the other, or hovering point N would also tint link N.
317
+ * deck's auto-highlight, through cosmos.gl's own hover emphasis: the hovered point
318
+ * gets the hover ring, the hovered link the hovered-link width and color. It is the
319
+ * graph's host hover, so the graph's config — focus included — stays the
320
+ * application's. deck's picking module has no model of ours to tint, so
321
+ * `highlightColor` does not apply.
162
322
  */
163
323
  protected _updateAutoHighlight(info: PickingInfo): void;
324
+ /**
325
+ * The pointer in space coordinates, through the view of the viewport the pointer
326
+ * is in — the same derivation `draw` hands cosmos, inverted — under a map as well
327
+ * as an orthographic view. Not through the view cosmos holds: that is whichever
328
+ * viewport drew the graph last, a thumbnail's as easily as the one being dragged
329
+ * in. Pixels are relative to that viewport. Where the view cannot be derived the
330
+ * point stays where it is.
331
+ */
332
+ private _dragPosition;
333
+ /** Adopts the provided graph, or creates a headless one on deck's device when `provided` is `null`. */
334
+ private _attachGraph;
335
+ /**
336
+ * Destroys a layer-created graph; a provided one is left to the application, without
337
+ * the hover this layer put on it. deck sends no leave to a layer it removes.
338
+ */
339
+ private _releaseGraph;
340
+ /** The graph's space size — authoritative for a provided graph too. */
341
+ private _spaceSize;
342
+ /**
343
+ * The config for a layer-created graph: the prop without the keys deck owns,
344
+ * and the pixel ratio deck's canvas draws at, so cosmos sizes pixels alike.
345
+ */
346
+ private _graphConfig;
347
+ /** deck's device pixels per CSS pixel, as its canvas context reports them. */
348
+ private _pixelRatio;
349
+ /**
350
+ * cosmos's view for a deck viewport: a uniform scale `k` (pixels per space
351
+ * unit) and a translation, per `setViewTransform`'s space → screen formula,
352
+ * inverted. Three anchors through deck's projection — the space origin, its
353
+ * x axis, its y axis — give the scale and tell whether the view is one cosmos
354
+ * can draw: unrotated, unpitched, y up. The space origin's pixel is returned
355
+ * too, for mapping the other way.
356
+ */
357
+ private _viewTransform;
164
358
  private _onTimelineTick;
165
- private _dragCoordinate;
166
- private _updateSimulationData;
359
+ /**
360
+ * Load mode: puts the layer's `points`, `links` and styles into the graph.
361
+ * Each channel is sent only when its own input changed — a restyle leaves the
362
+ * layout alone, a changed id map re-resolves array links without touching the
363
+ * positions.
364
+ */
365
+ private _load;
167
366
  }
168
367
  export {};
package/dist/index.d.ts CHANGED
@@ -1,11 +1,8 @@
1
1
  /**
2
- * deck.gl layers that render a cosmos.gl simulation with **zero position
3
- * readback**: each draw samples the live GPU position texture exposed by
4
- * `graph.getPointPositionTexture()` with `texelFetch`, so point coordinates
5
- * never leave the GPU. The layers share deck.gl's device with the cosmos.gl
6
- * simulation, which the application owns and steps.
2
+ * A deck.gl layer that runs and draws a cosmos.gl graph. The simulation runs
3
+ * on deck.gl's own luma.gl device, and cosmos.gl's own renderer draws it into
4
+ * deck's render pass under deck's camera — positions never leave the GPU, and
5
+ * every cosmos.gl rendering option is available through `config`. Picking is
6
+ * deck's: cosmos.gl draws its picking colors in deck's pick pass.
7
7
  */
8
- export { CosmosGraphLayer, type CosmosGraphLayerProps, type CosmosGraphPoints, type CosmosGraphLinks, type CosmosGraphPickingInfo, } from './cosmos-graph-layer';
9
- export { CosmosPointsLayer, type CosmosPointsLayerProps } from './cosmos-points-layer';
10
- export { CosmosLinksLayer, type CosmosLinksLayerProps } from './cosmos-links-layer';
11
- export type { PositionTextureSource } from './types';
8
+ export { CosmosGraphLayer, DECK_OWNED_CONFIG_KEYS, type CosmosGraphLayerProps, type CosmosGraphLayerConfig, type CosmosGraphPoints, type CosmosPointAttributes, type CosmosGraphLinks, type CosmosLinkAttributes, type CosmosGraphDataLoadedInfo, type CosmosGraphPickingInfo, } from './cosmos-graph-layer';