@fusion.dev/helix-graph 0.125.0 → 0.127.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 +84 -35
- package/dist/connect-graph/arrange.d.ts +4 -2
- package/dist/connect-graph/arrange.js +5 -22
- package/dist/connect-graph/connect-graph.d.ts +18 -6
- package/dist/connect-graph/connect-graph.js +76 -32
- package/dist/connect-graph/diff.d.ts +7 -0
- package/dist/connect-graph/looks.d.ts +8 -0
- package/dist/connect-graph/looks.js +6 -3
- package/dist/connect-graph/seed.d.ts +9 -0
- package/dist/connect-graph/seed.js +21 -15
- package/dist/connect-graph/stencil.d.ts +11 -1
- package/dist/connect-graph/stencil.js +109 -11
- package/dist/cosmos/cosmos-driver.d.ts +5 -4
- package/dist/cosmos/cosmos-driver.js +122 -39
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -2
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/model.d.ts +16 -0
- package/dist/model/model.js +50 -0
- package/dist/overlay/overlay.d.ts +14 -8
- package/dist/overlay/overlay.js +64 -62
- package/dist/shapes/flat.d.ts +3 -2
- package/dist/shapes/flat.js +59 -6
- package/dist/shapes/index.d.ts +3 -4
- package/dist/shapes/index.js +3 -4
- package/dist/{connect-graph → shapes}/shape-field.d.ts +12 -3
- package/dist/{connect-graph → shapes}/shape-field.js +4 -2
- package/dist/shapes/solids.d.ts +3 -3
- package/dist/shapes/solids.js +25 -9
- package/dist/{three → shapes}/surface.d.ts +1 -1
- package/dist/shapes/triangles.d.ts +12 -3
- package/dist/shapes/triangles.js +83 -2
- package/dist/sigma/sigma-driver.d.ts +33 -17
- package/dist/sigma/sigma-driver.js +69 -17
- package/dist/three/three-driver.d.ts +12 -3
- package/dist/three/three-driver.js +376 -201
- package/package.json +9 -5
- package/dist/shapes/model.d.ts +0 -12
- package/dist/shapes/model.js +0 -31
- /package/dist/{three → shapes}/surface.js +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-graph",
|
|
3
3
|
"description": "Connects the Helix Graph frame to a graph renderer: Sigma.js, cosmos.gl, three.js, or a driver of your own.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.127.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"types": "./dist/cosmos/index.d.ts",
|
|
22
22
|
"default": "./dist/cosmos/index.js"
|
|
23
23
|
},
|
|
24
|
+
"./model": {
|
|
25
|
+
"types": "./dist/model/index.d.ts",
|
|
26
|
+
"default": "./dist/model/index.js"
|
|
27
|
+
},
|
|
24
28
|
"./shapes": {
|
|
25
29
|
"types": "./dist/shapes/index.d.ts",
|
|
26
30
|
"default": "./dist/shapes/index.js"
|
|
@@ -47,12 +51,12 @@
|
|
|
47
51
|
},
|
|
48
52
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
49
53
|
"dependencies": {
|
|
50
|
-
"@fusion.dev/helix-core": "0.
|
|
54
|
+
"@fusion.dev/helix-core": "0.127.0"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@cosmos.gl/graph": "^3.4.2",
|
|
54
|
-
"@fusion.dev/helix-headless": "0.
|
|
55
|
-
"@fusion.dev/helix-testing": "0.
|
|
58
|
+
"@fusion.dev/helix-headless": "0.127.0",
|
|
59
|
+
"@fusion.dev/helix-testing": "0.127.0",
|
|
56
60
|
"@types/bun": "^1.3.0",
|
|
57
61
|
"@types/three": "^0.186.0",
|
|
58
62
|
"d3-force-3d": "^3.0.6",
|
|
@@ -77,7 +81,7 @@
|
|
|
77
81
|
"@cosmos.gl/graph": "^3.4.0",
|
|
78
82
|
"d3-force-3d": "^3.0.0",
|
|
79
83
|
"sigma": "^3.0.0",
|
|
80
|
-
"three": ">=0.160.0"
|
|
84
|
+
"three": ">=0.160.0 <0.200.0"
|
|
81
85
|
},
|
|
82
86
|
"peerDependenciesMeta": {
|
|
83
87
|
"@cosmos.gl/graph": {
|
package/dist/shapes/model.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ShapeField } from '../connect-graph/shape-field.js';
|
|
2
|
-
import { type TriangleOptions } from './triangles.js';
|
|
3
|
-
/**
|
|
4
|
-
* A solid field from a glTF model, the web's standard format for one: a
|
|
5
|
-
* URL to a `.glb` or `.gltf` file, or the file's bytes. Every mesh in it is
|
|
6
|
-
* read, placed as the model places it.
|
|
7
|
-
*
|
|
8
|
-
* **three.js reads the file**, imported when this is first called, so a page
|
|
9
|
-
* that draws no model never downloads a loader. It is an optional peer of
|
|
10
|
-
* this package.
|
|
11
|
-
*/
|
|
12
|
-
export declare const shapeFromModel: (source: string | ArrayBuffer, options?: TriangleOptions) => Promise<ShapeField>;
|
package/dist/shapes/model.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { shapeFromTriangles } from './triangles.js';
|
|
2
|
-
export const shapeFromModel = async (source, options = {}) => {
|
|
3
|
-
const [{ GLTFLoader }, { Mesh, Vector3 }] = await Promise.all([
|
|
4
|
-
import('three/addons/loaders/GLTFLoader.js'),
|
|
5
|
-
import('three'),
|
|
6
|
-
]);
|
|
7
|
-
const loader = new GLTFLoader();
|
|
8
|
-
const model = typeof source === 'string'
|
|
9
|
-
? await loader.loadAsync(source)
|
|
10
|
-
: await loader.parseAsync(source, '');
|
|
11
|
-
model.scene.updateMatrixWorld(true);
|
|
12
|
-
const corners = [];
|
|
13
|
-
const point = new Vector3();
|
|
14
|
-
model.scene.traverse((object) => {
|
|
15
|
-
if (!(object instanceof Mesh)) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const geometry = object.geometry;
|
|
19
|
-
const place = geometry.getAttribute('position');
|
|
20
|
-
if (!place) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const index = geometry.getIndex();
|
|
24
|
-
const count = index ? index.count : place.count;
|
|
25
|
-
for (let at = 0; at < count; at++) {
|
|
26
|
-
point.fromBufferAttribute(place, index ? index.getX(at) : at).applyMatrix4(object.matrixWorld);
|
|
27
|
-
corners.push(point.x, point.y, point.z);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return shapeFromTriangles(corners, null, options);
|
|
31
|
-
};
|
|
File without changes
|