Skip to content
GitHub

ComponentStyle

ComponentStyle manifests capture styling information for components. They allow you to centralize typography, colors, spacing, and other visual rules.

apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: corporateTheme
spec:
  content: {}  # object or JSON string

spec.content can be either:

  • A YAML object
  • A JSON string (useful when copying from front-end configuration)

The style object has the following top-level sections:

SectionDescription
globalGlobal typography and color settings applied to all components
bn-textStyle settings for text components (extensible)
bn-chart-timeStyle settings for time/column charts
bn-chart-structureStyle settings for structure/bar charts
bn-chart-treeStyle settings for hierarchical tree diagrams
bn-gridStyle settings for grid layouts with row/column headers

Global settings are inherited by all components.

PropertyTypeDefaultDescription
fontSizePxnumber13.3333Base font size in pixels. Scale factors multiply this value.
fontFamilystring'Noto Sans', sans-serifCSS font-family value
fontColorstring#000000Primary text color (CSS color)
fontBackgroundColorstring#ffffffBackground color for text elements (CSS color)
global:
  fontSizePx: 14
  fontFamily: "'Inter', sans-serif"
  fontColor: "#1a1a1a"
  fontBackgroundColor: "#ffffff"

Reserved for future text component styling. Currently accepts any properties.


Style settings for vertical column charts (time series visualizations).

PropertyTypeDescription
scaleFactorsobjectScale factors for element sizing
axisStylesobjectSVG styles for axis elements by scenario
barStylesobjectSVG styles for bar/column elements by scenario
varianceStylesobjectSVG styles for variance indicators
paddingobjectPadding around the chart area

All scale factors are multiplied by global.fontSizePx to calculate pixel values.

PropertyDefaultDescription
scenarioOffset0.3Horizontal offset between scenario bars
scenarioLabelToColumn0.3Gap between scenario label and column
labelToColumn0.3Gap between category label and column
labelToAxis0.3Gap between label and axis
needleWidth0.3Width of needle indicators
needleHeadWidth0.6Width of needle head (arrow)
columnWidth2.0Width of data columns
varianceAxisLineWidth0.3Width of variance axis lines
axisLineWidth0.1Width of main axis lines
auxiliaryLineWidth0.1Width of auxiliary/grid lines
scenarioLineWidth0.2Width of scenario indicator lines
markerWidth0.7Width of data point markers
markerOffset0.0Offset of markers from data points
categoryWidth3.0Width allocated per category
axisTickLength0.3Length of axis tick marks

Structure chart style (bn-chart-structure)

Section titled “Structure chart style (bn-chart-structure)”

Style settings for horizontal bar charts (structure visualizations).

PropertyTypeDescription
scaleFactorsobjectScale factors for element sizing
axisStylesobjectSVG styles for axis elements by scenario
barStylesobjectSVG styles for bar elements by scenario
varianceStylesobjectSVG styles for variance indicators
paddingobjectPadding around the chart area

All scale factors are multiplied by global.fontSizePx to calculate pixel values.

PropertyDefaultDescription
scenarioOffset0.3Vertical offset between scenario bars
scenarioLabelToBar0.1Gap between scenario label and bar
labelToBar0.3Gap between category label and bar
labelToAxis0.3Gap between label and axis
needleWidth0.3Width of needle indicators
needleHeadWidth0.6Width of needle head (arrow)
barWidth1.2Height of horizontal bars
varianceAxisLineWidth0.3Width of variance axis lines
axisLineWidth0.1Width of main axis lines
auxiliaryLineWidth0.1Width of auxiliary/grid lines
scenarioLineWidth0.2Width of scenario indicator lines
markerWidth0.7Width of data point markers
markerOffset0.0Offset of markers from data points
categoryWidth1.9Height allocated per category row
axisTickLength0.3Length of axis tick marks

Style settings for hierarchical tree diagrams.

PropertyTypeDefaultDescription
edgeColorstring#404040Color for tree edges/connections (CSS color)
edgeWidthnumber1Width of tree edges in pixels
operatorCircleRadiusnumber10Radius of operator node circles in pixels
operatorFontSizeScalenumber0.9Scale factor for operator font size relative to global.fontSizePx
operatorColorstring#404040Color for operator nodes (CSS color)
bn-chart-tree:
  edgeColor: "#606060"
  edgeWidth: 2
  operatorCircleRadius: 12
  operatorFontSizeScale: 0.85
  operatorColor: "#333333"

Style settings for grid layouts with row and column headers.

PropertyTypeDefaultDescription
headerBackgroundstring"transparent"Background color for row and column headers (CSS color)
borderColorstring"#A6A6A6"Color of cell border/divider lines (CSS color)
borderWidthnumber1Width of cell borders in pixels
cellPaddingnumber4Padding inside cells in pixels
bn-grid:
  headerBackground: "#f0f0f0"
  borderColor: "#cccccc"
  borderWidth: 1
  cellPadding: 8

Both axisStyles and barStyles use scenario-based grouping following IBCS notation:

KeyDescription
acStyle for Actual values
fcStyle for Forecast values
ppStyle for Prior Period values
plStyle for Plan values

Each scenario key contains an SVG style object.


The varianceStyles property groups styles by variance direction:

KeyDescription
posStyle for positive variances (favorable)
negStyle for negative variances (unfavorable)
neuStyle for neutral/zero variances

Individual SVG style properties:

PropertyTypeDescription
strokestringSVG stroke color (CSS color)
fillstringSVG fill color (CSS color)
widthnumberStroke width in pixels
dasharraystringSVG stroke-dasharray pattern (e.g., "10 5 5 5" for dashed lines)
fillpatternstringReference to a fill pattern (e.g., "fc" for forecast hatching)
axisStyles:
  ac: { stroke: "#121212", fill: "#121212", width: 0.1 }
  fc: { stroke: "#121212", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" }
  pp: { stroke: "#606060", fill: "#606060", width: 0.1 }
  pl: { stroke: "#121212", fill: "#ffffff", width: 0.1 }

Padding configuration for chart areas:

PropertyTypeDefaultDescription
topnumber10Top padding in pixels
leftnumber10Left padding in pixels
rightnumber10Right padding in pixels
bottomnumber10Bottom padding in pixels

---
apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: corporateTheme
spec:
  content:
    global:
      fontSizePx: 14
      fontFamily: "'Inter', sans-serif"
      fontColor: "#1a1a1a"
      fontBackgroundColor: "#ffffff"

    bn-chart-time:
      scaleFactors:
        columnWidth: 2.5
        categoryWidth: 3.5
      axisStyles:
        ac: { stroke: "#000000", fill: "#000000", width: 0.1 }
        fc: { stroke: "#000000", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" }
        pp: { stroke: "#666666", fill: "#666666", width: 0.1 }
        pl: { stroke: "#000000", fill: "#ffffff", width: 0.1 }
      barStyles:
        ac: { stroke: "#333333", fill: "#333333", width: 0.1 }
        fc: { stroke: "#333333", fill: "#ffffff", width: 0.5, fillpattern: "fc" }
        pp: { stroke: "#999999", fill: "#999999", width: 0.1 }
        pl: { stroke: "#333333", fill: "#ffffff", width: 0.1 }
      varianceStyles:
        pos: { stroke: "#008f96", fill: "#008f96", width: 0.1 }
        neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 }
        neu: { stroke: "#808080", fill: "#808080", width: 0.1 }
      padding:
        top: 15
        left: 15
        right: 15
        bottom: 15

    bn-chart-structure:
      scaleFactors:
        barWidth: 1.5
        categoryWidth: 2.0
      axisStyles:
        ac: { stroke: "#000000", fill: "#000000", width: 0.1 }
        fc: { stroke: "#000000", fill: "#ffffff", width: 0.1, dasharray: "10 5 5 5" }
        pp: { stroke: "#666666", fill: "#666666", width: 0.1 }
        pl: { stroke: "#000000", fill: "#ffffff", width: 0.1 }
      barStyles:
        ac: { stroke: "#333333", fill: "#333333", width: 0.1 }
        fc: { stroke: "#333333", fill: "#ffffff", width: 0.5, fillpattern: "fc" }
        pp: { stroke: "#999999", fill: "#999999", width: 0.1 }
        pl: { stroke: "#333333", fill: "#ffffff", width: 0.1 }
      varianceStyles:
        pos: { stroke: "#008f96", fill: "#008f96", width: 0.1 }
        neg: { stroke: "#ff0000", fill: "#ff0000", width: 0.1 }
        neu: { stroke: "#808080", fill: "#808080", width: 0.1 }

    bn-chart-tree:
      edgeColor: "#505050"
      edgeWidth: 1.5
      operatorCircleRadius: 12
      operatorFontSizeScale: 0.85
      operatorColor: "#404040"

    bn-grid:
      headerBackground: "#f5f5f5"
      borderColor: "#cccccc"
      borderWidth: 1
      cellPadding: 8

You can also provide the content as a JSON string:

---
apiVersion: bino.bi/v1alpha1
kind: ComponentStyle
metadata:
  name: compactStyle
spec:
  content: >-
    {"global":{"fontSizePx":12,"fontFamily":"'Roboto', sans-serif"}}