Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Add annotations #1

Merged
merged 8 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,32 @@ smart_columns:
status: {0: "Active", 1: "Archived"}
```

### Annotations

Shows overlay lines or box ranges for line queries.

Suppose your sales data and your deployments data, given a query:

```sql
SELECT date_trunc('hour', created_at), sum(value) FROM sales GROUP BY 1
```

You might want to see the influence of a deployment for those sales.

```yml
annotations:
deployments: SELECT date, name FROM deployments WHERE date BETWEEN {min_date} AND {max_date}
```

You can also show periods:

```yml
annotations:
holidays: SELECT min_date, max_date, name FROM holidays WHERE (min_date, max_date) OVERLAPS ({min_date}, {max_date})
```

Conditions for those queries are optional, but they will help to only fetch the relevant annotations for a particular chart.

### Caching

Blazer can automatically cache results to improve speed. It can cache slow queries:
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/blazer/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//= require ./chartjs-adapter-date-fns.bundle
//= require ./chartkick
//= require ./mapkick.bundle
//= require ./chartjs-plugin-annotation.js
//= require ./ace
//= require ./Sortable
//= require ./bootstrap
Expand Down
Loading