Skip to content

Resolve "Plot Reference to Missing SubSection Crashes GUI"

Aim

Closes #1313 (closed)

Closes #1311 (closed)

This means that:

  1. Non-instantiated subsections will not be plotted until they are instantiated (Bug fix)
  2. The paths for plot annotations now support a python like slice operator (start:end) (feature)

For example:

plot:
  - x: my_middle_sections/:/my_sub_sections/-2:/x
    y: my_middle_sections/:/my_sub_sections/-2:/y

will plot data from the last two my_sub_sections of all the my_middle_sections. This means that passing the following data:

data:
  m_def: '#/MyTopSection'
  my_middle_sections:
    - name: Middle 1
      my_sub_sections:
      - name: Sub 1
        x: [0,1]
        y: [1,2]
      - name: Sub 2
        x: [0,0.5]
        y: [1,2]
      - name: Sub 3
        x: [0.2,0.4]
        y: [1.5,3]
    - name: Middle 2
      my_sub_sections:
      - name: Sub 1
        x: [0.5,1]
        y: [3,1]
      - name: Sub 2
        x: [0.5,1.5]
        y: [-1,2]

Will give the following plot:

image

Tasks

  • Add tests:
    • Non-instantiated SubSection
    • Wildcard
    • Legend labels
  • Fix bugs:
  • Add features:
    • Wildcard for repeating subsections #1311 (closed)
    • Legend labels for repeating sections
  • Add documentation:
    • Information on how to use the new features
    • Adding links to plotly javascript docs
    • Potentially a link to the plot examples? → Will need new issue
Edited by Hampus Naesstroem

Merge request reports