08-31-2017 07:11
08-31-2017 07:11
Just wondered if there are examples of how to draw using code for non-static elements?
eg Using lines to draw a graph or drawing arcs to show the seconds around the edge (like Fitbit Blaze Chronograph face).
Thanks,
NiVZ
Answered! Go to the Best Answer.
09-01-2017 00:04
09-01-2017 00:04
Great question.
We don't currently have a drawing or canvas API, but it's something we're definitely aware of the benefits.
You also can't directly modify the innerHTML, or it's equivalent in this case.
You can however dynamically adjust the attributes of the existing svg elements, like <arc>.
https://dev.fitbit.com/guides/user-interface/svg/#arc
I'll try to add an example to the developer website.
08-31-2017 09:53 - edited 08-31-2017 12:30
08-31-2017 09:53 - edited 08-31-2017 12:30
I'm interested in this as well.
I'm wondering if the answer is essentially that you have to modify the document's innerHTML manually to edit "inline" .gui files.
Perhaps with the help of Preact if it can handle the 3kb memory hit it could be accomplished in a React / JSX style way. I could be overthinking things and introducing unneeded complexity, but I'm not seeing an actual drawing library like <canvas> provides.
09-01-2017 00:04
09-01-2017 00:04
Great question.
We don't currently have a drawing or canvas API, but it's something we're definitely aware of the benefits.
You also can't directly modify the innerHTML, or it's equivalent in this case.
You can however dynamically adjust the attributes of the existing svg elements, like <arc>.
https://dev.fitbit.com/guides/user-interface/svg/#arc
I'll try to add an example to the developer website.
09-02-2017 04:22
09-02-2017 04:22
Examples will really help get us started. The initial ones don't cover all we need, as Paul has highlighted.
09-02-2017 07:35
09-02-2017 07:35
I know that visibility can't be toggled, but what about access to an element's classList methods?
09-03-2017 10:08
09-03-2017 10:08
classList isn't available, sorry.