Building Interactive Diagrams with PureScript and GoJS
If you’re into functional programming and looking for a way to create interactive diagrams, you’re in for a treat. In this blog post, we have gathered the resources for Went, an open-source library that enables you to use PureScript and the GoJS library to build visually appealing diagrams.
Went: GoJS diagrams in PureScript
What is it?
Went is a wrapper library over purescript-gojs, a library containing bare bindings to GoJS. It supports defining diagrams declaratively with a monadic DSL that looks similar to GoJS’ make functionality.
Why is it?
The motivation for Went is twofold
- To support writing GoJS diagrams in PureScript applications. (duh)
- As long as we’re doing that, to address shortcomings of JavaScript and TypeScript via added type safety. For instance, Panels in GoJS that are of type Auto should not have their isOpposite property ever set – this is not currently expressible in that library, whereas in Went it is, by moving as much information as possible to the type level.
Introduction to Went
Source code and more examples on GitHub
- https://github.com/AdaBeat/purescript-went
- https://github.com/AdaBeat/purescript-went-examples
- https://github.com/AdaBeat/purescript-gojs
Feel free to contact us if you have questions or needs of Went or PureScript.