✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

Custom renderer

Hi,

I am in the process of building a plotting library for Fitbit.
I like the plotly syntax, so I started with that, but from scratch. Then I thought, I might be able to take advantage of the plotly core modules, and change only the rendering, because Fitbit uses a custom gui, based on svg.
So is it possible to use only the core modules, and change only the rendering process? Can you please give me some hints where to start?

I suspect this would be very, very challenging… our rendering logic is pretty deeply ingrained into the rest of the code and archaic fire architecture (sorry, autocorrect!). That said, Plotly.js targets SVG as an output format already so you might be able to integrate it without much work?

Hi Nicolas,

thanks, that’s sad news.

Well, not really… Fitbit’s SVG is a limited subset of SVG, and the implementation is rather weird too (possibly because of limited computational/storage resources). You cannot dynamically create svg elements. You have to define every element that you want to use at design time, then you can change attributes of these and hide what you don’t need.

Ah I see. Seems like an awkward fit then unfortunately… You might try looking at Vega/VegaLite?

Hi Nicolas,

so I checked Vega/VegaLite, but I like Plotly’s syntax more, and I was up for a challenge, so went ahead and started from scratch. Of course it is a tiny subset of Plotly, but as I said above, the svg is limited, so it won’t ever do everything that Plotly can do. Right now it can display scatter, bar and pie charts and I am at a point where it could be published online. With that said, how would you feel if I name it Fitbit-Plotly? Does the license allow this, do I have to publish it under MIT too? I am technically not using anything from Plotly, other than its syntax. Do you want me to put any notice in the repository?

I’m glad you got things going! If you’re not using any of our code, you’re not bound by our license, but I would maybe recommend against using our name in your name if it’s not based on our code or intended to be compatible with it fully, just to avoid confusing your users (and to avoid us getting inquiries about it which we won’t be able to respond to!). We’d love a shoutout in the readme though :slight_smile:

Well, I hope to have 100% compatible API. Almost all of the bar/pie/scatter examples from the documentation work without changing the code. Some of the layout attributes won’t work yet, and some things won’t make sense on a 300x300 touchscreen (e.g. subplots, hover, etc.), and then there are cases which are not available due to Fitbit’s gui limitations (basically anything that is not a line/text/rect/circle). The plan is to document the differences well and link to Plotly-js docs.
I would not worry about questions pouring in, as the fitbit developer community is rather small :upside_down_face: