Menu

#362 graph.py test produces blank graph.png file

next
open
nobody
None
4normal
2018-12-06
2018-12-03
No

Also (with app.exit() commented out), the first graph is invisible

1 Attachments

Discussion

  • Fellype

    Fellype - 2018-12-04

    It is not blank here, only unorganized (probably due to my default settings).

     
  • gbm

    gbm - 2018-12-06

    There is a bug in MultiLayer::arrangeLayers (graph.arrangeLayers in python).
    The method fails to produce reasonable "Automatic layout" arrangements for more than 3 layers.
    The bug is hit both from python scripts and from interactive GUI.
    To reproduce in the GUI:
    1. Open a new project (Ctrl+N)
    2. Create a new graph (Ctrl+G)
    3. Add 3 layers to the graph (3x Alt+L), accepting the "Guess" button
    when asked for the origin of the new layer.
    4. The resulting multilayer graph is empty, as is the exported 'graph.png' from 'graph.py' script.
    The earliest version I could compile, version 1.14.1, already had this bug.

    A workaround for the bug is to call 'graph.setLayerCanvasSize(width,height)'
    before 'graph.arrangeLayers(True)' (see attached script).

    For the interactive GUI, the workaround is:
    1. After step 2 above, select menu 'Graph/Arrange Layers'
    2. Check ON the 'Layer Canvas Size' checkbox
    3. Select the desired number of layers in 'Number' spinbox and press 'Apply' button
    4. Check ON the "Automatic layout" checkbox and press 'Apply' button again
    5. Result is four equally sized layers:
    The layers shrink to fit in the graph window, or the graph window
    enlarges to contain the four former layers, depending on the state
    of the 'Layer Canvas Size' checkbox in step 4.

     

Log in to post a comment.