Skip to content

Releases: oegedijk/dash_oop_components

v0.0.8: component_callbacks and self.Input, self.Output

18 Nov 16:09
Compare
Choose a tag to compare

Version 0.0.8:

Breaking Changes

  • component callbacks should now be declared in def component_callbacks(self, app) instead of _register_callbacks(self, app). Although for now the old _register_callbacks() will still work.

New Features

  • added .id(), .Input(), .Output() and .State() methods to DashComponent
    • basically just tags +'-'+self.name to the end of a component_id
    • results in somewhat cleaner callbacks:
      html.Div(id=self.id("output-div")
      
      @app.callback(
          self.Output("output-div", "children"),
          self.Input("input-first-n", "value")
      )
      def update_div(first_n):
          ...
      

v0.0.6: tab-only querystrings, connectors, load from pickles

03 Nov 08:19
Compare
Choose a tag to compare

New Features

  • If you add a parameter filepath to your DashFigureFactory you can .dump() without specifying a filepath as it defaults to the filepath parameter.
    • If that DashFigureFactory is parameter for a DashComponent (orDashApp), you can
      then load the pickled object instead of rebuilding the DashFigureFactory from scratch.
      This is useful for when you have a computationally expensive build process
      for your DashFigureFactory. You can indicate that you would like
      to try to load from pickles or only wish to load from pickles by
      passing try_pickles=True or force_pickles=True when loading from config:
    DashApp.from_yaml("dashboard.yaml", try_pickles=True)`
  • DashComponentTabs: generate a dcc.Tabs wrapper with a list of dcc.Tab children based on a list of DashComponent subcomponents.
    • This allows dash_oop_components to keep track of which querystring parameters belong to which tab in ._tab_params.
    • So this DashApp the possibility only keeping track of querystring parameters of the specific tab that you are currently on.
    • Documentation here and here
  • DashConnector: a Connector can generate callbacks between
    DashComponent instances. This makes connections between components
    also modular and re-usable.
    • Documentation here

Bug Fixes

  • Cleaned up querystring code