Number#
The Number indicator renders the value as text optionally colored according to the colors thresholds.
Use pn.ui.Number to create this component.
API#
.. py:class:: Number(*, colors, default_color, font_size, format, nan_format, title_size, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, label, value, name) :module: panel.widgets.indicators
The Number indicator renders the value as text optionally
colored according to the colors thresholds.
Reference: https://panel.holoviz.org/reference/indicators/Number.html
:Example:
Number(label=’Rate’, value=72, format=’{value}%’, colors=[(80, ‘green’), (100, ‘red’)]
:Attributes:
**colors**
..
.. !! processed by numpydoc !!
Parameter Definitions
Parameters inherited from:
:class:`panel.widgets.base.WidgetBase`: label
:class:`panel.viewable.Layoutable`: align, aspect_ratio, css_classes, design, min_width, min_height, max_width, max_height, styles, stylesheets, tags, width_policy, height_policy, visible
:class:`panel.viewable.Viewable`: loading
:class:`panel.widgets.base.Widget`: height, margin, width, disabled
:class:`panel.widgets.indicators.Indicator`: sizing_mode
:class:`panel.widgets.indicators.ValueIndicator`: value
default_color = String(default='currentcolor', label='Default color')
The color of the Number indicator if no colors are provided
colors = List(allow_None=True, bounds=(0, None), item_type=<class 'tuple'>, label='Colors')
Color thresholds for the Number indicator, specified as a tuple of the absolute thresholds
and the color to switch to.
format = String(default='{value}', label='Format')
A formatter string which accepts a {value}.
font_size = String(default='54pt', label='Font size')
The size of number itself.
nan_format = String(default='-', label='Nan format')
How to format nan values.
title_size = String(default='18pt', label='Title size')
The size of the title given by the label.