problem is… when external canvas refreshes goJS doesn’t pick it up until there is another event that would cause a visual refresh… like hovering a node, selecting etc…
also when the diagram initially loads the canvas contents is not displayed until such a refresh event happens.
that’s probably because the chart is drawn async and is not there at the time when the canvas is set on the Picture element.
I’ve seen the example with WebGL and that seems to work just fine… so… is there something I need to turn on for this to work?.. or not turn off?.. or anything that might affect/cause this behaviour in any way?
We updated the samples/canvases.html sample to be more useful to more people – since creating and showing more realistic charts is by far the most common need for putting complex content in nodes, without re-implementing everything in GoJS.
So you are sure that a Canvas element has been completely drawn at the time you call Diagram.requestUpdate, and that that Canvas element is the value of some Picture.element being shown in some Node in your Diagram?
Is there a difference in behavior if you call Diagram.redraw instead of Diagram.requestUpdate?
Hmmm. Now I’d like to know what the situation is when you were calling Diagram.requestUpdate. At the time of that call, has an “InitialLayoutCompleted” DiagramEvent already been raised for the diagram? In other words, do all of the Nodes and Links exist in the whole diagram, and are they all laid out as expected (but those Pictures showing charts are still blank), and have the scrollbars been updated, and can the user do things such as select or scroll or whatever?
I’m wondering if there’s a possible problem trying to call requestUpdate during or immediately after initialization. There shouldn’t be any problem a little later, so I’m betting if you just called
I see, we’ll put redraw() in the .d.ts file, sorry about that. You’ll have to use a
(diagram as any).redraw()
style of workaround for now.
requestUpdate() only updates if there is something to update: If the Diagram DIV changed size, or a part or layout became invalid. It does not know about that state of a canvas outside the diagram, in this case your go.Picture’s element. This canvas is already fully “loaded”, rgraph just draws different pixels to it, and we do not go trying to detect something like that, so you gotta tell GoJS with a call to redraw().
That requestUpdate() worked before for this was something of a bug, it was doing too much work and should not have been.