M Makefile +1 -0
@@ 4,6 4,7 @@ all:
-t 3,4,5 \
-i "${DATA}" \
-s \
+ -y org.css \
-c "3,TRUE,contractor" \
-c "4,TRUE,convert" \
-c "2,TRUE,manager" > "${WHO}.svg"
M README +21 -21
@@ 4,8 4,6 @@ Generate an org chart diagram from sprea
== Let me show you its features
-image::sample.svg[Example]
-
* SVG output
* Configurable color coding by text match
* Auto-layout
@@ 20,27 18,29 @@ go get https://repos.seanrussell.us/orgc
== How to use it
--f `person`:: Filters on this person; includes reports and reports-to
--t `x,y,z`::
- All column #s are base-0. Column 0 is the person's name.
- * `x` - column # for the text above the person's name
- * `y` - column # for the row belowe the person's name
- * `z` - column # for the bottom row
--i `input`:: CSV-formatted input data; `-` for stdin
--s:: boolean, show the person's supervisor. Used with `-f`
--c `color format`::
- CSV formatted rules for coloring. May be spcified multiple times; first
- match wins.
- col-#,regular-expression,CSS styling
- e.g., `-c "2,[^ ]Manager,fill:yellow"`
+```
+ -i CSV input file (either this flag, or as the last argument)
+ -f Filter for these people's organization (regex)
+ -t Display column numbers, indexed by 0, separated by commas; empty cells are omitted; badly formatted numbers are ignored
+ -s Display superior; only used if results are filtered
+ -c Column,ValueMatch,ClassName -- sets a CSS class based on a regexp match in a column
+ -y CSS file to embed
+ --ex-and= Column,Value -- Exclude (and -- all ands must match
+ --ex-or= Column,Value -- Exclude (or -- any ors may match
+ --ex-incl= Column,Value -- Include (overrides and and or excludes)
+ --help show usage message
+```
+
.Example
```
orgchart \
- -f 'Sean' \
- -t 3,4,5 \
- -i org.csv \
- -s \
- -c "2,Contractor,fill:yellow" \
- -c "2,[^ ]Manager,fill:lightgreen"
+ -f "Richard Stephen" \
+ -t 3,4,5 \
+ -i sample.csv \
+ -s \
+ -y org.css \
+ -c "3,TRUE,contractor" \
+ -c "4,TRUE,convert" \
+ -c "2,TRUE,manager" > richard.svg
```
M org.css +14 -1
@@ 1,10 1,23 @@
+.capex {
+ fill: white;
+}
+.ga {
+ stroke-dasharray: 5,5;
+ stroke: red;
+ fill: white;
+}
.contractor {
fill: yellow;
}
.convert {
- stroke-dasharray: 5,5;
fill: orange;
}
.manager {
fill: lightgreen;
}
+.bussupport {
+ fill: lightblue;
+}
+.fy1617 {
+ fill: fuchsia;
+}
M todo.txt +1 -0
@@ 1,3 1,4 @@
Dotted-line reports
Admin associations
Pictures
+Dashed connection lines
M vendor/manifest +10 -0
@@ 4,13 4,23 @@
{
"importpath": "github.com/ajstarks/svgo",
"repository": "https://github.com/ajstarks/svgo",
+ "vcs": "",
"revision": "672fe547df4e49efc6db67a74391368bcb149b37",
"branch": "master",
"notests": true
},
{
+ "importpath": "github.com/droundy/goopt",
+ "repository": "https://github.com/droundy/goopt",
+ "vcs": "git",
+ "revision": "e5c9ab183a102ef3ad2363b04483784258984157",
+ "branch": "master",
+ "notests": true
+ },
+ {
"importpath": "honnef.co/go/structlayout",
"repository": "https://github.com/dominikh/go-structlayout",
+ "vcs": "",
"revision": "504fdf06ef5c0d83a29c594b3a169af68b9c2e14",
"branch": "master",
"notests": true