Question

I am trying to draw graphs on a canvas using Enyo 2.0 and Javascript, have defined the canvas component as below..

{
      kind : "Canvas",
      name : "graph",
      nodeTag : "canvas",
      domAttributes : {
         width : "1020px",
         height : "656px",
         style : "border: 2px solid #98bf21;"
      }
   }

Need to get the value for the context of this canvas. Using the this.$.graph.hasNode() method return's false.

Can any one suggest the right method to get the context. Or am doing the whole thing (declaration of canvas) wrong.

As the graph library am using needs the context, a workaround is not possible in this case.

Was it helpful?

Solution

Got it...

The mistake i was doing is calling the hasNode method on the graph before it was rendered which would always return me false. Calling the same method after the page is rendered returns a valid value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top