Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow editor docs #64

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-ligers-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"docs": patch
---

Create documentation pages for flow-editor and graphviz-rendering.
32 changes: 32 additions & 0 deletions sites/docs/docs/flow-editor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
id: flow-editor
title: Flow editor component
---

## Overview

We provide a visual editor for creation and modification of `use-coordination` configs using their graph-based representation.
The functionality described on this page is available in the sub-package `@use-coordination/flow-editor` (and not contained in the main `use-coordination` package).


## `<FlowEditor/>`

### Required props

#### `config`

- Type: `object`


### Optional props

#### `onConfigChange`

- Type: `function`

A callback function that emits config updates upon changes in the editor.


```js
import { FlowEditor } from '@use-coordination/flow-editor';
```
29 changes: 29 additions & 0 deletions sites/docs/docs/graphviz-rendering.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: graphviz-rendering
title: Graphviz rendering
---

## Overview

We provide a function to render a `use-coordination` config to [Graphviz](https://graphviz.org/) [DOT](https://graphviz.org/doc/info/lang.html) format.
The functionality described on this page is available in the sub-package `@use-coordination/graphviz-renderer` (and not contained in the main `use-coordination` package).


To make this approach as modular as possible, we do not include the functionality to render the DOT-formatted string to an image.
We leave the choice of Graphviz rendering engine to the user.

## `toGraphviz(config)`

#### Parameters:

- `config` (`object`) - The config to render to DOT format.

#### Returns:

- Type: `string` - The DOT-formatted string.

```js
import { toGraphviz } from '@use-coordination/graphviz-renderer';
```


8 changes: 8 additions & 0 deletions sites/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ module.exports = {
type: 'doc',
id: 'config-js',
},
{
type: 'doc',
id: 'flow-editor',
},
{
type: 'doc',
id: 'graphviz-rendering',
}
],
examples: [
{
Expand Down
Loading