Any way to force a screen repaint? ( omniJS + JXA/AppleScript )

When I generate some kind of node and link diagram by script in omniJS (+AS/JXA)

  1. First creating and connecting the node shapes, then
  2. moving them into new positions.

I find that some the link line positions are not updated to the new position of the shapes which they are attached to. In other words some timing issue seems to leave us with an incomplete (or missing final ?) screen repaint. Links are shown in strange and stranded, temporarily disconnected positions.

The manual fix is quick - select all graphics and nudge them slightly – everything snaps into place.

The scripting fix is not clear to me ? Would it be within technical reach to expose something like a canvas.repaint() method in the scripting interface ?

Incidentally, this problem is even more noticeable in AppleScript/JXA - after a scripted update of things like shape position, and, particularly text and text-run attributes - it can take a bit of manual work to force the display to catch up with the model state, and see the updated or resized text, or the repositioned link lines. Sometimes it seems to require a full close and reopen of the document.

AS/JXA could do with a repaint() method too, I think …