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

add axis scale, scale-{min, max, padding} properties

parent 5c817f1d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -657,6 +657,11 @@ ReturnCode configure(

  static const ParserDefinitions pdefs = {
    {"position", bind(&parseAxisPositionProp, _1, &config->position)},
    {"scale", bind(&domain_configure, _1, &domain)},
    {"scale-min", bind(&configure_float_opt, _1, &domain.min)},
    {"scale-max", bind(&configure_float_opt, _1, &domain.max)},
    {"scale-padding", bind(&configure_float, _1, &domain.padding)},
    {"layout", bind(&axis_configure_label_placement, _1, &config->label_placement)},
  };

  if (auto rc = parseAll(plist, pdefs); !rc) {
+3 −0
Original line number Diff line number Diff line
@@ -3,4 +3,7 @@ height: 90px;

axis {
  scale: linear(1);
  scale-min: 0;
  scale-max: 16;
  layout: linear(1);
}
+9 −0
Original line number Diff line number Diff line
width: 1200px;
height: 90px;

axis {
  scale: linear(1);
  scale-min: 0;
  scale-max: 16;
  layout: linear(1, align 0.5);
}
+36 −0
Original line number Diff line number Diff line
<svg xmlns="http://www.w3.org/2000/svg" width="1200.000000" height="90.000000" viewBox="0 0 1200.0 90.0">
  <rect width="1200.000000" height="90.000000" fill="#ffffff"/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M40.0 50.0 L1160.0 50.0 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M75.0 50.0 L75.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M145.0 50.0 L145.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M215.0 50.0 L215.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M285.0 50.0 L285.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M355.0 50.0 L355.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M425.0 50.0 L425.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M495.0 50.0 L495.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M565.0 50.0 L565.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M635.0 50.0 L635.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M705.0 50.0 L705.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M775.0 50.0 L775.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M845.0 50.0 L845.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M915.0 50.0 L915.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M985.0 50.0 L985.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M1055.0 50.0 L1055.0 44.666667 "/>
  <path stroke-width="1.333333" stroke="#a8a8a8" fill="none" d="M1125.0 50.0 L1125.0 44.666667 "/>
  <text x="64.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">0.5</text>
  <text x="134.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">1.5</text>
  <text x="204.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">2.5</text>
  <text x="274.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">3.5</text>
  <text x="344.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">4.5</text>
  <text x="414.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">5.5</text>
  <text x="484.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">6.5</text>
  <text x="554.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">7.5</text>
  <text x="624.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">8.5</text>
  <text x="694.804688" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">9.5</text>
  <text x="760.726562" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">10.5</text>
  <text x="831.273438" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">11.5</text>
  <text x="900.726562" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">12.5</text>
  <text x="970.726562" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">13.5</text>
  <text x="1040.726562" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">14.5</text>
  <text x="1110.726562" y="75.733333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif">15.5</text>
</svg>
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
width: 1200px;
height: 90px;

axis {
  scale: linear(1);
  scale-min: 0;
  scale-max: 16;
  layout: subdivide(10);
}
Loading