Spaces:
Sleeping
Sleeping
File size: 1,056 Bytes
60f94ea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | import panel as pn
from colors import HEADER_CL, IN_TRANSIT_CL, LATE_CL, ON_TIME_CL, STOPPED_CL
# In transit vehicles
IN_TRANSIT_IND = pn.indicators.Number(
value=0,
name="In Transit",
title_size="18pt",
font_size="40pt",
default_color="white",
styles={
"background": IN_TRANSIT_CL,
"text-align": "center",
},
sizing_mode="stretch_width",
)
# Stopped vehicles
STOPPED_IND = IN_TRANSIT_IND.clone(
name="Stopped",
styles={
"background": STOPPED_CL,
"text-align": "center",
},
)
# Fleet (in transit + stopped)
FLEET_IND = IN_TRANSIT_IND.clone(
name="Fleet",
styles={
"background": HEADER_CL,
"text-align": "center",
},
)
# Vehicles on schedule
ON_TIME_IND = IN_TRANSIT_IND.clone(
name="On Time",
styles={
"background": ON_TIME_CL,
"text-align": "center",
},
)
# Vehicles behind schedule
LATE_IND = IN_TRANSIT_IND.clone(
name="Late",
styles={
"background": LATE_CL,
"text-align": "center",
},
)
|