Shared canvas rendering

71 views
Skip to first unread message

mattyc...@gmail.com

unread,
May 22, 2014, 12:40:05 PM5/22/14
to polym...@googlegroups.com
I'm using polymer to render certain things to a canvas. The canvas is overlaid on some video and it is performing annotations of object video analytics style. Each rendering element represents a certain type of object that needs to be rendered, e.g, zones, lines, streaming annotation. Having the logic for each element mean that the encapsulation of the code is sane.

I have multiple polymer elements that need to render to the same canvas. Is the best way to do this to pass the canvas id into the elements?

<canvas id="myCanvas"></canvas>
<rendering-element canvas="myCanvas"></rendering-element>
<other-rendering-element canvas="myCanvas"></other-rendering-element>
<rendering-element canvas="myCanvas"></rendering-element>

The elements will use document.getElementById('myCanvas') and use the returned element to render their data.

Is this the best practice for this?

Eric Bidelman

unread,
May 22, 2014, 4:45:44 PM5/22/14
to mattyc...@gmail.com, polymer-dev


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/10a0b581-b1c6-4081-bc9f-9989d733b405%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages