Skip to main content

Animate timeseries data with Grafana

Project description License Supported Grafana versions


Animate timeseries data with Grafana.


grafanimate captures screenshots while animating a Grafana dashboard by manipulating its time range control, i.e. navigating through time. The result can be rendered as a sequence of png images, an animated gif file, and as a video file.



This program uses the fine FFmpeg program for doing the heavy lifting within in its postprocessing subsystem.


pip install grafanimate



grafanimate works by operating on animations defined within description files, written in Python. In cinematography jargon, this is called “exposure sheet”, or “dope sheet”.

An exposure sheet (also known variously as “dope sheet”, “camera instruction sheet”, or “X-sheet”) is a sheet of paper used primarily in traditional animation to mark out the timing of various actions and dialogue.

grafanimate offers convenient data types, AnimationScenario and AnimationSequence, for outlining an animation scenario made of multiple sequences.

Please have a look at the file for a full example containing multiple scenarios.


A scenario definition:


In order to run a built-in scenario, invoke:

grafanimate --scenario=playdemo --output=./animations


grafanimate also supports relative timestamps, based on the fine pytimeparse2 library.

  • Within every, you will express a duration.


For getting a detailed and descriptive overview about all available command line options, please invoke:

grafanimate --help


Examples for scenario mode. Script your animations in file or any other Python module or file.

# Use freely accessible `` for demo purposes.
grafanimate --scenario=playdemo --output=./animations

# Example for generating graph & map.
export GRAFANIMATE_OUTPUT=./animations
grafanimate --grafana-url=http://localhost:3000/ --dashboard-uid=1aOmc1sik --scenario=ldi_all

# Use more parameters to control the rendering process.
grafanimate --grafana-url=http://localhost:3000/ --dashboard-uid=acUXbj_mz --scenario=ir_sensor_svg_pixmap \
    --header-layout=studio --datetime-format=human-time --panel-id=6

Background and details


Animating things in Grafana across the time-axis in the spirit of the GeoLoop Panel Plugin hasn’t been unlocked for Grafana in a more general way yet. Challenge accepted!

Time warp

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

timeSrv = angular.element('grafana-app').injector().get('timeSrv');
timeSrv.setTime({from: "2015-10-01", to: "2018-12-31"});

Rendering engine

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.


Neither Playlists nor Scripted Dashboards (now deprecated) offer these things to the user, but this program can be combined with both in order to implement more complex animations on top of Grafana.


# Acquire sources.
git clone
cd grafanimate

# Create and activate virtualenv.
python3 -m venv .venv
source .venv/bin/activate

# Install package in "editable" mode.
pip install --editable=.

# Run tests.
make test

Project information

The code lives on GitHub and the Python package is published to PyPI.


We are always happy to receive code contributions, ideas, suggestions and problem reports from the community. Spend some time taking a look around, locate a bug, design issue or spelling mistake and then send us a pull request or create an issue. You can also discuss grafanimate on our forum, you are welcome to join.


Thanks to all the contributors who helped to co-create and conceive this program in one way or another. You know who you are.

Also thanks to all the people working on Python, Grafana, Firefox, FFmpeg, and the countless other software components this program is based upon.


grafanimate is licensed under the terms of the GNU AGPL v3 license.

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.7.0.tar.gz (47.9 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