~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/gopkg.in/juju/jujusvg.v1/README.md

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
jujusvg
 
2
=======
 
3
 
 
4
A library for generating SVGs from Juju bundles and environments.
 
5
 
 
6
Installation
 
7
------------
 
8
 
 
9
To start using jujusvg, first ensure you have a valid Go environment, then run
 
10
the following:
 
11
 
 
12
    go get gopkg.in/juju/jujusvg.v1
 
13
 
 
14
Dependencies
 
15
------------
 
16
 
 
17
The project uses godeps (https://launchpad.net/godeps) to manage Go
 
18
dependencies. To install this, run:
 
19
 
 
20
 
 
21
    go get launchpad.net/godeps
 
22
 
 
23
After installing it, you can update the dependencies to the revision specified
 
24
in the `dependencies.tsv` file with the following:
 
25
 
 
26
    make deps
 
27
 
 
28
Use `make create-deps` to update the dependencies file.
 
29
 
 
30
Usage
 
31
-----
 
32
 
 
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.
 
36
 
 
37
For an example of how to use this library, please see `examples/generatesvg.go`.
 
38
You can run this example like:
 
39
 
 
40
    go run generatesvg.go bundle.yaml > bundle.svg
 
41
 
 
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.
 
45
 
 
46
Design-related assets
 
47
---------------------
 
48
 
 
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
 
53
may be used like so:
 
54
 
 
55
```go
 
56
import (
 
57
        "io"
 
58
 
 
59
        "gopkg.in/juju/jujusvg.v1/assets"
 
60
)
 
61
 
 
62
// ...
 
63
 
 
64
io.WriteString(canvas.Writer, assets.AssetToWrite)
 
65
```
 
66
 
 
67
Current assets in use:
 
68
 
 
69
* ~~The service block~~ *the service block has been deprecated and is now handled with SVGo*
 
70
* The relation health indicator