Non-printable items

I’ve created a ‘placeholder’ item so an editor can manually control the vertical/horizontal placement starting items in the flowchart diagram (rather than allowing the dynamic calculation of where ‘centre’ is etc. which can depend on the visibility of objects in the canvas space).

Is it possible to set such objects to not render on the canvas when makeImage is called?

At the moment the only solution I can see is to iterate through all objects, record and remove the placeholders, execute makeImage, add back the removed items to the JSON object and re-render the canvas? … I’m sure there’s something simpler I’ve just not seen?


Are those objects that you want to (not) render in Diagram.makeImage all Parts, or are they GraphObjects somewhere within some Parts?

If they are whole Parts, you could collect everything that you do want to render in a collection and pass that collection as the “parts” property in the named parameters argument to makeImage.

Alternatively you could temporarily put the Parts that you don’t want to render into a Layer whose Layer.isTemporary property is true. Better yet, if it doesn’t upset the Z-ordering of your app, you could always keep those parts in a separate layer, and toggle the Layer.isTemporary property just before and after calling makeImage.