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

update the command reference, documentation intro

parent df315df8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
desc_code: |
  {{name}} <color>
examples: |
  ;; set the color to grey
  {{name}} #eee

  ;; set the color to red, 50% transparent
  {{name}} (rgba 1 0 0 .5)
+6 −6
Original line number Diff line number Diff line
@@ -7,14 +7,14 @@ arguments:
    examples: |
      ;; set x axis limits to [1..10]
      limit-x (1 10)
  - name: limit-x-max
  - name: limit-x-min
    desc: |
      Set the minimum value (lower limit) for the 'x' (horizontal) scale.
    desc_code: |
      limit-x-max <max>
      limit-x-min <min>
    examples: |
      ;; set x axis lower limit to 2
      limit-x-max 2
      limit-x-min 2
  - name: limit-x-max
    desc: |
      Set the maximum value (upper limit) for the 'x' (horizontal) scale.
@@ -31,14 +31,14 @@ arguments:
    examples: |
      ;; set y axis limits to [1..10]
      limit-y (1 10)
  - name: limit-y-max
  - name: limit-y-min
    desc: |
      Set the minimum value (lower limit) for the 'y' (vertical) scale.
    desc_code: |
      limit-y-max <max>
      limit-y-min <max>
    examples: |
      ;; set y axis lower limit to 2
      limit-y-max 2
      limit-y-min 2
  - name: limit-y-max
    desc: |
      Set the maximum value (upper limit) for the 'y' (vertical) scale.
+83 −138
Original line number Diff line number Diff line
name: plot/areas
example: charts-editorial/stacked_areas
name: plot/draw-areas
desc: |
  The `plot/areas` element is used to create area charts.
  The `plot/draw-areas` command takes an input data table, transforms it according
  to a user-provided scale configuration and then plots the data as one or more
  'area' shapes.

reference: |
  (plot/areas <options>)

option_summary: true

properties:
  - title: "Area Options"
    anchor: area-options
    properties:
arguments:
  - name: data-x
    type: dataset
    desc: |
      Set the 'x' dataset for the plot. The 'x' dataset will be used to
      calculate the horizontal position of geometry.
        desc_code: |
          data-x (<values>...)
          data-x (csv <file> <column>)
        examples: |
          ;; list of static values
          data-x (10px 20px 30px)

          ;; load a csv file
          data-x (csv myfile.csv mycolumn)
  - name: data-x-high
    alias: data-x

  - name: data-x-low
        desc: |
          Set the 'x2' dataset for the plot. The 'x2' dataset will be used to
          calculate the horizontal position of geometry.
        desc_code: |
          data-x-low (<values>...)
          data-x-low (csv <file> <column>)
        examples: |
          ;; list of static values
          data-x-low (10px 20px 30px)
    type: dataset

          ;; load a csv file
          data-x-low (csv myfile.csv mycolumn)
  - name: data-y
        desc: |
          Set the 'y' dataset for the plot. The 'y' dataset will be used to
    type: dataset
      Set the 'x' dataset for the plot. The 'x' dataset will be used to
      calculate the vertical position of geometry.
        desc_code: |
          data-y (<values>...)
          data-y (csv <file> <column>)
        examples: |
          ;; list of static values
          data-y (10px 20px 30px)

          ;; load a csv file
          data-y (csv myfile.csv mycolumn)
  - name: data-y-high
    alias: data-y

  - name: data-y-low
        desc: |
          Set the 'y2' dataset for the plot. The 'y2' dataset will be used to
          calculate the vertical position of geometry.
        desc_code: |
          data-y-low (<values>...)
          data-y-low (csv <file> <column>)
        examples: |
          ;; list of static values
          data-y-low (10px 20px 30px)
    type: dataset

          ;; load a csv file
          data-y-low (csv myfile.csv mycolumn)
  - name: direction
    desc: |
      Set the area 'direction'.
@@ -76,64 +37,48 @@ properties:
    examples: |
      ;; draw a vertical area chart
      direction vertical

  - name: color
        desc: |
          Set the area's fill and stroke color.
        desc_code: |
          color <color>
    type: color
    desc: Set the area's fill and stroke color.

  - name: stroke-color
    type: color
    desc: Set the area's stroke color.

  - name: stroke-width
    type: stroke_width
    desc: Set the area's stroke width.

  - name: stroke-style
    type: stroke_style
    desc: Set the area's stroke style.

  - name: stroke-high-color
        desc: |
          Set the area's high ("upper") stroke color. See the [color](#FIXME) page for more details on valid values.
        desc_code: |
          stroke-high-color <color>
        examples: |
          ;; set the area's high ("upper") stroke color to grey
          stroke-high-color #eee
    type: color
    desc: Set the area's high ("upper") stroke color.

  - name: stroke-high-width
        desc: |
          Set the area's high ("upper") stroke width. See the
          [measure](#FIXME) page for more details on valid values.
        desc_code: |
          stroke-high-width <measure>
        examples: |
          ;; set the area's high ("upper") stroke width to 2pt
          stroke-high-width 2pt
    type: stroke_width
    desc: Set the area's high ("upper") stroke width.

  - name: stroke-high-style
        desc: |
          Set the area's high ("upper") stroke style. See the
          [Fill & Stroke Styles](#FIXME) page for more details on valid values.
        desc_code: |
          stroke-high-style <stroke-high-style>
        examples: |
          ;; set the area's high ("upper") stroke style to none
          stroke-high-style solid
    type: stroke_style
    desc: Set the area's high ("upper") stroke style.

  - name: stroke-low-color
        desc: |
          Set the area's low ("lower") stroke color. See the [color](#FIXME) page for more details on valid values.
        desc_code: |
          stroke-low-color <color>
        examples: |
          ;; set the area's low ("lower") stroke color to grey
          stroke-low-color #eee
    type: color
    desc: Set the area's low ("lower") stroke color.

  - name: stroke-low-width
        desc: |
          Set the area's low ("lower") stroke width. See the
          [measure](#FIXME) page for more details on valid values.
        desc_code: |
          stroke-low-width <measure>
        examples: |
          ;; set the area's low ("lower") stroke width to 2pt
          stroke-low-width 2pt
    type: stroke_width
    desc: Set the area's low ("lower") stroke width.

  - name: stroke-low-style
        desc: |
          Set the area's low ("lower") stroke style. See the
          [Fill & Stroke Styles](#FIXME) page for more details on valid values.
        desc_code: |
          stroke-low-style <stroke-low-style>
        examples: |
          ;; set the area's low ("lower") stroke style to none
          stroke-low-style solid
    type: stroke_style
    desc: Set the area's low ("lower") stroke style.

  - include: scale_args

  - title: "Scale Options"
    anchor: scale-options
    inherit: ["elements/plot", "scale-options"]
examples:
  - charts-editorial/stacked_areas
+202 −232
Original line number Diff line number Diff line
name: plot/axis
name: plot/draw-axis
desc: |
  The plot/axis element is used to draw a labelled 'axis'.
  The plot/draw-axis draws a labelled 'axis'.

reference: |
  (plot/axis <options>)
arguments:

option_summary: true

properties:
  - title: "Layout Options"
    anchor: layout-options
    properties:
  - name: align
    desc: |
      Controls where the axis is drawn.
@@ -23,10 +16,6 @@ properties:
      ;; draw a horizontal axis
      align x


  - title: "Label Options"
    anchor: label-options
    properties:
  - name: label-placement
    desc: |
      The 'label-placement' option controls the axis label placement.
@@ -93,9 +82,6 @@ properties:
      ;; set the label color to grey
      label-color #eee

  - title: "Tick Options"
    anchor: tick-options
    properties:
  - name: tick-placement
    desc: |
      The 'tick-placement' option controls where on the axis the "ticks" are
@@ -122,9 +108,6 @@ properties:
      ;; set tick length to 1em
      ticks-length 1em

  - title: "Scale Options"
    anchor: scale-options
    properties:
  - name: limit
    desc: |
      Set the axis value range to the closed interval [min, max].
@@ -180,9 +163,6 @@ properties:
      scale-padding 0.5


  - title: "Title Options"
    anchor: title-options
    properties:
  - name: title
    desc: |
      Set the axis title
@@ -233,13 +213,3 @@ properties:
      ;; set the title color to grey
      title-color #eee

  - title: "Border Options"
    anchor: border-options
    properties:
      - name: border
        inherit: ["elements/layout/box", "border"]
      - name: border-width
        inherit: ["elements/layout/box", "border-width"]
      - name: border-color
        inherit: ["elements/layout/box", "border-color"]
+101 −183
Original line number Diff line number Diff line
name: plot/bars
example: charts-editorial/barchart_with_labels
name: plot/draw-bars
desc: |
  The `plot/bars` element is used to create bar charts.
  The `plot/draw-bars` command takes an input data table, transforms it according
  to a user-provided scale configuration and then plots the data as one or more
  'bars' (rectangle shapes).

reference: |
  (plot/bars <options>)

option_summary: true

properties:
  - title: "Bar Options"
    anchor: bar-options
    properties:
arguments:
  - name: data-x
    type: dataset
    desc: |
      Set the 'x' dataset for the plot. The 'x' dataset will be used to
      calculate the horizontal position of geometry.
        desc_code: |
          data-x (<values>...)
          data-x (csv <file> <column>)
        examples: |
          ;; list of static values
          data-x (10px 20px 30px)

          ;; load a csv file
          data-x (csv myfile.csv mycolumn)
  - name: data-x-high
    alias: data-x

  - name: data-x-low
        desc: |
          Set the 'x2' dataset for the plot. The 'x2' dataset will be used to
          calculate the horizontal position of geometry.
        desc_code: |
          data-x-low (<values>...)
          data-x-low (csv <file> <column>)
        examples: |
          ;; list of static values
          data-x-low (10px 20px 30px)
    type: dataset

          ;; load a csv file
          data-x-low (csv myfile.csv mycolumn)
  - name: data-y
        desc: |
          Set the 'y' dataset for the plot. The 'y' dataset will be used to
    type: dataset
      Set the 'x' dataset for the plot. The 'x' dataset will be used to
      calculate the vertical position of geometry.
        desc_code: |
          data-y (<values>...)
          data-y (csv <file> <column>)
        examples: |
          ;; list of static values
          data-y (10px 20px 30px)

          ;; load a csv file
          data-y (csv myfile.csv mycolumn)
  - name: data-y-high
    alias: data-y

  - name: data-y-low
        desc: |
          Set the 'y2' dataset for the plot. The 'y2' dataset will be used to
          calculate the vertical position of geometry.
        desc_code: |
          data-y-low (<values>...)
          data-y-low (csv <file> <column>)
        examples: |
          ;; list of static values
          data-y-low (10px 20px 30px)
    type: dataset

          ;; load a csv file
          data-y-low (csv myfile.csv mycolumn)
  - name: color
        desc: |
          Set the bar color.
        desc_code: |
          color <color>
    type: color
    desc: Set the bar color.

  - name: direction
    desc: |
      Set the bar 'direction'.
@@ -84,6 +43,7 @@ properties:

      ;; draw a horizontal "column" chart
      direction horizontal

  - name: bar-width
    desc: |
      Set the bar width. See the
@@ -93,6 +53,7 @@ properties:
    examples: |
      ;; set the bar width to 1em
      bar-width 1em

  - name: bar-offset
    desc: |
      Set the bar offset. See the
@@ -102,83 +63,40 @@ properties:
    examples: |
      ;; set the bar offset to -.4em
      bar-offset -.4em

  - name: bar-stroke-color
        desc: |
          Set the bar's stroke color. See the [color](#FIXME) page for more details on valid values.
        desc_code: |
          bar-stroke-color <color>
        examples: |
          ;; set the stroke color to grey
          bar-stroke-color #eee
    type: color
    desc: Set the bar's stroke color.

  - name: bar-stroke-width
        desc: |
          Set the bar stroke width. See the
          [measure](#FIXME) page for more details on valid values.
        desc_code: |
          bar-stroke-width <measure>
        examples: |
          ;; set the bar stroke width to 2pt
          bar-stroke-width 2pt
    type: stroke_width
    desc: Set the bar stroke width.

  - name: bar-stroke-style
        desc: |
          Set the bar stroke style. See the
          [Fill & Stroke Styles](#FIXME) page for more details on valid values.
        desc_code: |
          bar-stroke-style <stroke-style>
        examples: |
          ;; set the bar stroke style to none
          bar-stroke-style solid
      - name: bar-fill
        desc: |
          Set the bar fill. See the
          [Fill & Stroke Styles](#FIXME) page for more details on valid values.
        desc_code: |
          bar-fill <fil-style>
        examples: |
          ;; set the bar fill to blue
          bar-fill #00f
    type: stroke_style
    desc: Set the bar stroke style.

  - title: "Label Options"
    anchor: label-options
    properties:
  - name: labels
    type: dataset_string
    desc: |
          Set the labels for the plot. If set, a label will be drawn for each
          bar in the dataset at the bar's (x, y) coordinate,
        desc_code: |
          label-format (<values>...)
          labels (csv <file> <column>)
        examples: |
          ;; list of static values
          label-format ("A" "B" "C")
      Set the labels dataset. If provided, a label will be drawn for each
      point in the dataset next to the corresponding bar. The number of
      entries in the 'labels' dataset must match the number of entries in the
      'x' and 'y' datasets exactly.

          ;; load a csv file
          labels (csv myfile.csv mylabels)
  - name: label-font-size
        desc: |
          Set the label font size. See the [measure](#FIXME) page for more details on valid values.
        desc_code: |
          label-font-size <measure>
        examples: |
          ;; set the label font size to 14pt
          label-font-size 14pt
    type: font_size
    desc: Set the label font size.

  - name: label-color
        desc: |
          Set the label color. See the [color](#FIXME) page for more details on valid values.
        desc_code: |
          label-color <color>
        examples: |
          ;; set the label color to grey
          label-color #eee
    type: color
    desc: Set the label color.

  - name: label-padding
        desc: |
          Set the label padding/spacing. See the [measure](#FIXME) page for more details on valid values.
        desc_code: |
          label-padding <measure>
        examples: |
          ;; set the label padding to 2em
          label-padding 2em
    type: padding
    desc: Set the label padding/spacing.

  - include: scale_args

  - title: "Scale Options"
    anchor: scale-options
    inherit: ["elements/plot", "scale-options"]
examples:
  - charts-editorial/barchart_with_labels
Loading