A lightweight SolidJS component for building interactive node-based diagrams and graphs.

Overview

Solid Graph banner

npm version gitHub license top-language code size repo stars

Convert Your Ideas To Graphs With Solid Graph!


Solid Graph

A lightweight and minimal Solid component for building interactive graphs and node-based editors.

Key Features

  • Easy to use: Just provide the nodes and edges data and it automatically gets converted to an interactive graph with seamless zooming and panning.
  • Customizable: Different edge types and support for custom nodes and custom edges.
  • Fast rendering: Only nodes that have changed are re-rendered and only those in the viewport are displayed
  • Reliable: Written in Typescript.

Installation

The easiest way to get the latest version of Solid Graph is to install it via npm:

npm install solid-graph # or yarn add

Quick Start

import SolidGraph from "solid-graph";

function Flow(props) {
  return <SolidGraph nodes={props.nodes} edges={props.edges}></SolidGraph>;
}

SolidGraph Props

Name Type default Description
nodes Node[] [] array of nodes
edges Edge[] [] array of edges
width number 800 width of the container
height number 800 height of the container
type Node = {
  id: number,
  position: { x: number, y: number },
  data: { label: string, ... },
  width?: number,
  height?: number,
  bgColor?: string,
  fontSize?: number,
  borderColor?: string,
  borderRadius?: number,
  textColor?: string,
};

type Edge = {
  source: number,
  target: number,
  label?: string,
  type?: "straight" | "smoothStep" | "step",
  animated?: boolean,
  noHandle?: boolean,
  arrow?: boolean,
  style?: JSX.CSSProperties,
  labelStyle?: JSX.CSSProperties,
  labelBgStyle?: JSX.CSSProperties,
};

Example

Live Example On stackblitz

  • Pan: alt + drag
  • Zoom: mouse wheel

Development

Before you start you need to build the project using npm run build. Then install the Solid Graph dependencies via npm install.

If you want to contribute or develop custom features the easiest way is to start the dev server:

npm start

Credits

Solid Graph is heavily based on react flow. Without them Solid Graph would not exist. Please consider donating to them.

License

Solid Graph is MIT licensed.

You might also like...

A form management library for SolidJS that is very lightweight and simple!

solform A form management library for SolidJS that is very lightweight and simple! Why solform Very easy, fast, lightweight and powerful! It has built

Nov 15, 2022

A JavaScript library for visualizing Sankey diagrams.

A JavaScript library for visualizing Sankey diagrams.

SanKEY.js v1.0.0 last updated: 20.07.2022 Getting started SanKEY.js is a JavaScript data visualization library that provides a simple object-oriented

Nov 8, 2022

Automatically construct and visualize Graphs generated from your Node.js project

Automatically construct and visualize Graphs generated from your Node.js project

cyclops is a minimalist developer tool that can be used to generate directed graphs from your Node.js project. It can automatically detect circular de

Jan 5, 2023

Build Schema.org graphs for JavaScript Runtimes (Browser, Node, etc). Improve your sites SEO with quick and easy Rich Results.

schema-org-graph-js The quickest and easiest way to build Schema.org graphs for JavaScript Runtimes (Browser, Node, etc). Status: 🔨 In Development Pl

Dec 21, 2022

Automatically construct, traverse and visualize graphs generated from your Node.js project

Automatically construct, traverse and visualize graphs generated from your Node.js project

skott is a minimalist developer tool that can be used to efficiently generate directed graphs from your JavaScript/Node.js project. It can automatical

Dec 21, 2022

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.

Jspreadsheet CE v4: The JavaScript spreadsheet Jexcel CE has been renamed to Jspreadsheet CE News Important: Please import jspreadsheet.css (jexcel.cs

Dec 19, 2022

View maps, graphs, and tables of your save and compete in a casual, evergreen leaderboard of EU4 achievement speed runs. Upload and share your save with the world.

View maps, graphs, and tables of your save and compete in a casual, evergreen leaderboard of EU4 achievement speed runs. Upload and share your save with the world.

PDX Tools PDX Tools is a modern EU4 save file analyzer that allow users to view maps, graphs, and data tables of their save all within the browser. If

Dec 27, 2022

API and site for discovering publicly-available Desmos graphs. Not affiliated with Desmos.

desmosearch-api API and site for discovering, cataloguing, and keeping track of publicly-available Desmos graphs. Not affiliated with Desmos. This pro

Feb 24, 2022

Obsidian plugin to export Graphviz graphs from vault's notes

Obsidian plugin to export Graphviz graphs from vault's notes

What it is: an Obsidian plugin to generate hierarchical graphs, with the nodes are from your Obsidian vault How it does: convert the database from Bre

Nov 14, 2022
Comments
  • more declarative API

    more declarative API

    Hey, I like the initial idea, makes it easy to change things reactively.

    First thought was, it could be nice to have an even more declarative API for it like

    <Flow>
      <Edge ... />
      <Node ... />
    </Flow>
    

    Then that makes it possible to use Show, For, etc, idiomatically.

    enhancement help wanted 
    opened by trusktr 1
Releases(v0.4.0)
  • v0.4.0(Sep 10, 2022)

    now you can add/modify nodes and edges individually using Node and Edge Components. type of id attribute has changed to string which gives you the ability to use id generators to produce ids for elements. there is an option to change the background of the graph using background prop.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jul 31, 2022)

  • v(Jul 26, 2022)

Owner
Ali Sal
Ali Sal
Export Diagrams.net diagrams during Dendron site publishing

Export Diagrams.net diagrams during Dendron site publishing Node module for exporting Diagrams.net (Draw.io) diagrams embedded in a published Dendron

Luke Carrier 4 Aug 18, 2022
Plugin that lets you create diagrams from textual representation (aka 'Diagrams as Code') within Logseq

Logseq - Diagrams as Code Plugin that lets you create diagrams (and other visualizations) from textual representation (aka 'Diagrams as Code') within

Nicolai P. Großer 80 Dec 21, 2022
A CLI tool to embed interactive PUML diagrams to your github markdown files.

puml-for-markdown Simple CLI Usage Just run puml-for-markdown in any directory where you have markdown files and it will render links to PlantUML file

Daniel 208 Jan 3, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js.

Pintora Documentation | Live Editor Pintora is an extensible javascript text-to-diagrams library that works in both browser and Node.js. Expressing yo

hikerpig 652 Dec 30, 2022
A modern solidjs based UI library ~ it is very lightweight!

?? 目前正在开发中,敬请期待~ cerises-ui 一个现代的基于 solidjs 的 UI 库~它是非常轻量级的! 官网:https://cerises-ui.edoc.wiki 目前计划组件 组件 说明 认领人 进度 Review & Unit Test Button、ButtonGroup

Cerises UI 4 Jul 19, 2022
Template for building SolidJS web application with Tailwind CSS faster!

Hardtail Template for building SolidJS web application with Tailwind CSS faster! Setup First you could clone or fork this project or repository to you

VVX Friends 5 Sep 18, 2022
:mechanical_leg: Tiny and performant collapse component for SolidJS.

Solid Collapse Tiny and performant collapse component for SolidJS. Demo and examples Features Pure dynamic CSS height transition, no javascript animat

Simone 12 Dec 29, 2022