Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions edisgo/tools/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

from typing import TYPE_CHECKING

import dash
import matplotlib
import numpy as np
import pandas as pd
import plotly.graph_objects as go

from dash import dcc, html
from dash.dependencies import Input, Output
from jupyter_dash import JupyterDash
from matplotlib import pyplot as plt
from networkx import Graph
from pyproj import Transformer
Expand Down Expand Up @@ -1513,9 +1513,9 @@ def plot_dash_app(
edisgo_objects: EDisGo | dict[str, EDisGo],
debug: bool = False,
height: int = 500,
) -> JupyterDash:
) -> dash.Dash:
"""
Generates a jupyter dash app from given eDisGo object(s).
Generates a dash app from given eDisGo object(s).

Parameters
----------
Expand All @@ -1538,8 +1538,8 @@ def plot_dash_app(

Returns
-------
JupyterDash
Jupyter dash app.
Dash
dash app.

"""
if isinstance(edisgo_objects, dict):
Expand Down Expand Up @@ -1586,7 +1586,7 @@ def plot_dash_app(

padding = 1

app = JupyterDash(__name__)
app = dash.Dash(__name__)
# Workaround to use standard python logging with plotly dash
if debug:
app.logger.disabled = False
Expand Down Expand Up @@ -2216,7 +2216,7 @@ def plot_dash(
height: int = 820,
):
"""
Shows the generated jupyter dash app from given eDisGo object(s).
Shows the generated dash app from given eDisGo object(s).

Parameters
----------
Expand All @@ -2236,16 +2236,16 @@ def plot_dash(
Plotting in own browser tab.

debug : bool
If True, enables debugging of the jupyter dash app.
If True, enables debugging of the dash app.

port : int
Port which the app uses. Default: 8050.

height : int
Height of the jupyter dash cell.
Height of the dash cell.

"""
app = plot_dash_app(edisgo_objects, debug=debug, height=height - 300)
log = logging.getLogger("werkzeug")
log.setLevel(logging.ERROR)
app.run_server(mode=mode, debug=debug, height=height, port=port)
app.run(mode=mode, debug=debug, height=height, port=port)
2 changes: 1 addition & 1 deletion rtd_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dash < 2.9.0
dash < 3.1.0
demandlib < 0.3.0
egoio >= 0.4.7, < 0.5.0
geopy >= 2.0.0, < 2.5.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read(fname):

requirements = [
"contextily < 1.7.0",
"dash < 2.9.0",
"dash < 3.1.0",
"demandlib < 0.3.0",
"descartes < 1.2.0",
"egoio >= 0.4.7, < 0.5.0",
Expand Down
Loading