Skip to content
Snippets Groups Projects
Commit 449bdb1e authored by Max Väistö's avatar Max Väistö
Browse files

Renamed APP to app

parent 3624aa1a
No related branches found
No related tags found
No related merge requests found
......@@ -21,15 +21,15 @@ from visual_presentation.Annual_release_games import get_game_release_figure
from visual_presentation.Distribution_of_review_rating import get_rating_density_plot
from visual_presentation.Market_performance_function import plot_market_performance
APP = dash.Dash(
app = dash.Dash(
name=__name__,
use_pages=True,
external_stylesheets=['/assets/styles.css',
'https://codepen.io/chriddyp/pen/bWLwgP.css']
)
server = APP.server
APP.layout = html.Div([
server = app.server
app.layout = html.Div([
html.Nav(className="navbar", children=[
html.A("SteamSavvy - Steam game data insights", href="/",
style={"margin-left": "60px", "display": "inline-block"},
......@@ -70,7 +70,7 @@ def update_company_info(filtered_dataframe: pandas.DataFrame):
company_top_games_label, user_rating_value
@APP.callback([Output(DEV_REVENUE_LABEL, "children"),
@app.callback([Output(DEV_REVENUE_LABEL, "children"),
Output(DEV_TOP_GENRES_LABEL, "children"),
Output(DEV_CCU_LABEL, "children"),
Output(DEV_GAME_COUNT_LABEL, "children"),
......@@ -89,7 +89,7 @@ def update_dev_info(dev_name):
return update_company_info(dev_data)
@APP.callback([Output(PUB_REVENUE_LABEL, "children"),
@app.callback([Output(PUB_REVENUE_LABEL, "children"),
Output(PUB_TOP_GENRES_LABEL, "children"),
Output(PUB_CCU_LABEL, "children"),
Output(PUB_GAME_COUNT_LABEL, "children"),
......@@ -107,7 +107,7 @@ def update_pub_info(pub_name):
return update_company_info(pub_data)
@APP.callback(Output(GAMES_BY_PUB_GRAPH, "figure"),
@app.callback(Output(GAMES_BY_PUB_GRAPH, "figure"),
Input(PUBLISHER_DROPDOWN, "value"))
def get_games_by_pub_table(pub_name):
if not (pub_name and isinstance(ds.FULL_DATA, pandas.DataFrame)):
......@@ -118,7 +118,7 @@ def get_games_by_pub_table(pub_name):
return get_game_release_figure(ds.FULL_DATA, pub_name, "publisher", **layout_arguments)
@APP.callback(Output(GAMES_BY_DEV_GRAPH, "figure"),
@app.callback(Output(GAMES_BY_DEV_GRAPH, "figure"),
Input(DEVELOPER_DROPDOWN, "value"))
def get_games_by_dev_table(dev_name):
if not (dev_name and isinstance(ds.FULL_DATA, pandas.DataFrame)):
......@@ -129,7 +129,7 @@ def get_games_by_dev_table(dev_name):
return get_game_release_figure(ds.FULL_DATA, dev_name, "developer", **layout_arguments)
@APP.callback(Output(RATING_TABS_OUTPUT_AREA, 'children'),
@app.callback(Output(RATING_TABS_OUTPUT_AREA, 'children'),
Input(RATING_SLIDER, "value"),
Input(RATING_MIN_REVIEWS, "value"),
Input(RATING_TABS, "value"))
......@@ -165,7 +165,7 @@ def update_density_filter_plot(rating_range, min_reviews, active_tab):
return [output]
@APP.callback(Output(GENRE_PREDICTION_GRAPH, "figure"),
@app.callback(Output(GENRE_PREDICTION_GRAPH, "figure"),
Input(GENRE_DROPDOWN, "value")
)
def get_genre_prediction_table(genre, **kwargs):
......@@ -180,7 +180,7 @@ def get_genre_prediction_table(genre, **kwargs):
return fig
@APP.callback(Output(MARKET_PERFORMANCE_SCATTER, "figure"),
@app.callback(Output(MARKET_PERFORMANCE_SCATTER, "figure"),
Input(MP_COMPANY_TYPE_DROPDOWN, "value"),
Input(REVENUE_COMPANY_GAME_COUNT, "value"))
def get_market_performance_scatter(company_type, company_game_onwer_range):
......@@ -210,7 +210,7 @@ def get_company_information_for_company_list(company_list, company_type):
return table_data
@APP.callback(Output(TOP_COMPANY_TABLE_AREA, 'children'),
@app.callback(Output(TOP_COMPANY_TABLE_AREA, 'children'),
Input(TOP_REVENUE_COMPANIES, "value"))
def get_top_companies_table(company_type, get_largest_to=50):
data = ds.FULL_DATA[[company_type, "game_revenue"]].groupby(company_type).sum()
......@@ -232,7 +232,7 @@ def get_top_companies_table(company_type, get_largest_to=50):
def start_server():
APP.run_server(debug=True, host="0.0.0.0")
app.run_server(debug=True, host="0.0.0.0")
if __name__ == "__main__":
......
......@@ -15,7 +15,6 @@ from dash_plot_generation.styles_and_handles import RATING_MIN_REVIEWS, RATING_S
from dash_plot_generation.utils import get_cumulative_owner_game_count_limits_for_dev_and_pub
global APP
# unique_publishers = extract_unique_companies(FULL_DATA["publisher"].apply(lambda x: split_companies(x)))
# unique_developers = extract_unique_companies(FULL_DATA["developer"].apply(lambda x: split_companies(x)))
......
import dash
from dash import html
global APP
dash.register_page(__name__, path='/')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment