@cosmos.gl/graph 2.6.2 → 2.7.0-beta.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.
- package/dist/config.d.ts +2 -2
- package/dist/graph/utils/error-message.d.ts +1 -1
- package/dist/helper.d.ts +39 -2
- package/dist/index-B1_1MjaX.js +19917 -0
- package/dist/index-B1_1MjaX.js.map +1 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +14 -14658
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1068 -469
- package/dist/index.min.js.map +1 -1
- package/dist/modules/Clusters/index.d.ts +11 -6
- package/dist/modules/ForceCenter/index.d.ts +10 -3
- package/dist/modules/ForceGravity/index.d.ts +5 -1
- package/dist/modules/ForceLink/index.d.ts +8 -5
- package/dist/modules/ForceManyBody/index.d.ts +16 -7
- package/dist/modules/ForceMouse/index.d.ts +5 -1
- package/dist/modules/Lines/index.d.ts +11 -5
- package/dist/modules/Points/index.d.ts +30 -14
- package/dist/modules/Store/index.d.ts +93 -0
- package/dist/modules/core-module.d.ts +3 -3
- package/dist/webgl-device-DzkMihDq.js +3923 -0
- package/dist/webgl-device-DzkMihDq.js.map +1 -0
- package/package.json +5 -3
package/dist/config.d.ts
CHANGED
|
@@ -447,8 +447,8 @@ export interface GraphConfigInterface {
|
|
|
447
447
|
*/
|
|
448
448
|
showFPSMonitor?: boolean;
|
|
449
449
|
/**
|
|
450
|
-
*
|
|
451
|
-
* Default value: `2`
|
|
450
|
+
* Pixel ratio for the canvas. Higher values use more GPU memory but provide better quality on high-DPI displays.
|
|
451
|
+
* Default value: `window.devicePixelRatio || 2`
|
|
452
452
|
*/
|
|
453
453
|
pixelRatio?: number;
|
|
454
454
|
/**
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @param container The HTML element to append the error message to
|
|
4
4
|
* @returns The created error div element
|
|
5
5
|
*/
|
|
6
|
-
export declare function createWebGLErrorMessage(container: HTMLElement): HTMLDivElement;
|
|
6
|
+
export declare function createWebGLErrorMessage(container: HTMLElement, error: string): HTMLDivElement;
|
package/dist/helper.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Device, Framebuffer } from '@luma.gl/core';
|
|
2
2
|
import { default as DOMPurify } from 'dompurify';
|
|
3
3
|
export declare const isFunction: <T>(a: T) => boolean;
|
|
4
4
|
export declare const isArray: <T>(a: unknown | T[]) => a is T[];
|
|
@@ -7,7 +7,44 @@ export declare const isAClassInstance: <T>(a: T) => boolean;
|
|
|
7
7
|
export declare const isPlainObject: <T>(a: T) => boolean;
|
|
8
8
|
export declare function getRgbaColor(value: string | [number, number, number, number]): [number, number, number, number];
|
|
9
9
|
export declare function rgbToBrightness(r: number, g: number, b: number): number;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* TODO: Migrate from deprecated `readPixelsToArrayWebGL` to CommandEncoder API
|
|
12
|
+
*
|
|
13
|
+
* `readPixelsToArrayWebGL` is deprecated in luma.gl v9. The recommended modern approach is:
|
|
14
|
+
*
|
|
15
|
+
* 1. Create a buffer to hold the pixel data:
|
|
16
|
+
* const buffer = device.createBuffer({
|
|
17
|
+
* byteLength: width * height * 4 * 4, // RGBA, 4 bytes per float
|
|
18
|
+
* usage: Buffer.COPY_DST | Buffer.MAP_READ
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* 2. Copy texture/framebuffer to buffer using command encoder:
|
|
22
|
+
* const commandEncoder = device.createCommandEncoder();
|
|
23
|
+
* commandEncoder.copyTextureToBuffer({
|
|
24
|
+
* sourceTexture: fbo, // Can be Texture or Framebuffer
|
|
25
|
+
* width: sourceWidth ?? fbo.width,
|
|
26
|
+
* height: sourceHeight ?? fbo.height,
|
|
27
|
+
* origin: [sourceX, sourceY],
|
|
28
|
+
* destinationBuffer: buffer
|
|
29
|
+
* });
|
|
30
|
+
* const commandBuffer = commandEncoder.finish();
|
|
31
|
+
* device.submit(commandBuffer);
|
|
32
|
+
*
|
|
33
|
+
* 3. Read the data from the buffer (async):
|
|
34
|
+
* const pixelData = await buffer.readAsync(); // Returns ArrayBuffer
|
|
35
|
+
* return new Float32Array(pixelData);
|
|
36
|
+
*
|
|
37
|
+
* Note: The modern approach is asynchronous, so this function signature would need to change
|
|
38
|
+
* to return Promise<Float32Array> or we'd need to handle async at all call sites (18 locations).
|
|
39
|
+
*
|
|
40
|
+
* Migration impact:
|
|
41
|
+
* - This function is used in 18 places across the codebase
|
|
42
|
+
* - All call sites would need to be updated to handle async
|
|
43
|
+
* - Consider batching the migration to avoid inconsistencies
|
|
44
|
+
*
|
|
45
|
+
* Current status: Deprecated but still functional. Keeping for now until full migration can be planned.
|
|
46
|
+
*/
|
|
47
|
+
export declare function readPixels(device: Device, fbo: Framebuffer, sourceX?: number, sourceY?: number, sourceWidth?: number, sourceHeight?: number): Float32Array;
|
|
11
48
|
export declare function clamp(num: number, min: number, max: number): number;
|
|
12
49
|
export declare function isNumber(value: number | undefined | null | typeof NaN): boolean;
|
|
13
50
|
/**
|