Adityadn commited on
Commit
9ebff55
·
verified ·
1 Parent(s): 420f7b7

Upload 14 files

Browse files
Files changed (3) hide show
  1. calculate.ipynb +2 -2
  2. data/dynamic.py +8 -4
  3. data/static.py +7 -3
calculate.ipynb CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2c762bc3d17afa304fcc1241f786bef217586f8042cdfb5aa69284d9461ff541
3
- size 33137753
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0e6a0b741b72a7e0a12259c96212901e2e64b3dc6bb5ca1f759d4e764521925
3
+ size 33131737
data/dynamic.py CHANGED
@@ -53,7 +53,7 @@ def generate(is_img=False):
53
  tickvals_list["btn" if isBtn else "ss"].append(tickvals)
54
 
55
  y_ax_rng_list["btn" if isBtn else "ss"].append(
56
- [min(dfc["Harga Jual"]) - 100_000, max(dfc["Harga Beli"]) + 200_000]
57
  )
58
 
59
  hasil = []
@@ -190,8 +190,10 @@ def generate(is_img=False):
190
  x=[tb], y=[hasil[j]["HBg"]],
191
  mode='markers+text',
192
  name=f'Transaksi ke-{j+1} (Beli)',
193
- text=[f'Beli ke-{j+1}<br>(Rp {hasil[j]["M"]:,.0f})' if hari <= 80 else f'B{j+1}'],
 
194
  textposition=f'{lbp} center',
 
195
  marker=dict(color='green', size=10),
196
  visible=(hari==default_hari) if not isBtn else False
197
  )
@@ -205,8 +207,10 @@ def generate(is_img=False):
205
  x=[dfc.iloc[-1]['lastUpdate']], y=[dfc.iloc[-1]['Harga Jual']],
206
  mode='markers+text',
207
  name='Harga Jual Terakhir',
208
- text=['Jual Sekarang' if hari <= 60 else 'JS'],
 
209
  textposition=f'{"top" if lbp == "bottom" else lbp} center',
 
210
  marker=dict(color='red', size=10),
211
  visible=(hari==default_hari) if not isBtn else False
212
  )
@@ -369,7 +373,7 @@ def generate(is_img=False):
369
  title="Harga per Gram",
370
  tickprefix="Rp ",
371
  tickformat=",",
372
- range=[min(dfc["Harga Jual"]) - 100_000, max(dfc["Harga Beli"]) + 200_000],
373
  ),
374
  )
375
 
 
53
  tickvals_list["btn" if isBtn else "ss"].append(tickvals)
54
 
55
  y_ax_rng_list["btn" if isBtn else "ss"].append(
56
+ [min(dfc["Harga Jual"]) - 100_000, max(dfc["Harga Beli"]) + 100_000]
57
  )
58
 
59
  hasil = []
 
190
  x=[tb], y=[hasil[j]["HBg"]],
191
  mode='markers+text',
192
  name=f'Transaksi ke-{j+1} (Beli)',
193
+ text=[# f'Beli ke-{j+1}<br>(Rp {hasil[j]["M"]:,.0f})' if hari <= 80 else
194
+ f'B{j+1}'],
195
  textposition=f'{lbp} center',
196
+ # textfont=dict(size=10),
197
  marker=dict(color='green', size=10),
198
  visible=(hari==default_hari) if not isBtn else False
199
  )
 
207
  x=[dfc.iloc[-1]['lastUpdate']], y=[dfc.iloc[-1]['Harga Jual']],
208
  mode='markers+text',
209
  name='Harga Jual Terakhir',
210
+ text=[# 'Jual Sekarang' if hari <= 60 else
211
+ 'JS'],
212
  textposition=f'{"top" if lbp == "bottom" else lbp} center',
213
+ # textfont=dict(size=10),
214
  marker=dict(color='red', size=10),
215
  visible=(hari==default_hari) if not isBtn else False
216
  )
 
373
  title="Harga per Gram",
374
  tickprefix="Rp ",
375
  tickformat=",",
376
+ range=[min(dfc["Harga Jual"]) - 100_000, max(dfc["Harga Beli"]) + 100_000],
377
  ),
378
  )
379
 
data/static.py CHANGED
@@ -157,8 +157,10 @@ def generate(lama_hari, is_img=False):
157
  x=[tb], y=[hasil[i]["HBg"]],
158
  mode='markers+text',
159
  name=f'Transaksi ke-{i+1} (Beli)',
160
- text=[f'Beli ke-{i+1}<br>(Rp {hasil[i]["M"]:,.0f})' if lama_hari <= 80 else f'B{i+1}'],
 
161
  textposition=f'{"top" if i % 2 == 0 else "bottom"} center',
 
162
  marker=dict(color='green', size=10)
163
  ), row=2, col=1)
164
  continue
@@ -168,8 +170,10 @@ def generate(lama_hari, is_img=False):
168
  x=[df.iloc[-1]['lastUpdate']], y=[df.iloc[-1]['Harga Jual']],
169
  mode='markers+text',
170
  name='Harga Jual Terakhir',
171
- text=['Jual Sekarang' if lama_hari <= 60 else 'JS'],
 
172
  textposition=f'{"top" if lbp == "bottom" else lbp} center',
 
173
  marker=dict(color='red', size=10)
174
  ), row=2, col=1)
175
 
@@ -199,7 +203,7 @@ def generate(lama_hari, is_img=False):
199
  title="Harga per Gram",
200
  tickprefix="Rp ",
201
  tickformat=",",
202
- range=[min(df["Harga Jual"]) - 100_000, max(df["Harga Beli"]) + 200_000],
203
  )
204
  )
205
 
 
157
  x=[tb], y=[hasil[i]["HBg"]],
158
  mode='markers+text',
159
  name=f'Transaksi ke-{i+1} (Beli)',
160
+ text=[# f'Beli ke-{i+1}<br>(Rp {hasil[i]["M"]:,.0f})' if lama_hari <= 80 else
161
+ f'B{i+1}'],
162
  textposition=f'{"top" if i % 2 == 0 else "bottom"} center',
163
+ # textfont=dict(size=10),
164
  marker=dict(color='green', size=10)
165
  ), row=2, col=1)
166
  continue
 
170
  x=[df.iloc[-1]['lastUpdate']], y=[df.iloc[-1]['Harga Jual']],
171
  mode='markers+text',
172
  name='Harga Jual Terakhir',
173
+ text=[# 'Jual Sekarang' if lama_hari <= 60 else
174
+ 'JS'],
175
  textposition=f'{"top" if lbp == "bottom" else lbp} center',
176
+ # textfont=dict(size=10),
177
  marker=dict(color='red', size=10)
178
  ), row=2, col=1)
179
 
 
203
  title="Harga per Gram",
204
  tickprefix="Rp ",
205
  tickformat=",",
206
+ range=[min(df["Harga Jual"]) - 100_000, max(df["Harga Beli"]) + 100_000],
207
  )
208
  )
209