MatplotLibAPI 3.1.2__py3-none-any.whl → 3.2.1__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 +1 -1
- MatplotLibAPI/Composite.py +1 -1
- MatplotLibAPI/Network.py +1 -1
- MatplotLibAPI/StyleTemplate.py +169 -0
- MatplotLibAPI/Table.py +1 -1
- MatplotLibAPI/Timeserie.py +1 -1
- MatplotLibAPI/Treemap.py +1 -1
- MatplotLibAPI/__init__.py +60 -189
- {MatplotLibAPI-3.1.2.dist-info → MatplotLibAPI-3.2.1.dist-info}/METADATA +1 -1
- MatplotLibAPI-3.2.1.dist-info/RECORD +14 -0
- MatplotLibAPI-3.1.2.dist-info/RECORD +0 -13
- {MatplotLibAPI-3.1.2.dist-info → MatplotLibAPI-3.2.1.dist-info}/LICENSE +0 -0
- {MatplotLibAPI-3.1.2.dist-info → MatplotLibAPI-3.2.1.dist-info}/WHEEL +0 -0
- {MatplotLibAPI-3.1.2.dist-info → MatplotLibAPI-3.2.1.dist-info}/top_level.txt +0 -0
MatplotLibAPI/Bubble.py
CHANGED
|
@@ -6,7 +6,7 @@ import matplotlib.pyplot as plt
|
|
|
6
6
|
from matplotlib.axes import Axes
|
|
7
7
|
import seaborn as sns
|
|
8
8
|
|
|
9
|
-
from . import DynamicFuncFormatter, StyleTemplate, generate_ticks, string_formatter, bmk_formatter, percent_formatter, format_func,validate_dataframe
|
|
9
|
+
from .StyleTemplate import DynamicFuncFormatter, StyleTemplate, generate_ticks, string_formatter, bmk_formatter, percent_formatter, format_func,validate_dataframe
|
|
10
10
|
|
|
11
11
|
BUBBLE_STYLE_TEMPLATE = StyleTemplate(
|
|
12
12
|
format_funcs={"label": string_formatter,
|
MatplotLibAPI/Composite.py
CHANGED
|
@@ -8,7 +8,7 @@ from matplotlib.figure import Figure
|
|
|
8
8
|
from .Network import plot_network, plot_network_components, DEFAULT
|
|
9
9
|
from .Bubble import plot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
10
10
|
from .Table import plot_table
|
|
11
|
-
from . import StyleTemplate, format_func, validate_dataframe
|
|
11
|
+
from .StyleTemplate import StyleTemplate, format_func, validate_dataframe
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def plot_composite_bubble(
|
MatplotLibAPI/Network.py
CHANGED
|
@@ -13,7 +13,7 @@ from networkx import Graph
|
|
|
13
13
|
from networkx.classes.graph import Graph
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
from . import StyleTemplate, string_formatter, format_func,validate_dataframe
|
|
16
|
+
from .StyleTemplate import StyleTemplate, string_formatter, format_func,validate_dataframe
|
|
17
17
|
|
|
18
18
|
NETWORK_STYLE_TEMPLATE = StyleTemplate(
|
|
19
19
|
)
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional, Dict, Callable, Union
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
import pandas as pd
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
from matplotlib.dates import num2date
|
|
9
|
+
from matplotlib.ticker import FuncFormatter
|
|
10
|
+
|
|
11
|
+
# region Utils
|
|
12
|
+
|
|
13
|
+
def validate_dataframe(pd_df: pd.DataFrame,
|
|
14
|
+
cols: List[str],
|
|
15
|
+
sort_by: Optional[str] = None):
|
|
16
|
+
_columns = cols.copy()
|
|
17
|
+
if sort_by and sort_by not in _columns:
|
|
18
|
+
_columns.append(sort_by)
|
|
19
|
+
for col in _columns:
|
|
20
|
+
if col not in pd_df.columns:
|
|
21
|
+
raise AttributeError(f"{col} is not a DataFrame's column")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def format_func(
|
|
25
|
+
format_funcs: Optional[Dict[str, Optional[Callable[[Union[int, float, str]], str]]]],
|
|
26
|
+
label: Optional[str] = None,
|
|
27
|
+
x: Optional[str] = None,
|
|
28
|
+
y: Optional[str] = None,
|
|
29
|
+
z: Optional[str] = None):
|
|
30
|
+
|
|
31
|
+
if label and "label" in format_funcs:
|
|
32
|
+
format_funcs[label] = format_funcs["label"]
|
|
33
|
+
if x and "x" in format_funcs:
|
|
34
|
+
format_funcs[x] = format_funcs["x"]
|
|
35
|
+
if y and "y" in format_funcs:
|
|
36
|
+
format_funcs[y] = format_funcs["y"]
|
|
37
|
+
if z and "z" in format_funcs:
|
|
38
|
+
format_funcs[z] = format_funcs["z"]
|
|
39
|
+
return format_funcs
|
|
40
|
+
|
|
41
|
+
# endregion
|
|
42
|
+
|
|
43
|
+
# region Style
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
MAX_RESULTS = 50
|
|
47
|
+
X_COL = "index"
|
|
48
|
+
Y_COL = "overlap"
|
|
49
|
+
Z_COL = "users"
|
|
50
|
+
FIG_SIZE = (19.2, 10.8)
|
|
51
|
+
BACKGROUND_COLOR = 'black'
|
|
52
|
+
TEXT_COLOR = 'white'
|
|
53
|
+
PALETTE = "Greys_r"
|
|
54
|
+
FONT_SIZE = 14
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass
|
|
58
|
+
class StyleTemplate:
|
|
59
|
+
background_color: str = BACKGROUND_COLOR
|
|
60
|
+
fig_border: str = BACKGROUND_COLOR
|
|
61
|
+
font_name: str = 'Arial'
|
|
62
|
+
font_size: int = FONT_SIZE
|
|
63
|
+
font_color: str = TEXT_COLOR
|
|
64
|
+
palette: str = PALETTE
|
|
65
|
+
legend: bool = True
|
|
66
|
+
xscale: Optional[str] = None
|
|
67
|
+
x_ticks: int = 10
|
|
68
|
+
yscale: Optional[str] = None
|
|
69
|
+
y_ticks: int = 5
|
|
70
|
+
format_funcs: Optional[Dict[str, Optional[Callable[[
|
|
71
|
+
Union[int, float, str]], str]]]] = None
|
|
72
|
+
col_widths: Optional[List[float]] = None
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def font_mapping(self):
|
|
76
|
+
return {0: self.font_size-3,
|
|
77
|
+
1: self.font_size-1,
|
|
78
|
+
2: self.font_size,
|
|
79
|
+
3: self.font_size+1,
|
|
80
|
+
4: self.font_size+3}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class DynamicFuncFormatter(FuncFormatter):
|
|
84
|
+
def __init__(self, func_name):
|
|
85
|
+
super().__init__(func_name)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def percent_formatter(val, pos: Optional[int] = None):
|
|
89
|
+
if val*100 <= 0.1: # For 0.1%
|
|
90
|
+
return f"{val*100:.2f}%"
|
|
91
|
+
elif val*100 <= 1: # For 1%
|
|
92
|
+
return f"{val*100:.1f}%"
|
|
93
|
+
else:
|
|
94
|
+
return f"{val*100:.0f}%"
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def bmk_formatter(val, pos: Optional[int] = None):
|
|
98
|
+
if val >= 1_000_000_000: # Billions
|
|
99
|
+
return f"{val / 1_000_000_000:.2f}B"
|
|
100
|
+
elif val >= 1_000_000: # Millions
|
|
101
|
+
return f"{val / 1_000_000:.1f}M"
|
|
102
|
+
elif val >= 1_000: # Thousands
|
|
103
|
+
return f"{val / 1_000:.1f}K"
|
|
104
|
+
else:
|
|
105
|
+
return f"{int(val)}"
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def integer_formatter(value, pos: Optional[int] = None):
|
|
109
|
+
return f"{int(value)}"
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def string_formatter(value, pos: Optional[int] = None):
|
|
113
|
+
return str(value).replace("-", " ").replace("_", " ").title()
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def yy_mm__formatter(x, pos: Optional[int] = None):
|
|
117
|
+
return num2date(x).strftime('%Y-%m')
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def yy_mm_dd__formatter(x, pos: Optional[int] = None):
|
|
121
|
+
return num2date(x).strftime('%Y-%m-%D')
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def percent_formatter(x, pos: Optional[int] = None):
|
|
125
|
+
return f"{x * 100:.0f}%"
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def generate_ticks(min_val, max_val, num_ticks="10"):
|
|
129
|
+
# Identify the type of the input
|
|
130
|
+
try:
|
|
131
|
+
min_val = float(min_val)
|
|
132
|
+
max_val = float(max_val)
|
|
133
|
+
is_date = False
|
|
134
|
+
except ValueError:
|
|
135
|
+
is_date = True
|
|
136
|
+
|
|
137
|
+
# Convert string inputs to appropriate numerical or date types
|
|
138
|
+
num_ticks = int(num_ticks)
|
|
139
|
+
|
|
140
|
+
if is_date:
|
|
141
|
+
min_val = pd.Timestamp(min_val).to_datetime64()
|
|
142
|
+
max_val = pd.Timestamp(max_val).to_datetime64()
|
|
143
|
+
data_range = (max_val - min_val).astype('timedelta64[D]').astype(int)
|
|
144
|
+
else:
|
|
145
|
+
data_range = max_val - min_val
|
|
146
|
+
|
|
147
|
+
# Calculate a nice step size
|
|
148
|
+
step_size = data_range / (num_ticks - 1)
|
|
149
|
+
|
|
150
|
+
# If date, convert back to datetime
|
|
151
|
+
if is_date:
|
|
152
|
+
ticks = pd.date_range(
|
|
153
|
+
start=min_val, periods=num_ticks, freq=f"{step_size}D")
|
|
154
|
+
else:
|
|
155
|
+
# Round the step size to a "nice" number
|
|
156
|
+
exponent = np.floor(np.log10(step_size))
|
|
157
|
+
fraction = step_size / 10**exponent
|
|
158
|
+
nice_fraction = round(fraction)
|
|
159
|
+
|
|
160
|
+
# Create nice step size
|
|
161
|
+
nice_step = nice_fraction * 10**exponent
|
|
162
|
+
|
|
163
|
+
# Generate the tick marks based on the nice step size
|
|
164
|
+
ticks = np.arange(min_val, max_val + nice_step, nice_step)
|
|
165
|
+
|
|
166
|
+
return ticks
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# endregion
|
MatplotLibAPI/Table.py
CHANGED
|
@@ -3,7 +3,7 @@ import pandas as pd
|
|
|
3
3
|
import matplotlib.pyplot as plt
|
|
4
4
|
from matplotlib.axes import Axes
|
|
5
5
|
|
|
6
|
-
from . import StyleTemplate, string_formatter,validate_dataframe
|
|
6
|
+
from .StyleTemplate import StyleTemplate, string_formatter,validate_dataframe
|
|
7
7
|
|
|
8
8
|
TABLE_STYLE_TEMPLATE = StyleTemplate(
|
|
9
9
|
background_color='black',
|
MatplotLibAPI/Timeserie.py
CHANGED
|
@@ -6,7 +6,7 @@ import matplotlib.pyplot as plt
|
|
|
6
6
|
from matplotlib.axes import Axes
|
|
7
7
|
import seaborn as sns
|
|
8
8
|
|
|
9
|
-
from . import DynamicFuncFormatter, StyleTemplate, string_formatter, bmk_formatter, format_func,validate_dataframe
|
|
9
|
+
from .StyleTemplate import DynamicFuncFormatter, StyleTemplate, string_formatter, bmk_formatter, format_func,validate_dataframe
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
TIMESERIE_STYLE_TEMPLATE = StyleTemplate(
|
MatplotLibAPI/Treemap.py
CHANGED
|
@@ -5,7 +5,7 @@ import pandas as pd
|
|
|
5
5
|
from pandas import CategoricalDtype,BooleanDtype
|
|
6
6
|
import plotly.graph_objects as go
|
|
7
7
|
|
|
8
|
-
from . import StyleTemplate, string_formatter, percent_formatter,validate_dataframe
|
|
8
|
+
from .StyleTemplate import StyleTemplate, string_formatter, percent_formatter,validate_dataframe
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
MatplotLibAPI/__init__.py
CHANGED
|
@@ -1,184 +1,20 @@
|
|
|
1
1
|
|
|
2
|
-
from .
|
|
3
|
-
from .Network import Graph
|
|
4
|
-
from .Table import plot_table, TABLE_STYLE_TEMPLATE
|
|
5
|
-
from .Timeserie import plot_timeserie, TIMESERIE_STYLE_TEMPLATE
|
|
6
|
-
from .Composite import plot_composite_bubble
|
|
2
|
+
from .StyleTemplate import StyleTemplate
|
|
7
3
|
from .Bubble import plot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
8
|
-
from
|
|
9
|
-
from
|
|
4
|
+
from .Composite import plot_composite_bubble
|
|
5
|
+
from .Timeserie import plot_timeserie, TIMESERIE_STYLE_TEMPLATE
|
|
6
|
+
from .Table import plot_table, TABLE_STYLE_TEMPLATE
|
|
7
|
+
from .Network import plot_network, plot_network_components, NETWORK_STYLE_TEMPLATE
|
|
8
|
+
from .Treemap import plot_treemap, TREEMAP_STYLE_TEMPLATE
|
|
9
|
+
from typing import List, Optional
|
|
10
10
|
import pandas as pd
|
|
11
11
|
from pandas.api.extensions import register_dataframe_accessor
|
|
12
|
-
import numpy as np
|
|
13
12
|
|
|
14
13
|
from matplotlib.axes import Axes
|
|
15
14
|
from matplotlib.figure import Figure
|
|
16
|
-
from matplotlib.dates import num2date
|
|
17
|
-
from matplotlib.ticker import FuncFormatter
|
|
18
15
|
import plotly.graph_objects as go
|
|
19
16
|
|
|
20
17
|
|
|
21
|
-
# region Utils
|
|
22
|
-
|
|
23
|
-
def validate_dataframe(pd_df: pd.DataFrame,
|
|
24
|
-
cols: List[str],
|
|
25
|
-
sort_by: Optional[str] = None):
|
|
26
|
-
_columns = cols.copy()
|
|
27
|
-
if sort_by and sort_by not in _columns:
|
|
28
|
-
_columns.append(sort_by)
|
|
29
|
-
for col in _columns:
|
|
30
|
-
if col not in pd_df.columns:
|
|
31
|
-
raise AttributeError(f"{col} is not a DataFrame's column")
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def format_func(
|
|
35
|
-
format_funcs: Optional[Dict[str, Optional[Callable[[Union[int, float, str]], str]]]],
|
|
36
|
-
label: Optional[str] = None,
|
|
37
|
-
x: Optional[str] = None,
|
|
38
|
-
y: Optional[str] = None,
|
|
39
|
-
z: Optional[str] = None):
|
|
40
|
-
|
|
41
|
-
if label and "label" in format_funcs:
|
|
42
|
-
format_funcs[label] = format_funcs["label"]
|
|
43
|
-
if x and "x" in format_funcs:
|
|
44
|
-
format_funcs[x] = format_funcs["x"]
|
|
45
|
-
if y and "y" in format_funcs:
|
|
46
|
-
format_funcs[y] = format_funcs["y"]
|
|
47
|
-
if z and "z" in format_funcs:
|
|
48
|
-
format_funcs[z] = format_funcs["z"]
|
|
49
|
-
return format_funcs
|
|
50
|
-
|
|
51
|
-
# endregion
|
|
52
|
-
|
|
53
|
-
# region Style
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
MAX_RESULTS = 50
|
|
57
|
-
X_COL = "index"
|
|
58
|
-
Y_COL = "overlap"
|
|
59
|
-
Z_COL = "users"
|
|
60
|
-
FIG_SIZE = (19.2, 10.8)
|
|
61
|
-
BACKGROUND_COLOR = 'black'
|
|
62
|
-
TEXT_COLOR = 'white'
|
|
63
|
-
PALETTE = "Greys_r"
|
|
64
|
-
FONT_SIZE = 14
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@dataclass
|
|
68
|
-
class StyleTemplate:
|
|
69
|
-
background_color: str = BACKGROUND_COLOR
|
|
70
|
-
fig_border: str = BACKGROUND_COLOR
|
|
71
|
-
font_name: str = 'Arial'
|
|
72
|
-
font_size: int = FONT_SIZE
|
|
73
|
-
font_color: str = TEXT_COLOR
|
|
74
|
-
palette: str = PALETTE
|
|
75
|
-
legend: bool = True
|
|
76
|
-
xscale: Optional[str] = None
|
|
77
|
-
x_ticks: int = 10
|
|
78
|
-
yscale: Optional[str] = None
|
|
79
|
-
y_ticks: int = 5
|
|
80
|
-
format_funcs: Optional[Dict[str, Optional[Callable[[
|
|
81
|
-
Union[int, float, str]], str]]]] = None
|
|
82
|
-
col_widths: Optional[List[float]] = None
|
|
83
|
-
|
|
84
|
-
@property
|
|
85
|
-
def font_mapping(self):
|
|
86
|
-
return {0: self.font_size-3,
|
|
87
|
-
1: self.font_size-1,
|
|
88
|
-
2: self.font_size,
|
|
89
|
-
3: self.font_size+1,
|
|
90
|
-
4: self.font_size+3}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class DynamicFuncFormatter(FuncFormatter):
|
|
94
|
-
def __init__(self, func_name):
|
|
95
|
-
super().__init__(func_name)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def percent_formatter(val, pos: Optional[int] = None):
|
|
99
|
-
if val*100 <= 0.1: # For 0.1%
|
|
100
|
-
return f"{val*100:.2f}%"
|
|
101
|
-
elif val*100 <= 1: # For 1%
|
|
102
|
-
return f"{val*100:.1f}%"
|
|
103
|
-
else:
|
|
104
|
-
return f"{val*100:.0f}%"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def bmk_formatter(val, pos: Optional[int] = None):
|
|
108
|
-
if val >= 1_000_000_000: # Billions
|
|
109
|
-
return f"{val / 1_000_000_000:.2f}B"
|
|
110
|
-
elif val >= 1_000_000: # Millions
|
|
111
|
-
return f"{val / 1_000_000:.1f}M"
|
|
112
|
-
elif val >= 1_000: # Thousands
|
|
113
|
-
return f"{val / 1_000:.1f}K"
|
|
114
|
-
else:
|
|
115
|
-
return f"{int(val)}"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
def integer_formatter(value, pos: Optional[int] = None):
|
|
119
|
-
return f"{int(value)}"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def string_formatter(value, pos: Optional[int] = None):
|
|
123
|
-
return str(value).replace("-", " ").replace("_", " ").title()
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
def yy_mm__formatter(x, pos: Optional[int] = None):
|
|
127
|
-
return num2date(x).strftime('%Y-%m')
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def yy_mm_dd__formatter(x, pos: Optional[int] = None):
|
|
131
|
-
return num2date(x).strftime('%Y-%m-%D')
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
def percent_formatter(x, pos: Optional[int] = None):
|
|
135
|
-
return f"{x * 100:.0f}%"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def generate_ticks(min_val, max_val, num_ticks="10"):
|
|
139
|
-
# Identify the type of the input
|
|
140
|
-
try:
|
|
141
|
-
min_val = float(min_val)
|
|
142
|
-
max_val = float(max_val)
|
|
143
|
-
is_date = False
|
|
144
|
-
except ValueError:
|
|
145
|
-
is_date = True
|
|
146
|
-
|
|
147
|
-
# Convert string inputs to appropriate numerical or date types
|
|
148
|
-
num_ticks = int(num_ticks)
|
|
149
|
-
|
|
150
|
-
if is_date:
|
|
151
|
-
min_val = pd.Timestamp(min_val).to_datetime64()
|
|
152
|
-
max_val = pd.Timestamp(max_val).to_datetime64()
|
|
153
|
-
data_range = (max_val - min_val).astype('timedelta64[D]').astype(int)
|
|
154
|
-
else:
|
|
155
|
-
data_range = max_val - min_val
|
|
156
|
-
|
|
157
|
-
# Calculate a nice step size
|
|
158
|
-
step_size = data_range / (num_ticks - 1)
|
|
159
|
-
|
|
160
|
-
# If date, convert back to datetime
|
|
161
|
-
if is_date:
|
|
162
|
-
ticks = pd.date_range(
|
|
163
|
-
start=min_val, periods=num_ticks, freq=f"{step_size}D")
|
|
164
|
-
else:
|
|
165
|
-
# Round the step size to a "nice" number
|
|
166
|
-
exponent = np.floor(np.log10(step_size))
|
|
167
|
-
fraction = step_size / 10**exponent
|
|
168
|
-
nice_fraction = round(fraction)
|
|
169
|
-
|
|
170
|
-
# Create nice step size
|
|
171
|
-
nice_step = nice_fraction * 10**exponent
|
|
172
|
-
|
|
173
|
-
# Generate the tick marks based on the nice step size
|
|
174
|
-
ticks = np.arange(min_val, max_val + nice_step, nice_step)
|
|
175
|
-
|
|
176
|
-
return ticks
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
# endregion
|
|
180
|
-
|
|
181
|
-
|
|
182
18
|
@register_dataframe_accessor("mpl")
|
|
183
19
|
class DataFrameAccessor:
|
|
184
20
|
|
|
@@ -195,7 +31,8 @@ class DataFrameAccessor:
|
|
|
195
31
|
max_values: int = 50,
|
|
196
32
|
center_to_mean: bool = False,
|
|
197
33
|
sort_by: Optional[str] = None,
|
|
198
|
-
ascending: bool = False
|
|
34
|
+
ascending: bool = False,
|
|
35
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
199
36
|
|
|
200
37
|
return plot_bubble(pd_df=self._obj,
|
|
201
38
|
label=label,
|
|
@@ -207,7 +44,8 @@ class DataFrameAccessor:
|
|
|
207
44
|
max_values=max_values,
|
|
208
45
|
center_to_mean=center_to_mean,
|
|
209
46
|
sort_by=sort_by,
|
|
210
|
-
ascending=ascending
|
|
47
|
+
ascending=ascending,
|
|
48
|
+
ax=ax)
|
|
211
49
|
|
|
212
50
|
def plot_composite_bubble(self,
|
|
213
51
|
label: str,
|
|
@@ -219,7 +57,8 @@ class DataFrameAccessor:
|
|
|
219
57
|
max_values: int = 100,
|
|
220
58
|
center_to_mean: bool = False,
|
|
221
59
|
sort_by: Optional[str] = None,
|
|
222
|
-
ascending: bool = False
|
|
60
|
+
ascending: bool = False,
|
|
61
|
+
ax: Optional[Axes] = None) -> Figure:
|
|
223
62
|
|
|
224
63
|
return plot_composite_bubble(pd_df=self._obj,
|
|
225
64
|
label=label,
|
|
@@ -231,7 +70,8 @@ class DataFrameAccessor:
|
|
|
231
70
|
max_values=max_values,
|
|
232
71
|
center_to_mean=center_to_mean,
|
|
233
72
|
sort_by=sort_by,
|
|
234
|
-
ascending=ascending
|
|
73
|
+
ascending=ascending,
|
|
74
|
+
ax=ax)
|
|
235
75
|
|
|
236
76
|
def plot_table(self,
|
|
237
77
|
cols: List[str],
|
|
@@ -239,7 +79,8 @@ class DataFrameAccessor:
|
|
|
239
79
|
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
240
80
|
max_values: int = 20,
|
|
241
81
|
sort_by: Optional[str] = None,
|
|
242
|
-
ascending: bool = False
|
|
82
|
+
ascending: bool = False,
|
|
83
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
243
84
|
|
|
244
85
|
return plot_table(pd_df=self._obj,
|
|
245
86
|
cols=cols,
|
|
@@ -247,7 +88,8 @@ class DataFrameAccessor:
|
|
|
247
88
|
style=style,
|
|
248
89
|
max_values=max_values,
|
|
249
90
|
sort_by=sort_by,
|
|
250
|
-
ascending=ascending
|
|
91
|
+
ascending=ascending,
|
|
92
|
+
ax=ax)
|
|
251
93
|
|
|
252
94
|
def plot_timeserie(self,
|
|
253
95
|
label: str,
|
|
@@ -257,7 +99,8 @@ class DataFrameAccessor:
|
|
|
257
99
|
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
258
100
|
max_values: int = 100,
|
|
259
101
|
sort_by: Optional[str] = None,
|
|
260
|
-
ascending: bool = False
|
|
102
|
+
ascending: bool = False,
|
|
103
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
261
104
|
|
|
262
105
|
return plot_timeserie(pd_df=self._obj,
|
|
263
106
|
label=label,
|
|
@@ -267,24 +110,52 @@ class DataFrameAccessor:
|
|
|
267
110
|
style=style,
|
|
268
111
|
max_values=max_values,
|
|
269
112
|
sort_by=sort_by,
|
|
270
|
-
ascending=ascending
|
|
113
|
+
ascending=ascending,
|
|
114
|
+
ax=ax)
|
|
271
115
|
|
|
272
116
|
def plot_network(self,
|
|
273
117
|
source: str = "source",
|
|
274
118
|
target: str = "target",
|
|
275
119
|
weight: str = "weight",
|
|
276
120
|
title: Optional[str] = None,
|
|
277
|
-
style: StyleTemplate =
|
|
278
|
-
max_values: int = 20,
|
|
121
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
279
122
|
sort_by: Optional[str] = None,
|
|
280
|
-
ascending: bool = False
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
123
|
+
ascending: bool = False,
|
|
124
|
+
node_list: Optional[List] = None,
|
|
125
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
126
|
+
|
|
127
|
+
return plot_network(df=self._obj,
|
|
128
|
+
source=source,
|
|
129
|
+
target=target,
|
|
130
|
+
weight=weight,
|
|
131
|
+
title=title,
|
|
132
|
+
style=style,
|
|
133
|
+
sort_by=sort_by,
|
|
134
|
+
ascending=ascending,
|
|
135
|
+
node_list=node_list,
|
|
136
|
+
ax=ax)
|
|
137
|
+
|
|
138
|
+
def plot_network_components(self,
|
|
139
|
+
source: str = "source",
|
|
140
|
+
target: str = "target",
|
|
141
|
+
weight: str = "weight",
|
|
142
|
+
title: Optional[str] = None,
|
|
143
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
144
|
+
sort_by: Optional[str] = None,
|
|
145
|
+
ascending: bool = False,
|
|
146
|
+
node_list: Optional[List] = None,
|
|
147
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
148
|
+
|
|
149
|
+
return plot_network_components(df=self._obj,
|
|
150
|
+
source=source,
|
|
151
|
+
target=target,
|
|
152
|
+
weight=weight,
|
|
153
|
+
title=title,
|
|
154
|
+
style=style,
|
|
155
|
+
sort_by=sort_by,
|
|
156
|
+
ascending=ascending,
|
|
157
|
+
node_list=node_list,
|
|
158
|
+
ax=ax)
|
|
288
159
|
|
|
289
160
|
def plot_treemap(self,
|
|
290
161
|
path: str,
|
|
@@ -0,0 +1,14 @@
|
|
|
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,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
MatplotLibAPI/Bubble.py,sha256=zfm5Y2YU824TzvFb_57HeeTgOXgx0oozBRcxqr6g_lo,3829
|
|
2
|
-
MatplotLibAPI/Composite.py,sha256=V5VgYt6cSJkz74XtMoQHHr9VrJXojCFsmxjkqwA0oYc,2834
|
|
3
|
-
MatplotLibAPI/Network.py,sha256=zdu6kVIja0peYLL4mdpw76BijLn6hAmtoKbK_YukZC0,14836
|
|
4
|
-
MatplotLibAPI/Pivot.py,sha256=Bo7ZpkxqoE75e8vpSsKIT5X2Q7lLdfAyy46ox1fARbc,7183
|
|
5
|
-
MatplotLibAPI/Table.py,sha256=hokyBgkiwlA0B8Irx2yPL4xCeZlI-HK0Jln79qjMwZk,1992
|
|
6
|
-
MatplotLibAPI/Timeserie.py,sha256=kl7G5TgIz1MKEBegPE_hHuoPcMCS7-JkCjDyx3wuM8Q,3433
|
|
7
|
-
MatplotLibAPI/Treemap.py,sha256=ImfnPagGQkPwk15Yywroir-FLbBvBzpytEb1Uw7iQi4,2539
|
|
8
|
-
MatplotLibAPI/__init__.py,sha256=FoN0Qa1efBbRDK27vOxdQxT-iRMH4Hqz5WKxMdoSvZc,10430
|
|
9
|
-
MatplotLibAPI-3.1.2.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
|
|
10
|
-
MatplotLibAPI-3.1.2.dist-info/METADATA,sha256=uH2EUAne0e9xsrALJ9TUCRnEgfi5P0NIOtsv_4PnVps,462
|
|
11
|
-
MatplotLibAPI-3.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
12
|
-
MatplotLibAPI-3.1.2.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
|
|
13
|
-
MatplotLibAPI-3.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|