Download the PHP package georgebuilds/livewire-molecule without Composer
On this page you can find all versions of the php package georgebuilds/livewire-molecule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download georgebuilds/livewire-molecule
More information about georgebuilds/livewire-molecule
Files in georgebuilds/livewire-molecule
Package livewire-molecule
Short Description A Laravel Livewire component for 3D molecular visualization using 3DMol.js
License MIT
Informations about the package livewire-molecule
Livewire Molecule
A Laravel Livewire component for 3D molecular visualization powered by 3DMol.js
Features
- ๐งช Multiple input formats: SMILES, InChI, PDB ID, PubChem CID, or raw SDF data
- ๐จ Multiple visualization styles: stick, sphere, cartoon, line, ball-and-stick
- ๐ Three display modes: interactive, rotating, static
- โก Reactive updates with Livewire
- ๐ฏ Automatic 3D coordinate generation from SMILES/InChI
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- Livewire 4.x (requires Laravel 11+)
- Alpine.js (included with Livewire)
Installation
Optionally publish the config file:
Usage
Basic Usage
Display Modes
Visualization Styles
Customizing Appearance
Advanced 3Dmol Options
Pass additional 3Dmol.js options through the Livewire wrapper:
Reactive Updates
The component reacts to property changes:
Configuration
Input Format Priority
When multiple identifiers are provided, the component uses this priority:
sdf(raw data, no API call needed)pdb(fetches from RCSB PDB)pubchem-cid(fetches from PubChem)smiles(converts via NCI CACTUS)inchi(converts via NCI CACTUS)
External APIs Used
This package relies on these free public APIs for structure retrieval and conversion:
| API | Purpose | Rate Limits |
|---|---|---|
| RCSB PDB | Fetch protein structures | Generous |
| PubChem | Fetch compound structures | 5 req/sec |
| NCI CACTUS | SMILES/InChI โ 3D conversion | Best effort |
For production use with high traffic, consider implementing your own conversion service or caching aggressively.
Troubleshooting
"Failed to convert SMILES to 3D structure"
- Verify the SMILES string is valid
- The NCI CACTUS service may be temporarily unavailable
- Some complex molecules may fail to convert
Molecule appears blank
- Check browser console for JavaScript errors
- Ensure 3DMol.js is loading (check Network tab)
- Verify the molecule data is being resolved (check
$moleculeDataproperty)
"Cannot connect to [API]" or blank molecule in production
This package requires outbound HTTP access to external APIs for SMILES/InChI conversion and PubChem/PDB data fetching.
Laravel Vapor: Enable outbound HTTP in your vapor.yml:
Other platforms: Ensure your server/firewall allows outbound HTTPS to:
cactus.nci.nih.gov(SMILES/InChI conversion)pubchem.ncbi.nlm.nih.gov(PubChem data)files.rcsb.org(PDB structures)3dmol.csb.pitt.edu(3DMol.js CDN)
Workaround: Use raw SDF/PDB data instead of SMILES/PubChem CIDs to avoid external API calls:
Upgrade Guide (v1 โ v2)
v2 renames the publishable config file and config key.
-
Republish config:
- Update config usage:
- File moved from
config/molecule.phptoconfig/livewire-molecule.php - Config key changed from
moleculetolivewire-molecule
- File moved from
If you referenced config values in your app, update:
Local Development
To preview the component in a real browser while working on the package:
Then open http://localhost:8000 to see a live demo page with multiple molecule examples rendered using the actual component.
Testing
Acknowledgments
- 3DMol.js - BSD-3-Clause licensed molecular viewer
- NCI CACTUS - Chemical structure conversion service
- PubChem - Chemical compound database
License
MIT License. See LICENSE for details.
This package includes 3DMol.js which is licensed under BSD-3-Clause.
All versions of livewire-molecule with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
livewire/livewire Version ^4.1