Bring dash number input step, min, and type to parity w/ Streamlit
@@ -17,44 +17,52 @@ from penn_chime.parameters import Parameters
from chime_dash.app.components.base import Component
from chime_dash.app.utils.templates import create_switch_input, create_number_input, create_header
+FLOAT_INPUT_MIN = 0.001
+FLOAT_INPUT_STEP = FLOAT_INPUT_MIN
_INPUTS = OrderedDict(
regional_parameters={"type": "header", "size": "h3"},
- market_share={"type": "number", "min": 1, "step": 1, "max": 100, "percent": True},
+ market_share={"type": "number", "min": FLOAT_INPUT_MIN, "step": FLOAT_INPUT_STEP, "max": 100.0, "percent": True},
susceptible={"type": "number", "min": 1, "step": 1},
known_infected={"type": "number", "min": 0, "step": 1},
current_hospitalized={"type": "number", "min": 0, "step": 1},
spread_and_contact={"type": "header", "size": "h3"},
- doubling_time={"type": "number", "min": 0, "step": 1},
+ doubling_time={"type": "number", "min": FLOAT_INPUT_MIN, "step": FLOAT_INPUT_STEP},
relative_contact_rate={
"type": "number",
- "min": 0,
- "step": 1,
- "max": 100,
+ "min": 0.0,
+ "step": FLOAT_INPUT_STEP,
+ "max": 100.0,
"percent": True,
},
severity_parameters={"type": "header", "size": "h3"},
hospitalized_rate={
"type": "number",
- "min": 0,
- "step": 1,
- "max": 100,
+ "min": 0.0,
+ "step": FLOAT_INPUT_STEP,
+ "max": 100.0,
"percent": True,
},
- icu_rate={"type": "number", "min": 0, "step": 1, "max": 100, "percent": True},
+ icu_rate={
+ "type": "number",
+ "min": 0.0,
+ "step": FLOAT_INPUT_STEP,
+ "max": 100.0,
+ "percent": True
+ },
ventilated_rate={
"type": "number",
- "min": 0,
- "step": 1,
- "max": 100,
+ "min": 0.0,
+ "step": FLOAT_INPUT_STEP,
+ "max": 100.0,
"percent": True,
},
- hospitalized_los={"type": "number", "min": 0, "step": 1, "max": 100},
+ hospitalized_los={"type": "number", "min": 0, "step": 1},
icu_los={"type": "number", "min": 0, "step": 1},
ventilated_los={"type": "number", "min": 0, "step": 1},
display_parameters={"type": "header", "size": "h3"},
- n_days={"type": "number", "min": 20, "step": 1},
- as_date={"type": "switch", "value": False},
+ n_days={"type": "number", "min": 30, "step": 1},
max_y_axis_value={"type": "number", "min": 10, "step": 10, "value": None},
+ as_date={"type": "switch", "value": False},
show_tables={"type": "switch", "value": False},
show_tool_details={"type": "switch", "value": False},
show_additional_projections={"type": "switch", "value": False},
