Commit 66b38a2d authored by Paul Asmuth's avatar Paul Asmuth
Browse files

experimental new config interface with reduced indirection

parent 6c4d1428
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ include_directories(${CAIRO_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_IN
add_library(plotfx STATIC
    source/plotfx.cc
    source/plotfx_sdl.cc # TODO: only if SDL enabled
    source/plot.cc
    source/plot_area.cc
    source/plot_axis.cc
    source/plot_bars.cc
+10 −7
Original line number Diff line number Diff line
width: 1200px;
height: 480px;

data: csv('tests/testdata/point_example.csv');
x: x;
y: y;
group: series;
points {
  xs: 10px, 60px, 12em;
  ys: 60px, 200px, 14em;
  sizes: 4pt, 20pt;
}

grid: geom;
axis {
  position: bottom;
}

layer {
  type: points;
axis {
  position: top;
}
+6 −0
Original line number Diff line number Diff line
This page will guide you through creating a simple first plot and then give you
pointers to more detailed documentation.

Unlike a classical chart generator, a PlotFX file initially starts out as a blank
slate.

manual/ideas.txt

0 → 100644
+13 −0
Original line number Diff line number Diff line
scale: cartesian;

points {
  xs: 5 8 10;
  ys: 6 11 53;
  sizes: 4pt 8pt 8pt;
  color: auto;
}

axis {
  position: bottom outside;
}
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ namespace plotfx {

using ParserFn = std::function<ReturnCode (const plist::Property&)>;

template <typename T>
using ParseToFn = std::function<ReturnCode (const plist::Property&, T* value)>;

using ParserDefinitions = std::unordered_map<std::string, ParserFn>;

ReturnCode parseAll(
@@ -65,6 +68,9 @@ ReturnCode parse_classlike(
template <typename T>
ParserFn configure_opt(ParserFn parser);

template <typename T>
ParserFn configure_vec(ParseToFn<T> parser, std::vector<T>* values);

ParserFn configure_multiprop(const std::vector<ParserFn>& parsers);

ParserFn configure_key(std::string* key);
Loading