Azaya89 commited on
Commit
e4af1d6
·
1 Parent(s): e66a84e

refactored main app

Browse files
Files changed (1) hide show
  1. app.py +10 -14
app.py CHANGED
@@ -36,11 +36,6 @@ weekly_plot = weekly_group.hvplot.bar(stacked=True, rot=45, ylabel='Number of ho
36
  pn.extension('tabulator', sizing_mode="stretch_width")
37
 
38
  ACCENT = "#4099da"
39
- styles = {
40
- "box-shadow": "rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px",
41
- "border-radius": "4px",
42
- "padding": "10px",
43
- }
44
  BRAND_COLOR = ACCENT
45
  BRAND_TEXT_ON_COLOR = "white"
46
  CARD_STYLE = {
@@ -48,32 +43,33 @@ CARD_STYLE = {
48
  "padding": "10px",
49
  "border-radius": "5px"
50
  }
51
- header = pn.Row(
52
- pn.pane.Markdown(
53
- "# Omoku power supply report", styles={"color": BRAND_TEXT_ON_COLOR}, margin=(5, 20)
54
- ),
55
- styles={"background": BRAND_COLOR},
56
- )
 
57
  indicators = pn.FlexBox(
58
  pn.indicators.Number(
59
  value=daily_average,
60
  name="Average daily supply (Hrs)",
61
  default_color="gray",
62
- format="{value:,.0f}",
63
  styles=styles
64
  ),
65
  pn.indicators.Number(
66
  value=max_power,
67
  name="Highest daily supply (Hrs)",
68
  default_color="green",
69
- format="{value:,.1f}",
70
  styles=styles,
71
  ),
72
  pn.indicators.Number(
73
  value=min_power,
74
  name="Lowest daily supply (Hrs)",
75
  default_color="red",
76
- format="{value:,.1f}",
77
  styles=styles,
78
  ),
79
  )
 
36
  pn.extension('tabulator', sizing_mode="stretch_width")
37
 
38
  ACCENT = "#4099da"
 
 
 
 
 
39
  BRAND_COLOR = ACCENT
40
  BRAND_TEXT_ON_COLOR = "white"
41
  CARD_STYLE = {
 
43
  "padding": "10px",
44
  "border-radius": "5px"
45
  }
46
+ number_format = "{value:,.1f}"
47
+ styles = {
48
+ "box-shadow": "rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px",
49
+ "border-radius": "4px",
50
+ "padding": "10px",
51
+ }
52
+
53
  indicators = pn.FlexBox(
54
  pn.indicators.Number(
55
  value=daily_average,
56
  name="Average daily supply (Hrs)",
57
  default_color="gray",
58
+ format=number_format,
59
  styles=styles
60
  ),
61
  pn.indicators.Number(
62
  value=max_power,
63
  name="Highest daily supply (Hrs)",
64
  default_color="green",
65
+ format=number_format,
66
  styles=styles,
67
  ),
68
  pn.indicators.Number(
69
  value=min_power,
70
  name="Lowest daily supply (Hrs)",
71
  default_color="red",
72
+ format=number_format,
73
  styles=styles,
74
  ),
75
  )