### Setup for Contributors Source: https://github.com/plotly/dash-daq/blob/master/README.md Steps for contributors to set up a development environment, including installing dependencies and cloning the repository. ```sh # Clone this repository git clone https://github.com/plotly/dash-daq.git # Install dependencies npm install --also=dev # Watch source for changes and build to `lib/` npm start ``` -------------------------------- ### Install dash_daq Source: https://github.com/plotly/dash-daq/blob/master/README.md Installs the dash_daq library using pip. It also mentions the alternative for Python 3. ```sh pip install dash_daq # Or for Python 3, pip3 install dash_daq ``` -------------------------------- ### Install Python Package Locally Source: https://github.com/plotly/dash-daq/blob/master/README.md Installs the dash-daq module locally into the Python environment's site-packages for testing before publishing. ```sh yarn run install-local ``` -------------------------------- ### Run Demo Server Source: https://github.com/plotly/dash-daq/blob/master/README.md Starts a demo development server to view rendered components. Requires maintaining the component list in `demo/Demo.react.js`. ```sh npm run dash-demo ``` -------------------------------- ### Test Components in Dash Source: https://github.com/plotly/dash-daq/blob/master/README.md Guides on how to test components locally within a Dash application after development. ```sh # Build development bundle to `lib/` npm run start # Generate metadata, and install the daq pacakage locally for testing npm run install-local # Run the Dash demo npm run dash-demo ``` -------------------------------- ### LED Display Example Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Shows how to use the LED display component from Dash DAQ. This component mimics a seven-segment LED display, suitable for showing numerical values or status indicators. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.LEDDisplay( id='my-led-display', value='12345', color="#33FF57", size=50 ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Basic Gauge Example Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Demonstrates how to create a simple Gauge component in Dash DAQ. This component is useful for displaying a single value within a defined range, often used for metrics or sensor readings. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.Gauge( id='my-gauge', label='Default', value=60, max=100, min=0 ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Uninstall Python Package Locally Source: https://github.com/plotly/dash-daq/blob/master/README.md Removes the locally installed dash-daq module from the Python environment. ```sh yarn run uninstall-local ``` -------------------------------- ### Produce New Release Tarball Source: https://github.com/plotly/dash-daq/blob/master/README.md Steps to create a new release tarball for the dash-daq package, including version bumping and building. ```sh vim dash_daq/version.py # and increase it to X.X.X rm -rf node_modules dist build lib yarn install yarn build-tarball ls dist/dash_daq-X.X.X.tar.gz # this is your tarball ``` -------------------------------- ### Run Lint and Unit Tests Source: https://github.com/plotly/dash-daq/blob/master/README.md Executes linting and unit tests for code quality assurance. ```sh npm run test ``` -------------------------------- ### DarkThemeProvider Component Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Shows how to apply a dark theme to Dash DAQ components using the DarkThemeProvider. This component wraps other DAQ components to change their visual appearance. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = daq.DarkThemeProvider([ daq.LEDDisplay(value='DARK'), daq.Gauge(value=50) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Color Picker Component Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Demonstrates the ColorPicker component for selecting colors. This component provides a visual interface for users to choose colors, often used for theming or customization. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.ColorPicker( id='my-color-picker', label='Color Picker', value=dict(hex='#111F4B') ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Knob Component for Value Selection Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Shows how to use the Knob component, which provides a circular slider for selecting values. It's ideal for settings that require a continuous range of adjustment. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.Knob( id='my-knob', value=45, min=0, max=100, label='Knob', size=150 ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Power Button Component Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Illustrates the PowerButton component, a toggle switch that can be used to represent on/off states. It's a simple yet effective way to control binary states in an application. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.PowerButton( id='my-power-button', label='Power', checked=True ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Tank Component for Level Visualization Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Demonstrates the Tank component, which visually represents a fluid level within a container. This is useful for monitoring quantities or capacities. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.Tank( id='my-tank', value=75, min=0, max=100, label='Tank Level', units='L' ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Numeric Input with Stepper Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Illustrates the use of the NumericInput component with stepper buttons. This component allows users to input numerical values and adjust them using increment/decrement buttons. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.NumericInput( id='my-numeric-input', value=5, min=0, max=10, label='Numeric Input', labelPosition='top' ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Indicator Component for Status Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Demonstrates the Indicator component, which displays a colored circle to represent status (e.g., online, offline, warning). It's useful for quick visual feedback. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.Indicator( id='my-indicator', label='Status', value=True, # True for green, False for red color='green' ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` -------------------------------- ### Slider Component for Range Selection Source: https://github.com/plotly/dash-daq/blob/master/demo/index.html Illustrates the Slider component for selecting a value within a specified range. It's a common UI element for adjusting parameters or filtering data. ```python import dash from dash import html import dash_daq as daq app = dash.Dash(__name__) app.layout = html.Div([ daq.Slider( id='my-slider', min=0, max=10, value=5, marks={i: str(i) for i in range(11)}, step=1, tooltip={'always_visible': True} ) ]) if __name__ == '__main__': app.run_server(debug=True) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.