Resolve "y-axis label is broken in plotly visualization after resources-refactor"

Closes #45 (closed)

I have chosen to set the tickformat to ".4s", 4 decimals, because it looked best when viewing the plot. I did try using tickformatstops but it only seems to only work when you use xaxis.type='data' but that completely messes up the x-axis format.

# unfortunately the tickformatstops zoom-levels have no effect.
fig.update_xaxes(row=ports_length, col=1, title='Time', 
                     type='date' # tickformatstops only works with this, but messes up the plot x-axis format
                     # https://plotly.com/python/time-series/#customizing-tick-label-formatting-by-zoom-level
                     tickformatstops=[
                         dict(dtickrange=[None, 60000], value=".6s"),  # us (1e12)
                         dict(dtickrange=[60000, 3600000], value=".3s"),  # us (1e9)
                         dict(dtickrange=[3600000, 86400000], value="%f"),  # microseconds (1e6)
                         dict(dtickrange=[86400000, None], value="%S %L"),  # seconds:milliseconds (1e3)
                     ],
                     tickformat=".3s",
                     rangeslider_visible=True)

Commits:

  • fix(pluse_scheme): Set tickformat for xaxes to ".4s"
    • Added _populate_port_mapping local function
    • Remove redundant for-loop that updated the axes
    • Added python typing to all other pulse_scheme functions.
    • Fixed bug with inconsistent rainbow coloring.
    • Removed '.keys()' when trying to loopup a key in the dictionary
    • Removed try-catch around update_yaxes to catch if a port is not in the port_map
    • Formatted code
  • fix(pulse_scheme): Remove print statement from 'pulse_diagram_plotly'

Previews:

  • Default zoom: default-zoom
  • Operation zoom: operation-zoom
  • Pulse detail zoom pulse-detail
Edited by Thomas Reynders

Merge request reports

Loading