Birgir commited on
Commit
cde51b7
·
1 Parent(s): fc1f41f

aded params

Browse files
Files changed (1) hide show
  1. app/app.py +6 -3
app/app.py CHANGED
@@ -49,7 +49,11 @@ ui.page_opts(title="Borgarlínan", fillable=True)
49
  with ui.sidebar(open="open"):
50
 
51
  ui.input_select("year", "Year:", {2025: "2025", 2029: "2029", 2030: "2030"})
52
- ui.input_text("inputParam", "Param", "")
 
 
 
 
53
  ui.input_slider("rad", "Stop reach radius:", min=200, max=1000, value=400),
54
 
55
  ui.input_checkbox_group(
@@ -91,14 +95,13 @@ with ui.layout_columns(col_widths=[8, 4]):
91
  def ageScore():
92
  x, y = stop.get()
93
  score = initBackend.get_station_score((y, x), radius=input.rad())
94
- print(score)
95
  return f"Age Score: {round(float(score["age_score"]), 2)}"
96
 
97
  @render.text
98
  def sensityScoer():
99
  x, y = stop.get()
100
  score = initBackend.get_station_score((y, x), radius=input.rad())
101
- return f"Density Score: {round(float(score["density_score"]), 6)}"
102
 
103
  @render.plot(alt="A bar chart of age bracket data.")
104
  def plot():
 
49
  with ui.sidebar(open="open"):
50
 
51
  ui.input_select("year", "Year:", {2025: "2025", 2029: "2029", 2030: "2030"})
52
+
53
+ # station_coord, w_density=1, w_income=1, w_age=1):
54
+ ui.input_numeric("w_density", "Density Weight", "1")
55
+ ui.input_numeric("w_income", "Income Weight", "1")
56
+ ui.input_numeric("w_age", "Age Weight", "1")
57
  ui.input_slider("rad", "Stop reach radius:", min=200, max=1000, value=400),
58
 
59
  ui.input_checkbox_group(
 
95
  def ageScore():
96
  x, y = stop.get()
97
  score = initBackend.get_station_score((y, x), radius=input.rad())
 
98
  return f"Age Score: {round(float(score["age_score"]), 2)}"
99
 
100
  @render.text
101
  def sensityScoer():
102
  x, y = stop.get()
103
  score = initBackend.get_station_score((y, x), radius=input.rad())
104
+ return f"Density: {round(float(score["density_score"] * 1000000), 2)} Person / Kilometer"
105
 
106
  @render.plot(alt="A bar chart of age bracket data.")
107
  def plot():