If you don't have an existing project, you can create one with Vite by following the Vite Getting Started guide for your preferred package manager.
Alternatively, run this quick start command to create a React Vite app and start the development server in one step:
npm create vite@latest my-regraph-app -- --template reactyarn create vite my-regraph-app --template reactpnpm create vite my-regraph-app --template reactIf you are prompted about any settings while the command is running, you can accept the default values.
Once the process has finished, the terminal will show the development server URL where the boilerplate app is running.
By default, Vite runs a dev server at http://localhost:5173. You can start it any time from the my-regraph-app directory:
npm run devyarn devpnpm run devNext, download the latest version of ReGraph:
For Safari browsers, hold the ⌥ Option key when pressing the Download button to download the correct .tgz format.
Move the download into your new project's root folder. If you are on a UNIX-like operating system, you can do this from the terminal:
cp ~/Downloads/your_downloaded_file_name.tgz .From your project's root folder, install the bundle as a local package:
npm install file:your_downloaded_file_name.tgzyarn add ./your_downloaded_file_name.tgzpnpm install file:your_downloaded_file_name.tgzNext, open the App.jsx file in the src folder. This is where the component is declared. We will replace the boilerplate application with a ReGraph Chart component.
First, replace the import statements with an import statement for ReGraph:
import { Chart } from "regraph";And then replace the App() function with a new function:
function App() {
return (
// returns a div with a ReGraph Chart that fills the viewport
<div style={{ height: "100vh", width: "100vw" }}>
<Chart
// a dictionary where each key is an item id
// and each value is the item's definition
items={{ node: { label: { text: "Hello World!" } } }}
/>
</div>
);
}Finally, open the main.jsx file in the src folder and remove the index.css global stylesheet from imports. These styles come with the boilerplate app and are not needed in this example.
You should now see a ReGraph chart with a single node.

The chart sets its height and width to equal the size of its parent element, so any style should be set on the parent element.
Now that you have your first project, here's a few suggestions on where to go next if you're interested in...
- Adding font icons to items in your chart? Head to Font Icons docs.
- Grouping the nodes or links in your chart? See Combining Nodes and Aggregating Links.
- Filtering chart by time or learning about changes over time? Read about the Time Bar.
- Running graph analysis or social network analysis? Take a look at Graph Analysis.