Skip to content

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

Latest
Compare
Choose a tag to compare
@oegedijk oegedijk released this 18 Nov 16:09
· 17 commits to master since this release

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):
          ...