seolpyo-mplchart 2.1.0__py3-none-any.whl → 2.1.0.4__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.
@@ -116,6 +116,7 @@ class VolumeMixin(Base):
116
116
  self.collection_volume.set_edgecolor(seg_edgecolor_volume)
117
117
  return
118
118
 
119
+
119
120
  class CandleMixin(Base):
120
121
  def _set_candle_collection_segments(self, ind_start, ind_end):
121
122
  # print(f'{self.edgecolor_candle[ind_start:ind_end]=}')
@@ -131,7 +132,7 @@ class CandleMixin(Base):
131
132
  self.collection_candle.set_segments(self.segment_candle_wick[ind_start:ind_end])
132
133
  self.collection_candle.set_facecolor([])
133
134
  self.collection_candle.set_edgecolor(self.edgecolor_candle[ind_start:ind_end])
134
- self.collection_candle.set_linewidth(1.5)
135
+ self.collection_candle.set_linewidth(self.CONFIG.CANDLE.linewidth * 2)
135
136
  self.collection_candle.set_antialiased(False)
136
137
  return
137
138
 
@@ -4,7 +4,6 @@ from matplotlib.text import Text
4
4
  from ..base.a_canvas import Figure
5
5
 
6
6
 
7
-
8
7
  class Base:
9
8
  figure: Figure
10
9
  ax_price: Axes
@@ -2,6 +2,7 @@ import pandas as pd
2
2
 
3
3
  from ..._config import ConfigData
4
4
 
5
+
5
6
  class Base:
6
7
  CONFIG: ConfigData
7
8
 
@@ -1,6 +1,7 @@
1
1
 
2
2
 
3
3
  class Grid:
4
+ "https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.grid.html"
4
5
  def __init__(self):
5
6
  self.visible = True
6
7
  self.linewidth = 0.7
@@ -12,6 +13,7 @@ class Grid:
12
13
  GRID = Grid()
13
14
 
14
15
  class TickData:
16
+ "https://matplotlib.org/stable/api/ticker_api.html"
15
17
  def __init__(self):
16
18
  self.edgecolor: str|tuple[float, float, float, float] = 'k'
17
19
  self.fontcolor: str|tuple[float, float, float, float] = 'k'
@@ -22,7 +22,7 @@ CANDLEEDGECOLOR = CandleEdgeColorData()
22
22
  class CandleData:
23
23
  def __init__(self):
24
24
  self.half_width = 0.24
25
- self.linewidth = 0.8
25
+ self.linewidth = 0.4
26
26
  self.line_color: str|tuple[float, float, float, float] = 'k'
27
27
  self.FACECOLOR = CANDLEFACECOLOR
28
28
  self.EDGECOLOR = CANDLEEDGECOLOR
@@ -1,6 +1,7 @@
1
1
 
2
2
 
3
3
  class CrossLineData:
4
+ "https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html"
4
5
  def __init__(self):
5
6
  self.edgecolor = 'k'
6
7
  self.linewidth = 1
@@ -9,6 +10,7 @@ class CrossLineData:
9
10
  CROSSLINE = CrossLineData()
10
11
 
11
12
  class BBoxData:
13
+ "https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.FancyBboxPatch.html#matplotlib.patches.FancyBboxPatch"
12
14
  def __init__(self):
13
15
  self.boxstyle = 'round'
14
16
  self.facecolor = 'w'
@@ -17,6 +19,7 @@ class BBoxData:
17
19
  BBOX = BBoxData()
18
20
 
19
21
  class Text:
22
+ "https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html"
20
23
  def __init__(self):
21
24
  self.color = 'k'
22
25
  self.BBOX = BBOX
@@ -33,6 +36,7 @@ class Text:
33
36
  TEXT = Text()
34
37
 
35
38
  class Box:
39
+ "https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html"
36
40
  def __init__(self):
37
41
  self.edgecolor = 'k'
38
42
  self.linewidth = 1.2
@@ -16,6 +16,7 @@ class WatermarkData:
16
16
  WATERMARK = WatermarkData()
17
17
 
18
18
  class AdjustData:
19
+ "https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplots_adjust.html"
19
20
  def __init__(self):
20
21
  # 여백
21
22
  self.top = 0.98
@@ -0,0 +1,67 @@
1
+
2
+
3
+ def convert_num(num):
4
+ if isinstance(num, float) and num % 1:
5
+ return num
6
+ return int(num)
7
+
8
+
9
+ def float_to_str(num: float, *, digit=0, plus=False):
10
+ if 0 < digit:
11
+ num.__round__(digit)
12
+ text = f'{num:+,.{digit}f}' if plus else f'{num:,.{digit}f}'
13
+ else:
14
+ num = round(num, digit).__int__()
15
+ text = f'{num:+,}' if plus else f'{num:,}'
16
+ return text
17
+
18
+
19
+ data_unit_ko = {
20
+ '경': 10_000_000_000_000_000,
21
+ '조': 1_000_000_000_000,
22
+ '억': 100_000_000,
23
+ '만': 10_000,
24
+ }
25
+ def convert_unit(value, *, digit=0, word='원', unit_data: dict[str, int]=None):
26
+ if not unit_data:
27
+ unit_data = data_unit_ko
28
+ # print('ko')
29
+ # print(f'{value=:,}')
30
+ v = abs(value)
31
+ for unit, n in unit_data.items():
32
+ if n <= v:
33
+ # print(f'{n=:,}')
34
+ # print(f'{unit=}')
35
+ num = value / n
36
+ if word.startswith(' '):
37
+ return f'{float_to_str(num, digit=digit)}{unit}{word}'
38
+ return f'{float_to_str(num, digit=digit)}{unit} {word}'
39
+
40
+ if not value % 1:
41
+ value = int(value)
42
+ text = f'{float_to_str(value, digit=digit)}{word}'
43
+ # print(f'{text=}')
44
+ return text
45
+
46
+ data_unit_en = {
47
+ 'Qd': 1_000_000_000_000_000,
48
+ 'T': 1_000_000_000_000,
49
+ 'B': 1_000_000_000,
50
+ 'M': 1_000_000,
51
+ 'K': 1_000,
52
+ }
53
+ def convert_unit_en(value, *, digit=0, word='$', unit_data: dict[str, int]=None):
54
+ if not unit_data:
55
+ unit_data = data_unit_en
56
+ # print('en')
57
+ # print(f'{value=:,}')
58
+ return convert_unit(value, digit=digit, word=word, unit_data=unit_data)
59
+
60
+
61
+ if __name__ == '__main__':
62
+ a = 456.123
63
+ print(float_to_str(a))
64
+ print(float_to_str(a, 2))
65
+ print(float_to_str(a, 6))
66
+
67
+
@@ -1,4 +1,4 @@
1
- from .utils import convert_unit, convert_unit_en
1
+ from .nums import convert_unit, convert_unit_en
2
2
 
3
3
 
4
4
  class UnitData:
@@ -1,67 +1 @@
1
-
2
-
3
- def convert_num(num):
4
- if isinstance(num, float) and num % 1:
5
- return num
6
- return int(num)
7
-
8
-
9
- def float_to_str(num: float, *, digit=0, plus=False):
10
- if 0 < digit:
11
- num.__round__(digit)
12
- text = f'{num:+,.{digit}f}' if plus else f'{num:,.{digit}f}'
13
- else:
14
- num = round(num, digit).__int__()
15
- text = f'{num:+,}' if plus else f'{num:,}'
16
- return text
17
-
18
-
19
- data_unit_ko = {
20
- '경': 10_000_000_000_000_000,
21
- '조': 1_000_000_000_000,
22
- '억': 100_000_000,
23
- '만': 10_000,
24
- }
25
- def convert_unit(value, *, digit=0, word='원', unit_data: dict[str, int]=None):
26
- if not unit_data:
27
- unit_data = data_unit_ko
28
- # print('ko')
29
- # print(f'{value=:,}')
30
- v = abs(value)
31
- for unit, n in unit_data.items():
32
- if n <= v:
33
- # print(f'{n=:,}')
34
- # print(f'{unit=}')
35
- num = value / n
36
- if word.startswith(' '):
37
- return f'{float_to_str(num, digit=digit)}{unit}{word}'
38
- return f'{float_to_str(num, digit=digit)}{unit} {word}'
39
-
40
- if not value % 1:
41
- value = int(value)
42
- text = f'{float_to_str(value, digit=digit)}{word}'
43
- # print(f'{text=}')
44
- return text
45
-
46
- data_unit_en = {
47
- 'Qd': 1_000_000_000_000_000,
48
- 'T': 1_000_000_000_000,
49
- 'B': 1_000_000_000,
50
- 'M': 1_000_000,
51
- 'K': 1_000,
52
- }
53
- def convert_unit_en(value, *, digit=0, word='$', unit_data: dict[str, int]=None):
54
- if not unit_data:
55
- unit_data = data_unit_en
56
- # print('en')
57
- # print(f'{value=:,}')
58
- return convert_unit(value, digit=digit, word=word, unit_data=unit_data)
59
-
60
-
61
- if __name__ == '__main__':
62
- a = 456.123
63
- print(float_to_str(a))
64
- print(float_to_str(a, 2))
65
- print(float_to_str(a, 6))
66
-
67
-
1
+ from .._config.nums import *
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seolpyo-mplchart
3
- Version: 2.1.0
3
+ Version: 2.1.0.4
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
7
7
  Project-URL: Homepage, https://white.seolpyo.com/
8
- Project-URL: Documentation(English), https://white.seolpyo.com/entry/148/
8
+ Project-URL: Documentation(English), https://github.com/white-seolpyo/seolpyo-mplchart/tree/main
9
9
  Project-URL: Documentation(한글), https://white.seolpyo.com/entry/147/
10
10
  Project-URL: repository, https://github.com/white-seolpyo/seolpyo-mplchart
11
11
  Project-URL: Issues, https://github.com/white-seolpyo/seolpyo-mplchart/issues
@@ -32,7 +32,7 @@ Ethereum: 0x1c5fb8a5e0b1153cd4116c91736bd16fabf83520
32
32
 
33
33
 
34
34
  # Document
35
- [English Document](https://github.com/white-seolpyo/seolpyo-mplchart/tree/maind)
35
+ [English Document](https://github.com/white-seolpyo/seolpyo-mplchart/tree/main)
36
36
 
37
37
  [한글 설명서](https://white.seolpyo.com/entry/147/?from=pypi)
38
38
 
@@ -32,7 +32,7 @@ seolpyo_mplchart/_chart/base/a_canvas.py,sha256=1TQ_Znsi7dOA-4MttvuWksLjU3FpaPgj
32
32
  seolpyo_mplchart/_chart/base/b_artist.py,sha256=LcRc3jlXjWOFgkpnnFw-lfGhOcmEKq0Dz9IqcGvAmTY,4976
33
33
  seolpyo_mplchart/_chart/base/c_draw.py,sha256=B_bWn0KmQBkwIejulDNpxtOrjz7vZ4i3oAwQUEc6V-0,2533
34
34
  seolpyo_mplchart/_chart/base/d_segment.py,sha256=2RhZCBi5dgFjeUpBjHrjx4qwip9JFLp4sPQ7iKD4Dn4,9220
35
- seolpyo_mplchart/_chart/base/e_axis.py,sha256=j4fPa_UGBr5fpfef2IuyLvPT7Su9lS3WPmRmH63ZtJA,9714
35
+ seolpyo_mplchart/_chart/base/e_axis.py,sha256=nfp31Pk02EsLNOwlSRWBykqgDFDF1AQnLg4PI1nUK0M,9745
36
36
  seolpyo_mplchart/_chart/base/f_background.py,sha256=dsyvI6oYwib6TuG1_tbGzRE2E0rKWMXTEcJSRVE4apg,1509
37
37
  seolpyo_mplchart/_chart/base/g_event.py,sha256=rgYaHVicdMZZpVp5RIDZh0Xe6A2rm34erl_J30PK6nw,1795
38
38
  seolpyo_mplchart/_chart/base/h_data.py,sha256=1SI031vol37rGSVK0nnpSx3N5cPi3NU1BqP4E3ymUzE,4379
@@ -41,9 +41,9 @@ seolpyo_mplchart/_chart/cursor/__init__.py,sha256=VbjJBckQHc243aLmIWgzJ_0lTXPg8E
41
41
  seolpyo_mplchart/_chart/cursor/b_artist.py,sha256=jNIQ3ic9nA4NhSm-a1kmmLc8SgI4B-fmwZrtEBMn63M,3921
42
42
  seolpyo_mplchart/_chart/cursor/c_draw.py,sha256=oc3ppUhnMLqvweYfzNPs8DYV2rmKJbH4haid1CVFhCY,2320
43
43
  seolpyo_mplchart/_chart/cursor/d_segment.py,sha256=UWkTtrG1ovq-QiGkzmyUGTALQOv9kEmVVd-KgRNwWEE,12350
44
- seolpyo_mplchart/_chart/cursor/e_axis.py,sha256=qzsqYZy_mjo5T4ojQo87nSgQqoHIyUReAJRME7ChbZc,1428
44
+ seolpyo_mplchart/_chart/cursor/e_axis.py,sha256=D_fL8Xqx90yQx9uMiErlpKyUjkc0u6dRAncP6dlqX7A,1426
45
45
  seolpyo_mplchart/_chart/cursor/g_event.py,sha256=ZhYLsO64QhSUYZoXdPDdsTiWviGFdLigEsBju4rdp4A,6493
46
- seolpyo_mplchart/_chart/cursor/h_data.py,sha256=J89eWOnDkkcvFo_sDjVEjhjUjXVobyOyGu6N5RWQXUs,2424
46
+ seolpyo_mplchart/_chart/cursor/h_data.py,sha256=Gq7V9P2MF7FVS_Lgi4oEZ1aWHkqeHE0fqCZZaH4ROgs,2426
47
47
  seolpyo_mplchart/_chart/cursor/test.py,sha256=55-zz_5s6RakB87-cnYCN1JXX8wJok9QEzqVz1fwp0g,1873
48
48
  seolpyo_mplchart/_chart/slider/__init__.py,sha256=KtdIDFZ1jOJF4n4fuwlGJcD0js9wzCg9pOgI5sn5WJ0,3628
49
49
  seolpyo_mplchart/_chart/slider/a_canvas.py,sha256=BoHNK_DY1rxrrBhp2ugFl2MU7wzApLhV1824kswDwPM,8980
@@ -56,14 +56,15 @@ seolpyo_mplchart/_chart/slider/g_event.py,sha256=ozz0SmnPrd443iOd6Yz5UJYTUPJhPys
56
56
  seolpyo_mplchart/_chart/slider/h_data.py,sha256=nUBFMxquSYNr4djNygAZyshwbpKTTh1PosJGocmkPWE,2795
57
57
  seolpyo_mplchart/_chart/slider/test.py,sha256=dYSeCxaVkNSXhLPadQIYeWKVOnjQM9vjBQsCrIk8ecU,1973
58
58
  seolpyo_mplchart/_config/__init__.py,sha256=SDca-jQApd0JjBYav-Ymnvvmpw8RgueERtvCMg7bIL8,136
59
- seolpyo_mplchart/_config/ax.py,sha256=2tEMuoIp9oKKkVoSfUjLF4moVIGpkJCsiyGNqRji-qo,668
60
- seolpyo_mplchart/_config/candle.py,sha256=jalt_rixg_DS0GGFEaWuYYFsVGmkzlpNVswxYqIOUg4,1139
59
+ seolpyo_mplchart/_config/ax.py,sha256=P_tnFYT22LJKl_G-J2by08Z-jR0z-nz_mwLA-0K-Cyc,802
60
+ seolpyo_mplchart/_config/candle.py,sha256=ZjY2JU8wLtRTRG8LdMUsq6AIpZq6eDb_gPMnvRJjfzQ,1139
61
61
  seolpyo_mplchart/_config/config.py,sha256=WtNurQWhwp-WzY00s04DMFOfVs6NHsgM90izELPJ_yk,565
62
- seolpyo_mplchart/_config/cursor.py,sha256=T2UUiSwS8SZN1IjXUai0B0kDNSOcg1AmnqF_SceJRXY,937
63
- seolpyo_mplchart/_config/figure.py,sha256=M1pGX3iJ52_S5gKKe5TXhOvchCxT40Pa88hE6TcJ4m0,826
62
+ seolpyo_mplchart/_config/cursor.py,sha256=ZQQj3E190xAWF028nTBuRNEA5_vbdl9kLqdjOPu-078,1304
63
+ seolpyo_mplchart/_config/figure.py,sha256=sN63TqnwwV3JaTD2MCHmtynw0ZSSvEsDHe7Tn5bbWLs,914
64
64
  seolpyo_mplchart/_config/format.py,sha256=Vq3DnuxDTCCUyC1Bt6asQ1PU8qbJCVrjc88OMYnw0_A,1003
65
65
  seolpyo_mplchart/_config/ma.py,sha256=aaJ8vh2rGM4MomOl5NBBcGZt29ma--uXx2nYiR6axGQ,508
66
- seolpyo_mplchart/_config/unit.py,sha256=9zOOVu1QVQMUN7OdMI-EEHMQRBIYUepOxmb0d_4-2Kc,387
66
+ seolpyo_mplchart/_config/nums.py,sha256=FUkJSWM2RjSdyTzO3QERotkBlgKTcbwG5Kpg-smyWjE,1871
67
+ seolpyo_mplchart/_config/unit.py,sha256=d5YImbG0EdtLTFBZ7kl3vuRj4KljnZalPWNctY5h3yc,386
67
68
  seolpyo_mplchart/_config/utils.py,sha256=hPpHwVab7_FHh4H1RWdx9Pz8TxPVvbAxfBesfGB9ckA,1851
68
69
  seolpyo_mplchart/_config/volume.py,sha256=NHwo53HrGF9V3vLakIFZiRWy2vIAz4wEmJ4F2upL5oo,837
69
70
  seolpyo_mplchart/_config/slider/__init__.py,sha256=kzkIMNQguZIRXgPbLmuyrShoGSC7CD4lkvu4EHQv7N8,71
@@ -71,7 +72,7 @@ seolpyo_mplchart/_config/slider/config.py,sha256=sm6o_cHMBKITXfyXWmM_IPHf0AUcuhB
71
72
  seolpyo_mplchart/_config/slider/figure.py,sha256=qwDzQU0CN_GDyFqa9ikd97AepA8V6RGUzGRnWOmsBaw,363
72
73
  seolpyo_mplchart/_config/slider/nav.py,sha256=Qlar209yjdEUxzewDR_mdrNq5SsKXSfwsduLxqkgaRI,159
73
74
  seolpyo_mplchart/_utils/__init__.py,sha256=0eUbo75GJLePAefed__UiK5pWAEDVWbJDy3mIMdFVe4,260
74
- seolpyo_mplchart/_utils/nums.py,sha256=FUkJSWM2RjSdyTzO3QERotkBlgKTcbwG5Kpg-smyWjE,1871
75
+ seolpyo_mplchart/_utils/nums.py,sha256=3u_9WDs4Sg8e3D87BNcWykdxELRU_oikDrZbj9grjo4,28
75
76
  seolpyo_mplchart/_utils/utils.py,sha256=JOdJY__3mHTzMV2DCmlJHa8P2jsc3QK_0xbJ1CcIPao,632
76
77
  seolpyo_mplchart/_utils/theme/__init__.py,sha256=T9Z75r4gBj00ZMLwtaF8Q5unxLqYNgP2Kchlx8lMYrE,368
77
78
  seolpyo_mplchart/_utils/theme/dark.py,sha256=gvZSrYpTI6MmDg6lvFpUWVghyPP8Vuw4KNyHuqc0_sU,1751
@@ -83,7 +84,7 @@ seolpyo_mplchart/data/apple.txt,sha256=0izAfweu1lLsC0IwVthdVlo9reG8KGbKGTSX5knI5
83
84
  seolpyo_mplchart/data/samsung.txt,sha256=UejaSkbzr4E5K3lkelCT0yJiWUPfmViBEaTyoXyphIs,2476424
84
85
  seolpyo_mplchart/sample/apple.txt,sha256=vCN3oilzXZG8VQ39LYBMG1BKhwcv0ZFC1IUptJANJRA,110438
85
86
  seolpyo_mplchart/sample/samsung.txt,sha256=LIL30O0mk9Zcmd_7vQwP8FvoAMi_ttKTJZ7wXWMC-Lw,105228
86
- seolpyo_mplchart-2.1.0.dist-info/METADATA,sha256=F0lVEwme9B8OaVlbj2q5yLHPyvnHq-hUdoAtt7p6EMI,22343
87
- seolpyo_mplchart-2.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
88
- seolpyo_mplchart-2.1.0.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
89
- seolpyo_mplchart-2.1.0.dist-info/RECORD,,
87
+ seolpyo_mplchart-2.1.0.4.dist-info/METADATA,sha256=_DIEcXaW4MQdA3vyxPUiBKOQE1ghEom3VTES6XsOK4o,22367
88
+ seolpyo_mplchart-2.1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
89
+ seolpyo_mplchart-2.1.0.4.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
90
+ seolpyo_mplchart-2.1.0.4.dist-info/RECORD,,