MatplotLibAPI 3.2.2__py3-none-any.whl → 3.2.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.
- MatplotLibAPI/Bubble.py +3 -3
- MatplotLibAPI/Composite.py +10 -7
- MatplotLibAPI/Network.py +168 -82
- MatplotLibAPI/Table.py +3 -3
- MatplotLibAPI/Timeserie.py +3 -3
- MatplotLibAPI/Treemap.py +1 -1
- MatplotLibAPI/__init__.py +218 -200
- {MatplotLibAPI-3.2.2.dist-info → MatplotLibAPI-3.2.4.dist-info}/METADATA +1 -1
- MatplotLibAPI-3.2.4.dist-info/RECORD +14 -0
- MatplotLibAPI-3.2.2.dist-info/RECORD +0 -14
- {MatplotLibAPI-3.2.2.dist-info → MatplotLibAPI-3.2.4.dist-info}/LICENSE +0 -0
- {MatplotLibAPI-3.2.2.dist-info → MatplotLibAPI-3.2.4.dist-info}/WHEEL +0 -0
- {MatplotLibAPI-3.2.2.dist-info → MatplotLibAPI-3.2.4.dist-info}/top_level.txt +0 -0
MatplotLibAPI/Bubble.py
CHANGED
|
@@ -19,7 +19,7 @@ BUBBLE_STYLE_TEMPLATE = StyleTemplate(
|
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def aplot_bubble(
|
|
23
23
|
pd_df: pd.DataFrame,
|
|
24
24
|
label: str,
|
|
25
25
|
x: str,
|
|
@@ -125,7 +125,7 @@ def plot_bubble_ax(
|
|
|
125
125
|
return ax
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
def
|
|
128
|
+
def fplot_bubble(
|
|
129
129
|
pd_df: pd.DataFrame,
|
|
130
130
|
label: str,
|
|
131
131
|
x: str,
|
|
@@ -144,7 +144,7 @@ def plot_bubble_fig(
|
|
|
144
144
|
fig = plt.figure(figsize=figsize)
|
|
145
145
|
fig.patch.set_facecolor(style.background_color)
|
|
146
146
|
ax = fig.add_subplot()
|
|
147
|
-
ax =
|
|
147
|
+
ax = aplot_bubble(pd_df=pd_df,
|
|
148
148
|
label=label,
|
|
149
149
|
x=x,
|
|
150
150
|
y=y,
|
MatplotLibAPI/Composite.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
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 .Bubble import
|
|
9
|
-
from .Table import
|
|
10
|
+
from .Bubble import aplot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
11
|
+
from .Table import aplot_table
|
|
10
12
|
from .StyleTemplate import StyleTemplate, format_func, validate_dataframe
|
|
11
13
|
|
|
12
14
|
|
|
@@ -41,7 +43,7 @@ def plot_composite_bubble(
|
|
|
41
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
|
@@ -5,6 +5,7 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
|
5
5
|
|
|
6
6
|
import matplotlib.pyplot as plt
|
|
7
7
|
from matplotlib.axes import Axes
|
|
8
|
+
from matplotlib.figure import Figure
|
|
8
9
|
import seaborn as sns
|
|
9
10
|
import networkx as nx
|
|
10
11
|
import numpy as np
|
|
@@ -13,7 +14,7 @@ from networkx import Graph
|
|
|
13
14
|
from networkx.classes.graph import Graph
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
from .StyleTemplate import StyleTemplate, string_formatter, format_func,validate_dataframe
|
|
17
|
+
from .StyleTemplate import StyleTemplate, string_formatter, format_func, validate_dataframe
|
|
17
18
|
|
|
18
19
|
NETWORK_STYLE_TEMPLATE = StyleTemplate(
|
|
19
20
|
)
|
|
@@ -89,13 +90,14 @@ class EdgeView(nx.classes.reportviews.EdgeView):
|
|
|
89
90
|
return [(edge[0], edge[1]) for edge in filtered_edges]
|
|
90
91
|
|
|
91
92
|
|
|
92
|
-
class
|
|
93
|
+
class networkGraph():
|
|
93
94
|
"""
|
|
94
95
|
Custom graph class based on NetworkX's Graph class.
|
|
95
96
|
"""
|
|
97
|
+
_nx_graph: nx.Graph
|
|
96
98
|
|
|
97
|
-
def __init__(self):
|
|
98
|
-
|
|
99
|
+
def __init__(self, nx_graph: nx.Graph):
|
|
100
|
+
self._nx_graph = nx_graph
|
|
99
101
|
self._scale = 1.0
|
|
100
102
|
|
|
101
103
|
@property
|
|
@@ -108,7 +110,7 @@ class Graph(nx.Graph):
|
|
|
108
110
|
|
|
109
111
|
@property
|
|
110
112
|
def nodes(self):
|
|
111
|
-
return NodeView(self)
|
|
113
|
+
return NodeView(self._nx_graph)
|
|
112
114
|
|
|
113
115
|
@nodes.setter
|
|
114
116
|
def scale(self, value: NodeView):
|
|
@@ -116,21 +118,22 @@ class Graph(nx.Graph):
|
|
|
116
118
|
|
|
117
119
|
@property
|
|
118
120
|
def edges(self):
|
|
119
|
-
return EdgeView(self)
|
|
121
|
+
return EdgeView(self._nx_graph)
|
|
120
122
|
|
|
121
123
|
@property
|
|
122
124
|
def adjacency(self):
|
|
123
|
-
return AdjacencyView(list(self))
|
|
125
|
+
return AdjacencyView(list(self._nx_graph))
|
|
124
126
|
|
|
125
|
-
def edge_subgraph(self, edges: Iterable) ->
|
|
126
|
-
return nx.edge_subgraph(self, edges)
|
|
127
|
+
def edge_subgraph(self, edges: Iterable) -> 'networkGraph':
|
|
128
|
+
return nx.edge_subgraph(self._nx_graph, edges)
|
|
127
129
|
|
|
128
130
|
def layout(self,
|
|
129
131
|
max_node_size: int = DEFAULT["MAX_NODES"],
|
|
130
132
|
min_node_size: int = DEFAULT["MAX_NODES"],
|
|
131
133
|
max_edge_width: int = DEFAULT["MAX_EDGE_WIDTH"],
|
|
132
134
|
max_font_size: int = DEFAULT["MAX_FONT_SIZE"],
|
|
133
|
-
min_font_size: int = DEFAULT["MIN_FONT_SIZE"]
|
|
135
|
+
min_font_size: int = DEFAULT["MIN_FONT_SIZE"],
|
|
136
|
+
weight: str = "weight"):
|
|
134
137
|
"""
|
|
135
138
|
Calculates the sizes for nodes, edges, and fonts based on node weights and edge weights.
|
|
136
139
|
|
|
@@ -144,13 +147,13 @@ class Graph(nx.Graph):
|
|
|
144
147
|
and font sizes for node labels.
|
|
145
148
|
"""
|
|
146
149
|
# Normalize and scale nodes' weights within the desired range of edge widths
|
|
147
|
-
node_weights = [data.get(
|
|
150
|
+
node_weights = [data.get(weight, 1)
|
|
148
151
|
for node, data in self.nodes(data=True)]
|
|
149
152
|
node_size = scale_weights(
|
|
150
153
|
weights=node_weights, scale_max=max_node_size, scale_min=min_node_size)
|
|
151
154
|
|
|
152
155
|
# Normalize and scale edges' weights within the desired range of edge widths
|
|
153
|
-
edge_weights = [data.get(
|
|
156
|
+
edge_weights = [data.get(weight, 1)
|
|
154
157
|
for _, _, data in self.edges(data=True)]
|
|
155
158
|
edges_width = scale_weights(
|
|
156
159
|
weights=edge_weights, scale_max=max_edge_width)
|
|
@@ -165,7 +168,9 @@ class Graph(nx.Graph):
|
|
|
165
168
|
|
|
166
169
|
return node_size, edges_width, fonts_size
|
|
167
170
|
|
|
168
|
-
def subgraph(self,
|
|
171
|
+
def subgraph(self,
|
|
172
|
+
node_list: Optional[List[str]] = None,
|
|
173
|
+
max_edges: int = DEFAULT["MAX_EDGES"]) -> 'networkGraph':
|
|
169
174
|
if node_list is None:
|
|
170
175
|
node_list = self.nodes.sort("weight")[:DEFAULT["MAX_NODES"]]
|
|
171
176
|
connected_subgraph_nodes = list(self.find_connected_subgraph())
|
|
@@ -175,16 +180,18 @@ class Graph(nx.Graph):
|
|
|
175
180
|
subgraph = nx.subgraph(self, nbunch=node_list)
|
|
176
181
|
edges = subgraph.top_k_edges(attribute="weight", k=5).keys()
|
|
177
182
|
subgraph = subgraph.edge_subgraph(list(edges)[:max_edges])
|
|
178
|
-
return
|
|
183
|
+
return networkGraph(subgraph)
|
|
179
184
|
|
|
180
185
|
def plot_network(self,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
186
|
+
title: Optional[str] = None,
|
|
187
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
188
|
+
weight: str = "weight",
|
|
189
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
184
190
|
"""
|
|
185
191
|
Plots the degree distribution of the graph, including a degree rank plot and a degree histogram.
|
|
186
192
|
"""
|
|
187
|
-
degree_sequence = sorted(
|
|
193
|
+
degree_sequence = sorted(
|
|
194
|
+
[d for n, d in self._nx_graph.degree()], reverse=True)
|
|
188
195
|
dmax = max(degree_sequence)
|
|
189
196
|
sns.set_palette(style.palette)
|
|
190
197
|
if ax is None:
|
|
@@ -195,21 +202,22 @@ class Graph(nx.Graph):
|
|
|
195
202
|
max_node_size=DEFAULT["MAX_NODE_SIZE"],
|
|
196
203
|
max_edge_width=DEFAULT["MAX_EDGE_WIDTH"],
|
|
197
204
|
min_font_size=style.font_mapping.get(0),
|
|
198
|
-
max_font_size=style.font_mapping.get(4)
|
|
199
|
-
|
|
205
|
+
max_font_size=style.font_mapping.get(4),
|
|
206
|
+
weight=weight)
|
|
207
|
+
pos = nx.spring_layout(self._nx_graph, k=1)
|
|
200
208
|
# nodes
|
|
201
|
-
nx.draw_networkx_nodes(self,
|
|
209
|
+
nx.draw_networkx_nodes(self._nx_graph,
|
|
202
210
|
pos,
|
|
203
211
|
ax=ax,
|
|
204
212
|
node_size=list(node_sizes),
|
|
205
213
|
node_color=node_sizes,
|
|
206
|
-
cmap=plt.
|
|
214
|
+
cmap=plt.get_cmap(style.palette))
|
|
207
215
|
# edges
|
|
208
|
-
nx.draw_networkx_edges(self,
|
|
216
|
+
nx.draw_networkx_edges(self._nx_graph,
|
|
209
217
|
pos,
|
|
210
218
|
ax=ax,
|
|
211
219
|
edge_color=style.font_color,
|
|
212
|
-
edge_cmap=plt.
|
|
220
|
+
edge_cmap=plt.get_cmap(style.palette),
|
|
213
221
|
width=edge_widths)
|
|
214
222
|
# labels
|
|
215
223
|
for font_size, nodes in font_sizes.items():
|
|
@@ -221,34 +229,37 @@ class Graph(nx.Graph):
|
|
|
221
229
|
font_color=style.font_color,
|
|
222
230
|
labels={n: string_formatter(n) for n in nodes})
|
|
223
231
|
ax.set_facecolor(style.background_color)
|
|
224
|
-
|
|
232
|
+
if title:
|
|
233
|
+
ax.set_title(title, color=style.font_color,
|
|
234
|
+
fontsize=style.font_size*2)
|
|
225
235
|
ax.set_axis_off()
|
|
226
236
|
|
|
227
237
|
return ax
|
|
228
238
|
|
|
229
|
-
def plot_network_components(self,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
239
|
+
def plot_network_components(self,
|
|
240
|
+
node_list: Optional[List] = None,
|
|
241
|
+
scale: int = DEFAULT["GRAPH_SCALE"],
|
|
242
|
+
node_scale: int = DEFAULT["MAX_NODE_SIZE"],
|
|
243
|
+
edge_scale: float = DEFAULT["MAX_EDGE_WIDTH"],
|
|
244
|
+
max_nodes: int = DEFAULT["MAX_NODES"],
|
|
245
|
+
max_edges: int = DEFAULT["MAX_EDGES"],
|
|
246
|
+
plt_title: Optional[str] = "Top keywords"):
|
|
236
247
|
# node_list=self.nodes_circuits(node_list)
|
|
237
248
|
g = self.subgraph(max_edges=max_edges, node_list=node_list)
|
|
238
249
|
connected_components = nx.connected_components(g)
|
|
239
|
-
axes=[]
|
|
250
|
+
axes = []
|
|
240
251
|
for connected_component in connected_components:
|
|
241
252
|
if len(connected_component) > 5:
|
|
242
253
|
connected_component_graph = self.subgraph(max_edges=max_edges,
|
|
243
254
|
node_list=connected_component)
|
|
244
|
-
ax=connected_component_graph.plot_network()
|
|
255
|
+
ax = connected_component_graph.plot_network()
|
|
245
256
|
axes.append(ax)
|
|
246
257
|
return axes
|
|
247
258
|
|
|
248
|
-
def find_connected_subgraph(self):
|
|
259
|
+
def find_connected_subgraph(self) -> 'networkGraph':
|
|
249
260
|
logging.info(f'find_connected_subgraph')
|
|
250
261
|
# Copy the original graph to avoid modifying it
|
|
251
|
-
H = self.copy()
|
|
262
|
+
H = self._nx_graph.copy()
|
|
252
263
|
|
|
253
264
|
# Flag to keep track of whether any node with degree < 2 was removed
|
|
254
265
|
removed_node = True
|
|
@@ -265,7 +276,7 @@ class Graph(nx.Graph):
|
|
|
265
276
|
removed_node = True
|
|
266
277
|
break
|
|
267
278
|
|
|
268
|
-
return H
|
|
279
|
+
return networkGraph(H)
|
|
269
280
|
|
|
270
281
|
def top_k_edges(self, attribute: str, reverse: bool = True, k: int = 5) -> Dict[Any, List[Tuple[Any, Dict]]]:
|
|
271
282
|
"""
|
|
@@ -297,7 +308,7 @@ class Graph(nx.Graph):
|
|
|
297
308
|
def from_pandas_edgelist(df: pd.DataFrame,
|
|
298
309
|
source: str = "source",
|
|
299
310
|
target: str = "target",
|
|
300
|
-
weight: str = "weight") ->
|
|
311
|
+
weight: str = "weight") -> 'networkGraph':
|
|
301
312
|
"""
|
|
302
313
|
Initialize netX instance with a simple dataframe
|
|
303
314
|
|
|
@@ -307,11 +318,12 @@ class Graph(nx.Graph):
|
|
|
307
318
|
:param weight: Name of edges weight column in df_source.
|
|
308
319
|
|
|
309
320
|
"""
|
|
310
|
-
|
|
311
|
-
df, source=source, target=target, edge_attr=weight
|
|
312
|
-
|
|
321
|
+
network_G = nx.from_pandas_edgelist(
|
|
322
|
+
df, source=source, target=target, edge_attr=weight)
|
|
323
|
+
network_G = networkGraph(network_G)
|
|
324
|
+
network_G = network_G.find_connected_subgraph()
|
|
313
325
|
|
|
314
|
-
edge_aggregates =
|
|
326
|
+
edge_aggregates = network_G.top_k_edges(attribute=weight, k=10)
|
|
315
327
|
node_aggregates = {}
|
|
316
328
|
for (u, v), weight_value in edge_aggregates.items():
|
|
317
329
|
if u not in node_aggregates:
|
|
@@ -321,62 +333,136 @@ class Graph(nx.Graph):
|
|
|
321
333
|
node_aggregates[u] += weight_value
|
|
322
334
|
node_aggregates[v] += weight_value
|
|
323
335
|
|
|
324
|
-
nx.set_node_attributes(
|
|
336
|
+
nx.set_node_attributes(network_G, node_aggregates, name=weight)
|
|
325
337
|
|
|
326
|
-
|
|
327
|
-
|
|
338
|
+
network_G = network_G.edge_subgraph(
|
|
339
|
+
edges=network_G.top_k_edges(attribute=weight))
|
|
340
|
+
return networkGraph(network_G)
|
|
328
341
|
|
|
329
342
|
|
|
330
|
-
def
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
343
|
+
def aplot_network(pd_df: pd.DataFrame,
|
|
344
|
+
source: str = "source",
|
|
345
|
+
target: str = "target",
|
|
346
|
+
weight: str = "weight",
|
|
347
|
+
title: Optional[str] = None,
|
|
348
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
349
|
+
sort_by: Optional[str] = None,
|
|
350
|
+
ascending: bool = False,
|
|
351
|
+
node_list: Optional[List] = None,
|
|
352
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
340
353
|
if node_list:
|
|
341
|
-
df = pd_df[(pd_df["source"].isin(node_list)) |
|
|
354
|
+
df = pd_df[(pd_df["source"].isin(node_list)) |
|
|
355
|
+
(pd_df["target"].isin(node_list))]
|
|
342
356
|
else:
|
|
343
357
|
df = pd_df
|
|
344
358
|
validate_dataframe(df, cols=[source, target, weight], sort_by=sort_by)
|
|
345
359
|
|
|
346
|
-
graph =
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
360
|
+
graph = networkGraph.from_pandas_edgelist(df,
|
|
361
|
+
source=source,
|
|
362
|
+
target=target,
|
|
363
|
+
weight=weight)
|
|
350
364
|
return graph.plot_network(title=title,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
365
|
+
style=style,
|
|
366
|
+
weight=weight,
|
|
367
|
+
ax=ax)
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def aplot_network_components(pd_df: pd.DataFrame,
|
|
371
|
+
source: str = "source",
|
|
372
|
+
target: str = "target",
|
|
373
|
+
weight: str = "weight",
|
|
374
|
+
title: Optional[str] = None,
|
|
375
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
376
|
+
sort_by: Optional[str] = None,
|
|
377
|
+
node_list: Optional[List] = None,
|
|
378
|
+
ascending: bool = False,
|
|
379
|
+
ax: Optional[List[Axes]] = None) -> List[Axes]:
|
|
364
380
|
if node_list:
|
|
365
|
-
df = pd_df[(pd_df["source"].isin(node_list)) |
|
|
381
|
+
df = pd_df[(pd_df["source"].isin(node_list)) |
|
|
382
|
+
(pd_df["target"].isin(node_list))]
|
|
366
383
|
else:
|
|
367
384
|
df = pd_df
|
|
368
385
|
validate_dataframe(df, cols=[source, target, weight], sort_by=sort_by)
|
|
369
386
|
|
|
370
|
-
graph =
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
387
|
+
graph = networkGraph.from_pandas_edgelist(df,
|
|
388
|
+
source=source,
|
|
389
|
+
target=target,
|
|
390
|
+
weight=weight)
|
|
374
391
|
connected_components = nx.connected_components(graph)
|
|
375
|
-
axes=[]
|
|
392
|
+
axes = []
|
|
393
|
+
i = 0
|
|
376
394
|
for connected_component in connected_components:
|
|
377
395
|
if len(connected_component) > 5:
|
|
378
|
-
connected_component_graph = graph.subgraph(
|
|
379
|
-
|
|
396
|
+
connected_component_graph = graph.subgraph(
|
|
397
|
+
node_list=connected_component)
|
|
398
|
+
ax = connected_component_graph.plot_network(title=f"{title}::{i}",
|
|
399
|
+
style=style,
|
|
400
|
+
weight=weight,
|
|
401
|
+
ax=ax)
|
|
380
402
|
axes.append(ax)
|
|
403
|
+
i += 1
|
|
381
404
|
return axes
|
|
382
|
-
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
def fplot_network(pd_df: pd.DataFrame,
|
|
408
|
+
source: str = "source",
|
|
409
|
+
target: str = "target",
|
|
410
|
+
weight: str = "weight",
|
|
411
|
+
title: Optional[str] = None,
|
|
412
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
413
|
+
sort_by: Optional[str] = None,
|
|
414
|
+
ascending: bool = False,
|
|
415
|
+
node_list: Optional[List] = None,
|
|
416
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Figure:
|
|
417
|
+
fig = plt.figure(figsize=figsize)
|
|
418
|
+
fig.patch.set_facecolor(style.background_color)
|
|
419
|
+
ax = fig.add_subplot()
|
|
420
|
+
ax = aplot_network(pd_df,
|
|
421
|
+
source=source,
|
|
422
|
+
target=target,
|
|
423
|
+
weight=weight,
|
|
424
|
+
title=title,
|
|
425
|
+
style=style,
|
|
426
|
+
sort_by=sort_by,
|
|
427
|
+
ascending=ascending,
|
|
428
|
+
node_list=node_list,
|
|
429
|
+
ax=ax
|
|
430
|
+
)
|
|
431
|
+
return fig
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
def fplot_network_components(pd_df: pd.DataFrame,
|
|
435
|
+
source: str = "source",
|
|
436
|
+
target: str = "target",
|
|
437
|
+
weight: str = "weight",
|
|
438
|
+
title: Optional[str] = None,
|
|
439
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
440
|
+
sort_by: Optional[str] = None,
|
|
441
|
+
ascending: bool = False,
|
|
442
|
+
node_list: Optional[List] = None,
|
|
443
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Figure:
|
|
444
|
+
axes = aplot_network_components(pd_df,
|
|
445
|
+
source=source,
|
|
446
|
+
target=target,
|
|
447
|
+
weight=weight,
|
|
448
|
+
title=title,
|
|
449
|
+
style=style,
|
|
450
|
+
sort_by=sort_by,
|
|
451
|
+
ascending=ascending,
|
|
452
|
+
node_list=node_list
|
|
453
|
+
)
|
|
454
|
+
fig = plt.figure(figsize=figsize)
|
|
455
|
+
fig.patch.set_facecolor(style.background_color)
|
|
456
|
+
ax = fig.add_subplot()
|
|
457
|
+
ax = aplot_network(pd_df,
|
|
458
|
+
source=source,
|
|
459
|
+
target=target,
|
|
460
|
+
weight=weight,
|
|
461
|
+
title=title,
|
|
462
|
+
style=style,
|
|
463
|
+
sort_by=sort_by,
|
|
464
|
+
ascending=ascending,
|
|
465
|
+
node_list=node_list,
|
|
466
|
+
ax=ax
|
|
467
|
+
)
|
|
468
|
+
return fig
|
MatplotLibAPI/Table.py
CHANGED
|
@@ -14,7 +14,7 @@ TABLE_STYLE_TEMPLATE = StyleTemplate(
|
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def
|
|
17
|
+
def aplot_table(pd_df: pd.DataFrame,
|
|
18
18
|
cols: List[str],
|
|
19
19
|
title: Optional[str] = None,
|
|
20
20
|
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
@@ -67,7 +67,7 @@ def plot_table_ax(pd_df: pd.DataFrame,
|
|
|
67
67
|
return ax
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
def
|
|
70
|
+
def fplot_table(pd_df: pd.DataFrame,
|
|
71
71
|
cols: List[str],
|
|
72
72
|
title: Optional[str] = None,
|
|
73
73
|
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
@@ -79,7 +79,7 @@ def plot_table_fig(pd_df: pd.DataFrame,
|
|
|
79
79
|
fig = plt.figure(figsize=figsize)
|
|
80
80
|
fig.patch.set_facecolor(style.background_color)
|
|
81
81
|
ax = fig.add_subplot()
|
|
82
|
-
ax =
|
|
82
|
+
ax = aplot_table(pd_df,
|
|
83
83
|
cols,
|
|
84
84
|
title,
|
|
85
85
|
style,
|
MatplotLibAPI/Timeserie.py
CHANGED
|
@@ -18,7 +18,7 @@ TIMESERIE_STYLE_TEMPLATE = StyleTemplate(
|
|
|
18
18
|
# region Line
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def
|
|
21
|
+
def aplot_timeserie(pd_df: pd.DataFrame,
|
|
22
22
|
label: str,
|
|
23
23
|
x: str,
|
|
24
24
|
y: str,
|
|
@@ -99,7 +99,7 @@ def plot_timeserie_ax(pd_df: pd.DataFrame,
|
|
|
99
99
|
return ax
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
def
|
|
102
|
+
def fplot_timeserie(pd_df: pd.DataFrame,
|
|
103
103
|
label: str,
|
|
104
104
|
x: str,
|
|
105
105
|
y: str,
|
|
@@ -113,7 +113,7 @@ def plot_timeserie_fig(pd_df: pd.DataFrame,
|
|
|
113
113
|
fig = plt.figure(figsize=figsize)
|
|
114
114
|
fig.patch.set_facecolor(style.background_color)
|
|
115
115
|
ax = fig.add_subplot()
|
|
116
|
-
ax =
|
|
116
|
+
ax = aplot_timeserie(pd_df=pd_df,
|
|
117
117
|
label=label,
|
|
118
118
|
x=x,
|
|
119
119
|
y=y,
|
MatplotLibAPI/Treemap.py
CHANGED
MatplotLibAPI/__init__.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
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, fplot_network, NETWORK_STYLE_TEMPLATE
|
|
8
|
+
from .Treemap import fplot_treemap, TREEMAP_STYLE_TEMPLATE
|
|
9
9
|
from typing import List, Optional, Tuple
|
|
10
10
|
import pandas as pd
|
|
11
11
|
from pandas.api.extensions import register_dataframe_accessor
|
|
@@ -21,239 +21,257 @@ 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
|
-
|
|
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,
|
|
85
|
+
label: str,
|
|
86
|
+
x: str,
|
|
87
|
+
y: str,
|
|
88
|
+
z: str,
|
|
89
|
+
title: Optional[str] = None,
|
|
90
|
+
style: StyleTemplate = BUBBLE_STYLE_TEMPLATE,
|
|
91
|
+
max_values: int = 100,
|
|
92
|
+
center_to_mean: bool = False,
|
|
93
|
+
sort_by: Optional[str] = None,
|
|
94
|
+
ascending: bool = False) -> Figure:
|
|
95
|
+
|
|
96
|
+
return plot_composite_bubble(pd_df=self._obj,
|
|
97
|
+
label=label,
|
|
98
|
+
x=x,
|
|
99
|
+
y=y,
|
|
100
|
+
z=z,
|
|
101
|
+
title=title,
|
|
102
|
+
style=style,
|
|
103
|
+
max_values=max_values,
|
|
104
|
+
center_to_mean=center_to_mean,
|
|
105
|
+
sort_by=sort_by,
|
|
106
|
+
ascending=ascending)
|
|
107
|
+
|
|
108
|
+
def aplot_table_ax(self,
|
|
109
|
+
cols: List[str],
|
|
29
110
|
title: Optional[str] = None,
|
|
30
|
-
style: StyleTemplate =
|
|
31
|
-
max_values: int =
|
|
32
|
-
center_to_mean: bool = False,
|
|
111
|
+
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
112
|
+
max_values: int = 20,
|
|
33
113
|
sort_by: Optional[str] = None,
|
|
34
114
|
ascending: bool = False,
|
|
35
|
-
hline: bool = False,
|
|
36
|
-
vline: bool = False,
|
|
37
115
|
ax: Optional[Axes] = None) -> Axes:
|
|
38
116
|
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
center_to_mean=center_to_mean,
|
|
48
|
-
sort_by=sort_by,
|
|
49
|
-
ascending=ascending,
|
|
50
|
-
hline=hline,
|
|
51
|
-
vline=vline,
|
|
52
|
-
ax=ax)
|
|
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)
|
|
53
125
|
|
|
54
|
-
def
|
|
126
|
+
def fplot_table(self,
|
|
127
|
+
cols: List[str],
|
|
128
|
+
title: Optional[str] = None,
|
|
129
|
+
style: StyleTemplate = TABLE_STYLE_TEMPLATE,
|
|
130
|
+
max_values: int = 20,
|
|
131
|
+
sort_by: Optional[str] = None,
|
|
132
|
+
ascending: bool = False,
|
|
133
|
+
figsize: Tuple[float, float] = (19.2, 10.8)) -> Axes:
|
|
134
|
+
|
|
135
|
+
return fplot_table(pd_df=self._obj,
|
|
136
|
+
cols=cols,
|
|
137
|
+
title=title,
|
|
138
|
+
style=style,
|
|
139
|
+
max_values=max_values,
|
|
140
|
+
sort_by=sort_by,
|
|
141
|
+
ascending=ascending,
|
|
142
|
+
figsize=figsize)
|
|
143
|
+
|
|
144
|
+
def aplot_timeserie(self,
|
|
55
145
|
label: str,
|
|
56
146
|
x: str,
|
|
57
147
|
y: str,
|
|
58
|
-
z: str,
|
|
59
148
|
title: Optional[str] = None,
|
|
60
|
-
style: StyleTemplate =
|
|
61
|
-
max_values: int =
|
|
62
|
-
center_to_mean: bool = False,
|
|
149
|
+
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
150
|
+
max_values: int = 100,
|
|
63
151
|
sort_by: Optional[str] = None,
|
|
64
152
|
ascending: bool = False,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
figsize: Tuple[float, float] = (19.2, 10.8)) -> Figure:
|
|
153
|
+
std: bool = False,
|
|
154
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
68
155
|
|
|
69
|
-
return
|
|
156
|
+
return aplot_timeserie(pd_df=self._obj,
|
|
70
157
|
label=label,
|
|
71
158
|
x=x,
|
|
72
159
|
y=y,
|
|
73
|
-
z=z,
|
|
74
160
|
title=title,
|
|
75
161
|
style=style,
|
|
76
162
|
max_values=max_values,
|
|
77
|
-
center_to_mean=center_to_mean,
|
|
78
163
|
sort_by=sort_by,
|
|
79
164
|
ascending=ascending,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
figsize=figsize)
|
|
165
|
+
std=std,
|
|
166
|
+
ax=ax)
|
|
83
167
|
|
|
84
|
-
def
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
ax: Optional[Axes] = None) -> Figure:
|
|
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:
|
|
96
179
|
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
ax=ax)
|
|
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)
|
|
109
191
|
|
|
110
|
-
def
|
|
111
|
-
|
|
192
|
+
def aplot_network(self,
|
|
193
|
+
source: str = "source",
|
|
194
|
+
target: str = "target",
|
|
195
|
+
weight: str = "weight",
|
|
112
196
|
title: Optional[str] = None,
|
|
113
|
-
style: StyleTemplate =
|
|
114
|
-
max_values: int = 20,
|
|
197
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
115
198
|
sort_by: Optional[str] = None,
|
|
116
199
|
ascending: bool = False,
|
|
200
|
+
node_list: Optional[List] = None,
|
|
117
201
|
ax: Optional[Axes] = None) -> Axes:
|
|
118
202
|
|
|
119
|
-
return
|
|
120
|
-
|
|
203
|
+
return aplot_network(pd_df=self._obj,
|
|
204
|
+
source=source,
|
|
205
|
+
target=target,
|
|
206
|
+
weight=weight,
|
|
121
207
|
title=title,
|
|
122
208
|
style=style,
|
|
123
|
-
max_values=max_values,
|
|
124
209
|
sort_by=sort_by,
|
|
125
210
|
ascending=ascending,
|
|
211
|
+
node_list=node_list,
|
|
126
212
|
ax=ax)
|
|
127
213
|
|
|
128
|
-
def
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
cols=cols,
|
|
139
|
-
title=title,
|
|
140
|
-
style=style,
|
|
141
|
-
max_values=max_values,
|
|
142
|
-
sort_by=sort_by,
|
|
143
|
-
ascending=ascending,
|
|
144
|
-
figsize=figsize)
|
|
145
|
-
|
|
146
|
-
def plot_timeserie_ax(self,
|
|
147
|
-
label: str,
|
|
148
|
-
x: str,
|
|
149
|
-
y: str,
|
|
150
|
-
title: Optional[str] = None,
|
|
151
|
-
style: StyleTemplate = TIMESERIE_STYLE_TEMPLATE,
|
|
152
|
-
max_values: int = 100,
|
|
153
|
-
sort_by: Optional[str] = None,
|
|
154
|
-
ascending: bool = False,
|
|
155
|
-
std: bool = False,
|
|
156
|
-
ax: Optional[Axes] = None) -> Axes:
|
|
214
|
+
def aplot_network_components(self,
|
|
215
|
+
source: str = "source",
|
|
216
|
+
target: str = "target",
|
|
217
|
+
weight: str = "weight",
|
|
218
|
+
title: Optional[str] = None,
|
|
219
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
220
|
+
sort_by: Optional[str] = None,
|
|
221
|
+
ascending: bool = False,
|
|
222
|
+
node_list: Optional[List] = None,
|
|
223
|
+
ax: Optional[Axes] = None) -> Axes:
|
|
157
224
|
|
|
158
|
-
return
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
ax=ax)
|
|
225
|
+
return aplot_network_components(df=self._obj,
|
|
226
|
+
source=source,
|
|
227
|
+
target=target,
|
|
228
|
+
weight=weight,
|
|
229
|
+
title=title,
|
|
230
|
+
style=style,
|
|
231
|
+
sort_by=sort_by,
|
|
232
|
+
ascending=ascending,
|
|
233
|
+
node_list=node_list,
|
|
234
|
+
ax=ax)
|
|
169
235
|
|
|
170
|
-
def
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
std: bool = False,
|
|
180
|
-
figsize: Tuple[float, float] = (19.2, 10.8)) -> Axes:
|
|
181
|
-
|
|
182
|
-
return plot_timeserie_fig(pd_df=self._obj,
|
|
183
|
-
label=label,
|
|
184
|
-
x=x,
|
|
185
|
-
y=y,
|
|
186
|
-
title=title,
|
|
187
|
-
style=style,
|
|
188
|
-
max_values=max_values,
|
|
189
|
-
sort_by=sort_by,
|
|
190
|
-
ascending=ascending,
|
|
191
|
-
std=std,
|
|
192
|
-
figsize=figsize)
|
|
193
|
-
|
|
194
|
-
def plot_network(self,
|
|
195
|
-
source: str = "source",
|
|
196
|
-
target: str = "target",
|
|
197
|
-
weight: str = "weight",
|
|
198
|
-
title: Optional[str] = None,
|
|
199
|
-
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
200
|
-
sort_by: Optional[str] = None,
|
|
201
|
-
ascending: bool = False,
|
|
202
|
-
node_list: Optional[List] = None,
|
|
203
|
-
ax: Optional[Axes] = None) -> Axes:
|
|
204
|
-
|
|
205
|
-
return plot_network(df=self._obj,
|
|
206
|
-
source=source,
|
|
207
|
-
target=target,
|
|
208
|
-
weight=weight,
|
|
209
|
-
title=title,
|
|
210
|
-
style=style,
|
|
211
|
-
sort_by=sort_by,
|
|
212
|
-
ascending=ascending,
|
|
213
|
-
node_list=node_list,
|
|
214
|
-
ax=ax)
|
|
215
|
-
|
|
216
|
-
def plot_network_components(self,
|
|
217
|
-
source: str = "source",
|
|
218
|
-
target: str = "target",
|
|
219
|
-
weight: str = "weight",
|
|
220
|
-
title: Optional[str] = None,
|
|
221
|
-
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
222
|
-
sort_by: Optional[str] = None,
|
|
223
|
-
ascending: bool = False,
|
|
224
|
-
node_list: Optional[List] = None,
|
|
225
|
-
ax: Optional[Axes] = None) -> Axes:
|
|
236
|
+
def fplot_network(self,
|
|
237
|
+
source: str = "source",
|
|
238
|
+
target: str = "target",
|
|
239
|
+
weight: str = "weight",
|
|
240
|
+
title: Optional[str] = None,
|
|
241
|
+
style: StyleTemplate = NETWORK_STYLE_TEMPLATE,
|
|
242
|
+
sort_by: Optional[str] = None,
|
|
243
|
+
ascending: bool = False,
|
|
244
|
+
node_list: Optional[List] = None) -> Axes:
|
|
226
245
|
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
ax=ax)
|
|
246
|
+
return fplot_network(pd_df=self._obj,
|
|
247
|
+
source=source,
|
|
248
|
+
target=target,
|
|
249
|
+
weight=weight,
|
|
250
|
+
title=title,
|
|
251
|
+
style=style,
|
|
252
|
+
sort_by=sort_by,
|
|
253
|
+
ascending=ascending,
|
|
254
|
+
node_list=node_list)
|
|
237
255
|
|
|
238
|
-
def
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
return
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
+
def fplot_treemap(self,
|
|
257
|
+
path: str,
|
|
258
|
+
values: str,
|
|
259
|
+
style: StyleTemplate = TREEMAP_STYLE_TEMPLATE,
|
|
260
|
+
title: Optional[str] = None,
|
|
261
|
+
color: Optional[str] = None,
|
|
262
|
+
max_values: int = 100,
|
|
263
|
+
sort_by: Optional[str] = None,
|
|
264
|
+
ascending: bool = False) -> go.Figure:
|
|
265
|
+
return fplot_treemap(pd_df=self._obj,
|
|
266
|
+
path=path,
|
|
267
|
+
values=values,
|
|
268
|
+
title=title,
|
|
269
|
+
style=style,
|
|
270
|
+
color=color,
|
|
271
|
+
max_values=max_values,
|
|
272
|
+
sort_by=sort_by,
|
|
273
|
+
ascending=ascending)
|
|
256
274
|
|
|
257
275
|
|
|
258
|
-
__all__ = ["validate_dataframe", "
|
|
259
|
-
"plot_pivotbar", "
|
|
276
|
+
__all__ = ["validate_dataframe", "aplot_bubble", "aplot_timeserie", "aplot_table", "aplot_network", "aplot_network_components", "fplot_network",
|
|
277
|
+
"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=zzizLBAMD-nV-1WGZTIoOQn3SVsvr9R8Ba2DTCyuTvA,18790
|
|
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=AfjLR0mpN2uWc4cx3jkqS3co0ZFXiooWtD_rwSOmLUY,11931
|
|
10
|
+
MatplotLibAPI-3.2.4.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
|
|
11
|
+
MatplotLibAPI-3.2.4.dist-info/METADATA,sha256=vumufH-kr9LEMDkHHrjQ_16mi4XSQaLUnonjVWYY5Cg,462
|
|
12
|
+
MatplotLibAPI-3.2.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
13
|
+
MatplotLibAPI-3.2.4.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
|
|
14
|
+
MatplotLibAPI-3.2.4.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
MatplotLibAPI/Bubble.py,sha256=frIyQOuiw4UUDq0pP983fLTSWD3-sdNOa65qwSaynZo,5123
|
|
2
|
-
MatplotLibAPI/Composite.py,sha256=q-Jit2DsqTYmOF_9vmfb0sDwtZWRywHjzsidgywTjdw,2810
|
|
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=L9BiL16HFyCdYWHmbgkGaMFIThhhF_GSgh1OAILMlxQ,2816
|
|
7
|
-
MatplotLibAPI/Timeserie.py,sha256=5d-g60iLQlhsxLQdOaoQboQUAnu1mkpptSZ06k9Kuo4,4959
|
|
8
|
-
MatplotLibAPI/Treemap.py,sha256=ELkmcNZuWh-thd4gKwqkSQTisnBDutHHgxGuH1ZBzsg,2552
|
|
9
|
-
MatplotLibAPI/__init__.py,sha256=09gabCsJezGwaq_BUXvEjd2LQmStNr5B8r14WA1OZdc,11388
|
|
10
|
-
MatplotLibAPI-3.2.2.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
|
|
11
|
-
MatplotLibAPI-3.2.2.dist-info/METADATA,sha256=5vQRvyDbS30i80HtP22uLgvmnkaPCtn0_79LetKnHGs,462
|
|
12
|
-
MatplotLibAPI-3.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
13
|
-
MatplotLibAPI-3.2.2.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
|
|
14
|
-
MatplotLibAPI-3.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|