### Installing Project Dependencies for Storybook Source: https://github.com/playcanvas/pcui-graph/blob/main/README.md This command installs all dependencies listed in the package.json file of the current project. It's a prerequisite for running the Storybook examples locally. ```Shell npm install ``` -------------------------------- ### Running PCUI Graph Storybook Locally Source: https://github.com/playcanvas/pcui-graph/blob/main/README.md This command executes the storybook script defined in the project's package.json, which typically starts a local development server and opens the Storybook in a browser tab. It allows developers to view and interact with PCUI Graph examples. ```Shell npm run storybook ``` -------------------------------- ### Installing PCUI Graph and Dependencies via npm Source: https://github.com/playcanvas/pcui-graph/blob/main/README.md This command installs the @playcanvas/pcui-graph package along with its peer dependencies, @playcanvas/pcui and @playcanvas/observer, as production dependencies. This is the recommended way to install the library for use in a deployed application. ```Shell npm install --save @playcanvas/pcui-graph @playcanvas/pcui @playcanvas/observer ``` -------------------------------- ### Installing PCUI Graph Development Dependency via npm Source: https://github.com/playcanvas/pcui-graph/blob/main/README.md This command installs the @playcanvas/pcui-graph package as a development dependency in your npm project. It's typically used when developing applications that consume the library. ```Shell npm install @playcanvas/pcui-graph --save-dev ``` -------------------------------- ### Instantiating a PCUI Graph with a Schema in JavaScript Source: https://github.com/playcanvas/pcui-graph/blob/main/README.md This JavaScript code demonstrates how to import and instantiate a Graph object from @playcanvas/pcui-graph. It defines a simple schema for nodes and edges, then appends the graph's DOM element to the document body, creating a visual graph. ```JavaScript import Graph from '@playcanvas/pcui-graph'; import '@playcanvas/pcui/styles'; import '@playcanvas/pcui-graph/styles'; const schema = { nodes: { 0: { name: 'Hello', fill: 'red' }, 1: { name: 'World', fill: 'green' } }, edges: { 0: { from: [0], // this edge can connect nodes of type 0 to: [1], // to nodes of type 1, stroke: 'blue' } } } const graph = new Graph(schema); document.body.appendChild(graph.dom); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.