-
Notifications
You must be signed in to change notification settings - Fork 962
Open
Description
I'm using 3d-force-graph with custom node/link labels via three-spritetext, which requires access to the THREE namespace to create sprite objects.
Currently, I'm loading THREE.js separately:
<script src="https://unpkg.com/three@0.159.0/build/three.min.js"></script>
<script src="https://unpkg.com/3d-force-graph@1.73.3/dist/3d-force-graph.min.js"></script>
<script src="https://unpkg.com/three-spritetext@1.8.2/dist/three-spritetext.min.js"></script>This causes two issues:
- Deprecation warnings (as of THREE.js r150+):
Scripts "build/three.js" and "build/three.min.js" are deprecated with r150+,
and will be removed with r160. Please use ES Modules or alternatives.
- Multiple instances warning:
WARNING: Multiple instances of Three.js being imported.
Question: Is there a way to access the THREE.js instance that 3d-force-graph uses internally, so I can avoid importing it separately? Something like:
const THREE = graph.three(); // or similar?
const sprite = new THREE.SpriteText('Label');This would eliminate the multiple instances issue and align with THREE.js's move toward ES modules.
Use case: Creating custom three.js objects (sprites, geometries) for nodeThreeObject() and linkThreeObject() customizations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels