feat: upgrade dash

This commit is contained in:
Florian Bezannier
2023-05-23 09:08:12 +02:00
parent 0da2f9a431
commit 50cb5a44f5
4 changed files with 13 additions and 13 deletions
+3 -2
View File
@@ -18,12 +18,13 @@ class Button:
self.html_el = self.get_html()
self._fct = fct
self._output = Output(self.get_response_id(), 'children')
callback_id = create_callback_id(self._output)
self.input_button = Input(self.get_button_id(), 'n_clicks')
callback_id = create_callback_id(self._output, self.input_button)
if callback_id not in dash_app.callback_map:
self._set_callback(prevent_initial_call)
def _set_callback(self, prevent_initial_call):
dash_app.callback(self._output, Input(self.get_button_id(), 'n_clicks'),
dash_app.callback(self._output, self.input_button,
prevent_initial_call=prevent_initial_call)(self.call)
def get_button_id(self):
+7 -7
View File
@@ -113,7 +113,12 @@ class FigureFilter:
return params
def set_clientside_callback(self, dash_app, config: dict):
callback_id = create_callback_id(self.__get_output())
output = self.__get_output()
inputs = [Input('clientside-data-store', 'data'),
Input('date-slider', 'value'),
Input('clientside-figure-store', 'data'),
*self.__get_table_input_sort_by()]
callback_id = create_callback_id(self.__get_output(), inputs)
if callback_id not in dash_app.callback_map:
config_str = json.dumps(config)
if logger.isEnabledFor(DEBUG):
@@ -126,12 +131,7 @@ class FigureFilter:
return filterAndSort(data, range, figures, params, logLevel,
{self.__gen_sort_dict()}, {config_str})
}}"""
dash_app.clientside_callback(fct_def,
*self.__get_output(),
Input('clientside-data-store', 'data'),
Input('date-slider', 'value'),
Input('clientside-figure-store', 'data'),
*self.__get_table_input_sort_by())
dash_app.clientside_callback(fct_def, *output, *inputs)
return True
return False
+1 -1
View File
@@ -150,7 +150,7 @@ def askCode(n_clicks): # pylint: disable=unused-argument
if ctx.triggered:
try:
app.myp.remote_client.get_sms_otp_code()
return dbc.Alert("Sms sent", color="success")
return dbc.Alert("SMS sent", color="success")
except Exception as e:
res = str(e)
return dbc.Alert(res, color="danger")
+2 -3
View File
@@ -13,7 +13,7 @@ include = [
[tool.poetry.dependencies]
python = ">=3.7.0, <4.0.0"
paho-mqtt = ">=1.5.0"
dash = ">2.0.0, <2.9.0"
dash = ">=2.9.0, <3.0.0"
dash-daq = "^0.5.0"
plotly = ">=5"
cryptography = ">=2.6"
@@ -21,7 +21,6 @@ Werkzeug = ">=1.0.0"
Flask = ">=1.0.4"
dash-bootstrap-components = ">=1"
ConfigUpdater = ">=3.0"
pandas = ">=0.23"
oauth2-client = "^1.2.1"
requests = "^2.27.1"
pytz = "^2021.0"
@@ -35,7 +34,7 @@ pydantic = "^1.9.0"
certifi = ">=14.05.14"
six = ">=1.10"
python-dateutil = ">=2.5.3"
urllib3 = ">=1.15.1"
urllib3 = ">=1.15.1 <2.0.0"
importlib-metadata = {version = ">=1.7.0", python = "<3.8"}
[tool.poetry.dev-dependencies]