Skip to content

Commit

Permalink
closing error fix and yellow purple :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Farkites committed Apr 5, 2021
1 parent 4b724fc commit 4085e67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@
]),
html.Div([
html.H6("Sources:"),
html.P("https://www.kaggle.com/stephenofarrell/cost-of-living", className="source"),
html.P("https://www.economist.com/big-mac-index", className="source"),
html.P("https://worldhappiness.report/", className="source"),
html.P("https://www.nestpick.com/millennial-city-ranking-2018/", className="source"),
html.P("https://www.numbeo.com/quality-of-life/rankings.jsp", className="source"),
html.P("https://www.kaggle.com/sudalairajkumar/daily-temperature-of-major-cities", className="source"),
html.P("https://simplemaps.com/data/world-cities", className="source"),
])
],
style={"display": "flex", "align": "right", "bottom": "10%"}
Expand Down Expand Up @@ -249,8 +252,8 @@ def update_bubble_selection(click_map):
[Input('map', 'clickData')],
Input('x_close_selection', 'n_clicks'),
[Input('filters_drop', 'value')],
[Input('bubble', 'selectedData')],
[Input('bubble', 'clickData')],
[Input('bubble', 'selectedData'),
Input('bubble', 'clickData')],
Input('width', 'n_clicks'),
Input('height', 'n_clicks'),
[State('bubble', 'figure')])
Expand All @@ -259,6 +262,7 @@ def update_selected_location(clickData, n_clicks, dims_selected, bubbleSelect, b
global selected_location
global x_close_selection_clicks
location = ""

if clickData is not None or dims_selected is not None:
if clickData is not None:
location = clickData['points'][0]['text']
Expand All @@ -270,8 +274,6 @@ def update_selected_location(clickData, n_clicks, dims_selected, bubbleSelect, b
location = selected_location
style = {'display': 'none'}
else:
selected_location = ""
location = ""
style = {'display': 'none'}

if n_clicks != x_close_selection_clicks:
Expand Down
2 changes: 1 addition & 1 deletion helper/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def custom_dims_plot(location, dims_selected, city_info_num, city_info_num_agg,
opacity=0.7
)

fig.add_trace(trace1, row=idx + 1, col=1)
fig.add_trace(trace2, row=idx + 1, col=1)
fig.add_trace(trace1, row=idx + 1, col=1)

fig.update_layout(
barmode='overlay', # overlay, group
Expand Down

0 comments on commit 4085e67

Please sign in to comment.