@kdeighton wrote:
We used to create diagrams by passing an HTMLDivElement to graphObject.make, like so:
if (this.container instanceof HTMLDivElement) { this.diagram = this.make( go.Diagram, this.container, diagramConfig ); }
Since updating to GoJS v2, TypeScript is complaining that an argument of type HTMLDivElement can’t be used. However, looking at the minified function in dev tools I see this line:
“string” == typeof e ? t.Ia = d.document.getElementById(e) : e instanceof HTMLDivElement ? t.Ia = e : b("No DIV or DIV id supplied: " + e)
… which suggests that it would still accept a DOM element rather than an ID selector.
So is the signature for graphObject.make wrong? Or is that clause about using a supplied HTMLDivElement just a hang-over from the previous, now-removed, functionality?
Using TypeScript 3.3.3 at our end.
Posts: 10
Participants: 2