Commit a44e97c5 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

rename 'even' axis placement strategy to 'subdivide'

parent c75fa968
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ plot {
  axis-top: off;
  axis-left: off;
  axis-right: off;
  axis-bottom-layout: even;

  axis-bottom-layout: subdivide;

  x: inline(0, 16);
}
+1 −1
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ plot {
  axis-top: off;
  axis-left: off;
  axis-right: off;
  axis-bottom-layout: even;

  axis-bottom-layout: subdivide;
  axis-bottom-format: datetime("%H:%M:%S");

  x: inline(0, 5);
+3 −1
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@ plot {
  axis-top: off;
  axis-left: off;
  axis-right: off;
  axis-bottom-layout: even;

  axis-bottom-layout: subdivide;
  axis-bottom-format: fixed(1);

  x: inline(0, 5);
}
+1 −1
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ plot {
  axis-top: off;
  axis-left: off;
  axis-right: off;
  axis-bottom-layout: even;

  axis-bottom-layout: subdivide;
  axis-bottom-format: scientific;

  x: inline(0, 5);
+6 −6
Original line number Diff line number Diff line
@@ -458,7 +458,7 @@ ReturnCode axis_draw_all(
  return OK;
}

ReturnCode axis_place_labels_even(
ReturnCode axis_place_labels_subdivide(
    const DomainConfig& domain,
    AxisDefinition* axis) {
  uint32_t num_ticks = 8; // FIXME make configurable
@@ -513,16 +513,16 @@ ReturnCode axis_place_labels_default(
    return axis_place_labels_discrete(domain, axis);
  }

  return axis_place_labels_even(domain, axis);
  return axis_place_labels_subdivide(domain, axis);
}

ReturnCode axis_configure_label_placement(
    const plist::Property& prop,
    AxisLabelPlacement* label_placement) {
  if (plist::is_value(prop, "even") ||
      plist::is_enum(prop, "even")) {
  if (plist::is_value(prop, "subdivide") ||
      plist::is_enum(prop, "subdivide")) {
    *label_placement = bind(
        &axis_place_labels_even,
        &axis_place_labels_subdivide,
        _1,
        _2);

@@ -542,7 +542,7 @@ ReturnCode axis_configure_label_placement(
  return ReturnCode::errorf(
      "EARG",
      "invalid value '$0', expected one of: \n"
      "  - even\n"
      "  - subdivide\n"
      "  - discrete\n",
      prop.value);
}