Insert GoJS Chart into a Webix generated div

Hi, I am trying to insert a GoJS graph into a div element. GoJS requires the ID of the div you are inserting into.

The div element I am targeting was generated by the following Webix template:
{ template:“Column 2”, id:“graph”} from a call to webix.ui which generates a bunch of nested views.

When I inspect the dom the webix div generated by that template. I found that the id parameter specified in the template was turned into the attribute view_id=“graph” inside the div that was inserted. I was intending to insert the “id” property for that div.

Is inserting an id attribute something that can be done in Webix?

You can use something like next

https://webix.com/snippet/511e4e6a

$$("t1").$view.firstChild.setAttribute("id", "map");

This line sets the native html id to the template content.

Thank you. That worked perfectly. I was able to insert the graph inside the template like i wanted.

Can you please provide the code that you would / did use in the diagram.js file that you used to load a view containing a Gojs diagram?

As far as I can see from samples and API of GoJs charts, the main task here is to initialize the chart within the proper container inside the webix custom component. Please check the docs dedicated to custom components and the following sample:

https://jsfiddle.net/k0vfhr3q/