Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Vega Lite – Animated bar charts without looping

I came across a fantastic article on animated visualizations using Vega-Lite, which you can find here: https://vis.csail.mit.edu/pubs/animated-vega-lite/

However, what I’m currently exploring is whether it’s possible to create an animation in Vega-Lite that smoothly transitions from 0 to its respective value and stops there.

For instance, with bar charts, triggered by a filter change etc.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Does anyone happen to know if this is possible?

Attaching sample data:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "data": {
    "values": [
      {"month": "January", "value": 100},
      {"month": "February", "value": 150},
      {"month": "March", "value": 200},
      {"month": "April", "value": 180},
      {"month": "May", "value": 250},
      {"month": "June", "value": 300},
      {"month": "July", "value": 320},
      {"month": "August", "value": 270},
      {"month": "September", "value": 230},
      {"month": "October", "value": 200},
      {"month": "November", "value": 180},
      {"month": "December", "value": 150}
    ]
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "month", "type": "ordinal","sort":null},
    "y": {"field": "value", "type": "quantitative"}
  }
}

>Solution :

Animation is possible but it is manual and will require you to write the spec. You can see some examples of animation here on my GitHub and use the techniques yourself to build your viz.

https://github.com/PBI-David/Deneb-Showcase

Take a look at Convex Hull, Covid Map, Deneb Bubble Text, Fireworks, Starfield

I can also recommend the smoothing functions from Madison Giammaria as well as a neat animation that demonstrates their use.

https://www.linkedin.com/posts/madison-giammaria-58463b33_powerbi-pbi-datavisualization-activity-7132225538361810944-45rE?utm_source=share&utm_medium=member_desktop

https://www.linkedin.com/posts/madison-giammaria-58463b33_vega-deneb-powerbi-activity-7137122282727968769-Fh65?utm_source=share&utm_medium=member_desktop

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading