MatplotLibAPI 3.2.1__py3-none-any.whl → 3.2.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.
- MatplotLibAPI/Bubble.py +55 -14
- MatplotLibAPI/Composite.py +12 -9
- MatplotLibAPI/Network.py +2 -2
- MatplotLibAPI/Table.py +29 -4
- MatplotLibAPI/Timeserie.py +58 -27
- MatplotLibAPI/Treemap.py +1 -1
- MatplotLibAPI/__init__.py +152 -76
- {MatplotLibAPI-3.2.1.dist-info → MatplotLibAPI-3.2.3.dist-info}/METADATA +1 -1
- MatplotLibAPI-3.2.3.dist-info/RECORD +14 -0
- MatplotLibAPI-3.2.1.dist-info/RECORD +0 -14
- {MatplotLibAPI-3.2.1.dist-info → MatplotLibAPI-3.2.3.dist-info}/LICENSE +0 -0
- {MatplotLibAPI-3.2.1.dist-info → MatplotLibAPI-3.2.3.dist-info}/WHEEL +0 -0
- {MatplotLibAPI-3.2.1.dist-info → MatplotLibAPI-3.2.3.dist-info}/top_level.txt +0 -0
MatplotLibAPI/Bubble.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# Hint for Visual Code Python Interactive window
|
|
2
2
|
# %%
|
|
3
|
-
from typing import Optional
|
|
3
|
+
from typing import Optional, Tuple
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
6
|
from matplotlib.axes import Axes
|
|
7
|
+
from matplotlib.figure import Figure
|
|
7
8
|
import seaborn as sns
|
|
8
9
|
|
|
9
|
-
from .StyleTemplate import DynamicFuncFormatter, StyleTemplate, generate_ticks, string_formatter, bmk_formatter, percent_formatter, format_func,validate_dataframe
|
|
10
|
+
from .StyleTemplate import DynamicFuncFormatter, StyleTemplate, generate_ticks, string_formatter, bmk_formatter, percent_formatter, format_func, validate_dataframe
|
|
10
11
|
|
|
11
12
|
BUBBLE_STYLE_TEMPLATE = StyleTemplate(
|
|
12
13
|
format_funcs={"label": string_formatter,
|
|
@@ -18,7 +19,7 @@ BUBBLE_STYLE_TEMPLATE = StyleTemplate(
|
|
|
18
19
|
)
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
def
|
|
22
|
+
def aplot_bubble(
|
|
22
23
|
pd_df: pd.DataFrame,
|
|
23
24
|
label: str,
|
|
24
25
|
x: str,
|
|
@@ -30,6 +31,8 @@ def plot_bubble(
|
|
|
30
31
|
center_to_mean: bool = False,
|
|
31
32
|
sort_by: Optional[str] = None,
|
|
32
33
|
ascending: bool = False,
|
|
34
|
+
hline=False,
|
|
35
|
+
vline=False,
|
|
33
36
|
ax: Optional[Axes] = None):
|
|
34
37
|
|
|
35
38
|
validate_dataframe(pd_df, cols=[label, x, y, z], sort_by=sort_by)
|
|
@@ -92,17 +95,18 @@ def plot_bubble(
|
|
|
92
95
|
which='major',
|
|
93
96
|
colors=style.font_color,
|
|
94
97
|
labelsize=style.font_size)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
if vline:
|
|
99
|
+
ax.vlines(x=x_mean,
|
|
100
|
+
ymin=y_min,
|
|
101
|
+
ymax=y_max,
|
|
102
|
+
linestyle='--',
|
|
103
|
+
colors=style.font_color)
|
|
104
|
+
if hline:
|
|
105
|
+
ax.hlines(y=y_mean,
|
|
106
|
+
xmin=x_min,
|
|
107
|
+
xmax=x_max,
|
|
108
|
+
linestyle='--',
|
|
109
|
+
colors=style.font_color)
|
|
106
110
|
|
|
107
111
|
for index, row in plot_df.iterrows():
|
|
108
112
|
x_value = row[x]
|
|
@@ -121,4 +125,41 @@ def plot_bubble(
|
|
|
121
125
|
return ax
|
|
122
126
|
|
|
123
127
|
|
|
128
|
+
def fplot_bubble(
|
|
129
|
+
pd_df: pd.DataFrame,
|
|
130
|
+
label: str,
|
|
131
|
+
x: str,
|
|
132
|
+
y: str,
|
|
133
|
+
z: str,
|
|
134
|
+
title: Optional[str] = "Test",
|
|
135
|
+
style: StyleTemplate = BUBBLE_STYLE_TEMPLATE,
|
|
136
|
+
max_values: int = BUBBLE_STYLE_TEMPLATE,
|
|
137
|
+
center_to_mean: bool = False,
|
|
138
|
+
sort_by: Optional[str] = None,
|
|
139
|
+
ascending: bool = False,
|
|
140
|
+
hline=False,
|
|
141
|
+
vline=False,
|
|
142
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Figure:
|
|
143
|
+
|
|
144
|
+
fig = plt.figure(figsize=figsize)
|
|
145
|
+
fig.patch.set_facecolor(style.background_color)
|
|
146
|
+
ax = fig.add_subplot()
|
|
147
|
+
ax = aplot_bubble(pd_df=pd_df,
|
|
148
|
+
label=label,
|
|
149
|
+
x=x,
|
|
150
|
+
y=y,
|
|
151
|
+
z=z,
|
|
152
|
+
title=title,
|
|
153
|
+
style=style,
|
|
154
|
+
max_values=max_values,
|
|
155
|
+
center_to_mean=center_to_mean,
|
|
156
|
+
sort_by=sort_by,
|
|
157
|
+
ascending=ascending,
|
|
158
|
+
hline=hline,
|
|
159
|
+
vline=vline,
|
|
160
|
+
ax=ax)
|
|
161
|
+
return fig
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
124
165
|
# endregion
|
MatplotLibAPI/Composite.py
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# Hint for Visual Code Python Interactive window
|
|
2
2
|
# %%
|
|
3
|
-
from typing import Optional, Tuple
|
|
3
|
+
from typing import Optional, Tuple,List,Union, Dict
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
|
+
from matplotlib.pyplot import GridSpec
|
|
6
7
|
from matplotlib.figure import Figure
|
|
8
|
+
from matplotlib.axes import Axes
|
|
7
9
|
|
|
8
|
-
from .
|
|
9
|
-
from .
|
|
10
|
-
from .Table import plot_table
|
|
10
|
+
from .Bubble import aplot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
11
|
+
from .Table import aplot_table
|
|
11
12
|
from .StyleTemplate import StyleTemplate, format_func, validate_dataframe
|
|
12
13
|
|
|
13
14
|
|
|
15
|
+
|
|
14
16
|
def plot_composite_bubble(
|
|
15
17
|
pd_df: pd.DataFrame,
|
|
16
18
|
label: str,
|
|
@@ -38,10 +40,10 @@ def plot_composite_bubble(
|
|
|
38
40
|
style.format_funcs = format_func(
|
|
39
41
|
style.format_funcs, label=label, x=x, y=y, z=z)
|
|
40
42
|
fig = plt.figure(figsize=figsize)
|
|
41
|
-
fig.patch.set_facecolor(
|
|
43
|
+
fig.patch.set_facecolor(style.background_color)
|
|
42
44
|
grid = plt.GridSpec(2, 2, height_ratios=[2, 1], width_ratios=[1, 1])
|
|
43
45
|
ax = fig.add_subplot(grid[0, 0:])
|
|
44
|
-
ax =
|
|
46
|
+
ax = aplot_bubble(pd_df=plot_df,
|
|
45
47
|
label=label,
|
|
46
48
|
x=x,
|
|
47
49
|
y=y,
|
|
@@ -64,7 +66,7 @@ def plot_composite_bubble(
|
|
|
64
66
|
style.format_funcs[z] = style.format_funcs["z"]
|
|
65
67
|
|
|
66
68
|
ax2 = fig.add_subplot(grid[1, 0])
|
|
67
|
-
ax2 =
|
|
69
|
+
ax2 = aplot_table(
|
|
68
70
|
pd_df=plot_df,
|
|
69
71
|
cols=[label, z, y, x],
|
|
70
72
|
title=f"Top {table_rows}",
|
|
@@ -75,10 +77,10 @@ def plot_composite_bubble(
|
|
|
75
77
|
style=style
|
|
76
78
|
)
|
|
77
79
|
ax3 = fig.add_subplot(grid[1, 1])
|
|
78
|
-
ax3 =
|
|
80
|
+
ax3 = aplot_table(
|
|
79
81
|
pd_df=plot_df,
|
|
80
82
|
cols=[label, z, y, x],
|
|
81
|
-
title=f"
|
|
83
|
+
title=f"Last {table_rows}",
|
|
82
84
|
ax=ax3,
|
|
83
85
|
sort_by=sort_by,
|
|
84
86
|
ascending=True,
|
|
@@ -87,3 +89,4 @@ def plot_composite_bubble(
|
|
|
87
89
|
)
|
|
88
90
|
fig.tight_layout()
|
|
89
91
|
return fig
|
|
92
|
+
|
MatplotLibAPI/Network.py
CHANGED
|
@@ -327,7 +327,7 @@ class Graph(nx.Graph):
|
|
|
327
327
|
return Graph(G)
|
|
328
328
|
|
|
329
329
|
|
|
330
|
-
def
|
|
330
|
+
def aplot_network(pd_df: pd.DataFrame,
|
|
331
331
|
source: str = "source",
|
|
332
332
|
target: str = "target",
|
|
333
333
|
weight: str = "weight",
|
|
@@ -351,7 +351,7 @@ def plot_network(pd_df: pd.DataFrame,
|
|
|
351
351
|
style=style,
|
|
352
352
|
ax=ax)
|
|
353
353
|
|
|
354
|
-
def
|
|
354
|
+
def aplot_network_components(pd_df: pd.DataFrame,
|
|
355
355
|
source: str = "source",
|
|
356
356
|
target: str = "target",
|
|
357
357
|
weight: str = "weight",
|
MatplotLibAPI/Table.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
1
|
+
from typing import List, Optional, Tuple
|
|
2
2
|
import pandas as pd
|
|
3
3
|
import matplotlib.pyplot as plt
|
|
4
4
|
from matplotlib.axes import Axes
|
|
5
|
+
from matplotlib.figure import Figure
|
|
5
6
|
|
|
6
|
-
from .StyleTemplate import StyleTemplate, string_formatter,validate_dataframe
|
|
7
|
+
from .StyleTemplate import StyleTemplate, string_formatter, validate_dataframe
|
|
7
8
|
|
|
8
9
|
TABLE_STYLE_TEMPLATE = StyleTemplate(
|
|
9
10
|
background_color='black',
|
|
@@ -13,7 +14,7 @@ TABLE_STYLE_TEMPLATE = StyleTemplate(
|
|
|
13
14
|
)
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
def
|
|
17
|
+
def aplot_table(pd_df: pd.DataFrame,
|
|
17
18
|
cols: List[str],
|
|
18
19
|
title: Optional[str] = None,
|
|
19
20
|
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
@@ -23,7 +24,7 @@ def plot_table(pd_df: pd.DataFrame,
|
|
|
23
24
|
ax: Optional[Axes] = None
|
|
24
25
|
) -> Axes:
|
|
25
26
|
validate_dataframe(pd_df, cols=cols, sort_by=sort_by)
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
if not sort_by:
|
|
28
29
|
sort_by = cols[0]
|
|
29
30
|
|
|
@@ -64,3 +65,27 @@ def plot_table(pd_df: pd.DataFrame,
|
|
|
64
65
|
ax.set_title(title, color=style.font_color, fontsize=style.font_size*2)
|
|
65
66
|
ax.title.set_position([0.5, 1.05])
|
|
66
67
|
return ax
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def fplot_table(pd_df: pd.DataFrame,
|
|
71
|
+
cols: List[str],
|
|
72
|
+
title: Optional[str] = None,
|
|
73
|
+
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
74
|
+
max_values: int = 20,
|
|
75
|
+
sort_by: Optional[str] = None,
|
|
76
|
+
ascending: bool = False,
|
|
77
|
+
figsize: Tuple[float, float] = (19.2, 10.8)
|
|
78
|
+
) -> Figure:
|
|
79
|
+
fig = plt.figure(figsize=figsize)
|
|
80
|
+
fig.patch.set_facecolor(style.background_color)
|
|
81
|
+
ax = fig.add_subplot()
|
|
82
|
+
ax = aplot_table(pd_df,
|
|
83
|
+
cols,
|
|
84
|
+
title,
|
|
85
|
+
style,
|
|
86
|
+
max_values,
|
|
87
|
+
sort_by,
|
|
88
|
+
ascending,
|
|
89
|
+
ax
|
|
90
|
+
)
|
|
91
|
+
return fig
|
MatplotLibAPI/Timeserie.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# Hint for Visual Code Python Interactive window
|
|
2
2
|
# %%
|
|
3
|
-
from typing import Optional
|
|
3
|
+
from typing import Optional, Tuple
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
|
+
from matplotlib.figure import Figure
|
|
6
7
|
from matplotlib.axes import Axes
|
|
7
8
|
import seaborn as sns
|
|
8
9
|
|
|
9
|
-
from .StyleTemplate import DynamicFuncFormatter, StyleTemplate, string_formatter, bmk_formatter, format_func,validate_dataframe
|
|
10
|
+
from .StyleTemplate import DynamicFuncFormatter, StyleTemplate, string_formatter, bmk_formatter, format_func, validate_dataframe
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
TIMESERIE_STYLE_TEMPLATE = StyleTemplate(
|
|
@@ -16,16 +17,18 @@ TIMESERIE_STYLE_TEMPLATE = StyleTemplate(
|
|
|
16
17
|
|
|
17
18
|
# region Line
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
|
|
21
|
+
def aplot_timeserie(pd_df: pd.DataFrame,
|
|
22
|
+
label: str,
|
|
23
|
+
x: str,
|
|
24
|
+
y: str,
|
|
25
|
+
title: Optional[str] = None,
|
|
26
|
+
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
27
|
+
max_values: int = 100,
|
|
28
|
+
sort_by: Optional[str] = None,
|
|
29
|
+
ascending: bool = False,
|
|
30
|
+
std: bool = False,
|
|
31
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
29
32
|
|
|
30
33
|
validate_dataframe(pd_df, cols=[label, x, y], sort_by=sort_by)
|
|
31
34
|
style.format_funcs = format_func(style.format_funcs, label=label, x=x, y=y)
|
|
@@ -51,21 +54,23 @@ def plot_timeserie(pd_df: pd.DataFrame,
|
|
|
51
54
|
|
|
52
55
|
if style.format_funcs.get("label"):
|
|
53
56
|
label_type = style.format_funcs.get("label")(label_type)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
if std:
|
|
58
|
+
ma = temp_df[y].rolling(window=7, min_periods=1).mean()
|
|
59
|
+
std_dev = temp_df[y].rolling(window=7, min_periods=1).std()
|
|
60
|
+
# Calculate the last moving average value to include in the legend
|
|
61
|
+
last_ma_value = ma.iloc[-1]
|
|
62
|
+
# Dynamically creating the legend label
|
|
63
|
+
label_str = f"{string_formatter(label_type)} (avg 7d: {style.format_funcs[y](last_ma_value)})"
|
|
64
|
+
# Plot moving average and include the last MA value in the label for the legend
|
|
65
|
+
ax.plot(temp_df.index, ma, color=color,
|
|
66
|
+
linestyle='--', label=label_str)
|
|
67
|
+
|
|
68
|
+
ax.fill_between(temp_df.index, ma - std_dev, ma +
|
|
69
|
+
std_dev, color=color, alpha=0.2, label='_nolegend_')
|
|
70
|
+
else:
|
|
71
|
+
label_str = f"{string_formatter(label_type)}"
|
|
72
|
+
# Plot moving average and include the last MA value in the label for the legend
|
|
73
|
+
ax.plot(temp_df.index, temp_df[y], color=color, label=label_str)
|
|
69
74
|
|
|
70
75
|
ax.legend(
|
|
71
76
|
title=label,
|
|
@@ -94,4 +99,30 @@ def plot_timeserie(pd_df: pd.DataFrame,
|
|
|
94
99
|
return ax
|
|
95
100
|
|
|
96
101
|
|
|
102
|
+
def fplot_timeserie(pd_df: pd.DataFrame,
|
|
103
|
+
label: str,
|
|
104
|
+
x: str,
|
|
105
|
+
y: str,
|
|
106
|
+
title: Optional[str] = None,
|
|
107
|
+
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
108
|
+
max_values: int = 100,
|
|
109
|
+
sort_by: Optional[str] = None,
|
|
110
|
+
ascending: bool = False,
|
|
111
|
+
std: bool = False,
|
|
112
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Figure:
|
|
113
|
+
fig = plt.figure(figsize=figsize)
|
|
114
|
+
fig.patch.set_facecolor(style.background_color)
|
|
115
|
+
ax = fig.add_subplot()
|
|
116
|
+
ax = aplot_timeserie(pd_df=pd_df,
|
|
117
|
+
label=label,
|
|
118
|
+
x=x,
|
|
119
|
+
y=y,
|
|
120
|
+
title=title,
|
|
121
|
+
style=style,
|
|
122
|
+
max_values=max_values,
|
|
123
|
+
std=std,
|
|
124
|
+
sort_by=sort_by,
|
|
125
|
+
ascending=ascending,
|
|
126
|
+
ax=ax)
|
|
127
|
+
return fig
|
|
97
128
|
# endregion
|
MatplotLibAPI/Treemap.py
CHANGED
MatplotLibAPI/__init__.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
from .StyleTemplate import StyleTemplate
|
|
3
|
-
from .Bubble import
|
|
3
|
+
from .Bubble import aplot_bubble, fplot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
4
4
|
from .Composite import plot_composite_bubble
|
|
5
|
-
from .Timeserie import
|
|
6
|
-
from .Table import
|
|
7
|
-
from .Network import
|
|
8
|
-
from .Treemap import
|
|
9
|
-
from typing import List, Optional
|
|
5
|
+
from .Timeserie import aplot_timeserie, fplot_timeserie, TIMESERIE_STYLE_TEMPLATE
|
|
6
|
+
from .Table import aplot_table, fplot_table, TABLE_STYLE_TEMPLATE
|
|
7
|
+
from .Network import aplot_network, aplot_network_components, NETWORK_STYLE_TEMPLATE
|
|
8
|
+
from .Treemap import fplot_treemap, TREEMAP_STYLE_TEMPLATE
|
|
9
|
+
from typing import List, Optional, Tuple
|
|
10
10
|
import pandas as pd
|
|
11
11
|
from pandas.api.extensions import register_dataframe_accessor
|
|
12
12
|
|
|
@@ -21,33 +21,67 @@ class DataFrameAccessor:
|
|
|
21
21
|
def __init__(self, pd_df: pd.DataFrame):
|
|
22
22
|
self._obj = pd_df
|
|
23
23
|
|
|
24
|
-
def
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
def aplot_bubble(self,
|
|
25
|
+
label: str,
|
|
26
|
+
x: str,
|
|
27
|
+
y: str,
|
|
28
|
+
z: str,
|
|
29
|
+
title: Optional[str] = None,
|
|
30
|
+
style: StyleTemplate = BUBBLE_STYLE_TEMPLATE,
|
|
31
|
+
max_values: int = 50,
|
|
32
|
+
center_to_mean: bool = False,
|
|
33
|
+
sort_by: Optional[str] = None,
|
|
34
|
+
ascending: bool = False,
|
|
35
|
+
hline: bool = False,
|
|
36
|
+
vline: bool = False,
|
|
37
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
38
|
+
|
|
39
|
+
return aplot_bubble(pd_df=self._obj,
|
|
40
|
+
label=label,
|
|
41
|
+
x=x,
|
|
42
|
+
y=y,
|
|
43
|
+
z=z,
|
|
44
|
+
title=title,
|
|
45
|
+
style=style,
|
|
46
|
+
max_values=max_values,
|
|
47
|
+
center_to_mean=center_to_mean,
|
|
48
|
+
sort_by=sort_by,
|
|
49
|
+
ascending=ascending,
|
|
50
|
+
hline=hline,
|
|
51
|
+
vline=vline,
|
|
52
|
+
ax=ax)
|
|
53
|
+
|
|
54
|
+
def fplot_bubble(self,
|
|
55
|
+
label: str,
|
|
56
|
+
x: str,
|
|
57
|
+
y: str,
|
|
58
|
+
z: str,
|
|
59
|
+
title: Optional[str] = None,
|
|
60
|
+
style: StyleTemplate = BUBBLE_STYLE_TEMPLATE,
|
|
61
|
+
max_values: int = 50,
|
|
62
|
+
center_to_mean: bool = False,
|
|
63
|
+
sort_by: Optional[str] = None,
|
|
64
|
+
ascending: bool = False,
|
|
65
|
+
hline: bool = False,
|
|
66
|
+
vline: bool = False,
|
|
67
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Figure:
|
|
68
|
+
|
|
69
|
+
return fplot_bubble(pd_df=self._obj,
|
|
70
|
+
label=label,
|
|
71
|
+
x=x,
|
|
72
|
+
y=y,
|
|
73
|
+
z=z,
|
|
74
|
+
title=title,
|
|
75
|
+
style=style,
|
|
76
|
+
max_values=max_values,
|
|
77
|
+
center_to_mean=center_to_mean,
|
|
78
|
+
sort_by=sort_by,
|
|
79
|
+
ascending=ascending,
|
|
80
|
+
hline=hline,
|
|
81
|
+
vline=vline,
|
|
82
|
+
figsize=figsize)
|
|
83
|
+
|
|
84
|
+
def fplot_composite_bubble(self,
|
|
51
85
|
label: str,
|
|
52
86
|
x: str,
|
|
53
87
|
y: str,
|
|
@@ -57,8 +91,7 @@ class DataFrameAccessor:
|
|
|
57
91
|
max_values: int = 100,
|
|
58
92
|
center_to_mean: bool = False,
|
|
59
93
|
sort_by: Optional[str] = None,
|
|
60
|
-
ascending: bool = False
|
|
61
|
-
ax: Optional[Axes] = None) -> Figure:
|
|
94
|
+
ascending: bool = False) -> Figure:
|
|
62
95
|
|
|
63
96
|
return plot_composite_bubble(pd_df=self._obj,
|
|
64
97
|
label=label,
|
|
@@ -70,50 +103,93 @@ class DataFrameAccessor:
|
|
|
70
103
|
max_values=max_values,
|
|
71
104
|
center_to_mean=center_to_mean,
|
|
72
105
|
sort_by=sort_by,
|
|
73
|
-
ascending=ascending
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
label: str,
|
|
96
|
-
x: str,
|
|
97
|
-
y: str,
|
|
106
|
+
ascending=ascending)
|
|
107
|
+
|
|
108
|
+
def aplot_table_ax(self,
|
|
109
|
+
cols: List[str],
|
|
110
|
+
title: Optional[str] = None,
|
|
111
|
+
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
112
|
+
max_values: int = 20,
|
|
113
|
+
sort_by: Optional[str] = None,
|
|
114
|
+
ascending: bool = False,
|
|
115
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
116
|
+
|
|
117
|
+
return aplot_table(pd_df=self._obj,
|
|
118
|
+
cols=cols,
|
|
119
|
+
title=title,
|
|
120
|
+
style=style,
|
|
121
|
+
max_values=max_values,
|
|
122
|
+
sort_by=sort_by,
|
|
123
|
+
ascending=ascending,
|
|
124
|
+
ax=ax)
|
|
125
|
+
|
|
126
|
+
def fplot_table(self,
|
|
127
|
+
cols: List[str],
|
|
98
128
|
title: Optional[str] = None,
|
|
99
|
-
style: StyleTemplate =
|
|
100
|
-
max_values: int =
|
|
129
|
+
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
130
|
+
max_values: int = 20,
|
|
101
131
|
sort_by: Optional[str] = None,
|
|
102
132
|
ascending: bool = False,
|
|
103
|
-
|
|
133
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Axes:
|
|
104
134
|
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
x=x,
|
|
108
|
-
y=y,
|
|
135
|
+
return fplot_table(pd_df=self._obj,
|
|
136
|
+
cols=cols,
|
|
109
137
|
title=title,
|
|
110
138
|
style=style,
|
|
111
139
|
max_values=max_values,
|
|
112
140
|
sort_by=sort_by,
|
|
113
141
|
ascending=ascending,
|
|
114
|
-
|
|
142
|
+
figsize=figsize)
|
|
143
|
+
|
|
144
|
+
def aplot_timeserie(self,
|
|
145
|
+
label: str,
|
|
146
|
+
x: str,
|
|
147
|
+
y: str,
|
|
148
|
+
title: Optional[str] = None,
|
|
149
|
+
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
150
|
+
max_values: int = 100,
|
|
151
|
+
sort_by: Optional[str] = None,
|
|
152
|
+
ascending: bool = False,
|
|
153
|
+
std: bool = False,
|
|
154
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
155
|
+
|
|
156
|
+
return aplot_timeserie(pd_df=self._obj,
|
|
157
|
+
label=label,
|
|
158
|
+
x=x,
|
|
159
|
+
y=y,
|
|
160
|
+
title=title,
|
|
161
|
+
style=style,
|
|
162
|
+
max_values=max_values,
|
|
163
|
+
sort_by=sort_by,
|
|
164
|
+
ascending=ascending,
|
|
165
|
+
std=std,
|
|
166
|
+
ax=ax)
|
|
167
|
+
|
|
168
|
+
def fplot_timeserie(self,
|
|
169
|
+
label: str,
|
|
170
|
+
x: str,
|
|
171
|
+
y: str,
|
|
172
|
+
title: Optional[str] = None,
|
|
173
|
+
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
174
|
+
max_values: int = 100,
|
|
175
|
+
sort_by: Optional[str] = None,
|
|
176
|
+
ascending: bool = False,
|
|
177
|
+
std: bool = False,
|
|
178
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Axes:
|
|
179
|
+
|
|
180
|
+
return fplot_timeserie(pd_df=self._obj,
|
|
181
|
+
label=label,
|
|
182
|
+
x=x,
|
|
183
|
+
y=y,
|
|
184
|
+
title=title,
|
|
185
|
+
style=style,
|
|
186
|
+
max_values=max_values,
|
|
187
|
+
sort_by=sort_by,
|
|
188
|
+
ascending=ascending,
|
|
189
|
+
std=std,
|
|
190
|
+
figsize=figsize)
|
|
115
191
|
|
|
116
|
-
def
|
|
192
|
+
def aplot_network(self,
|
|
117
193
|
source: str = "source",
|
|
118
194
|
target: str = "target",
|
|
119
195
|
weight: str = "weight",
|
|
@@ -124,7 +200,7 @@ class DataFrameAccessor:
|
|
|
124
200
|
node_list: Optional[List] = None,
|
|
125
201
|
ax: Optional[Axes] = None) -> Axes:
|
|
126
202
|
|
|
127
|
-
return
|
|
203
|
+
return aplot_network(df=self._obj,
|
|
128
204
|
source=source,
|
|
129
205
|
target=target,
|
|
130
206
|
weight=weight,
|
|
@@ -135,7 +211,7 @@ class DataFrameAccessor:
|
|
|
135
211
|
node_list=node_list,
|
|
136
212
|
ax=ax)
|
|
137
213
|
|
|
138
|
-
def
|
|
214
|
+
def aplot_network_components(self,
|
|
139
215
|
source: str = "source",
|
|
140
216
|
target: str = "target",
|
|
141
217
|
weight: str = "weight",
|
|
@@ -146,7 +222,7 @@ class DataFrameAccessor:
|
|
|
146
222
|
node_list: Optional[List] = None,
|
|
147
223
|
ax: Optional[Axes] = None) -> Axes:
|
|
148
224
|
|
|
149
|
-
return
|
|
225
|
+
return aplot_network_components(df=self._obj,
|
|
150
226
|
source=source,
|
|
151
227
|
target=target,
|
|
152
228
|
weight=weight,
|
|
@@ -157,7 +233,7 @@ class DataFrameAccessor:
|
|
|
157
233
|
node_list=node_list,
|
|
158
234
|
ax=ax)
|
|
159
235
|
|
|
160
|
-
def
|
|
236
|
+
def fplot_treemap(self,
|
|
161
237
|
path: str,
|
|
162
238
|
values: str,
|
|
163
239
|
style: StyleTemplate = TREEMAP_STYLE_TEMPLATE,
|
|
@@ -166,7 +242,7 @@ class DataFrameAccessor:
|
|
|
166
242
|
max_values: int = 100,
|
|
167
243
|
sort_by: Optional[str] = None,
|
|
168
244
|
ascending: bool = False) -> go.Figure:
|
|
169
|
-
return
|
|
245
|
+
return fplot_treemap(pd_df=self._obj,
|
|
170
246
|
path=path,
|
|
171
247
|
values=values,
|
|
172
248
|
title=title,
|
|
@@ -177,5 +253,5 @@ class DataFrameAccessor:
|
|
|
177
253
|
ascending=ascending)
|
|
178
254
|
|
|
179
255
|
|
|
180
|
-
__all__ = ["validate_dataframe", "
|
|
181
|
-
"plot_pivotbar", "
|
|
256
|
+
__all__ = ["validate_dataframe", "aplot_bubble", "aplot_timeserie", "aplot_table", "aplot_network", "aplot_network_components",
|
|
257
|
+
"plot_pivotbar", "fplot_treemap", "plot_composite_bubble", "StyleTemplate", "DataFrameAccessor"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
MatplotLibAPI/Bubble.py,sha256=ZtOTWGAnJ1zy7bjKQ3OF985R-iZHvZOo_rG1dZMbP-Q,5116
|
|
2
|
+
MatplotLibAPI/Composite.py,sha256=ttcgB_6GiZJKTX-Cmai6MEXrpw1_MuLN9uzDj36v7JA,2889
|
|
3
|
+
MatplotLibAPI/Network.py,sha256=AruOpYSqSSUXHT_usZzcAI_DqDRfnJmiBKjazAvOnOU,14851
|
|
4
|
+
MatplotLibAPI/Pivot.py,sha256=Bo7ZpkxqoE75e8vpSsKIT5X2Q7lLdfAyy46ox1fARbc,7183
|
|
5
|
+
MatplotLibAPI/StyleTemplate.py,sha256=va8_yXaun1RnjQUOEHGvsXJrKWHdzz4BhnY0CkROLW8,4599
|
|
6
|
+
MatplotLibAPI/Table.py,sha256=p_nHXRiC6dneBSf0j5nx-hBijBSXd7NBLmdBicFUGqQ,2809
|
|
7
|
+
MatplotLibAPI/Timeserie.py,sha256=B03xjcBCgWVpkDQKvoyGtNjm6OLtCo1fINyXJrXeWM8,4952
|
|
8
|
+
MatplotLibAPI/Treemap.py,sha256=1QqBnV1EUzDHPSnp90n3TQKLZMuTymaJFZIdVJQqdjI,2553
|
|
9
|
+
MatplotLibAPI/__init__.py,sha256=77x-wLI_JJfXLWFgXNOX9cN3h4Q4ZaVxl5ppkRgZi1Q,11252
|
|
10
|
+
MatplotLibAPI-3.2.3.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
|
|
11
|
+
MatplotLibAPI-3.2.3.dist-info/METADATA,sha256=hGOX9uPWfaV6ZO9r3ZqtpzSQVSqVs6f-T1k9MHn7BSE,462
|
|
12
|
+
MatplotLibAPI-3.2.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
13
|
+
MatplotLibAPI-3.2.3.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
|
|
14
|
+
MatplotLibAPI-3.2.3.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
MatplotLibAPI/Bubble.py,sha256=haIj43o-t9P1OsIRNgS5_XVovdjCJGarMrr1V-bQWAI,3842
|
|
2
|
-
MatplotLibAPI/Composite.py,sha256=-ZXJQFkBzCtMoufKZUTRdH5fbhdRkHxLkXq-vdtRLSM,2847
|
|
3
|
-
MatplotLibAPI/Network.py,sha256=X-x5SKjncSFcK0bFd60e-HEbW4oBm9XIQKZtboPB4Eo,14849
|
|
4
|
-
MatplotLibAPI/Pivot.py,sha256=Bo7ZpkxqoE75e8vpSsKIT5X2Q7lLdfAyy46ox1fARbc,7183
|
|
5
|
-
MatplotLibAPI/StyleTemplate.py,sha256=va8_yXaun1RnjQUOEHGvsXJrKWHdzz4BhnY0CkROLW8,4599
|
|
6
|
-
MatplotLibAPI/Table.py,sha256=4vgvF2pXjewd23-a7KyuLQs-Hohnv69VK1_uRPgGi_o,2005
|
|
7
|
-
MatplotLibAPI/Timeserie.py,sha256=cqPONNvDmJ_7UmkOBVpBbD9oEgS79SbhEVlf1qZ3kW0,3446
|
|
8
|
-
MatplotLibAPI/Treemap.py,sha256=ELkmcNZuWh-thd4gKwqkSQTisnBDutHHgxGuH1ZBzsg,2552
|
|
9
|
-
MatplotLibAPI/__init__.py,sha256=O1b1kutZ_E8pUx4lkQTM2OXjZQIWQ8X7CUPScHRq5dI,7691
|
|
10
|
-
MatplotLibAPI-3.2.1.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
|
|
11
|
-
MatplotLibAPI-3.2.1.dist-info/METADATA,sha256=6fvA8pdZp_AWIDUNVBEm1vwhCkNUQ01XP3WYiJbMgUg,462
|
|
12
|
-
MatplotLibAPI-3.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
13
|
-
MatplotLibAPI-3.2.1.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
|
|
14
|
-
MatplotLibAPI-3.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|