| 72 | } |
| 73 | |
| 74 | ReturnCode plot_draw( |
| 75 | Context* ctx, |
| 76 | PlotConfig* plot, |
| 77 | const Expr* expr) { |
| 78 | return expr_walk_map(expr, { |
| 79 | /* margins */ |
| 80 | { |
| 81 | "margin", |
| 82 | expr_calln_fn({ |
| 83 | std::bind(&measure_read, _1, &plot->margins[0]), |
| 84 | std::bind(&measure_read, _1, &plot->margins[1]), |
| 85 | std::bind(&measure_read, _1, &plot->margins[2]), |
| 86 | std::bind(&measure_read, _1, &plot->margins[3]), |
| 87 | }) |
| 88 | }, |
| 89 | {"margin-top", std::bind(&measure_read, _1, &plot->margins[0])}, |
| 90 | {"margin-right", std::bind(&measure_read, _1, &plot->margins[1])}, |
| 91 | {"margin-bottom", std::bind(&measure_read, _1, &plot->margins[2])}, |
| 92 | {"margin-left", std::bind(&measure_read, _1, &plot->margins[3])}, |
| 93 | |
| 94 | /* axes/grid/legend */ |
| 95 | {"axes", std::bind(&plotgen::plot_axes, ctx, plot, _1)}, |
| 96 | {"axis", std::bind(&plotgen::plot_axis, ctx, plot, _1)}, |
| 97 | {"grid", std::bind(&plotgen::plot_grid, ctx, plot, _1)}, |
| 98 | {"background", std::bind(&plot_set_background, ctx, plot, _1)}, |
| 99 | {"legend", std::bind(&plotgen::plot_legend, ctx, plot, _1)}, |
| 100 | |
| 101 | /* geometry elements */ |
| 102 | {"areas", std::bind(&plotgen::areas_draw, ctx, plot, _1)}, |
| 103 | {"bars", std::bind(&plotgen::bars_draw, ctx, plot,_1)}, |
| 104 | {"errorbars", std::bind(&plotgen::errorbars_draw, ctx, plot, _1)}, |
| 105 | {"labels", std::bind(&plotgen::labels_draw, ctx, plot, _1)}, |
| 106 | {"lines", std::bind(&plotgen::lines_draw, ctx, plot, _1)}, |
| 107 | {"points", std::bind(&plotgen::points_draw, ctx, plot, _1)}, |
| 108 | {"polygons", std::bind(&plotgen::polygons_draw, ctx, plot, _1)}, |
| 109 | {"rectangles", std::bind(&plotgen::rectangles_draw, ctx, plot, _1)}, |
| 110 | {"vectors", std::bind(&plotgen::vectors_draw, ctx, plot, _1)}, |
| 111 | }, false); |
| 112 | } |
| 113 | |
| 114 | ReturnCode plot_eval( |
| 115 | Context* ctx, |
no test coverage detected