![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@cosmograph/cosmograph
Advanced tools
Cosmograph is a powerful and flexible visualization component built on top of the @cosmograph/cosmos GPU-accelerated force graph layout algorithm and rendering engine.
To install Cosmograph, run the following command:
npm install @cosmograph/cosmograph
To use Cosmograph, import the Cosmograph
class from @cosmograph/cosmograph
and create a new instance of it with a div element and a configuration object. Then, set the data for the graph using the setData
method.
import { Cosmograph } from '@cosmograph/cosmograph'
const nodes = [
{ id: 0, color: 'red' },
{ id: 1, color: 'green' },
{ id: 2, color: 'blue' },
]
const links = [
{ source: 0, target: 1, color: 'blue' },
{ source: 1, target: 2, color: 'green' },
{ source: 2, target: 0, color:'red' },
]
const cosmographContainer = document.createElement('div')
const config = {
simulation: {
repulsion: 0.5,
},
renderLinks: true,
linkColor: link => link.color,
nodeColor: node => node.color,
events: {
onClick: node => {
console.log('Clicked node: ', node)
},
},
/* ... */
}
const cosmograph = new Cosmograph(canvas, config)
cosmograph.setData(nodes, links)
Cosmograph has an extensive set of configuration options that allow you to customize the appearance and behavior of the graph. For more information on configuration options, see the documentation.
Cosmograph is licensed under the CC-BY-NC-4.0 license, or the Creative Commons Attribution-NonCommercial 4.0 International License.
FAQs
Cosmograph: The fastest web-based graph visualization library
We found that @cosmograph/cosmograph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.