{"id":15466131,"url":"https://github.com/moaxcp/graph-dsl","last_synced_at":"2026-03-10T13:32:15.801Z","repository":{"id":57721617,"uuid":"72962924","full_name":"moaxcp/graph-dsl","owner":"moaxcp","description":"A groovy dsl for creating and traversing graphs.","archived":false,"fork":false,"pushed_at":"2019-07-16T16:25:05.000Z","size":4555,"stargazers_count":28,"open_issues_count":16,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T10:39:17.362Z","etag":null,"topics":["dag","directed-graph","graph","groovy"],"latest_commit_sha":null,"homepage":"https://moaxcp.github.io/graph-dsl/","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moaxcp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-06T01:13:35.000Z","updated_at":"2025-04-10T07:31:38.000Z","dependencies_parsed_at":"2022-09-26T21:50:20.766Z","dependency_job_id":null,"html_url":"https://github.com/moaxcp/graph-dsl","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/moaxcp/graph-dsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moaxcp%2Fgraph-dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moaxcp%2Fgraph-dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moaxcp%2Fgraph-dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moaxcp%2Fgraph-dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moaxcp","download_url":"https://codeload.github.com/moaxcp/graph-dsl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moaxcp%2Fgraph-dsl/sbom","scorecard":{"id":655256,"data":{"date":"2025-08-11","repo":{"name":"github.com/moaxcp/graph-dsl","commit":"2154e897de654eb6ca7b817a93b01168688cd5ff"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T14:28:44.499Z","repository_id":57721617,"created_at":"2025-08-21T14:28:44.499Z","updated_at":"2025-08-21T14:28:44.499Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30334644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dag","directed-graph","graph","groovy"],"created_at":"2024-10-02T01:05:10.162Z","updated_at":"2026-03-10T13:32:15.781Z","avatar_url":"https://github.com/moaxcp.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graph-dsl\n\nA groovy dsl for creating and traversing graphs. Graphs can be extended with \ntypes and plugins which allows developers to create the desired behavior and \nvalues for their algorithm.\n\n[![GitHub top language](https://img.shields.io/github/languages/top/moaxcp/graph-dsl.svg)]()\n[![GitHub last commit](https://img.shields.io/github/last-commit/moaxcp/graph-dsl.svg)]()\n[![Build Status](https://travis-ci.org/moaxcp/graph-dsl.svg?branch=master)](https://travis-ci.org/moaxcp/graph-dsl)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.moaxcp/graph-dsl.svg)](https://mvnrepository.com/artifact/com.github.moaxcp/graph-dsl)\n[![Javadocs](https://www.javadoc.io/badge/com.github.moaxcp/graph-dsl.svg)](https://www.javadoc.io/doc/com.github.moaxcp/graph-dsl)\n[![Libraries.io for GitHub](https://img.shields.io/librariesio/github/moaxcp/graph-dsl.svg)](https://libraries.io/github/moaxcp/graph-dsl)\n[![license](https://img.shields.io/github/license/moaxcp/graph-dsl.svg)](LICENSE)\n\n# Usage\n\nThere are two entry points into the dsl: The `graph` method, and `BaseScript`.\n\n## BaseScript\n\n`BaseScript` is a transformation which allows developers to change the base \nscript class for the current script. By changing the script to `DslScript` a \nnew `Graph` becomes the delegate of the script.\n\n```groovy\n#!/usr/bin/env groovy\n@Grab(group='com.github.moaxcp', module='graph-dsl', version='latest.revision')\nimport graph.*\n@groovy.transform.BaseScript DslScript script\nplugin 'graphviz'\nedge 'A', 'B'\nassert graph.vertices.keySet() == ['A', 'B'] as Set\nassert graph.edges.size() == 1\nassert graph.edges.first() == new Edge(from:'A', to:'B')\nimage 'images/base-script-method.png'\n```\n\n![Image](images/base-script-method.png?raw=true)\n\nThis example of a graph creates two vertices named 'step1' and 'step2' as well \nas an edge between them. The basic graph structure is held in a map of named \nVertex objects and a set of Edge objects. Each Edge contains the names of the \ntwo vertices it connects.\n\nThe same graph can be created using the `graph` method.\n\n## graph method\n\nThe entry-point to the dsl is the `Graph.graph(Closure)` method. This method \napplies the closure to a new Graph object and returns it.\n\n```groovy\n#!/usr/bin/env groovy\n@Grab(group='com.github.moaxcp', module='graph-dsl', version='latest.revision')\nimport graph.*\nimport static graph.Graph.*\ndef graph = graph {\n    edge 'A', 'B'\n}\n\nassert graph.vertices.keySet() == ['A', 'B'] as Set\nassert graph.edges.size() == 1\nassert graph.edges.first() == new Edge(from:'A', to:'B')\ngraph.plugin 'graphviz'\ngraph.image 'images/graph-method.png'\n```\n\n![Image](images/graph-method.png?raw=true)\n\n# dsl policy\n\nThere are a few rules the dsl follows:\n\n1. All referenced vertices are created if they don't exist.\n2. If an edge or vertex already exists it will be reused by an operation.\n3. Type can be changed at any time if the type is compatible with the current graph structure.\n4. Plugins can be applied at any time.\n5. Vertices and edges are always Maps.\n\n# Traversals\n\nAll traversal methods start at a root vertex and traverse the graph. A closure is called on each \"visit\" which can\nmodify the graph in some way. The following examples create a graph and perform a traversal.\n\n## Example: breadthFirstTraversal, label and color vertex\n\n```groovy\ntype 'directed-graph'\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo('C')\n        connectsTo('D')\n    }\n    connectsFrom('D') {\n        connectsTo('C')\n        connectsTo('E')\n    }\n    connectsTo('E')\n}\nsnapshot()\neachBfs('A') { vertex -\u003e\n    vertex.fillcolor = 'green'\n    vertex.style = 'filled'\n    snapshot()\n}\ngif 'images/breadth-first-traversal.gif'\n```\n\n![Image](images/breadth-first-traversal.gif?raw=true)\n\n## Example: preOrder, label and color vertex\n\n```groovy\ntype 'directed-graph'\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo('C')\n        connectsTo('D')\n    }\n    connectsFrom('D') {\n        connectsTo('C')\n        connectsTo('E')\n    }\n    connectsTo('E')\n}\nsnapshot()\npreOrder('A') { vertex -\u003e\n    vertex.fillcolor = 'green'\n    vertex.style = 'filled'\n    snapshot()\n    CONTINUE\n}\ngif 'images/pre-order-traversal.gif'\n```\n\n![Image](images/pre-order-traversal.gif?raw=true)\n\n## Example: postOrder, label and color vertex\n\n```groovy\ntype 'directed-graph'\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo('C')\n        connectsTo('D')\n    }\n    connectsFrom('D') {\n        connectsTo('C')\n        connectsTo('E')\n    }\n    connectsTo('E')\n}\nsnapshot()\npostOrder('A') { vertex -\u003e\n    vertex.fillcolor = 'green'\n    vertex.style = 'filled'\n    snapshot()\n    CONTINUE\n}\ngif 'images/post-order-traversal.gif'\n```\n\n![Image](images/post-order-traversal.gif?raw=true)\n\n## Example: reversePostOrder, label and color vertex\n\nNote: This is the DAG created by the java gradle plugin\n\n```groovy\ntype 'directed-graph'\nplugin 'graphviz'\nedge 'compileJava', 'classes'\nedge 'processResources', 'classes'\nvertex('classes') {\n    connectsTo 'javadoc'\n    connectsTo('compileTestJava') {\n        connectsTo('testClasses') {\n            connectsFrom('processTestResources')\n            connectsTo('test') {\n                connectsFrom 'classes'\n                connectsTo('check') {\n                    connectsTo 'build'\n                }\n            }\n        }\n    }\n    connectsTo('jar') {\n        connectsTo 'uploadArchives'\n        connectsTo('assemble') {\n            connectsTo 'build'\n        }\n    }\n}\nsnapshot()\nreversePostOrder('build') { vertex -\u003e\n    vertex.fillcolor = 'green'\n    vertex.style = 'filled'\n    snapshot()\n    CONTINUE\n}\ngif 'images/reverse-post-order-traversal.gif'\n```\n\n![Image](images/reverse-post-order-traversal.gif?raw=true)\n\n## Example: classifyEdges, color edge by type\n\nThis example classifies edges and colors them by type. The closure takes the arguments from, to, and type. These\narguments can be used to modify the graph. In this example the edges are colored and labeled with the type.\n\n```groovy\n\ntype 'directed-graph'\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo 'C'\n        connectsTo('D') {\n            connectsTo 'A'\n            connectsFrom 'A'\n            connectsTo 'C'\n            connectsTo 'E'\n        }\n    }\n}\nvertex('F') {\n    connectsTo('G') {\n        connectsTo 'D'\n    }\n}\nsnapshot()\nclassifyEdges('A') {Object from, Object to, EdgeType type -\u003e\n    edge(from, to) {\n        switch(type) {\n            case EdgeType.TREE_EDGE:\n                color = 'green'\n                snapshot()\n                label = 'tree'\n                break\n            case EdgeType.BACK_EDGE:\n                color = 'red'\n                snapshot()\n                label = 'back'\n                break\n            case EdgeType.FORWARD_EDGE:\n                color = 'grey'\n                snapshot()\n                label = 'forward'\n                break\n            case EdgeType.CROSS_EDGE:\n                color = 'blue'\n                snapshot()\n                label = 'cross'\n                break\n        }\n    }\n    snapshot()\n    CONTINUE\n}\nsnapshot(4)\ngif 'images/edge-classification.gif', 500\n```\n\n![Image](images/edge-classification.gif?raw=true)\n\n## Example: connectedComponent (undirected), label and color components\n\nConnected component visits each vertex supplying the root vertex for the component. The closure parameters are the\nroot vertex key and the current vertex.\n\n```groovy\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo 'C'\n    }\n    connectsTo 'C'\n}\n\nvertex('Z') {\n    connectsTo('X') {\n        connectsTo('Y')\n    }\n    connectsTo('W') {\n        connectsTo 'X'\n    }\n}\n\nvertex 'J'\ndef colors = ['A':'yellow', 'Z':'green', J:'blue']\nsnapshot()\nconnectedComponent('A') { root, vertex -\u003e\n    vertex.fillcolor = colors[(root)]\n    vertex.style = 'filled'\n    snapshot()\n    CONTINUE\n}\ngif 'images/connected-component-undirected.gif'\n```\n\n![Image](images/connected-component-undirected.gif?raw=true)\n\n## Example: connectedComponent (directed), label and color components\n\n```groovy\ntype 'directed-graph'\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo 'C'\n    }\n    connectsTo 'C'\n}\n\nvertex('Z') {\n    connectsTo('X') {\n        connectsTo('Y')\n    }\n    connectsTo('W') {\n        connectsTo 'X'\n    }\n}\nvertex 'J'\ndef colors = ['A': 'yellow', 'Z': 'green', J: 'blue']\nsnapshot()\nconnectedComponent('A') { root, vertex -\u003e\n    vertex.fillcolor = colors[(root)]\n    vertex.style = 'filled'\n    snapshot()\n    CONTINUE\n}\ngif 'images/connected-component-directed.gif'\n```\n\n![Image](images/connected-component-directed.gif?raw=true)\n\n# directed graphs\n\nThe Default behavior of a graph is undirected. These graphs have a set of edges \nwhere only one edge can connect any two vertices. An undirected graph can be \nchanged to a directed graph at any time using the `type` method.\n\n```groovy\n//lots of code\ntype 'directed-graph'\n//lots of code\n```\n\n# Functional search methods\n\nThere are functional search methods built on the depthFirstTraversal and breadthFirstTraversal method. These methods \nfollow the standard names in groovy: each, find, inject, findAll, collect. The methods can specify which type of \nsearch to perform such as `eachBfs` or `eachDfs`.\n\n```groovy\neachBfs {\n    println it.id\n}\n    \ndef vertex = findBfs {\n    it.id == 'A'\n}\n    \ndef bfsOrder = collectBfs {\n    it.id\n}\n```\n\nNote: These methods are not yet implemented for depth first traversal. The depth first search methods will be the\ndefaults when a search type is not specified.\n\n# Edge and Vertex\n\n## Vertex keys\n\nVertex keys are used to refer to a Vertex in the dsl. Keys can be any object which implements equals and hashCode.\n\n## Edge and Vertex are Maps\n\nSince Edge and Vertex are maps, all of the syntax for maps apply to them. In a dsl closure assignments create\nand entry in the Edge or Vertex.\n\n```groovy\nedge('A', 'B') {\n    label = 'edge label'\n}\n\nvertex('step1') {\n    label = 'first step in process'\n}\n```\n\nIf non dsl entries are used in a dsl method they are added to the object.\n\n```groovy\nedge('A', 'B', [weight:10]) //weight is a non dsl entry\n\nvertex('step1', [connectsTo:step1, color:'red']) //color is a non dsl entry\n```\n\n# Types\n\nTypes can be changed with the type methods.\n\n```groovy\ntype 'directed-graph'\ntype graph.type.DirectedGraphType\n```\n\nA graph's type determines specific behavior. A type can change a normal graph to an directed-graph. It can add wieght\nto the graph. It can change the graph to a DAG. Developers can make their own type and apply it to a graph. Types can:\n\n1. replace all edges and vertices\n2. add methods to the edge and vertex dsl\n3. change the data structures used by the graph\n4. add constraints to the structure of the graph\n\nThe type of a graph may be changed at any time. An undirected-graph may be changed to a directed-graph which can be\nchanged back to an undirected-graph.\n\n\n## DirectedGraphType\n\n```groovy\ntype 'directed-graph'\n```\n\nThe DirectedGraphType changes the behavior of a graph to that of a directed graph. In a directed graph edges\nbecome directional. Only two edges can exist between any two vertices. In that case, the edges need to go in\nopposite directions.\n\nTraversal methods will only follow out edges from a vertex.\n\n## WeightedGraphType\n\n```groovy\ntype 'weighted-graph'\n```\n\nWeightedGraphType is an undirected graph where edges can have weight. Traversal methods follow edges with the least\nweight.\n\n### Adding weight\n\nEdges can be assigned weight within the dsl.\n\n```groovy\ntype 'weighted-graph'\n\nedge 'A', 'B', [weight:10]\n\nedge ('A', 'B') { weight = 10 }\n```\n\n## WeightedDirectedGraphType\n\n```groovy\ntype 'weighted-directed-graph'\n```\n\nWeightedDirectedGraphType is a directed graph where edges can have weight. Traversal methods follow edges with the least\nweight.\n\n\n# Plugins\n\nPlugins may be applied with the plugin methods.\n\n```groovy\nplugin 'graphviz'\nplugin graph.plugin.GraphViz\n```\n\n## Graphviz\n\nGraphviz is a graph visualization toolset. The project provides a dsl called dot for visualizing graphs. The graphviz\nplugin provides methods to create dot strings, BufferedImages and to view the graph. Edge and Vertex attributes will be used as dot attributes.\n\n```groovy\ntype 'directed-graph'\nplugin 'graphviz'\nvertex('A') {\n    connectsTo('B') {\n        connectsTo 'C', 'D'\n    }\n    connectsTo('D') {\n        connectsTo 'C'\n        connectsTo 'E'\n    }\n    connectsFrom 'D'\n}\nvertex 'F', [connectsTo:'G']\nedge 'G', 'D'\nimage 'images/graphviz.png'\n```\n![Image of graph](/images/graphviz.png?raw=true \"Grpah\")\n\n# Getting Started With Development/Contributing\n\n## install git\n\nFollow this guide to install git.\n\nhttps://git-scm.com/book/en/v2/Getting-Started-Installing-Git\n\n## clone the project\n\nclone the project from github.\n\ngit clone https://github.com/moaxcp/graph-dsl.git\n\n## build\n\nThe project uses gradle for the build system. Using gradlew, you do not need to install gradle to build the project.\n\n`./gradlew build`\n\n## Contributing\n\nAll contributions are welcome. Please submit a pull request to the develop branch in github.\n\n## Ways to contribute\n\nEven if you are just learning groovy there are many ways to contribute.\n\n* Fix a codenarc issue. See [codenarc report](https://moaxcp.github.io/graph-dsl/reports/codenarc/main.html)\n* Add/fix groovydoc\n* create a wiki page\n* create a plugin\n* add a graph algorithm\n\nIf there are any issues contact me moaxcp@gmail.com.\n\n# Technology\n\n* [github](https://github.com/)\n* [git](https://git-scm.com/)\n* [gradle](https://gradle.org/) \n    * [reckon](https://github.com/ajoberstar/reckon)\n* [codenarc](http://codenarc.sourceforge.net/)\n* [groovy](http://www.groovy-lang.org/)\n* [spock](http://spockframework.org/)\n* [jacoco](http://www.eclemma.org/jacoco/)\n* [travis-ci.org](https://travis-ci.org/moaxcp/graph-dsl)\n* [oss sonatype](https://oss.sonatype.org/#welcome)\n\n# Releases\n\n## 0.27.0\n\n* graphviz pluging can now create gifs\n\n## 0.26.0\n\n* connectsFrom now works for undirected graphs\n* closure in vertex and edge methods now delegate to objects for code completion\n\n## 0.25.0\n\n* vertex.key has been renamed to vertex.id\n* edge.one has been renamed to edge.from\n* edge.two has been renamed to edge.to\n\n## 0.24.0\n\n* Switched to using reckon gradle plugin. This is an opinionated version similar to gradle-gitflow but there is no need\nto use gitflow\n* Stopped using gitflow and simply use master with tagged versions for releases\n* removed NameSpec for naming vertices and all associated methods.\n* Traversal methods are now in TraversalDsl trait\n* `depthFirstSearch` is now split in\n\n    protected void addVertex(Vertex vertex) {\n    }to two methods `preOrder`, and `postOrder`\n* `breadthFirstSearch` has been simplified\n* added new traversals `classifyEdges`, `connectedComponent`\n* Can now change key of vertex by assigning property in vertex method closures\n* Can now change one or two of edge by assigning property in edge method closures\n\n## 0.23.0\n\nAdding graphviz plugin.\n\nVertices and edges are now maps. Closures in entries are not resolved as was the case when dynamic properties were set.\n\nExample\n\n```groovy\nedge.weight = { queue.size() }\nassert edge.weight == 10 //in 0.22.0 would call the closure. In this release the closure is returned.\n```\n\n## 0.22.0\n\n[#102](https://github.com/moaxcp/graph-dsl/issues/102) Switch from name to key\n\nIn this release Vertex.name has been repalced with Vertex.key. The key may be any object that implements equals and\nhashCode.\n\n## 0.21.0\n\nThis release represents a major change in how graphs are typed. Additional functionality is no only added through a\nType. Type is the delegate of a Graph. A graph's type provides additional methods and can change any aspect of how a\ngraph works. Types provide a graph with edges and vertices. They define the EdgeSpec and VertexSpec which means a type\nmay add new methods to the dsl for building edges and vertices.\n\n* upgraded to gradle 4.2\n* replaced plugins with type\n* edges and vertices can now add properties dynamically. This removes the need for traits.\n\n## 0.20.0\n\n* [#98](https://github.com/moaxcp/graph-dsl/issues/98)\n\nAdding DslScript which can be used with @BaseScript to make a new Graph object the delegate of the current script.\n\n## 0.19.0\n\n* [#91](https://github.com/moaxcp/graph-dsl/issues/91) Plugins should be called Type\n \nThis change adds names for types of graphs and plugins. Instead of the developers needing to import and use classes\nthey can simply use a name.\n\n```\ntype 'directed-graph'\nplugin 'edge-map'\n```\n\n## 0.18.0\n\n* [#93](https://github.com/moaxcp/graph-dsl/issues/89) NameSpec and ConfigSpec\n* runnerCode can no longer be set in map parameters to vertex and edge methods\n\nThis release includes a major refactor in how graphs are built. Configurations for vertex and edge methods have been \nrefactored to use NameSpec and ConfigSpec object. A NameSpec is a wrapper for a string. It represents the name of \nsomething. A ConfigSpec is a wrapper around a map and closure. It represents the configuration for something. NameSpec\nand ConfigSpec are a common interface for graph types to share. VertexSpec and EdgeSpec are now controlled by the graph\ntype. Types can add new properties and methods for use in a ConfigSpec. An example of this is connectsFrom in a \ndirected graph. `connectsFrom` can only be used after applying `DirectedGraphPlugin`. Graph types can override methods \nlike connectsTo and connectsFrom to perform checks before adding edges. This will be important when the DAG type is \nadded.\n\nFor the first time packages have been introduced to the project.\n\n\u003cdl\u003e\n  \u003cdt\u003eplugin\u003c/dt\u003e\n  \u003cdd\u003ethese are plugins which add functionality not related to specific types of graphs\u003c/dd\u003e\n  \u003cdt\u003etrait\u003c/dt\u003e\n  \u003cdd\u003ethese are traits which can be used on vertices and edges\u003c/dd\u003e\n  \u003cdt\u003etype\u003c/dt\u003e\n  \u003cdd\u003ethese are types of graphs and related classes\u003c/dd\u003e\n\u003c/dl\u003e\n\nFactories for EdgeSpec and VertexSpec are now used by Graph. This allows plugins to add new behavior to the edge and \nvertex methods. New attributes and methods can be added to the ConfigSpec used in these methods. DirectedGraphPlugin\nuses this to add connectsFrom to the map and closure in the ConfigSpec.\n\n## 0.17.0\n\n* [#82](https://github.com/moaxcp/graph-dsl/issues/82) Methods that take vertex names should also take VertexNameSpec\n* [#84](https://github.com/moaxcp/graph-dsl/issues/84) Configure gradle to fail for codenarc violations and jacoc verification\n* [#87](https://github.com/moaxcp/graph-dsl/issues/87) TraversalSpec should return VertexNameSpec when property or method is missing\n* [#85](https://github.com/moaxcp/graph-dsl/issues/85) Traversal methods should accept a root param\n\n## 0.16.0\n\n* [#80](https://github.com/moaxcp/graph-dsl/issues/80) Removed sonarqube since it no longer supports groovy\n* [#78](https://github.com/moaxcp/graph-dsl/issues/78) Changed edgesFirst and edgesSecond in dsl to connectsTo and connectsFrom.\n* [#77](https://github.com/moaxcp/graph-dsl/issues/77) renameOne and renameTwo in edge methods will not add extra vertex objects to the graph.\n\n## 0.15.0\n\nThis release combines fixes for a few issues on github.\n\n* [#75](https://github.com/moaxcp/graph-dsl/issues/75) Vertex.name, Edge.one, and Edge.two is now @PackageScope. This only \naffects code that is @CompileStatic for now due to [GROOVY-3010](https://issues.apache.org/jira/browse/GROOVY-3010).\n* [#74](https://github.com/moaxcp/graph-dsl/issues/74)Vertices and edges may now be deleted. A vertex cannot be deleted if\nthere are edges referencing it.\n* [#73](https://github.com/moaxcp/graph-dsl/issues/73) Added EdgeWeightPlugin. This plugin adds the Weight trait to each \nedge. Traversal methods are ordered by edge weight.\n\nThere were also several other changes that were not an issue on github:\n\nUpdated gradle to 3.5. Refactored gradle script to use the plugins closure when possible. gradle-gitflow does not work \nwith the closure because it is not in the gradle repository. This is another reason to update the plugin. Spock was also \nupdated to 1.1.\n\nAdded edgeTraits and vertexTraits. These methods will ensure traits are applied to current and future edges and vertices.\n\nAdded tests to provide more code coverage in jacoco.\n\nAdded more usage details to README.md\n\n## 0.14.0\n\nJust as in 0.13.0, where the config closure was removed from VertexSpec, this release removes the config closure from \nEdgeSpec. Traits can be added and configured for an Edge all within the same closure.\n\n```groovy\ngraph.with {\n    edge (step1, step2) {\n        traits Mapping\n        message = \"hello from edge between $one and $two\"\n        queue = [] as LinkedList\n        traits Weight\n        weight { queue.size() }\n    }\n}\n```\n\nAs in 0.13.0 this represents a major step in finalizing the edge api.\n\n## 0.13.0\n\nThis release removes the need for the config closure when creating a vertex. It is now possible to apply traits and configure\nthem all within the closure passed to vertex methods.\n\n```groovy\ngraph.with {\n   vertex step1 {\n       traits Mapping\n       message = 'hello from step1'\n       queue = [] as LinkedList\n       traits Weight\n       weight { queue.size() }\n   }\n}\n```\n\nThis change represents a major step in finalizing the vertex api.\n\n## 0.12.0\n\nThis release introduces a new way of creating a Vertex. The new methods allow vertices to be created without using strings for names.\nVertices can now be added with the following syntax.\n\n```groovy\ngraph.with {\n    vertex step1\n    vertex step2(traits:Mapping)\n    vertex step3 {\n        traits Mapping\n        config {\n            label = 'step3'\n        }\n    }\n    vertex step4(traits:Mapping) {\n        config {\n            label = 'step4'\n        }\n    }\n}\n```\n\nThis was achieve by adding propertyMissing and methodMissing to Graph which return a VertexSpec. A vertex(VertexSpec) method was\nadded to allow this syntax.\n\n## 0.11.0\n\nRemoving connectsTo from VertexSpec and replacing it with edgesFirst and edgesSecond. This helps in creating directed graphs\nusing the vertex methods. It also helps when creating vertices first then applying the DirectedGraphPlugin.\n\n## 0.10.3\n\nPublishing of gh-pages was still broken. This release fixed the issue. Also added reports to gh-pages so we can now view\ntest results, code coverage, and static analysis.\n\n## 0.10.2\n\nFixed publishing of gh-pages.\n\n## 0.10.1\n\nRelease to maven central for 0.10.0 failed. Upgraded gradle-nexus-staging-plugin which fixed the problem.\n\n## 0.10.0\n\nThis release features breadth first search methods. These are methods that follow the standard collection methods\nthat come with groovy: eachBfs, findBfs, findAllBfs, injectBfs, and collectBfs. There are two overrides for each.\nThe first takes a closure and starts at the first vertex in the vertices map. The second can specify the root to\nstart at in the breadth first traversal. Here is a short example using findBfs:\n\n```groovy\nfindBfs {\n    it.work \u003e 0\n}\n```\n\nFinds the first vertex with `work \u003e 0`\n\n```groovy\nfindBfs('step4') {\n    it.work \u003e 0\n}\n```\n\nFinds the first vertex with `work \u003e 0` starting at step4.\n\n## 0.9.0\n\nAdded reversePostOrder to DirectedGraphPlugin. This will allow a DirectedGraph to perform a\nclosure on each vertex in reverse post order (topological order). Also added reversePostOrderSort which\nreturns the vertex names in reverse post order of a graph.\n\nDirectedGraphPlugin was reorganized making it possible to javadoc methods dynamically added to the graph.\nThe methods added are static in DirectedGraphPlugin. They are added to Graph's metaClass using method pointers\nwhile currying the graph param to the apply method. This could be used in future plugins.\n\n## 0.8.2\n\n* fixing publishing of javadoc and groovydoc. gh-pages branch must exist.\n\n## 0.8.1\n\n* Automatically publishing javadoc and groovydoc to gh-pages.\n\n## 0.8.0\n\nThis is a major update to the api. It focuses on the edge and vertex methods in Graph. These methods\nprovide developers with the flexibility to create and configure the objects as they see fit. All edge\nand vertex methods return the object which allows the object to be configured with the `\u003c\u003c` operator.\nThe methods use *Spec objects to store specifications for the edge or vertex and then applies it to the\ngraph. See the groovydoc for more details.\n\n* upgraded to groovy-2.4.10\n* Adding edge and vertex methods to Graph which provides many new ways to manipulate a graph.\n* Vertices can be renamed and edges can be moved to different vertices.\n* Anytime a vertex is referenced it will be created.\n\n## 0.7.0\n\n* Added support for classifying edges. This can be used to detect cycles in a graph.\n* Added test coverage.\n* Added javadoc.\n\n## 0.6.0\n\n* fixed issue with logging when optimizations are turned off\n* updating gradle to 3.4.1\n* fixed many codenarc issues\n* added support for breadth first traversal\n\n## 0.5.1\n\n* Added warning when optimizations are turned off\n* Adjusting retry time for nexus-staging-plugin\n\n## 0.5.0\n\n* Fixed vertex and edge methods so they can modify existing objects\n* Added entry point to dsl though graph method\n* Added trait key to vertex and edge map. This makes it easier to add a single trait.\n\n## 0.4.4\n\n* Following suggestions from [#5](https://github.com/Codearte/gradle-nexus-staging-plugin/issues/5) to fix nexus release issue\n\n## 0.4.3\n\n* Adding fix for closeAndPromoteRepository\n\n## 0.4.2\n\n* Switched from maven-publish to maven plugin\n\n## 0.4.1\n\n* Fixes for maven-publish plugin.\n\n## 0.4.0\n\n* Artifacts publish to nexus automatically\n\n## 0.3.0\n\n* Added delegate support for Edges and Vertices\n* Added VertexMapPlugin and EdgeMapPlugin\n\n## 0.2.0\n\n* Optimized codenarc configuration using the ruleset method.\n* Updated gradle to version 3.3.\n* Added Plugin interface for all Plugins to implement.\n* Added plugins property to Graph which contains all plugins applied to the Graph.\n* Adde DirectedGraph plugin which converts a Graph into a DirectedGraph.\n\n## 0.1.2\n\nsonarqube.com doesn't seem to show any issues for groovy projects. This release adds codenarc support for local development. This allows developers to view issues right away without worrying about sonar.\n\n## 0.1.1\n\n* Changed travis.sh so master gets published to sonar instead of develop.\n\n## 0.1.0\n\n* initial plugin support\n* DirectedGraph plugin\n\n## 0.0.0\n\n* Support for vertices, edges, and depth first traversal\n\n# License\n\nThe license can be found in the LICENSE file.\n\nMIT License\n\nCopyright (c) 2017 John Mercier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoaxcp%2Fgraph-dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoaxcp%2Fgraph-dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoaxcp%2Fgraph-dsl/lists"}