Appearance
Integrating Ogma with React
Installation
In order to use Ogma with React, you can either use the Ogma React wrapper or create your own React components that integrates Ogma. In both cases you will need to install the Ogma library first. To do that, you can follow the installation guide.
Using @linkurious/ogma-react
wrapper
The @linkurious/ogma-react
package provides a React component that wraps the Ogma library, making it easier to integrate Ogma into your React applications. This wrapper allows you to use Ogma as a React component, handling the lifecycle methods and providing a clean API for interacting with the graph. It also exposes Ogma's events in a React-friendly way, allowing you to easily bind event handlers to the graph. It also offers the set of components to work with Ogma in React way, such as <Node/EdgeStyle>
, transformations, and overlays. It's available on Github an npm
. You can see the API documentation to have the full list of available components and check out the demo using all of them in one app. Also check out the ogma-react wrapper tutorial.
Examples
Advanced use and principles
If you want to have detailed control over the Ogma instance, you can partially re-create the API wrapper by creating your own React components that integrate Ogma. This allows you to interact with Ogma directly, bind events, and manage the graph data in a way that suits your application's needs. Here are the tutorials to help you get started: