Skip to content

Commit

Permalink
support links in panel title
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Sep 24, 2023
1 parent 3f820c1 commit cf18d42
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The following variables are available:
* `title`: title of the panel. Default: unset
* `width`: width of the panel. Default: 100%
* `height`: height of the panel. Default: 400px
* `link`: optional link target of the panel header.
* `queries`: a list of dicts with a `bql` attribute.
* `type`: panel type. Must be one of `html`, `echarts`, `d3_sankey` or `jinja2`.

Expand Down
14 changes: 14 additions & 0 deletions example/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dashboards:
- title: Assets 💰
width: 50%
height: 80px
link: /beancount/balance_sheet/
queries:
- bql: SELECT CONVERT(SUM(position), '{{ledger.ccy}}') AS value WHERE account ~ '^Assets:'
type: html
Expand All @@ -20,6 +21,7 @@ dashboards:
- title: Liabilities 💳
width: 50%
height: 80px
link: /beancount/balance_sheet/
queries:
- bql: SELECT CONVERT(SUM(position), '{{ledger.ccy}}') AS value WHERE account ~ '^Liabilities:'
type: html
Expand All @@ -35,6 +37,7 @@ dashboards:
- title: Income/Expenses 💸
height: 520px
link: /beancount/income_statement/
queries:
- name: Income
stack: income
Expand Down Expand Up @@ -172,6 +175,7 @@ dashboards:
- title: Net Worth 💰
width: 50%
link: /beancount/income_statement/
queries:
- bql: |
SELECT year, month,
Expand Down Expand Up @@ -477,6 +481,7 @@ dashboards:
- title: Avg. Income per Month 💰
width: 33.3%
height: 80px
link: /beancount/account/Income/?r=changes
queries:
- bql: SELECT CONVERT(SUM(position), '{{ledger.ccy}}') AS value WHERE account ~ '^Income:'
type: html
Expand All @@ -494,6 +499,7 @@ dashboards:
- title: Avg. Expenses per Month 💸
width: 33.3%
height: 80px
link: /beancount/account/Expenses/?r=changes
queries:
- bql: SELECT CONVERT(SUM(position), '{{ledger.ccy}}') AS value WHERE account ~ '^Expenses:'
type: html
Expand All @@ -511,6 +517,7 @@ dashboards:
- title: Avg. Savings per Month ✨
width: 33.3%
height: 80px
link: /beancount/income_statement/
queries:
- bql: SELECT CONVERT(SUM(position), '{{ledger.ccy}}') AS value WHERE account ~ '^Income:'
- bql: SELECT CONVERT(SUM(position), '{{ledger.ccy}}') AS value WHERE account ~ '^Expenses:'
Expand All @@ -536,6 +543,7 @@ dashboards:
- title: Income Categories (per month) 💸
width: 50%
link: /beancount/account/Income/?r=changes
queries:
- bql: |
SELECT root(account, 4) AS account, CONVERT(SUM(position), '{{ledger.ccy}}') AS value
Expand Down Expand Up @@ -584,6 +592,7 @@ dashboards:
- title: Expenses Categories (per month) 💸
width: 50%
link: /beancount/account/Expenses/?r=changes
queries:
- bql: |
SELECT root(account, 3) AS account, CONVERT(SUM(position), '{{ledger.ccy}}') AS value
Expand Down Expand Up @@ -632,6 +641,7 @@ dashboards:
- title: Recurring Expenses 🔁
width: 50%
link: /beancount/income_statement/?filter=#recurring
queries:
- name: Recurring
stack: expenses
Expand All @@ -652,6 +662,7 @@ dashboards:

- title: Food Expenses 🥐
width: 50%
link: /beancount/account/Expenses:Food/
queries:
- bql: |
SELECT year, month, CONVERT(SUM(position), '{{ledger.ccy}}', LAST(date)) AS value
Expand Down Expand Up @@ -830,6 +841,7 @@ dashboards:
panels:
- title: Travel Costs per Year 📅
# Note: Holidays over New Year's Eve are counted in both years aliquot.
link: /beancount/income_statement/?filter=#travel
queries:
- bql: |
SELECT year, CONVERT(SUM(position), '{{ledger.ccy}}', LAST(date)) AS value
Expand Down Expand Up @@ -878,6 +890,7 @@ dashboards:
- title: Destinations ✈️
height: 300px
link: /beancount/income_statement/?filter=#travel
queries:
- bql: |
SELECT tags, CONVERT(position, '{{ledger.ccy}}') AS value
Expand Down Expand Up @@ -936,6 +949,7 @@ dashboards:
panels:
- title: Sankey (per month) 💸
height: 800px
link: /beancount/income_statement/
queries:
- bql: |
SELECT account, CONVERT(SUM(position), '{{ledger.ccy}}') AS value
Expand Down
Loading

0 comments on commit cf18d42

Please sign in to comment.