Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebinsua/graphviz-config-template
:art: Templates as visual graph configuration.
https://github.com/sebinsua/graphviz-config-template
database dot edge graphs graphviz neo4j node relationship string template vertex visual
Last synced: 3 months ago
JSON representation
:art: Templates as visual graph configuration.
- Host: GitHub
- URL: https://github.com/sebinsua/graphviz-config-template
- Owner: sebinsua
- Created: 2017-02-27T22:56:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-16T01:47:18.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T01:31:09.176Z (3 months ago)
- Topics: database, dot, edge, graphs, graphviz, neo4j, node, relationship, string, template, vertex, visual
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# `graphviz-config-template` [![Build Status](https://travis-ci.org/sebinsua/graphviz-config-template.png)](https://travis-ci.org/sebinsua/graphviz-config-template) [![npm version](https://badge.fury.io/js/graphviz-config-template.svg)](https://www.npmjs.com/package/graphviz-config-template)
> :art: Templates as visual graph configuration.**NOTE:** This is an alpha version. It needs a refactor and possibly further design work.
Describe the configuration of your graph using the [`dot`](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) graph description language and get a `save` function in return that'll generate [Neo4j](https://neo4j.com/) Cypher queries when given some data.
The purpose of this is to experiment with visualising small [DSL](https://en.wikipedia.org/wiki/Domain-specific_language)s within the [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment).
A companion atom plugin [`atom-graphviz-config-template`](https://github.com/sebinsua/atom-graphviz-config-template) is [in early development](https://github.com/sebinsua/graphviz-config-template/issues/1).
## Example
### ![Farm](./preview/farm.png)
```js
const graphConfig = require('graphviz-config-template')
const createCypherStream = require('cypher-stream')const { digraph } = graphConfig();
const cypher = createCypherStream('bolt://localhost', 'username', 'password')
const transaction = cypher.transaction()const farmer = { id: 1, name: 'Old McDonald' }
const farm = { id: 1, name: 'Animal Farm' }
const animal = { id: 1, name: 'Duck' }transaction.write(
digraph`farmer -> farm -> animal`({ farmer, farm, animal })
)
transaction.commit()
```## Install
```sh
yarn add graphviz-config-template
```