MatplotLibAPI 3.1.1__py3-none-any.whl → 3.1.2__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 -2
- MatplotLibAPI/Composite.py +1 -2
- MatplotLibAPI/Network.py +1 -2
- MatplotLibAPI/Table.py +1 -2
- MatplotLibAPI/Timeserie.py +1 -2
- MatplotLibAPI/Treemap.py +5 -4
- MatplotLibAPI/__init__.py +16 -7
- {MatplotLibAPI-3.1.1.dist-info → MatplotLibAPI-3.1.2.dist-info}/METADATA +1 -1
- MatplotLibAPI-3.1.2.dist-info/RECORD +13 -0
- MatplotLibAPI-3.1.1.dist-info/RECORD +0 -13
- {MatplotLibAPI-3.1.1.dist-info → MatplotLibAPI-3.1.2.dist-info}/LICENSE +0 -0
- {MatplotLibAPI-3.1.1.dist-info → MatplotLibAPI-3.1.2.dist-info}/WHEEL +0 -0
- {MatplotLibAPI-3.1.1.dist-info → MatplotLibAPI-3.1.2.dist-info}/top_level.txt +0 -0
MatplotLibAPI/Bubble.py
CHANGED
|
@@ -6,8 +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
|
|
10
|
-
from .. import validate_dataframe
|
|
9
|
+
from . import DynamicFuncFormatter, StyleTemplate, generate_ticks, string_formatter, bmk_formatter, percent_formatter, format_func,validate_dataframe
|
|
11
10
|
|
|
12
11
|
BUBBLE_STYLE_TEMPLATE = StyleTemplate(
|
|
13
12
|
format_funcs={"label": string_formatter,
|
MatplotLibAPI/Composite.py
CHANGED
|
@@ -8,8 +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
|
|
12
|
-
from .. import validate_dataframe
|
|
11
|
+
from . import StyleTemplate, format_func, validate_dataframe
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
def plot_composite_bubble(
|
MatplotLibAPI/Network.py
CHANGED
|
@@ -13,8 +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
|
|
17
|
-
from .. import validate_dataframe
|
|
16
|
+
from . import StyleTemplate, string_formatter, format_func,validate_dataframe
|
|
18
17
|
|
|
19
18
|
NETWORK_STYLE_TEMPLATE = StyleTemplate(
|
|
20
19
|
)
|
MatplotLibAPI/Table.py
CHANGED
|
@@ -3,8 +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
|
|
7
|
-
from .. import validate_dataframe
|
|
6
|
+
from . import StyleTemplate, string_formatter,validate_dataframe
|
|
8
7
|
|
|
9
8
|
TABLE_STYLE_TEMPLATE = StyleTemplate(
|
|
10
9
|
background_color='black',
|
MatplotLibAPI/Timeserie.py
CHANGED
|
@@ -6,8 +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
|
|
10
|
-
from .. import validate_dataframe
|
|
9
|
+
from . import DynamicFuncFormatter, StyleTemplate, string_formatter, bmk_formatter, format_func,validate_dataframe
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
TIMESERIE_STYLE_TEMPLATE = StyleTemplate(
|
MatplotLibAPI/Treemap.py
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
# %%
|
|
3
3
|
from typing import Optional
|
|
4
4
|
import pandas as pd
|
|
5
|
+
from pandas import CategoricalDtype,BooleanDtype
|
|
5
6
|
import plotly.graph_objects as go
|
|
6
7
|
|
|
7
|
-
from . import StyleTemplate, string_formatter, percent_formatter
|
|
8
|
-
|
|
8
|
+
from . import StyleTemplate, string_formatter, percent_formatter,validate_dataframe
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
TREEMAP_STYLE_TEMPLATE = StyleTemplate(
|
|
@@ -49,9 +50,9 @@ def plot_treemap(pd_df: pd.DataFrame,
|
|
|
49
50
|
|
|
50
51
|
if color and color in pd_df.columns:
|
|
51
52
|
color_data = pd_df[color]
|
|
52
|
-
if
|
|
53
|
+
if isinstance(color_data, CategoricalDtype) or pd.api.types.is_object_dtype(color_data):
|
|
53
54
|
color_data = color_data.astype('category').cat.codes
|
|
54
|
-
elif
|
|
55
|
+
elif isinstance(color_data, BooleanDtype):
|
|
55
56
|
color_data = color_data.astype(int)
|
|
56
57
|
data['marker'] = dict(colorscale="Viridis",
|
|
57
58
|
colors=color_data.to_list())
|
MatplotLibAPI/__init__.py
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
from .Treemap import plot_treemap, TREEMAP_STYLE_TEMPLATE
|
|
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
|
|
7
|
+
from .Bubble import plot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
2
8
|
from typing import List, Optional, Dict, Callable, Union
|
|
3
9
|
from dataclasses import dataclass
|
|
4
10
|
import pandas as pd
|
|
@@ -11,16 +17,19 @@ from matplotlib.dates import num2date
|
|
|
11
17
|
from matplotlib.ticker import FuncFormatter
|
|
12
18
|
import plotly.graph_objects as go
|
|
13
19
|
|
|
14
|
-
from . import StyleTemplate
|
|
15
|
-
from .Bubble import plot_bubble, BUBBLE_STYLE_TEMPLATE
|
|
16
|
-
from .Composite import plot_composite_bubble
|
|
17
|
-
from .Timeserie import plot_timeserie, TIMESERIE_STYLE_TEMPLATE
|
|
18
|
-
from .Table import plot_table, TABLE_STYLE_TEMPLATE
|
|
19
|
-
from .Network import Graph
|
|
20
|
-
from .Treemap import plot_treemap, TREEMAP_STYLE_TEMPLATE
|
|
21
20
|
|
|
22
21
|
# region Utils
|
|
23
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
|
+
|
|
24
33
|
|
|
25
34
|
def format_func(
|
|
26
35
|
format_funcs: Optional[Dict[str, Optional[Callable[[Union[int, float, str]], str]]]],
|
|
@@ -0,0 +1,13 @@
|
|
|
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,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
MatplotLibAPI/Bubble.py,sha256=dYmmtYKECFcraAwfStc5Se9TmxsCUxmRyDS2q3lLxQc,3844
|
|
2
|
-
MatplotLibAPI/Composite.py,sha256=XEW5iaXuqjB1ask_M2ZhGnj8enWcxLmt8nqQdw_HNxE,2848
|
|
3
|
-
MatplotLibAPI/Network.py,sha256=2IHpfTolux84OhJ2xcmROcXFM7lr-ZUH6E_oX8t5AyA,14851
|
|
4
|
-
MatplotLibAPI/Pivot.py,sha256=Bo7ZpkxqoE75e8vpSsKIT5X2Q7lLdfAyy46ox1fARbc,7183
|
|
5
|
-
MatplotLibAPI/Table.py,sha256=RxADNGU_EghQFCxV7Tlk7mYbLRJXPJ7XNK5emjAg8e0,2007
|
|
6
|
-
MatplotLibAPI/Timeserie.py,sha256=SJ2TgaXynbBiwNXjCIbSXlQa9vLh2weyNFW5Xeaknb4,3448
|
|
7
|
-
MatplotLibAPI/Treemap.py,sha256=fOUMeWd8JqI3KhI2mmYg0o0pevBd_af80Im4ILm9wBo,2511
|
|
8
|
-
MatplotLibAPI/__init__.py,sha256=YUSyPpLmu7riEv1X76OLjIhWGtZMK5x0WqaFO-_Oh-g,10081
|
|
9
|
-
MatplotLibAPI-3.1.1.dist-info/LICENSE,sha256=hMErKLb6YZR3lRR5zr-vxeFkvY69QAaafgSpZ5-P1dQ,1067
|
|
10
|
-
MatplotLibAPI-3.1.1.dist-info/METADATA,sha256=dkZ4xZfVEhhf7V7UY1fMXs_SCBIjvo-gIj3c3Lum_yY,462
|
|
11
|
-
MatplotLibAPI-3.1.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
12
|
-
MatplotLibAPI-3.1.1.dist-info/top_level.txt,sha256=MrzbBjDEW48Vb6YhQIqpFYGOhHzQnEIM5Qy2xy2iqew,14
|
|
13
|
-
MatplotLibAPI-3.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|