Skip to main content

Fava Dashboards

Continuous Integration PyPI

fava-dashboards allows creating custom dashboards in Fava.

Example dashboards with random data: Overview Assets Income and Expenses Sankey

More screenshots

Installation

pip install fava-dashboards

Enable this plugin in Fava by adding the following lines to your ledger:

2010-01-01 custom "fava-extension" "fava_dashboards"

Configuration

The plugin looks by default for a dashboards.tsx file (or .ts, .js[x], .[cm]js) in the directory of the Beancount ledger (e.g. if you run fava personal.beancount, the dashboards.tsx file should be in the same directory as personal.beancount). The location of the dashboards.tsx configuration file can be customized:

2010-01-01 custom "fava-extension" "fava_dashboards" "{
    'config': '/path/to/dashboards.tsx'
}"

Please take a look at the example dashboards configuration dashboards.tsx, which uses most of the functionality described below. To get TypeScript type support, download fava-dashboards.d.ts and place it next to dashboards.tsx.

To convert a legacy dashboards.yaml file from version 1 to the new dashboards.tsx format, you can run make deps && uv run scripts/convert_dashboards_yaml_to_tsx.py path/to/dashboards.yaml --output path/to/dashboards.tsx. This script covers most common cases, and does not perform TypeScript type inference.

The dashboard configuration defines one or more dashboards, each with one or more panels. A panel has a relative width (e.g. 50% for 2 columns, or 33.3% for 3 column layouts) and an absolute height.

Configuration Properties

  • dashboards: list of dashboards
  • theme: optional theme configuration

The theme configuration supports:

  • echarts: optional ECharts theme name, or a custom ECharts theme object
  • dashboard.panel.style: optional custom MUI style properties for dashboard panels

Dashboard Properties

  • name: dashboard name
  • variables: optional list of dashboard-level variables
  • panels: list of panels

Variable Properties

Variables can be defined on dashboards or panels. Dashboard variables are available to all panels in that dashboard, and panel variables are only available to that panel.

  • name: variable name
  • label: optional display label. Default: variable name
  • display: optional variable control type. Must be one of select or toggle. Default: select
  • style: optional custom MUI style properties for the variable control
  • multiple: optional flag to allow selecting multiple values. Default: false
  • options: a JavaScript function which returns the available values
  • default: optional default value. Use an array when multiple is true

Panel Properties

  • title: optional title of the panel
  • width: optional width of the panel. Default: 100%
  • height: optional height of the panel. Default: 400px
  • link: optional link target of the panel header
  • variables: optional list of panel-level variables
  • kind: panel kind. Must be one of html, echarts, d3_sankey, table or react
  • spec: a JavaScript function which generates a valid spec depending on the panel kind

The spec function is called with an object containing the following properties:

  • panel: the current panel definition
  • variables: the resolved dashboard and panel variables
  • ledger.dateFirst: start date of the current date filter, or first transaction date of the ledger
  • ledger.dateLast: end date of the current date filter, or last transaction date of the ledger
  • ledger.filterFirst: start date of the current date filter, or null if no date filter is set
  • ledger.filterLast: end date of the current date filter, or null if no date filter is set
  • ledger.operatingCurrencies: configured operating currencies of the ledger
  • ledger.ccy: shortcut for the first configured operating currency of the ledger
  • ledger.accounts: declared accounts of the ledger
  • ledger.commodities: declared commodities of the ledger
  • ledger.query(bql): executes the specified BQL query
  • ledger.urlFor(url): adds current Fava filter parameters to url

HTML panel

The spec code of HTML panels must return valid HTML. The HTML code will be rendered in the panel.

ECharts panel

The spec code of Apache ECharts panels must return valid Apache ECharts chart options. Please take a look at the ECharts examples to get familiar with the available chart types and options.

d3-sankey panel

The spec code of d3-sankey panels must return valid d3-sankey chart options. Please take a look at the example dashboard configuration dashboards.tsx.

Table panel

The spec code of table panels must return valid MUI X Data Grid props.

React panel

The spec code of React panels must return a valid JSX element. Please note that the code must not return a Promise (i.e. async/await is not supported).

View Example Ledger

cd example; fava example.beancount

Contributing

This plugin consists of a Python backend and a TypeScript frontend.

Install uv and Node.js 22, run make deps to install the dependencies, and make dev to run the Fava dev server with auto-rebuild.

Before submitting a PR, please run make build to build the frontend in production mode, and add the compiled frontend to the PR.

Articles

Related Projects

Acknowledgements

Thanks to Martin Blais and all contributors of Beancount, Jakob Schnitzer, Dominik Aumayr and all contributors of Fava, and to all contributors of Apache ECharts, D3.js and d3-sankey.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fava_dashboards-2.0.2.tar.gz (5.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fava_dashboards-2.0.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file fava_dashboards-2.0.2.tar.gz.

File metadata

  • Download URL: fava_dashboards-2.0.2.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fava_dashboards-2.0.2.tar.gz
Algorithm Hash digest
SHA256 01aa4ed537280017605edf2a7c094f36ceabc2cdcf794ba8a7e110a3cd5d4aa6
MD5 e1661ca72ae09833b08dbab5f70a81cc
BLAKE2b-256 d793b3d6b246355a3212db687f7412c34a3ac8d0e40daeb5be01de7b6acfeeb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for fava_dashboards-2.0.2.tar.gz:

Publisher: release.yml on andreasgerstmayr/fava-dashboards

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fava_dashboards-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fava_dashboards-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b29b581cbe993998ab200f7cb9980b74a1010f545506600f59426b3697e80c
MD5 6ef3e6fec2b686dd68e280e071d50235
BLAKE2b-256 3e6179750c332ed0091977c4d7e3be3b7a0a8f5d3f73f8b09b19fd7ce95cf19b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fava_dashboards-2.0.2-py3-none-any.whl:

Publisher: release.yml on andreasgerstmayr/fava-dashboards

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 files

2.0.1

2 files

2.0.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page