Commit 5fca358e authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add an improved mechanism for referencing data files

parent b69b0981
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -19,23 +19,25 @@ In essence, clip is an automated drawing program; it reads a text file containin
a description of the chart or diagram and produces an image from it. This is best
explained by example, so here is how to draw a simple line chart using clip:

```css
class: plot;

limit-x: 0 7200;
limit-y: 0 100;

axes {
      font: "Latin Modern Roman";
      font-size: 12pt;
      label-format-x: datetime("%H:%M:%S");
  font: "Roboto";
  position: left bottom;
  label-placement-x: linear-interval(900 900 7000);
  label-format-x: datetime("%H:%M:%S");
}

lines {
      data-x: csv(test/testdata/timeseries.csv time);
      data-y: csv(test/testdata/timeseries.csv value);
  data: "test/testdata/timeseries.csv";
  stroke-width: 0.8pt;
  color: #06c;
}
```

The input file from above (`example.clp`) can be processed with clip using the
following command:
+6 −5
Original line number Diff line number Diff line
class: plot;
size: 1750px 500px;

limit-x: 0 7200;
limit-y: 0 100;

axes {
  font: "Latin Modern Roman";
  font-size: 12pt;
  label-format-x: datetime("%H:%M:%S");
  font: "Roboto";
  position: left bottom;
  label-placement-x: linear-interval(900 900 7000);
  label-format-x: datetime("%H:%M:%S");
}

lines {
  data-x: csv(test/testdata/timeseries.csv time);
  data-y: csv(test/testdata/timeseries.csv value);
  data: "test/testdata/timeseries.csv";
  stroke-width: 0.8pt;
  color: #06c;
}
+124 −255

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
lines {
  data-x: 100 200 300 400 500 600 700 800 900;
  data-y: 1.2 1.8 1.3 1.6 1.5 1.3 1.8 1.9 2.0;
  data-x: list(100 200 300 400 500 600 700 800 900);
  data-y: list(1.2 1.8 1.3 1.6 1.5 1.3 1.8 1.9 2.0);
  limit-y: 0 3;
  limit-x: 0 1000;
  marker-shape: pentagon;
+2 −2
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@ axes {
}

lines {
  data-x: 100 200 300 400 500 600 700 800 900;
  data-y: 1.2 1.8 1.3 1.6 1.5 1.3 1.8 1.9 2.0;
  data-x: list(100 200 300 400 500 600 700 800 900);
  data-y: list(1.2 1.8 1.3 1.6 1.5 1.3 1.8 1.9 2.0);
  limit-y: 0 3;
  limit-x: 0 1000;
  marker-shape: pentagon;
Loading