seolpyo-mplchart 1.4.1.2__py3-none-any.whl → 1.4.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of seolpyo-mplchart might be problematic. Click here for more details.

@@ -234,7 +234,7 @@ class CrossLineMixin(EventMixin):
234
234
 
235
235
  if self.in_price_chart or self.in_volume_chart:
236
236
  self._restore_region()
237
- self._draw_crossline(e, self.in_price_chart)
237
+ self._draw_crossline(e)
238
238
  self.figure.canvas.blit()
239
239
  else:
240
240
  if self._erase_crossline():
@@ -249,10 +249,10 @@ class CrossLineMixin(EventMixin):
249
249
  return True
250
250
  return False
251
251
 
252
- def _draw_crossline(self, e: MouseEvent, in_price_chart):
252
+ def _draw_crossline(self, e: MouseEvent):
253
253
  x, y = (e.xdata, e.ydata)
254
254
 
255
- if in_price_chart:
255
+ if self.in_price_chart:
256
256
  self.collection_price_crossline.set_segments([((x, self.price_ymin), (x, self.price_ymax)), ((self.vxmin, y), (self.vxmax, y))])
257
257
  self.collection_volume_crossline.set_segments([((x, 0), (x, self.volume_ymax))])
258
258
  else:
@@ -263,14 +263,14 @@ class CrossLineMixin(EventMixin):
263
263
  self.collection_price_crossline.draw(renderer)
264
264
  self.collection_volume_crossline.draw(renderer)
265
265
 
266
- self._draw_text_artist(e, in_price_chart)
266
+ self._draw_text_artist(e)
267
267
  return
268
268
 
269
- def _draw_text_artist(self, e: MouseEvent, in_price_chart):
269
+ def _draw_text_artist(self, e: MouseEvent):
270
270
  x, y = (e.xdata, e.ydata)
271
271
 
272
272
  renderer = self.figure.canvas.renderer
273
- if in_price_chart:
273
+ if self.in_price_chart:
274
274
  # 가격
275
275
  self.artist_text_price.set_text(f'{float_to_str(y, self.digit_price)}{self.unit_price}')
276
276
  self.artist_text_price.set_x(self.v0 if self.veighth < x else self.vsixth)
@@ -298,17 +298,20 @@ class CrossLineMixin(EventMixin):
298
298
 
299
299
 
300
300
  class BoxMixin(CrossLineMixin):
301
- def _draw_crossline(self, e, in_price_chart):
302
- super()._draw_crossline(e, in_price_chart)
303
- self._draw_box_artist(e, in_price_chart)
301
+ def _draw_crossline(self, e):
302
+ super()._draw_crossline(e)
303
+ self._draw_box_artist(e)
304
304
  return
305
305
 
306
- def _draw_box_artist(self, e: MouseEvent, in_price_chart):
306
+ def _draw_box_artist(self, e: MouseEvent):
307
307
  y = e.ydata
308
308
 
309
309
  renderer = self.figure.canvas.renderer
310
+
311
+ self.in_candle = False
312
+ self.in_volumebar = False
310
313
  if self.intx is not None:
311
- if in_price_chart:
314
+ if self.in_price_chart:
312
315
  # 박스 크기
313
316
  high = self.df['top_box_candle'][self.intx]
314
317
  low = self.df['bottom_box_candle'][self.intx]
@@ -318,21 +321,19 @@ class BoxMixin(CrossLineMixin):
318
321
  high, low = (high+sub, low-sub)
319
322
 
320
323
  # 커서가 캔들 사이에 있는지 확인
321
- if high < y or y < low: self.in_candle = False
322
- else:
324
+ if low <= y and y <= high:
323
325
  # 캔들 강조
324
326
  self.in_candle = True
325
327
  x1, x2 = (self.intx-0.3, self.intx+1.3)
326
328
  self.collection_price_box.set_segments([((x1, high), (x2, high), (x2, low), (x1, low), (x1, high))])
327
329
  self.collection_price_box.draw(renderer)
328
- elif self.volume:
330
+ elif self.in_volume_chart and self.volume:
329
331
  # 거래량 강조
330
332
  high = self.df['max_box_volume'][self.intx]
331
333
  low = 0
332
334
  if high < self.min_height_box_volume: high = self.min_height_box_volume
333
335
 
334
- if high < y or y < low: self.in_volumebar = False
335
- else:
336
+ if low <= y and y <= high:
336
337
  self.in_volumebar = True
337
338
  x1, x2 = (self.intx-0.3, self.intx+1.3)
338
339
  self.collection_volume_box.set_segments([((x1, high), (x2, high), (x2, low), (x1, low), (x1, high))])
@@ -395,8 +396,8 @@ class InfoMixin(BoxMixin):
395
396
  self._length_text = lenth_high if lenth_volume < lenth_high else lenth_volume
396
397
  return
397
398
 
398
- def _draw_box_artist(self, e, in_price_chart):
399
- super()._draw_box_artist(e, in_price_chart)
399
+ def _draw_box_artist(self, e):
400
+ super()._draw_box_artist(e)
400
401
 
401
402
  if self.intx is not None:
402
403
  if self.in_candle: self._draw_candle_info_artist(e)
@@ -302,7 +302,7 @@ class MouseMoveMixin(BackgroundMixin):
302
302
  self.figure.canvas.blit()
303
303
  elif self.in_price_chart or self.in_volume_chart:
304
304
  self._restore_region()
305
- self._draw_crossline(e, self.in_price_chart)
305
+ self._draw_crossline(e)
306
306
  self.figure.canvas.blit()
307
307
  else:
308
308
  if self._erase_crossline():
@@ -378,10 +378,10 @@ class MouseMoveMixin(BackgroundMixin):
378
378
  self.artist_text_slider.draw(renderer)
379
379
  return
380
380
 
381
- def _draw_crossline(self, e: MouseEvent, in_price_chart):
381
+ def _draw_crossline(self, e: MouseEvent):
382
382
  self.collection_slider_vline.set_segments([((e.xdata, self.slider_ymin), (e.xdata, self.slider_ymax))])
383
383
  self.collection_slider_vline.draw(self.figure.canvas.renderer)
384
- return super()._draw_crossline(e, in_price_chart)
384
+ return super()._draw_crossline(e)
385
385
 
386
386
 
387
387
  class ClickMixin(MouseMoveMixin):
@@ -567,7 +567,7 @@ class ChartClickMixin(ReleaseMixin):
567
567
  elif self.in_price_chart or self.in_volume_chart:
568
568
  self._restore_region(self.is_click_chart)
569
569
  if not self.is_click_chart:
570
- self._draw_crossline(e, self.in_price_chart)
570
+ self._draw_crossline(e)
571
571
  else: self._move_chart(e)
572
572
  self.figure.canvas.blit()
573
573
  else:
seolpyo_mplchart/test.py CHANGED
@@ -26,7 +26,7 @@ class Chart(mc.SliderChart):
26
26
  kwargs['close'] = 'You can Change close price info.'
27
27
  return kwargs
28
28
 
29
- def get_candle_segm1ent(self, *, x, left, right, top, bottom, is_up, high, low):
29
+ def get_candle_segment(self, *, x, left, right, top, bottom, is_up, high, low):
30
30
  if is_up:
31
31
  return (
32
32
  (x, top), (right, top), (x, top),
@@ -53,7 +53,7 @@ path_file = Path(__file__).parent / 'sample/samsung.txt'
53
53
 
54
54
  with open(path_file, 'r', encoding='utf-8') as txt:
55
55
  data = json.load(txt)
56
- df = pd.DataFrame(data[:20])
56
+ df = pd.DataFrame(data[:100])
57
57
 
58
58
  C.set_data(df)
59
59
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seolpyo-mplchart
3
- Version: 1.4.1.2
3
+ Version: 1.4.1.3
4
4
  Summary: Fast candlestick chart using Python. Includes navigator, slider, navigation, and text information display functions
5
5
  Author-email: white-seolpyo <white-seolpyo@naver.com>
6
6
  License: MIT License
@@ -50,8 +50,9 @@ Ethereum: 0x1c5fb8a5e0b1153cd4116c91736bd16fabf83520
50
50
  ## Korean format sample
51
51
  ![korean sample](https://raw.githubusercontent.com/white-seolpyo/seolpyo-mplchart/refs/heads/main/images/sample%20kor.png)
52
52
 
53
- ## change Candle shape sample
53
+ ## change Candle shape sample(draw Bar Chart)
54
54
  ![Candle shape sample](https://raw.githubusercontent.com/white-seolpyo/seolpyo-mplchart/refs/heads/main/images/change%20candle%20segment.png)
55
55
 
56
- # 40,000 data sample
56
+ # Mass Data Testing (40,000 Stock Price Data Points)
57
57
  ![40,000 sample](https://raw.githubusercontent.com/white-seolpyo/seolpyo-mplchart/refs/heads/main/images/40000.gif)
58
+
@@ -1,17 +1,17 @@
1
1
  seolpyo_mplchart/__init__.py,sha256=1rY6PP1OMMr1d_5x7dlAD2ImQAXChT5spvB45j6yDp8,18255
2
2
  seolpyo_mplchart/_base.py,sha256=3iG4AVwHR_h3rh6c1oJahWt7NvBpBFrS0bUZd4PaHfY,3921
3
- seolpyo_mplchart/_cursor.py,sha256=sQqMOkd8xgWMEs1RoUcAluiCQni680ri4WKCnzMiPHw,23515
3
+ seolpyo_mplchart/_cursor.py,sha256=v__66q2P4MdIsHjCZL_WcW2A-iFmXZaQMvOmbXvvkno,23370
4
4
  seolpyo_mplchart/_draw.py,sha256=kD-FliRDDB7Jpfj_wbOtDs9bHla0oNr9_ksh5PXhUDI,23057
5
- seolpyo_mplchart/_slider.py,sha256=XcUna2pClVu9g4Ih8OQ_ZCjuKbDBmfQ_b0Snw97dqfs,23431
5
+ seolpyo_mplchart/_slider.py,sha256=Tuaz0_R9_U0oFqsGPzOZ1Gc2RnDiHdDP-gJrNyMFUBc,23357
6
6
  seolpyo_mplchart/base.py,sha256=0qdImsIMPzTTkkHzPv479BVe_ojrn45FidGE46eT5x4,3797
7
7
  seolpyo_mplchart/cursor.py,sha256=qq1WJJa7vCE5C2XeGBECt2XqxR_WxfybZZ5u6zVx5Ps,20415
8
8
  seolpyo_mplchart/draw.py,sha256=MiqDhbMJOSlWD6qdAghsyrZwCixcwm4nfmiinvwtt-o,21520
9
9
  seolpyo_mplchart/slider.py,sha256=-jZ6D23orDj3NmtnOviO1NRx4BrRxWvwTV5pzGQuWNI,22188
10
- seolpyo_mplchart/test.py,sha256=ScyAkGpGzOb0DZe1pQcY7bWELPZy9jI8Zag3EhiP3XI,1646
10
+ seolpyo_mplchart/test.py,sha256=hfqxvgffRxM7hZCNakpWGkzVdENMc31Nrmp4RpY05Lg,1646
11
11
  seolpyo_mplchart/utils.py,sha256=a3XycRBTndrsjBw_1VKTxbSvOGpVYXHRK87v7azgRe8,1433
12
12
  seolpyo_mplchart/data/apple.txt,sha256=0izAfweu1lLsC0IwVthdVlo9reG8KGbKGTSX5knI5Zc,1380864
13
13
  seolpyo_mplchart/data/samsung.txt,sha256=UejaSkbzr4E5K3lkelCT0yJiWUPfmViBEaTyoXyphIs,2476424
14
- seolpyo_mplchart-1.4.1.2.dist-info/METADATA,sha256=5IATBGlo5ddq1B_sh8qnolCKhDlHhTWhcZ_qLtqhfYg,2678
15
- seolpyo_mplchart-1.4.1.2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
16
- seolpyo_mplchart-1.4.1.2.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
17
- seolpyo_mplchart-1.4.1.2.dist-info/RECORD,,
14
+ seolpyo_mplchart-1.4.1.3.dist-info/METADATA,sha256=ytPqKuBmE7XSdhKLXat4HRGLp9PRPJfoI9qIgfymU3w,2728
15
+ seolpyo_mplchart-1.4.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ seolpyo_mplchart-1.4.1.3.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
17
+ seolpyo_mplchart-1.4.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5