seolpyo-mplchart 1.4.1.1__tar.gz → 1.4.1.3__tar.gz
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-1.4.1.1/seolpyo_mplchart.egg-info → seolpyo_mplchart-1.4.1.3}/PKG-INFO +4 -3
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/README.md +3 -2
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/pyproject.toml +1 -1
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/_cursor.py +19 -18
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/_draw.py +4 -5
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/_slider.py +8 -6
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/test.py +6 -16
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3/seolpyo_mplchart.egg-info}/PKG-INFO +4 -3
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/MANIFEST.in +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/__init__.py +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/_base.py +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart/utils.py +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/SOURCES.txt +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/dependency_links.txt +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/requires.txt +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/top_level.txt +0 -0
- {seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: seolpyo-mplchart
|
|
3
|
-
Version: 1.4.1.
|
|
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
|

|
|
52
52
|
|
|
53
|
-
## change Candle shape sample
|
|
53
|
+
## change Candle shape sample(draw Bar Chart)
|
|
54
54
|

|
|
55
55
|
|
|
56
|
-
# 40,000
|
|
56
|
+
# Mass Data Testing (40,000 Stock Price Data Points)
|
|
57
57
|

|
|
58
|
+
|
|
@@ -23,8 +23,9 @@ Ethereum: 0x1c5fb8a5e0b1153cd4116c91736bd16fabf83520
|
|
|
23
23
|
## Korean format sample
|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
## change Candle shape sample
|
|
26
|
+
## change Candle shape sample(draw Bar Chart)
|
|
27
27
|

|
|
28
28
|
|
|
29
|
-
# 40,000
|
|
29
|
+
# Mass Data Testing (40,000 Stock Price Data Points)
|
|
30
30
|

|
|
31
|
+
|
|
@@ -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
|
|
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
|
|
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
|
|
266
|
+
self._draw_text_artist(e)
|
|
267
267
|
return
|
|
268
268
|
|
|
269
|
-
def _draw_text_artist(self, e: MouseEvent
|
|
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
|
|
302
|
-
super()._draw_crossline(e
|
|
303
|
-
self._draw_box_artist(e
|
|
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
|
|
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
|
|
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
|
|
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
|
|
399
|
-
super()._draw_box_artist(e
|
|
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)
|
|
@@ -251,11 +251,11 @@ class CandleSegmentMixin(DataMixin):
|
|
|
251
251
|
tuple[tuple[float, float]]: candle segment
|
|
252
252
|
"""
|
|
253
253
|
return (
|
|
254
|
-
(x,
|
|
254
|
+
(x, top),
|
|
255
255
|
(left, top), (left, bottom),
|
|
256
256
|
(x, bottom), (x, low), (x, bottom),
|
|
257
257
|
(right, bottom), (right, top),
|
|
258
|
-
(x, top), (x, high)
|
|
258
|
+
(x, top), (x, high)
|
|
259
259
|
)
|
|
260
260
|
|
|
261
261
|
def _create_candle_segments(self):
|
|
@@ -411,9 +411,8 @@ class VolumeSegmentMixin(MaSegmentMixin):
|
|
|
411
411
|
tuple[tuple[float, float]]: volume bar segment
|
|
412
412
|
"""
|
|
413
413
|
return (
|
|
414
|
-
(left,
|
|
415
|
-
(right,
|
|
416
|
-
(left, top), (left, 0),
|
|
414
|
+
(left, 0), (left, top),
|
|
415
|
+
(right, top), (right, 0),
|
|
417
416
|
)
|
|
418
417
|
|
|
419
418
|
def _create_volume_segments(self):
|
|
@@ -131,7 +131,9 @@ class CollectionMixin(PlotMixin):
|
|
|
131
131
|
keys.append('x')
|
|
132
132
|
keys.append(f'ma{i}')
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
series = self.df[keys + ['x', self.close]]
|
|
135
|
+
series['x'] = series['x'] - 0.5
|
|
136
|
+
segment_slider = series.values
|
|
135
137
|
segment_slider = segment_slider.reshape(segment_slider.shape[0], len(self.list_ma)+1, 2).swapaxes(0, 1)
|
|
136
138
|
self.collection_slider.set_segments(segment_slider)
|
|
137
139
|
linewidth = [1 for _ in self.list_ma]
|
|
@@ -300,7 +302,7 @@ class MouseMoveMixin(BackgroundMixin):
|
|
|
300
302
|
self.figure.canvas.blit()
|
|
301
303
|
elif self.in_price_chart or self.in_volume_chart:
|
|
302
304
|
self._restore_region()
|
|
303
|
-
self._draw_crossline(e
|
|
305
|
+
self._draw_crossline(e)
|
|
304
306
|
self.figure.canvas.blit()
|
|
305
307
|
else:
|
|
306
308
|
if self._erase_crossline():
|
|
@@ -376,10 +378,10 @@ class MouseMoveMixin(BackgroundMixin):
|
|
|
376
378
|
self.artist_text_slider.draw(renderer)
|
|
377
379
|
return
|
|
378
380
|
|
|
379
|
-
def _draw_crossline(self, e: MouseEvent
|
|
381
|
+
def _draw_crossline(self, e: MouseEvent):
|
|
380
382
|
self.collection_slider_vline.set_segments([((e.xdata, self.slider_ymin), (e.xdata, self.slider_ymax))])
|
|
381
383
|
self.collection_slider_vline.draw(self.figure.canvas.renderer)
|
|
382
|
-
return super()._draw_crossline(e
|
|
384
|
+
return super()._draw_crossline(e)
|
|
383
385
|
|
|
384
386
|
|
|
385
387
|
class ClickMixin(MouseMoveMixin):
|
|
@@ -405,7 +407,7 @@ class ClickMixin(MouseMoveMixin):
|
|
|
405
407
|
|
|
406
408
|
navleft, navright = self.navcoordinate
|
|
407
409
|
x = e.xdata.__round__()
|
|
408
|
-
|
|
410
|
+
|
|
409
411
|
leftmax = navleft + self._navLineWidth_half
|
|
410
412
|
rightmin = navright - self._navLineWidth_half
|
|
411
413
|
|
|
@@ -565,7 +567,7 @@ class ChartClickMixin(ReleaseMixin):
|
|
|
565
567
|
elif self.in_price_chart or self.in_volume_chart:
|
|
566
568
|
self._restore_region(self.is_click_chart)
|
|
567
569
|
if not self.is_click_chart:
|
|
568
|
-
self._draw_crossline(e
|
|
570
|
+
self._draw_crossline(e)
|
|
569
571
|
else: self._move_chart(e)
|
|
570
572
|
self.figure.canvas.blit()
|
|
571
573
|
else:
|
|
@@ -13,7 +13,7 @@ import seolpyo_mplchart as mc
|
|
|
13
13
|
class Chart(mc.SliderChart):
|
|
14
14
|
format_candleinfo = mc.format_candleinfo_ko + '\nCustom info: {ci}'
|
|
15
15
|
format_volumeinfo = mc.format_volumeinfo_ko
|
|
16
|
-
min_distance =
|
|
16
|
+
min_distance = 2
|
|
17
17
|
|
|
18
18
|
def __init__(self, *args, **kwargs):
|
|
19
19
|
super().__init__(*args, **kwargs)
|
|
@@ -29,27 +29,17 @@ class Chart(mc.SliderChart):
|
|
|
29
29
|
def get_candle_segment(self, *, x, left, right, top, bottom, is_up, high, low):
|
|
30
30
|
if is_up:
|
|
31
31
|
return (
|
|
32
|
+
(x, top), (right, top), (x, top),
|
|
32
33
|
(x, high),
|
|
33
|
-
(x, top),
|
|
34
|
-
(right, top),
|
|
35
|
-
(x, top),
|
|
36
|
-
(x, bottom),
|
|
37
|
-
(left, bottom),
|
|
38
|
-
(x, bottom),
|
|
39
34
|
(x, low),
|
|
40
|
-
(x,
|
|
35
|
+
(x, bottom), (left, bottom), (x, bottom),
|
|
41
36
|
)
|
|
42
37
|
else:
|
|
43
38
|
return (
|
|
39
|
+
(x, bottom), (right, bottom), (x, bottom),
|
|
44
40
|
(x, high),
|
|
45
|
-
(x, bottom),
|
|
46
|
-
(right, bottom),
|
|
47
|
-
(x, bottom),
|
|
48
|
-
(x, top),
|
|
49
|
-
(left, top),
|
|
50
|
-
(x, top),
|
|
51
41
|
(x, low),
|
|
52
|
-
(x,
|
|
42
|
+
(x, top), (left, top), (x, top),
|
|
53
43
|
)
|
|
54
44
|
|
|
55
45
|
|
|
@@ -63,7 +53,7 @@ path_file = Path(__file__).parent / 'sample/samsung.txt'
|
|
|
63
53
|
|
|
64
54
|
with open(path_file, 'r', encoding='utf-8') as txt:
|
|
65
55
|
data = json.load(txt)
|
|
66
|
-
df = pd.DataFrame(data[:
|
|
56
|
+
df = pd.DataFrame(data[:100])
|
|
67
57
|
|
|
68
58
|
C.set_data(df)
|
|
69
59
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: seolpyo-mplchart
|
|
3
|
-
Version: 1.4.1.
|
|
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
|

|
|
52
52
|
|
|
53
|
-
## change Candle shape sample
|
|
53
|
+
## change Candle shape sample(draw Bar Chart)
|
|
54
54
|

|
|
55
55
|
|
|
56
|
-
# 40,000
|
|
56
|
+
# Mass Data Testing (40,000 Stock Price Data Points)
|
|
57
57
|

|
|
58
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/requires.txt
RENAMED
|
File without changes
|
{seolpyo_mplchart-1.4.1.1 → seolpyo_mplchart-1.4.1.3}/seolpyo_mplchart.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|