Various funky loading spinners for your Dash apps
Project description
Dash Spinner
This library is designed for use with Plotly Dash. The components have all been
designed to provide functionality similar to Dash's core
Loading
component,
and will display a loading spinner whilst the underlying children are re-rendering.
The spinners in it have been adapted for use from a number of other existing libraries:
The majority of spinner names have been retained from the originals, but some have been amended where there were name clashes.
Installation
Dash Spinners is available through PyPI, and can be installed with pip:
pip install dash-spinner
Basic Usage
Once installed, you can make use of the components as follows:
import dash_spinner
from dash import Dash
app = Dash(__name__)
app.layout = dash_spinner.DashSpinner(
Size=30,
Color='#00ff89',
spinner_type="PushSpinner",
loading=True
)
if __name__ == '__main__':
app.run_server(debug=True)
- Using
@callbacks
import dash_spinner
from dash import Dash,html,callback,Input, Output
import time
app = Dash(__name__)
app.layout = html.Div(children=[dash_spinner.DashSpinner(
id = 'dash-spinner',
Size=30,
Color='#00ff89',
spinner_type="PushSpinner",
loading=True
),
html.Div(id="input")])
@callback(Output('dash-spinner', 'loading'), Input('input', 'children'))
def display_output(value):
time.sleep(10)
return False
if __name__ == '__main__':
app.run_server(debug=True)
All Dash Spinner
Dash Spinner Attributes
There are a number of attributes which are common across all spinners. These are:
id
(string; optional): The ID of this component, used to identify dash components in callbacks. The ID needs to be unique across all of the components in an app.Size
(number; required): Number RequiredColor
(string; required): CSS RGB and Hex Color codesspinner_type
(string; required):Property that determines which spinner to show one ofBallSpinner
ClapSpinner
BarsSpinner
CircleSpinner
ClassicSpinner
CombSpinner
CubeSpinner
DominoSpinner
FillSpinner
FireworkSpinner
FlagSpinner
FlapperSpinner
GooSpinner
GridSpinner
GuardSpinner
HeartSpinner
HoopSpinner
ImpulseSpinner
JellyfishSpinner
MagicSpinner
MetroSpinner
PongSpinner
PulseSpinner
PushSpinner
RainbowSpinner
RingSpinner
RotateSpinner
SequenceSpinner
SphereSpinner
SpiralSpinner
SwapSpinner
SwishSpinner
TraceSpinner
WaveSpinner
WhisperSpinner
loading
(boolean; requiredTrue
orFalse
): Whether the Spinner should show on app start-up before the loading state has been determined.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file dash_spinner-0.0.2.tar.gz
.
File metadata
- Download URL: dash_spinner-0.0.2.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e6b011709585069173fd1e3c18bf64fa3b5a75d4be28dd0d5b07b776c758a62 |
|
MD5 | 66973b5fc9d66c9a89ea598c97ce57fa |
|
BLAKE2b-256 | 90c5585fe0def45971a2a1e5258abc84870845e588758995992683eea8cbfd6a |