Skip to content

Annotation

An Annotation points at a component, or at one data point of it, and draws a mark over the page:

  • marker (default): a numbered circle.
  • frame: a rounded frame around a value. A frame around a text is an oval.
  • arrow: a straight arrow between two data points.
  • difference: the difference of two values of a chart.
  • pointer: a thick arrow that points down at the end of a bar.
  • bracket: a line around some rows of a ChartStructure, with a text or their share.

An annotation with a title or a text gets a number. An AnnotationList on the same page prints the numbered texts.

The annotation points at the component. The component does not change and does not know about it, so this also works for a component from a package.

apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: plan_software_2024
spec:
  target:
    kind: ChartTime
    name: net_sales_by_segment
    point: { date: "2024-01-01", scenario: pl1 }
  title: 2024 Plan Software
  text: Software increases by **9.1 kEUR** compared to 2023.

target.name is the document a layout child refs, or metadata.name of an inline child. Without point the mark goes on the component as a whole.

point names one data point by its raw dataset values, not by the formatted label.

Field Value
rowGroup, category, subCategory The value of the column.
date The first day of the period, YYYY-MM-DD. With dateInterval: year a row of 2024-03-15 is in the period 2024-01-01. A period that does not start at midnight also has the time: 2024-01-01T09:00:00.
scenario A slot (ac1, pl1), a variance (dac1_pl1_pos), a table column, or a family (ac, pl) on the total of a stack that overlays families.
row subtotal or total, for those rows of a table. On a ChartTime with totals, total is a total column. With by other than all, date is the first day of its period.
part element (default): the bar, mark, row or cell. label: its value label. total: the total label of a stack.

A field left out is a wildcard. The point must match exactly one rendered element. What a component reports differs by kind:

Kind Fields of a data point
ChartTime date and scenario. With stack.by: dimensions a segment also has category, the name of its series. A stack total has date only, or also scenario: ac when the stack overlays families and each one has its own total.
ChartStructure The dimension of level and scenario. With stack by dimensions a segment also has the next lower dimension. A sum row has the name of its rowGroup, or the sumTitle, in the dimension of level. With template engine v1.0.0-next.69 it also has row: total for the row over all rows, subtotal for the row of a group.
ChartScatter, ChartBubble The dimensions of the point level, the series level and the facet level.
ChartBullet The dimension of level and the actual measure as scenario.
Table rowGroup, category, subCategory, and date in a column of a date interval. scenario selects the column. Without scenario the whole row is the target.
Text, Tree, Grid None: use a target without point.
SmallMultiple With panel: the fields of its base kind. Without panel: none.

A table point without subCategory means the row itself and not its thereof rows. All columns of one scenario with columnthereof or interval: setname have the same key, so a point cannot tell them apart.

apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: software_actual
spec:
  target:
    kind: Table
    name: sales_by_product
    point: { category: Software, scenario: ac1 }
  title: Software
  text: Ahead of plan.
---
apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: services_row
spec:
  target:
    kind: Table
    name: sales_by_product
    point: { category: Services }
  title: Services
  text: Behind plan in every quarter.

On a table cell the marker sits next to the number, not on it. The same holds for a value label of a chart (part: label or part: total) from template engine v1.0.0-next.51 on: the marker sits right of the label. A dense table has no room for that: there it is smaller and sits in the wider gap next to the number.

target:
  kind: Table
  name: pnl
  point: { row: subtotal, rowGroup: Revenue, scenario: ac1 }
target:
  kind: Table
  name: pnl
  point: { row: total }
apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: total_2025
spec:
  mark: frame
  target:
    kind: ChartTime
    name: net_sales
    point: { date: "2025-01-01", part: total }

This annotation has no text, so it has no number and no entry in a list.

apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: decline_trend
spec:
  mark: arrow
  color: negative
  target:
    kind: ChartTime
    name: net_sales
    point: { date: "2024-01-01", part: total }
  to:
    kind: ChartTime
    name: net_sales
    point: { date: "2028-01-01", part: total }

Both ends are data points, never free coordinates, and both must be on one page. to is required for mark: arrow, mark: difference and mark: bracket, optional for mark: frame and not allowed for the other marks.

mark: difference shows how far two values of a chart are apart. A thin line runs from the level of each value to a bar behind the second one, and the label is to minus target. Needs template engine v1.0.0-next.49.

---
apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: plan_growth
spec:
  mark: difference
  percent: true
  target:
    kind: ChartTime
    name: sales_by_area_chart
    point: { date: "2025-01-01" }
  to:
    kind: ChartTime
    name: sales_by_area_chart
    point: { date: "2026-01-01" }
  • A point of a stacked chart without category means the sum of the stack. With category it means one series.
  • percent: true adds the relative difference in brackets: +12.2 (+12%). highlight: true draws a frame around it.
  • digits sets the digits of the absolute difference. Default: 1.
  • The bar has the color positive for a higher value and negative for a lower one. sentiment: good-down turns that around, for costs. A color on the annotation wins.
  • A difference has no part: the point always means the bars.
  • On a ChartStructure the bars run from left to right. There the bar of the difference lies below the second row, or above it when that row is the upper one. This needs template engine v1.0.0-next.51.

mark: pointer draws a thick arrow that points down at the value end of a bar: the right end of a bar of a ChartStructure, the top of a column of a ChartTime. A point of a stack without a scenario means the whole stack. Needs template engine v1.0.0-next.51.

spec:
  mark: pointer
  target:
    kind: ChartStructure
    name: sales_by_country
    point: { category: Switzerland }

mark: bracket marks the rows of a ChartStructure from target to to. A line runs below the last row to the end of its bar, and from there up to the end of the bar of the first row. The text stands in a frame at the upper left. With percent: true the text is the share of these rows in all rows of the chart, for the bars the point names. markText sets another text. Needs template engine v1.0.0-next.51.

spec:
  mark: bracket
  percent: true
  target:
    kind: ChartStructure
    name: sales_by_country
    point: { category: France, scenario: ac1 }
  to:
    kind: ChartStructure
    name: sales_by_country
    point: { category: Germany, scenario: ac1 }
  • Both ends must be in one chart.
  • The share counts the rows with a bar. A sum row is not a part of it.

A frame with to is one oval around both data points: the ellipse through the corners of the box that holds both. Use it for a group of points in a ChartScatter: name the two points that lie farthest apart, and the points between them are inside. Needs template engine v1.0.0-next.75.

spec:
  mark: frame
  target:
    kind: ChartScatter
    name: product_portfolio
    point: { rowGroup: VA, category: VA-303 }
  to:
    kind: ChartScatter
    name: product_portfolio
    point: { rowGroup: VA, category: VA-328 }

The two ends can also be the mark and the name label of one point. The oval then goes around both:

spec:
  mark: frame
  target:
    kind: ChartScatter
    name: product_portfolio
    point: { rowGroup: VA, category: VA-07 }
  to:
    kind: ChartScatter
    name: product_portfolio
    point: { rowGroup: VA, category: VA-07, part: label }
  • Both ends must be data points, not a component as a whole.
  • A text of its own (markText) is not printed on such a frame.
  • When the oval has no room on the page, the frame is drawn close around both ends with round ends.

A frame with markText prints that text on the target and draws the frame around it. Use it for a number the chart does not show, for example a share. Needs template engine v1.0.0-next.49.

On a value label of a chart (part: label or part: total) the text stands right of the label, so both can be read. This needs template engine v1.0.0-next.51. An older engine prints the text on the label. markTextPosition: above puts the text above the label and not right of it (template engine v1.0.0-next.54).

spec:
  mark: frame
  markText: "61%"
  target:
    kind: ChartTime
    name: sales_by_area_chart
    point: { date: "2025-12-01", category: Software }

A SmallMultiple draws one chart or table per panel. panel names one of them by its label: a value of panels.by, or the label of a panels.items entry. point is then a data point of the chart or table in this panel.

apiVersion: bino.bi/v1alpha1
kind: Annotation
metadata:
  name: berlin_2026
spec:
  target:
    kind: SmallMultiple
    name: net-profit-by-location
    panel: Berlin
    point: { date: "2026-01-01", scenario: ac1 }
  title: Berlin 2026
  text: The new site opened in March.
  • With panel and without point, the mark goes on the panel as a whole.
  • Without panel, the target is the SmallMultiple as a whole, like a Grid. It has no data points then.
  • panel is only allowed with kind: SmallMultiple.
  • A panel that does not exist is reported by annotation-target-missing. The labels of panels.by come from the data, so for them the rule needs --execute-queries, and bino build writes a warning to its log.
  • A label should name one panel. When two panels have it, a by value that is also the label of a panels.items entry, or two entries with one label, the mark goes on each of them, with the same number. Lint and the build log report it as annotation-panel-ambiguous. Give the item another label.
  • A panel that panels.limit drops does not exist. Lint builds the by panels like the build: with panels.order and panels.limit.
  • The point check looks at the rows of the panel only: for a by panel the rows with its value in the by column. It does not look at the filter of a panels.items entry.

The CLI gives the numbers, per page and starting at 1:

  1. The order of the entries of the page’s AnnotationLists.
  2. Then the other annotations of the page, in manifest order.

Only an annotation with a title or a text gets a number. A number exists only if a mark carries it: an annotation whose point is not in the data gets none, and the next ones move up. Its text stays in the list without a number.

A component that sits on a page twice gets the mark twice, with the same number.

This is a warning and not a failure. The rule annotation-point-missing compares the point with the rows of the component’s dataset. bino build and bino preview write it to their log. bino lint --execute-queries reports it as a finding, which fails only with --fail-on-warnings or a severity you set in bino.toml.

The check does not look at the filter of a component, it skips a component that binds several datasets, and it cannot see whether a wildcard matches several elements. For a panel of a SmallMultiple whose sums, sumTitle or level holds a param of the base document, bino lint does not judge the point: only the build knows the value. In these cases the engine draws nothing and writes a warning to the browser console. The entry in the list keeps its place and loses its circle, the other numbers stay as they are.

color names a color from the bn-annotation section of a ComponentStyle. Built in are negative and positive. Without color, or with a name the style does not have, a mark has the main color of the style, a blue.

  • A direct child of a Grid can be a target, and so can a node of a Tree that renders a document by ref. A component in a card that sits in a Grid or a Tree, and an inline node of a Tree, cannot. The rule annotation-target-missing says so. The Grid or the Tree as a whole can be one. A panel of a SmallMultiple can be a target, see One panel of a SmallMultiple.
  • A ScreenshotArtefact of a single component does not show the marks: they are drawn over the page and not in the component.
  • A component embedded in the Markdown of a DocumentArtefact has no marks.
  • The presentation view shows annotations like bino preview.
  • metadata.annotations of any document is an unused free-form map and has nothing to do with this kind.

A tool that reads the HTML of bino preview or of a build can find the targets without an annotation on the page:

  • A component on a page or in a card on a page sits in an element with data-bino-kind and data-bino-ref (a document by ref) or data-bino-name (an inline child). Its target is kind from data-bino-kind and name from data-bino-ref, else from data-bino-name.
  • A direct child of a Grid and a node of a Tree that can be a target sit in an element with data-bino-target-kind and data-bino-target-name. These are target.kind and target.name as they are. A child that cannot be a target has neither.
  • Each panel of a SmallMultiple sits in an element with data-bino-panel: the label that target.panel takes. kind and name are those of the SmallMultiple.

A mark knows its annotation too. From template engine v1.0.0-next.88 on, each mark of bn-annotation-layer (a g.mark in its shadow root) and each entry of bn-annotation-list has data-bino-annotation with the metadata.name of its Annotation. Two annotations with the same target and point can so be told apart. In bino preview the items of the layer and the list also carry the file and line of each Annotation (sourceFile, line). An older engine draws the marks without the attribute.

A document that sits on a page twice has the same target in both places, and the mark goes on both.

Attribute Type Required Default Description
spec.mark string no marker marker, frame, arrow, difference, pointer or bracket.
spec.markText string no - For frame: a text printed on the target, with the frame around it. For bracket: its text.
spec.markTextPosition string no beside For frame with markText on a value label of a chart: beside or above.
spec.percent boolean no false For difference: also print the relative difference. For bracket: print the share of its rows.
spec.digits integer no 1 For difference: digits of the absolute difference.
spec.sentiment string no good-up For difference: good-up or good-down.
spec.highlight boolean no false For difference with percent: a frame around the relative difference.
spec.color string no main color Name of a color in the bn-annotation style.
spec.target.kind string yes - ChartTime, ChartStructure, ChartScatter, ChartBubble, ChartBullet, Table, Text, Tree, Grid or SmallMultiple.
spec.target.name string yes - Name of the component.
spec.target.panel string no - Label of one panel. Only with kind: SmallMultiple. See One panel of a SmallMultiple.
spec.target.point object no whole component See The point.
spec.to object for arrow, difference and bracket - The end of the arrow, the second value of the difference, the last row of the bracket or the second data point of a frame, the same shape as target.
spec.title string no - Shown in bold in the list.
spec.text string no - Inline Markdown shown in the list.