dcjones/Compose.jl — pull request #67 by darwindarak (2014-06-30 07:43:38+00:00)
Title: [WIP] PGF/TikZ backend

Some initial work towards providing a PGF backend for Compose, mainly to address dcjones/Gadfly.jl#152.
The primitives:
- `LinePrimitive`
- `PolygonPrimitive`
- `LineWidthPrimitive`
- `StrokePrimitive`
- `FillPrimitive`

have been implemented. The `sierpinski` and `dashedlines` examples were tested with
the new backend, generating [sierpinski.tex](https://gist.github.com/darwindarak/21417297362c021136d3) and [dashedlines.tex](https://gist.github.com/darwindarak/f4c83487f8f97d091d32) with the following screenshots.
![sierpinski](https://cloud.githubusercontent.com/assets/7328215/3426876/2866afca-002a-11e4-97e4-d9f22ad60c2d.png)
![dashedlines](https://cloud.githubusercontent.com/assets/7328215/3426877/2a12a342-002a-11e4-9a1e-9a7681fd636b.png)
Although the `stroke` and `fill` colors seem to be working fine, the implementation is very patchy at the moment. TikZ seems to be treating the color different from other properties. For example, to specify line width and dash pattern, we can use

```
\draw [line width=1mm, dash pattern=on 2mm off 3mm] (0,0) -- (1,0)
```
However, it seem like color has be defined before `\draw` is called:
```
\definecolor{mycolorFF0000}{RGB}{255,0,0}
\draw [line width=1mm, dash pattern=on 2mm off 3mm,color=mycolorFF0000] (0,0) -- (1,0)
```

`fill` color also behaves counterintuitively. I have been using the `{scope}` environment to replace the `` container in SVG. I was hoping I could set the fill property of the primitives it contains using:
```
\definecolor{mycolorFF0000}{RGB}{255,0,0}
\begin{scope}[fill=mycolorFF0000},line width=0.1mm]
\draw (101.6,87.99) -- (100.01,87.99)
\draw (96.84,87.99) -- (95.25,87.99);
\end{scope}
```
but the fill colors stay unchanged unless I change the parameters to:
```
\begin{scope}[draw/.style={fill=mycolorFF0000}, line width=0.1mm]
```

That's all I have for now. Any advice or suggestions will be greatly appreciated. Thanks!