Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cosmograph/cosmograph

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmograph/cosmograph

Cosmograph: The fastest web-based graph visualization library

  • 2.0.0-beta.8
  • npm
  • Socket score

Version published
Weekly downloads
740
increased by106.7%
Maintainers
0
Weekly downloads
 
Created
Source

🌌 Cosmograph

npm version license GitHub Issues Discord Docs

A powerful graph visualization library powered by @cosmograph/cosmos – a GPU-accelerated force layout engine. It rapidly visualizes real-time network simulations and static graph embeddings in any modern web browser, providing interactive tools for exploring your data.

✨ Features

  • Easily process millions of points and edges on modern hardware
  • Ready-to-use interactive components: timeline, histograms and legends
  • Handy features like clustering, labels, dragging points and area selection
  • Rich configuration API for full customization over graph behavior and appearance
  • Support for standard data formats including .csv, .parquet, .arrow and .json
  • SQL capabilities for powerful data transformations and filtering
  • Connect directly to your tables in external DuckDB instances

🚀 Quick Start

Install the package:

npm install @cosmograph/cosmograph@beta

Get the data, configure the graph and render Cosmograph in the provided container:

import { Cosmograph, prepareCosmographData } from '@cosmograph/cosmograph'

// Points and links data can be:
// - Array of objects
// - File (.csv/.tsv, .parquet/.pq, .arrow, .json)
// - URL string to a file
// - Apache Arrow Table (binary data Uint8Array/ArrayBuffer)
// - DuckDB table name if connection is passed into the Cosmograph constructor

const rawPoints = [{ id: 'a' }, { id: 'b' }, { id: 'c' }]

const rawLinks = [
  { source: 'a', target: 'b' },
  { source: 'b', target: 'c' },
  { source: 'c', target: 'a' },
]

// Create a config to map your data into Cosmograph's internal format
const dataPrepConfig = {
  points: {
    pointIdBy: 'id',
  },
  links: {
    linkSourceBy: 'source',
    linkTargetsBy: ['target'],
  },
}

const createCosmograph = async (container: HTMLElement): Promise<void> => {
  // Prepare data and config for Cosmograph
  const result = await prepareCosmographData(dataPrepConfig, rawPoints, rawLinks)

  // Create Cosmograph instance from prepared data and config
  if (result) {
    const { points, links, cosmographConfig } = result
    const cosmograph = new Cosmograph(container, { points, links, ...cosmographConfig })
  }
}

// Render Cosmograph in the provided container
createCosmograph(document.getElementById('cosmograph-container'))

Check out the Cosmograph documentation for more information and examples.

🛸 Issues and Contributing

While currently closed source, we welcome your feedback! Help improve Cosmograph by submitting bug reports and feature ideas in our issues repository.

💫 License

Cosmograph is licensed under the CC-BY-NC-4.0 license and free for any non-commercial usage. If you want to use it in a commercial project, please reach out to us.

👩🏻‍🚀 Contacts

📩 hi@cosmograph.app · 👾 Cosmograph Discord channel

FAQs

Package last updated on 11 Dec 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc