seolpyo-mplchart 0.1.1__py3-none-any.whl → 0.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.
- seolpyo_mplchart/__init__.py +2 -2
- seolpyo_mplchart/cursor.py +3 -4
- seolpyo_mplchart/draw.py +0 -6
- seolpyo_mplchart/slider.py +23 -27
- {seolpyo_mplchart-0.1.1.dist-info → seolpyo_mplchart-0.1.3.dist-info}/METADATA +5 -3
- seolpyo_mplchart-0.1.3.dist-info/RECORD +13 -0
- seolpyo_mplchart-0.1.1.dist-info/RECORD +0 -13
- {seolpyo_mplchart-0.1.1.dist-info → seolpyo_mplchart-0.1.3.dist-info}/WHEEL +0 -0
- {seolpyo_mplchart-0.1.1.dist-info → seolpyo_mplchart-0.1.3.dist-info}/top_level.txt +0 -0
seolpyo_mplchart/__init__.py
CHANGED
|
@@ -70,8 +70,8 @@ class Chart(CM):
|
|
|
70
70
|
textboxKwargs: Options that apply to the information text box. dufault dict(boxstyle='round', facecolor='w')
|
|
71
71
|
|
|
72
72
|
fraction: Decide whether to express information as a fraction. default False
|
|
73
|
-
candleformat: Candle information text format. default '{}\n\n종가: {}\n등락률: {}\n대비: {}\n시가: {}({})\n고가: {}({})\n저가: {}({})\n거래량: {}({})'
|
|
74
|
-
volumeformat: Volume information text format. default '{}\n\n거래량 : {}\n거래량증가율: {}'
|
|
73
|
+
candleformat: Candle information text format. default '{dt}\n\n종가: {close}\n등락률: {rate}\n대비: {compare}\n시가: {open}({rate_open})\n고가: {high}({rate_high})\n저가: {low}({rate_low})\n거래량: {volume}({rate_volume})'
|
|
74
|
+
volumeformat: Volume information text format. default '{dt}\n\n거래량 : {volume}\n거래량증가율: {rate_volume}'
|
|
75
75
|
digit_price, digit_volume: Number of decimal places expressed in informational text. default (0, 0)
|
|
76
76
|
|
|
77
77
|
min_distance: Minimum number of candles that can be selected with the slider. default 30
|
seolpyo_mplchart/cursor.py
CHANGED
|
@@ -14,6 +14,9 @@ class Mixin:
|
|
|
14
14
|
def on_draw(self, e):
|
|
15
15
|
"This function works if draw event active."
|
|
16
16
|
return
|
|
17
|
+
def on_move(self, e):
|
|
18
|
+
"This function works if mouse move event active."
|
|
19
|
+
return
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
class CollectionMixin(DrawMixin):
|
|
@@ -412,10 +415,6 @@ class Chart(CursorMixin, CM, Mixin):
|
|
|
412
415
|
self.on_pick(e)
|
|
413
416
|
return super()._on_pick(e)
|
|
414
417
|
|
|
415
|
-
def _blit(self):
|
|
416
|
-
super()._blit()
|
|
417
|
-
return self.on_blit()
|
|
418
|
-
|
|
419
418
|
def _on_move(self, e):
|
|
420
419
|
super()._on_move(e)
|
|
421
420
|
return self.on_move(e)
|
seolpyo_mplchart/draw.py
CHANGED
|
@@ -9,15 +9,9 @@ from .base import Base
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Mixin:
|
|
12
|
-
def on_blit(self):
|
|
13
|
-
"This function works after cavas.blit()."
|
|
14
|
-
return
|
|
15
12
|
def on_draw(self, e):
|
|
16
13
|
"This function works if draw event active."
|
|
17
14
|
return
|
|
18
|
-
def on_move(self, e):
|
|
19
|
-
"This function works if mouse move event active."
|
|
20
|
-
return
|
|
21
15
|
def on_pick(self, e):
|
|
22
16
|
"This function works if pick event active."
|
|
23
17
|
return
|
seolpyo_mplchart/slider.py
CHANGED
|
@@ -6,15 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from .cursor import CursorMixin, Chart as CM
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
v = x.values
|
|
11
|
-
return ((v[0], v[1]), (v[0], v[2]))
|
|
12
|
-
def get_volumeline(x: pd.Series):
|
|
13
|
-
v = x.values
|
|
14
|
-
return ((v[0], 0), (v[0], v[1]))
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class Mixin(CursorMixin):
|
|
9
|
+
class Mixin:
|
|
18
10
|
def on_click(self, e):
|
|
19
11
|
"This function works if mouse button click event active."
|
|
20
12
|
return
|
|
@@ -26,7 +18,7 @@ class Mixin(CursorMixin):
|
|
|
26
18
|
return
|
|
27
19
|
|
|
28
20
|
|
|
29
|
-
class NavgatorMixin(
|
|
21
|
+
class NavgatorMixin(CursorMixin):
|
|
30
22
|
min_distance = 30
|
|
31
23
|
color_navigatorline = '#1e78ff'
|
|
32
24
|
color_navigator = 'k'
|
|
@@ -319,6 +311,7 @@ class SimpleMixin(LimMixin):
|
|
|
319
311
|
simpler = False
|
|
320
312
|
limit_volume = 1_500
|
|
321
313
|
default_left, default_right = (180, 10)
|
|
314
|
+
_draw_blit = False
|
|
322
315
|
|
|
323
316
|
def __init__(self, *args, **kwargs):
|
|
324
317
|
super().__init__(*args, **kwargs)
|
|
@@ -369,19 +362,15 @@ class SimpleMixin(LimMixin):
|
|
|
369
362
|
self.ax_price.xaxis.draw(renderer)
|
|
370
363
|
self.ax_price.yaxis.draw(renderer)
|
|
371
364
|
|
|
372
|
-
left, right = self._navcoordinate
|
|
373
|
-
Range = right - left
|
|
374
365
|
if self.simpler:
|
|
375
|
-
if
|
|
376
|
-
else: self.
|
|
366
|
+
if self._draw_blit: self.priceline.draw(renderer)
|
|
367
|
+
else: self.blitcandle.draw(renderer)
|
|
377
368
|
elif self.candle_on_ma:
|
|
378
369
|
self.macollection.draw(renderer)
|
|
379
|
-
if
|
|
380
|
-
elif 800 < Range or 9_999 < self.xmax: self.blitcandle.draw(renderer)
|
|
370
|
+
if self._draw_blit: self.blitcandle.draw(renderer)
|
|
381
371
|
else: self.candlecollection.draw(renderer)
|
|
382
372
|
else:
|
|
383
|
-
if
|
|
384
|
-
elif 800 < Range or 9_999 < self.xmax: self.blitcandle.draw(renderer)
|
|
373
|
+
if self._draw_blit: self.blitcandle.draw(renderer)
|
|
385
374
|
else: self.candlecollection.draw(renderer)
|
|
386
375
|
self.macollection.draw(renderer)
|
|
387
376
|
|
|
@@ -477,9 +466,13 @@ class ClickMixin(SimpleMixin):
|
|
|
477
466
|
self._change_coordinate()
|
|
478
467
|
if self.is_click:
|
|
479
468
|
nsub = self._navcoordinate[1] - self._navcoordinate[0]
|
|
480
|
-
if self.min_distance <= nsub: self._lim()
|
|
481
469
|
if self.is_move: self._set_navigator(*self._navcoordinate)
|
|
482
|
-
|
|
470
|
+
else:
|
|
471
|
+
self._draw_blit = 900 < nsub
|
|
472
|
+
if self.intx is not None: self._set_navigator(self._x_click, self.intx)
|
|
473
|
+
|
|
474
|
+
if self.min_distance <= nsub: self._lim()
|
|
475
|
+
|
|
483
476
|
self.navigator.draw(self.canvas.renderer)
|
|
484
477
|
self._draw_blit_artist()
|
|
485
478
|
self._slider_move_action(e)
|
|
@@ -514,6 +507,10 @@ class Chart(SliderMixin, CM, Mixin):
|
|
|
514
507
|
self.on_pick(e)
|
|
515
508
|
return super()._on_pick(e)
|
|
516
509
|
|
|
510
|
+
def _on_move(self, e):
|
|
511
|
+
super()._on_move(e)
|
|
512
|
+
return self.on_move(e)
|
|
513
|
+
|
|
517
514
|
def _draw_artist(self):
|
|
518
515
|
super()._draw_artist()
|
|
519
516
|
return self.draw_artist()
|
|
@@ -521,13 +518,12 @@ class Chart(SliderMixin, CM, Mixin):
|
|
|
521
518
|
super()._draw_blit_artist()
|
|
522
519
|
return self.draw_artist()
|
|
523
520
|
|
|
524
|
-
def
|
|
525
|
-
super().
|
|
526
|
-
return self.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return self.on_move(e)
|
|
521
|
+
def _on_click(self, e):
|
|
522
|
+
super()._on_click(e)
|
|
523
|
+
return self.on_click(e)
|
|
524
|
+
def _on_release(self, e):
|
|
525
|
+
super()._on_release(e)
|
|
526
|
+
return self.on_release(e)
|
|
531
527
|
|
|
532
528
|
|
|
533
529
|
if __name__ == '__main__':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: seolpyo-mplchart
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.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
|
|
@@ -38,10 +38,12 @@ Ethereum: 0x1c5fb8a5e0b1153cd4116c91736bd16fabf83520
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
# Sample
|
|
41
|
-
|
|
41
|
+
<img alt="sample gif" src="https://github.com/white-seolpyo/seolpyo-mplchart/blob/main/images/sample.gif?raw=true">
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
<img alt="tkinter sample gif" src="https://github.com/white-seolpyo/seolpyo-mplchart/blob/main/images/with%20tkinter.gif?raw=true">
|
|
44
44
|
|
|
45
45
|

|
|
46
46
|
|
|
47
47
|

|
|
48
|
+
|
|
49
|
+
<img alt="40,000 sample" src="https://github.com/white-seolpyo/seolpyo-mplchart/blob/main/images/40000.gif?raw=true">
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
seolpyo_mplchart/__init__.py,sha256=FiuciCaX9lU12gwuDBYUNw0yLD06p4o7o19kR5jGips,5248
|
|
2
|
+
seolpyo_mplchart/base.py,sha256=vQ4OOBm3nGwjJ4wjDLaD_3LGxYzlP6AWpI6SZrZiwnQ,3600
|
|
3
|
+
seolpyo_mplchart/cursor.py,sha256=KSyYXJ1qVFgvrFBEhO8cazcZCxoJWqBAw0WvyVs9gNk,18405
|
|
4
|
+
seolpyo_mplchart/draw.py,sha256=NJH1dnmfepafMlc7K2ccwZbv0FDS3ItSiirCq4gMlOI,13145
|
|
5
|
+
seolpyo_mplchart/slider.py,sha256=R29vyNAdJkLEXgpP4hxe9O0WoLgoOnPOUHuKFNpdcnw,19601
|
|
6
|
+
seolpyo_mplchart/test.py,sha256=cW2hoaVbRtoSXlpmA4i1BKHBjI3-FAqYq__kryxkrC8,1007
|
|
7
|
+
seolpyo_mplchart/utils.py,sha256=-8cq4-WwiqKQxtwu3NPxOVTDDvoWH28tu4OTWr4hPTg,1208
|
|
8
|
+
seolpyo_mplchart/data/apple.txt,sha256=0izAfweu1lLsC0IwVthdVlo9reG8KGbKGTSX5knI5Zc,1380864
|
|
9
|
+
seolpyo_mplchart/data/samsung.txt,sha256=UejaSkbzr4E5K3lkelCT0yJiWUPfmViBEaTyoXyphIs,2476424
|
|
10
|
+
seolpyo_mplchart-0.1.3.dist-info/METADATA,sha256=Srf62CYZXlFvCYw4xqVy6DFtcEmun_dV3FymQXdzQyo,2347
|
|
11
|
+
seolpyo_mplchart-0.1.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
12
|
+
seolpyo_mplchart-0.1.3.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
|
|
13
|
+
seolpyo_mplchart-0.1.3.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
seolpyo_mplchart/__init__.py,sha256=HITw-PVvJA4AHOO_gOAsbBxNvEbou-JLtivnKA_dn0A,5157
|
|
2
|
-
seolpyo_mplchart/base.py,sha256=vQ4OOBm3nGwjJ4wjDLaD_3LGxYzlP6AWpI6SZrZiwnQ,3600
|
|
3
|
-
seolpyo_mplchart/cursor.py,sha256=Ho57DqT0n8OJhGyqekTkzfap-dyIXXFKJys5Ydn-aJ4,18383
|
|
4
|
-
seolpyo_mplchart/draw.py,sha256=JMbbmyRrV2YHa3yXPLbIPCe0qr9Xf1zFCFYxecOtplI,13338
|
|
5
|
-
seolpyo_mplchart/slider.py,sha256=rh4J42AffclXUHupD1cHHGudCv0rT8L_QEcqWYEUvHc,19811
|
|
6
|
-
seolpyo_mplchart/test.py,sha256=cW2hoaVbRtoSXlpmA4i1BKHBjI3-FAqYq__kryxkrC8,1007
|
|
7
|
-
seolpyo_mplchart/utils.py,sha256=-8cq4-WwiqKQxtwu3NPxOVTDDvoWH28tu4OTWr4hPTg,1208
|
|
8
|
-
seolpyo_mplchart/data/apple.txt,sha256=0izAfweu1lLsC0IwVthdVlo9reG8KGbKGTSX5knI5Zc,1380864
|
|
9
|
-
seolpyo_mplchart/data/samsung.txt,sha256=UejaSkbzr4E5K3lkelCT0yJiWUPfmViBEaTyoXyphIs,2476424
|
|
10
|
-
seolpyo_mplchart-0.1.1.dist-info/METADATA,sha256=F1Mtm4P-bEtO-ZveM0ThWnxk8BgoxHo-Ma3_TEa4qEo,2176
|
|
11
|
-
seolpyo_mplchart-0.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
12
|
-
seolpyo_mplchart-0.1.1.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
|
|
13
|
-
seolpyo_mplchart-0.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|