Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott committed Feb 4, 2024
2 parents c518bee + cd65f09 commit 4ea340f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 28 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Docs"

on:
workflow_dispatch:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
- run: npm ci
# Add a step to set up Ruby
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
# Install Bundler
- run: gem install bundler
# Install Jekyll and other gems
- run: |
cd docs
bundle install
cd ..
# Now run your original command
- run: npm run build:docsite:production
# https://github.com/actions/upload-pages-artifact
- uses: actions/upload-pages-artifact@v2
with:
path: ./docs/_site
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
# https://github.com/actions/deploy-pages
uses: actions/deploy-pages@v2
40 changes: 13 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# PCUI Graph
# PCUI Graph - Node-based Graphs for PCUI

![PCUI Graph](https://blog.playcanvas.com/assets/media/pcui-graph-editors.png)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/playcanvas/pcui-graph/blob/main/LICENSE)
[![NPM Version](https://img.shields.io/npm/v/@playcanvas/pcui-graph.svg?style=flat?style=flat)](https://www.npmjs.com/package/@playcanvas/pcui-graph)
[![NPM Downloads](https://img.shields.io/npm/dw/@playcanvas/pcui-graph)](https://npmtrends.com/@playcanvas/pcui=gra[j)

![PCUI Graph](./docs/assets/pcui-graph-banner.png)

Create node based visual graphs in the browser. Supports undirected / directed graphs as well as visual scripting graphs containing nodes with input / output ports. Your graphs can be saved to a JSON file and loaded back into a new graph view at any time.

## Getting Started

First install PCUI Graph into your npm project:

```
npm install @playcanvas/pcui-graph
```
npm install @playcanvas/pcui-graph --save-dev

You can then use the library in your own project by importing the PCUI Graph build and its styling file into your project. The graph can then be instantiated as follows:

Expand Down Expand Up @@ -45,38 +47,22 @@ document.body.appendChild(graph.dom);

The library is also available on [npm](https://www.npmjs.com/package/@playcanvas/pcui-graph) and can be installed in your project with:

```
npm install --save @playcanvas/pcui-graph @playcanvas/pcui @playcanvas/observer
```
npm install --save @playcanvas/pcui-graph @playcanvas/pcui @playcanvas/observer

The npm package includes two builds of the library:

```
@playcanvas/pcui-graph/dist/pcui-graph.js // UMD build (requires that the pcui and observer libraries are present in the global namespace)
@playcanvas/pcui-graph/dist/pcui-graph.mjs // module build (requires a build tool like rollup / webpack)
```
@playcanvas/pcui-graph/dist/pcui-graph.js // UMD build (requires that the pcui and observer libraries are present in the global namespace)
@playcanvas/pcui-graph/dist/pcui-graph.mjs // module build (requires a build tool like rollup / webpack)

## Storybook

Examples of graphs created using PCUI Graph are available in this library's [storybook](https://playcanvas.github.io/pcui-graph/storybook/). Alternatively you can run the storybook locally and use it as a development environment for your own graphs. To do so, run the following commands in this projects root directory:

```
npm install
npm run storybook
```
npm install
npm run storybook

This will automatically open the storybook in a new browser tab.

# Documentation

- [Config Options](./docs/config-options.md)

- [Schema](./docs/schema.md)

- [Context Menus](./docs/context-menus.md)

- [Styling](./docs/styling.md)

- [Events](./docs/events.md)

- [API](./docs/api.md)
Information on building the documentation can be found in the [docs](./docs/README.md) directory.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Open your browser and visit: http://localhost:3000/

### Publishing Docs

The PCUI docs site is automatically redeployed one every commit to the `main` branch.
The PCUI=Graph docs site is automatically redeployed one every commit to the `main` branch.
4 changes: 4 additions & 0 deletions docs/pages/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ const graph = new Graph(schema, {
});
```

<<<<<<< HEAD
You can see a full list of options [here](https://api.playcanvas.com/classes/PCUIGraph.Graph.html#constructor).
=======
You can see a full list of options [here](https://api.playcanvas.com/classes/PCUIGraph.Graph.html#constructor).
>>>>>>> main

0 comments on commit 4ea340f

Please sign in to comment.