Commit edccdfe157b8cdd74de9028777231dac30cbefe0
Update readme
Charles Lehner committed on 2/10/2015, 5:48:52 PMParent: 378c8b78a1a63307a4f41c22709ff8a0ac8026a3
Files changed
README.md | changed |
README.md | |||
---|---|---|---|
@@ -2,25 +2,26 @@ | |||
2 | 2 … | ### [Sparklines](https://github.com/holman/spark) as PNGs | |
3 | 3 … | ||
4 | 4 … | ![histogram](https://cloud.githubusercontent.com/assets/95347/6131872/f78ab708-b11c-11e4-9ae2-fd6cd0ec2b76.png) | |
5 | 5 … | ||
6 … | +Uses [LuPng](https://github.com/jansol/LuPng). | ||
7 … | + | ||
6 | 8 … | ## Install | |
7 | 9 … | ``` | |
8 | 10 … | make | |
9 | 11 … | [sudo] make install [PREFIX=/usr/local] | |
10 | 12 … | ``` | |
11 | 13 … | ||
12 | 14 … | ## Usage | |
13 | 15 … | ``` | |
14 | -pngspark [-h height] [-c color] [-s scaling] output.png | ||
16 … | +echo 1 2 3 ... | pngspark [-h height] [-c color] [-s scaling] output.png | ||
15 | 17 … | ``` | |
16 | -Pipe numbers to pngspark to add them to the image. | ||
17 | 18 … | ||
18 | 19 … | ### Options | |
19 | 20 … | * `-h height`: the height of the image in pixels | |
20 | 21 … | * `-c color`: the color of the foreground, as #rrggbb hex | |
21 | -* `-s scaling`: scaling factor. 0 to do no scaling, 1 to make the minimum | ||
22 | - value be at the bottom of the image | ||
22 … | +* `-s scaling`: scaling factor. 0 to keep things proportional, 1 to make the | ||
23 … | + minimum value be at the bottom of the image | ||
23 | 24 … | ||
24 | 25 … | ## Examples | |
25 | 26 … | ||
26 | 27 … | Display BTC ticker data | |
@@ -36,20 +37,22 @@ | |||
36 | 37 … | ![sine](https://cloud.githubusercontent.com/assets/95347/6132308/b42da1d4-b11f-11e4-9748-5b61febd9df9.png) | |
37 | 38 … | ||
38 | 39 … | ## API | |
39 | 40 … | ||
41 … | +Generate pngsparks in your own C programs! | ||
42 … | + | ||
40 | 43 … | ```c | |
41 | 44 … | struct pngspark; | |
42 | 45 … | ``` | |
43 | 46 … | A png spark instance: collection of values and settings. | |
44 | 47 … | ||
45 | 48 … | ```c | |
46 | 49 … | int pngspark_init(struct pngspark *ps, size_t height, const char *color, double scaling); | |
47 | 50 … | ``` | |
48 | -Initialize a pngspark struct. | ||
51 … | +Initialize a pngspark struct. Arguments are as in the command-line options. | ||
49 | 52 … | ||
50 | 53 … | ```c | |
51 | -int pngspark_append(struct pngspark *ps, double, value); | ||
54 … | +int pngspark_append(struct pngspark *ps, double value); | ||
52 | 55 … | ``` | |
53 | 56 … | Append a value to the pngspark. | |
54 | 57 … | ||
55 | 58 … | ```c |
Built with git-ssb-web