Skip to content

Tools for generating graphs for application flow, So you can make a diagram of your application flow with graphviz dot format, and then actually use it to drive your application.

Notifications You must be signed in to change notification settings

mikedmcfarland/appflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appflow

Tools for generating graphs for application flow. So you can make a diagram of your application flow with dotviz, and then actually use it in your application.

Introduction

You write graphs (in dot format) that represent connectioning parts of an application.

digraph app {
        titleScreen -> mainMenu
        mainMenu -> singlePlayer
        mainMenu -> multiPlayer
        mainMenu -> settings

        singlePlayer -> game
        game -> quit
        quit -> mainMenu
}

example.png

You then instantiate the graph, providing implementations for nodes to link it to your application code.

You can then listen to changes in the graph.

const appflow = require('./lib/appflow')
const Graph = appFlow.Graph
const Race = appFlow.node.Race

const src = `
  digraph app {
          titleScreen -> mainMenu
          mainMenu -> singlePlayer
          mainMenu -> multiPlayer
          mainMenu -> settings

          singlePlayer -> game
          game -> quit
          quit -> mainMenu
  }
  `
const app = Graph.fromDot(src)
const nodes = {
  mainMenu: Race()
}
const startingNode = app.nodes.titleScreen
app.run(startingNode)
app.on('change',() => console.log(app.active)

How do these nodes work?

Check out the literate specs about the nodes for more information.

run tests

gulp test

watch directory for changes

gulp watch

About

Tools for generating graphs for application flow, So you can make a diagram of your application flow with graphviz dot format, and then actually use it to drive your application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published