This was posted on SO:
http://stackoverflow.com/questions/23812518/render-to-common-canvas-with-polymer-elements/23816594#23816594


On Thu, May 22, 2014 at 9:40 AM, <[email protected]> wrote:

> 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?
>
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/10a0b581-b1c6-4081-bc9f-9989d733b405%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/10a0b581-b1c6-4081-bc9f-9989d733b405%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CACGqRCD3cyZeB1BwALVpEB5UCagrHZ2PeoGvHedW6nqfMAqieg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to