seolpyo-mplchart 1.1.1__tar.gz → 1.2.0__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.1.1/seolpyo_mplchart.egg-info → seolpyo_mplchart-1.2.0}/PKG-INFO +1 -1
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/pyproject.toml +1 -1
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart/__init__.py +9 -9
- seolpyo_mplchart-1.1.1/seolpyo_mplchart/cursor.py → seolpyo_mplchart-1.2.0/seolpyo_mplchart/_cursor.py +1 -1
- seolpyo_mplchart-1.1.1/seolpyo_mplchart/draw.py → seolpyo_mplchart-1.2.0/seolpyo_mplchart/_draw.py +22 -14
- seolpyo_mplchart-1.1.1/seolpyo_mplchart/slider.py → seolpyo_mplchart-1.2.0/seolpyo_mplchart/_slider.py +6 -3
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0/seolpyo_mplchart.egg-info}/PKG-INFO +1 -1
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart.egg-info/SOURCES.txt +4 -4
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/MANIFEST.in +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/README.md +0 -0
- /seolpyo_mplchart-1.1.1/seolpyo_mplchart/base.py → /seolpyo_mplchart-1.2.0/seolpyo_mplchart/_base.py +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart/test.py +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart/utils.py +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart.egg-info/dependency_links.txt +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart.egg-info/requires.txt +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart.egg-info/top_level.txt +0 -0
- {seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: seolpyo-mplchart
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
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
|
|
@@ -5,9 +5,9 @@ from pathlib import Path
|
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
6
|
import pandas as pd
|
|
7
7
|
|
|
8
|
-
from .
|
|
9
|
-
from .
|
|
10
|
-
from .
|
|
8
|
+
from ._draw import Chart as _BaseChart
|
|
9
|
+
from ._cursor import Chart as _BaseCursorChart, format_candleinfo_ko, format_volumeinfo_ko, format_candleinfo_en, format_volumeinfo_en
|
|
10
|
+
from ._slider import Chart as _BaseSliderChart
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
__all__ = [
|
|
@@ -24,7 +24,7 @@ path_samsung = Path(__file__).parent / 'sample/samsung.txt'
|
|
|
24
24
|
path_apple = Path(__file__).parent / 'sample/apple.txt'
|
|
25
25
|
|
|
26
26
|
def sample(stock: Literal['samsung', 'apple']='samsung', chart: Literal['Chart', 'CursorChart', 'SliderChart']='SliderChart'):
|
|
27
|
-
C:
|
|
27
|
+
C: _BaseSliderChart = {'Chart': _BaseChart, 'CursorChart': _BaseCursorChart, 'SliderChart': _BaseSliderChart}[chart]()
|
|
28
28
|
path_file = path_samsung if stock == 'samsung' else path_apple
|
|
29
29
|
if stock == 'samsung':
|
|
30
30
|
C.format_candleinfo = format_candleinfo_ko
|
|
@@ -68,7 +68,7 @@ def close(fig='all'):
|
|
|
68
68
|
return plt.close(fig)
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
class OnlyChart(
|
|
71
|
+
class OnlyChart(_BaseChart):
|
|
72
72
|
r"""
|
|
73
73
|
You can see the guidance document:
|
|
74
74
|
Korean: https://white.seolpyo.com/entry/147/
|
|
@@ -129,7 +129,7 @@ class OnlyChart(BaseChart):
|
|
|
129
129
|
pass
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
class CursorChart(
|
|
132
|
+
class CursorChart(_BaseCursorChart):
|
|
133
133
|
r"""
|
|
134
134
|
You can see the guidance document:
|
|
135
135
|
Korean: https://white.seolpyo.com/entry/147/
|
|
@@ -201,7 +201,7 @@ class CursorChart(BaseCursorChart):
|
|
|
201
201
|
pass
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
class SliderChart(
|
|
204
|
+
class SliderChart(_BaseSliderChart):
|
|
205
205
|
r"""
|
|
206
206
|
You can see the guidance document:
|
|
207
207
|
Korean: https://white.seolpyo.com/entry/147/
|
|
@@ -272,7 +272,7 @@ class SliderChart(BaseSliderChart):
|
|
|
272
272
|
min_distance: Minimum number of candles that can be selected with the slider. default 30
|
|
273
273
|
limit_candle: Maximum number of candles to draw. default 800
|
|
274
274
|
limit_wick: Maximum number of candle wicks to draw. default 4,000
|
|
275
|
-
limit_volume: Maximum number of volume bars to draw. default
|
|
275
|
+
limit_volume: Maximum number of volume bars to draw. default 200. Applies only to drawing candle wicks or price line.
|
|
276
276
|
limit_ma: If the number of displayed data is more than this, the price moving average line is not drawn. default 8,000
|
|
277
277
|
|
|
278
278
|
color_navigator_line: Navigator divider color. default '#1e78ff'
|
|
@@ -303,7 +303,7 @@ def set_theme(chart: OnlyChart|CursorChart|SliderChart, theme: Literal['light',
|
|
|
303
303
|
chart.color_box = 'w'
|
|
304
304
|
chart.textboxKwargs = {'facecolor': 'k', 'edgecolor': 'w'}
|
|
305
305
|
chart.textKwargs = {'color': 'w'}
|
|
306
|
-
chart.color_navigator_cover, chart.color_navigator_line = ('w', '#
|
|
306
|
+
chart.color_navigator_cover, chart.color_navigator_line = ('w', '#FF2400')
|
|
307
307
|
|
|
308
308
|
if initialized:
|
|
309
309
|
chart.change_background_color('k')
|
seolpyo_mplchart-1.1.1/seolpyo_mplchart/draw.py → seolpyo_mplchart-1.2.0/seolpyo_mplchart/_draw.py
RENAMED
|
@@ -6,7 +6,7 @@ import numpy as np
|
|
|
6
6
|
import pandas as pd
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
from .
|
|
9
|
+
from ._base import Base
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Mixin:
|
|
@@ -182,7 +182,7 @@ class SegmentMixin(DataMixin):
|
|
|
182
182
|
|
|
183
183
|
limit_candle = 800
|
|
184
184
|
limit_wick = 4_000
|
|
185
|
-
limit_volume =
|
|
185
|
+
limit_volume = 200
|
|
186
186
|
|
|
187
187
|
color_priceline = 'k'
|
|
188
188
|
format_ma = '{}일선'
|
|
@@ -348,15 +348,19 @@ class SegmentMixin(DataMixin):
|
|
|
348
348
|
self.collection_candle.set_edgecolor(self.edgecolor_candle[index_start:index_end])
|
|
349
349
|
|
|
350
350
|
if self.volume:
|
|
351
|
-
|
|
351
|
+
seg_volume = self.segment_volume_wick[index_start:index_end]
|
|
352
|
+
seg_facecolor_volume = self.facecolor_volume[index_start:index_end]
|
|
353
|
+
seg_edgecolor_volume = self.edgecolor_volume[index_start:index_end]
|
|
352
354
|
if simpler:
|
|
353
|
-
values =
|
|
355
|
+
values = seg_volume[:, 1, 1]
|
|
354
356
|
top_index = np.argsort(-values)[:self.limit_volume]
|
|
355
|
-
|
|
356
|
-
|
|
357
|
+
seg_volume = seg_volume[top_index]
|
|
358
|
+
seg_facecolor_volume = seg_facecolor_volume[top_index]
|
|
359
|
+
seg_edgecolor_volume = seg_edgecolor_volume[top_index]
|
|
360
|
+
self.collection_volume.set_segments(seg_volume)
|
|
357
361
|
self.collection_volume.set_linewidth(1.3)
|
|
358
|
-
self.collection_volume.set_facecolor(
|
|
359
|
-
self.collection_volume.set_edgecolor(
|
|
362
|
+
self.collection_volume.set_facecolor(seg_facecolor_volume)
|
|
363
|
+
self.collection_volume.set_edgecolor(seg_edgecolor_volume)
|
|
360
364
|
|
|
361
365
|
self.collection_ma.set_segments(self.segment_ma[:, index_start:index_end])
|
|
362
366
|
self.collection_ma.set_edgecolor(self.edgecolor_ma)
|
|
@@ -368,15 +372,19 @@ class SegmentMixin(DataMixin):
|
|
|
368
372
|
self.collection_candle.set_edgecolor(self.color_priceline)
|
|
369
373
|
|
|
370
374
|
if self.volume:
|
|
371
|
-
|
|
375
|
+
seg_volume = self.segment_volume_wick[index_start:index_end]
|
|
376
|
+
seg_facecolor_volume = self.facecolor_volume[index_start:index_end]
|
|
377
|
+
seg_edgecolor_volume = self.edgecolor_volume[index_start:index_end]
|
|
372
378
|
if simpler:
|
|
373
|
-
values =
|
|
379
|
+
values = seg_volume[:, 1, 1]
|
|
374
380
|
top_index = np.argsort(-values)[:self.limit_volume]
|
|
375
|
-
|
|
376
|
-
|
|
381
|
+
seg_volume = seg_volume[top_index]
|
|
382
|
+
seg_facecolor_volume = seg_facecolor_volume[top_index]
|
|
383
|
+
seg_edgecolor_volume = seg_edgecolor_volume[top_index]
|
|
384
|
+
self.collection_volume.set_segments(seg_volume)
|
|
377
385
|
self.collection_volume.set_linewidth(1.3)
|
|
378
|
-
self.collection_volume.set_facecolor(
|
|
379
|
-
self.collection_volume.set_edgecolor(
|
|
386
|
+
self.collection_volume.set_facecolor(seg_facecolor_volume)
|
|
387
|
+
self.collection_volume.set_edgecolor(seg_edgecolor_volume)
|
|
380
388
|
|
|
381
389
|
if not set_ma: self.collection_ma.set_segments([])
|
|
382
390
|
else:
|
|
@@ -5,8 +5,8 @@ from matplotlib.text import Text
|
|
|
5
5
|
from matplotlib.backend_bases import MouseEvent, MouseButton, cursors
|
|
6
6
|
import pandas as pd
|
|
7
7
|
|
|
8
|
-
from .
|
|
9
|
-
from .
|
|
8
|
+
from ._base import convert_unit
|
|
9
|
+
from ._cursor import BaseMixin as BM, Mixin as M
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class Mixin(M):
|
|
@@ -163,6 +163,7 @@ class CollectionMixin(PlotMixin):
|
|
|
163
163
|
super().change_line_color(color)
|
|
164
164
|
|
|
165
165
|
self.text_slider.get_bbox_patch().set_edgecolor(color)
|
|
166
|
+
self.slider_vline.set_edgecolor(color)
|
|
166
167
|
return
|
|
167
168
|
|
|
168
169
|
|
|
@@ -239,7 +240,9 @@ class DataMixin(NavigatorMixin):
|
|
|
239
240
|
|
|
240
241
|
def get_default_lim(self):
|
|
241
242
|
xmax = self.list_index[-1]
|
|
242
|
-
|
|
243
|
+
xmin = xmax - 120
|
|
244
|
+
if xmin < 0: xmin = 0
|
|
245
|
+
return (xmin, xmax)
|
|
243
246
|
|
|
244
247
|
|
|
245
248
|
class BackgroundMixin(DataMixin):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: seolpyo-mplchart
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
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
|
|
@@ -2,10 +2,10 @@ MANIFEST.in
|
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
4
|
seolpyo_mplchart/__init__.py
|
|
5
|
-
seolpyo_mplchart/
|
|
6
|
-
seolpyo_mplchart/
|
|
7
|
-
seolpyo_mplchart/
|
|
8
|
-
seolpyo_mplchart/
|
|
5
|
+
seolpyo_mplchart/_base.py
|
|
6
|
+
seolpyo_mplchart/_cursor.py
|
|
7
|
+
seolpyo_mplchart/_draw.py
|
|
8
|
+
seolpyo_mplchart/_slider.py
|
|
9
9
|
seolpyo_mplchart/test.py
|
|
10
10
|
seolpyo_mplchart/utils.py
|
|
11
11
|
seolpyo_mplchart.egg-info/PKG-INFO
|
|
File without changes
|
|
File without changes
|
/seolpyo_mplchart-1.1.1/seolpyo_mplchart/base.py → /seolpyo_mplchart-1.2.0/seolpyo_mplchart/_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{seolpyo_mplchart-1.1.1 → seolpyo_mplchart-1.2.0}/seolpyo_mplchart.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|