Skip to content

Commit

Permalink
Changed to use importmap and a new threejs version
Browse files Browse the repository at this point in the history
  • Loading branch information
met4citizen committed Apr 13, 2024
1 parent b08852b commit a3b2ca0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
.nodeLabelGraph3d, .linkLabelGraph3d { display: inline-block; background-color: olive; color: white; font-size: 14px; font-weight: bold; line-height: 20px; padding: 0 4px; height: auto; min-width: 14px; border-radius: 4px; text-align: center; vertical-align: middle; }
</style>

<script type="importmap">
{ "imports":
{
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js/+esm",
"three/examples/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/",
"forcegraph": "https://cdn.jsdelivr.net/npm/[email protected]/+esm"
}
}
</script>

<script nomodule>alert("You browser doesn't seem to support modules. Use a modern desktop browser to run Hypergraph 3D.");</script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha256-4+XzXVhsDmqanXGHaHvgh1gMQKX40OUvDEBTu8JcmNs=" crossorigin="anonymous"></script>

Expand Down
2 changes: 1 addition & 1 deletion modules/ConvexGeometry.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BufferGeometry, Float32BufferAttribute } from 'https://cdn.jsdelivr.net/npm/three@0.149.0/build/three.module.js';
import { BufferGeometry, Float32BufferAttribute } from 'three';
import { ConvexHull } from './ConvexHull.mjs';

class ConvexGeometry extends BufferGeometry {
Expand Down
2 changes: 1 addition & 1 deletion modules/ConvexHull.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Plane,
Triangle,
Vector3
} from 'https://cdn.jsdelivr.net/npm/three@0.149.0/build/three.module.js';
} from 'three';

/**
* Ported from: https://github.com/maurizzzio/quickhull3d/ by Mauricio Poppe (https://github.com/maurizzzio)
Expand Down
4 changes: 2 additions & 2 deletions modules/Graph3D.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
BufferGeometry, BufferAttribute, Sprite, SpriteMaterial, Texture,
MeshBasicMaterial, Mesh, DoubleSide, Vector3
} from 'https://cdn.jsdelivr.net/npm/three@0.149.0/build/three.module.js'
} from 'three'
import { ConvexGeometry } from './ConvexGeometry.mjs';

import _3dForceGraph from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
import _3dForceGraph from 'forcegraph';
import { Graph } from "./Graph.mjs";

/**
Expand Down
2 changes: 1 addition & 1 deletion modules/SpriteText.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LinearFilter, Sprite, SpriteMaterial, Texture } from 'https://cdn.jsdelivr.net/npm/three@0.149.0/build/three.module.js'
import { LinearFilter, Sprite, SpriteMaterial, Texture } from 'three'

class SpriteText extends Sprite {

Expand Down

0 comments on commit a3b2ca0

Please sign in to comment.