The Keyboard component makes it possible to capture keyboard events at the document level. js file in the assets folder with the following content,įrom dash import Dash, html, Input, Output, State from dash_extensions import EventListener # JavaScript event(s) that we want to listen to and what properties to collect. JavaScript variablesĪny JavaScript variable defined in the (global) window object can passed as a component property.
The complete example apps are available in the dash-leaflet documentation. In the examples below, we will consider the GeoJSON component in dash-leaflet=0.1.10.
The javascript module is the Python side of the bridge, while the dash-extensions package on npm forms the JavaScript side. To ease the process, dash-extensions implements a simple bridge for passing function handles (and other variables) as component properties. However, many React components take JavaScript functions (or objects) as inputs, which can make it tedious to write Dash wrappers. In Dash, component properties must be JSON serializable.
#PURIFY APP ALTERNATIVE CODE#
While the snippets module documentation will be limited to source code comments, the javascript module, the enrich module, the multipage module, and the custom components are documented below. The multipage module, which contains utilities for multi page apps.