Hello Adafruit IO community!

In order to reduce the amount of Javascript we send to your browser every time you visit Adafruit IO and in order to fix an annoying memory leak bug, we’ve replaced the rendering engines for the gauge and line charts you see on your Adafruit IO dashboards and feed pages. They’re low-level updates to the Adafruit IO website you all use. For the most part the changes should be invisible, but we wanted to at least mention it in case they take you by surprise.

New gauge and line charts on an Adafruit IO dashboard

The question you may have, then, is why fix what isn’t (obviously) broken? I’m glad you asked! We made this update for two big reasons and one small one.

First, we’ve known for a loooong time that we have a big memory leak problem with line charts. If you’ve tried to keep a dashboard open with a line chart for more than a day, you might have noticed that you eventually came back to a frozen browser tab. If you’re unlucky, you might’ve found a crashed browser. :( Even after long hours of debugging in multiple browsers, tracing live code, and rewriting parts of the chart rendering pipeline, it’s still not clear where the problem was. It could’ve been the library we were using–an SVG based renderer–or code we wrote on top of it, but we were pushing some part of the system beyond what it could handle. By replacing the old SVG based system with a canvas based charting library we eliminate the type of memory leak we were encountering. The bonus with choosing a charting library with more options for chart types is that we’ll soon be able to introduce those to you on the dashboards. Look for that in the next few months.

Second, our old gauges and line charts used a lot of code behind the scenes–the immensely powerful d3 library–to do just a little bit of work. We have intentionally kept our charts simple and clean, visually, but we included ~200 extra KB of uncompressed javascript code to do it. By replacing the gauge with a much smaller, hand built canvas-based plugin and line charts with a simpler library (even though it’s still powerful), we cut that code out of the bundle we have to ship to your browser. We’re sending 800KB+ of compressed/gziped, too much in our opinion, but we’re working on it :D

Small changes that hopefully produce benefits long into the future.


Let us know if our updates aren’t working for you or are otherwise affecting your quality of life. Join us in the forum or on Discord in the adafruit-io channel with questions, comments, or suggestions. We’d love to hear from you!