-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
77 lines (68 loc) · 2.6 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# ui.R - Define the user interface
ui <- fluidPage(
titlePanel("BTCBESS Analysis"),
sidebarLayout(
sidebarPanel(
# Project Parameters
selectInput("miner_model",
"Select Mining Hardware",
choices = NULL), # Will be populated from miners$model_name
selectInput("storage_system",
"Select Storage System",
choices = NULL), # Will be populated from storage_systems$model_name
# Financial Parameters
numericInput("btc_price", "Bitcoin Price (USD)", value = 50000),
numericInput("electricity_cost", "Electricity Cost ($/kWh)", value = 0.05),
numericInput("discount_rate", "Discount Rate (%)", value = 10),
numericInput("project_duration", "Project Duration (Years)", value = 5)
),
mainPanel(
tabsetPanel(
tabPanel("Project Overview",
h3("Key Metrics"),
verbatimTextOutput("npv_output"),
verbatimTextOutput("irr_output"),
plotlyOutput("cashflow_chart")
),
tabPanel("Mining Analysis",
fluidRow(
column(4,
numericInput("network_hashrate",
"Network Hashrate (EH/s)",
value = 500,
min = 1,
max = 1000),
numericInput("block_reward",
"Block Reward (BTC)",
value = 6.25,
min = 0)
),
column(8,
plotlyOutput("profitability_plot", height = "400px")
)
),
fluidRow(
column(6,
plotlyOutput("efficiency_plot", height = "400px")
),
column(6,
plotlyOutput("power_hashrate_plot", height = "400px")
)
)
),
tabPanel("Sensitivity Analysis",
plotlyOutput("sensitivity_plot")
),
tabPanel("Operating Strategy",
plotlyOutput("daily_operation_plot")
),
tabPanel("Debug",
h4("Miners Data:"),
verbatimTextOutput("debug_miners"),
h4("Storage Systems Data:"),
verbatimTextOutput("debug_storage")
)
)
)
)
)