Skip to main content

Animate all the data.

Project description

https://img.shields.io/badge/Python-2.7-green.svg https://img.shields.io/pypi/v/grafanimate.svg https://img.shields.io/github/tag/daq-tools/grafanimate.svg

grafanimate

Animate all the data.

About

In essence, this program captures screenshots while animating a Grafana dashboard by manipulating its time range control.

The result can be saved as a series of images, an animated gif file or as a video file. The latter optionally accepts adding audio to support creating a lovely atmosphere when watching the data move.

Details

Animating things in Grafana across the time-axis in the spirit of the GeoLoop Panel Plugin has not been unlocked in a general way. Neither Playlists nor Scripted Dashboards offer these things to the user, but this program can be combined with both to

At this programs’ core is the code to set time range in Grafana:

timeSrv = angular.element('grafana-app').injector().get('timeSrv');
timeSrv.setTime({from: "$date_range_start", to: "$date_range_end"});

Turtles all the way up, the main rendering work horse is a Firefox Browser automated through Marionette Python Client fame:

The Marionette Python client library allows you to remotely control a Gecko-based browser or device which is running a Marionette server.

Demo

Todo.

Setup

virtualenv --python=python2 .venv2
source .venv2/bin/activate
pip install grafanimate

Usage

$ grafanimate --help

Usage:
  grafanimate <url> [options] [--target=<target>]...
  grafanimate --version
  grafanimate (-h | --help)

Options:
  --target=<target>             Data output target (not available yet)
  --start=<start>               Start time
  --end=<end>                   End time
  --interval=<end>              Interval time
  --debug                       Enable debug logging
  -h --help                     Show this screen

Examples:

  # Run on designated dashboard, starting time range control at 2015-10-01 with an interval of 1 day
  grafanimate http://localhost:3000/d/1aOmc1sik/luftdaten-info-growth --start=20151001 --interval=1d

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program; if not, see: <http://www.gnu.org/licenses/agpl-3.0.txt>, or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Download files

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

Source Distribution

grafanimate-0.1.0.tar.gz (8.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page