Michael Ross has kindly offered these bindings for using a Diagram as a Webix component:
webix.protoUI({
name:"goJsDiagram",
$init:function(config){
this.$view.innerHTML = "<div style='position:relative; width:100%; height:100%; overflow:visible'; ></div>";
this._initChart(config);
},
_initChart:function(config){
this.$ = go.GraphObject.make;
this.myDiagram = this.$(go.Diagram, this.$view.firstChild, {
initialContentAlignment: go.Spot.Center,
}); },
model_setter:function(value){
this.myDiagram.model = new go.GraphLinksModel(value.data, value.links);
},
getDiagram() {
return this.myDiagram
}
}, webix.ui.view);
And for an Palette:
webix.protoUI({
name:"goJsPalette",
$init:function(config){
this.$view.innerHTML = "<div style='position:relative; width:100%; height:100%; overflow:visible'; ></div>";
this._initChart(config);
},
_initChart:function(config){
this.$ = go.GraphObject.make;
this.myPalette = this.$(go.Palette, this.$view.firstChild);
},
model_setter:function(value){
this.myPalette.model = new go.Palette(this.$view.innerHTML);
},
getPalette() {
return this.myPalette
}
}, webix.ui.view);
He further writes:
Using these prototypes allows the Webix integration to be as simple as setting the object field {view: “goJsPalette”, id: “myPalette”}. That’s it you can then use GoJS the same as any other Webix UI component