4
A library for generating SVGs from Juju bundles and environments.
9
To start using jujusvg, first ensure you have a valid Go environment, then run
12
go get gopkg.in/juju/jujusvg.v1
17
The project uses godeps (https://launchpad.net/godeps) to manage Go
18
dependencies. To install this, run:
21
go get launchpad.net/godeps
23
After installing it, you can update the dependencies to the revision specified
24
in the `dependencies.tsv` file with the following:
28
Use `make create-deps` to update the dependencies file.
33
Given a Juju bundle, you can convert this to an SVG programatically. This
34
generates a simple SVG representation of a bundle or bundles that can then be
35
included in a webpage as a visualization.
37
For an example of how to use this library, please see `examples/generatesvg.go`.
38
You can run this example like:
40
go run generatesvg.go bundle.yaml > bundle.svg
42
The examples directory also includes three sample bundles that you can play
43
around with, or you can use the [Juju GUI](https://demo.jujucharms.com) to
44
generate your own bundles.
49
Some assets are specified based on assets provided by the design team. These
50
assets are specified in the defs section of the generated SVG, and can thus
51
be found in the Canvas.definition() method. These assets are, except where
52
indicated, embedded in a go file assigned to an exported variable, so that they
59
"gopkg.in/juju/jujusvg.v1/assets"
64
io.WriteString(canvas.Writer, assets.AssetToWrite)
67
Current assets in use:
69
* ~~The service block~~ *the service block has been deprecated and is now handled with SVGo*
70
* The relation health indicator