Pacioli

A statically typed unit-aware matrix language

View project on GitHub

Pacioli Table

The table web component displays a table.

The pacioli-table Component

The pacioli-table element adds a Pacioli table to a web page.

A table has one more index columns, and zero or more value columns. Each row display the values corresponding with the key(s) in the index column(s).

<pacioli-table>
  <column header="..." definition="..."></column>
  <column header="..." definition="..."></column>
  ...
</pacioli-table>

or

<pacioli-table definition="..."></pacioli-table>

With the second form the columns are defined in Pacioli code. Type Column provides some convience functions to create columns.

Columns

Each column child element of a table specifies a column in the table.

All columns in the table must have the same keys. The keys can come from an index set, or can be natural numbers, depending on the whether the column data comes from vectors, or from lists. When the data comes from vectors, the vectors must have the same index set. When the data comes from list, they must have the same length.

Input Data

The value for a column must be one of:

  • vector
  • list of numbers
  • list of (key, value) pairs
  • list of ((key, key, …), value)

A key is a string, a coordinate or a number (or anything really).

When the columns are defined in Pacioli the value must be a tuple of column values.

Common

definition
Name of the value or function to display
width
Width of the pacioli component.
height
Height of the pacioli component.
margin
Margin used around charts. For example margin="10,10,10,10"
decimals
Number of decimals for numbers. Default is 2.
zero
String to display for zero values
raw
Ignore number of decimals and display numbers with relevant digits.
exponential
Display numbers in exopnential format.

Table

gap
Distance between the bars. Dimensionless?
xlabel
Label on the x-axis
ylabel
Label on the y-axis
ylower
Start of the y-axis range
yupper
End of the y-axis range
ascii
Display the table in ascii format.
clipboard
Display the table in clipboard format.

Column

nozerorows
Don't show rows with all zeros
totals
Add a row with totals