d3graph 2.8.0__tar.gz → 2.8.1__tar.gz
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.
- {d3graph-2.8.0/d3graph.egg-info → d3graph-2.8.1}/PKG-INFO +1 -1
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/__init__.py +1 -1
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/d3graph.py +45 -13
- {d3graph-2.8.0 → d3graph-2.8.1/d3graph.egg-info}/PKG-INFO +1 -1
- {d3graph-2.8.0 → d3graph-2.8.1}/LICENSE +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/MANIFEST.in +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/README.md +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/d3js/d3.v3.js +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/d3js/d3graphscript.js +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/d3js/index.html.j2 +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/d3js/style.css +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/examples.py +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph/examples_docs.py +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph.egg-info/SOURCES.txt +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph.egg-info/dependency_links.txt +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph.egg-info/requires.txt +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/d3graph.egg-info/top_level.txt +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/pyproject.toml +0 -0
- {d3graph-2.8.0 → d3graph-2.8.1}/setup.cfg +0 -0
|
@@ -1602,20 +1602,52 @@ def adjmat2vec(adjmat, min_weight: float = 1.0) -> pd.DataFrame:
|
|
|
1602
1602
|
return adjmat
|
|
1603
1603
|
|
|
1604
1604
|
|
|
1605
|
+
# def _check_hex_color(color, n=None, cmap='Set1'):
|
|
1606
|
+
# if isinstance(color, str) and len(color) != 7:
|
|
1607
|
+
# logger.warning('Input parameter [color] has wrong format. Must be like color="#000000" <auto-fixing>')
|
|
1608
|
+
# return get_hex_color(color, cmap=cmap)[0]
|
|
1609
|
+
# if isinstance(color, (list, np.ndarray, pd.Series, pd.Series, StringArray)) and len(color) == 0:
|
|
1610
|
+
# logger.warning('Input parameter [color] has wrong format and length. Must be like: color=["#000000", "...", "#000000"] <auto-fixing>')
|
|
1611
|
+
# return get_hex_color(color, cmap=cmap)[0]
|
|
1612
|
+
# if isinstance(color, (list, np.ndarray, pd.Series, pd.Series, StringArray)) and (not np.all(list(map(lambda x: len(x) == 7, color)))):
|
|
1613
|
+
# logger.warning('[color] contains incorrect hex-colors. Hex must be of length 7: ["#000000", "#000000", etc] <auto-fixing>')
|
|
1614
|
+
# return get_hex_color(color, cmap=cmap)[0]
|
|
1615
|
+
# if (n is not None) and isinstance(color, (list, np.ndarray, pd.Series, pd.Series, StringArray)) and len(color) != n:
|
|
1616
|
+
# logger.warning(f'Input parameter [color] has wrong length. Must be of length: {str(n)} <auto-fixing>')
|
|
1617
|
+
# return get_hex_color(color, cmap=cmap)[0]
|
|
1618
|
+
# # Return original input
|
|
1619
|
+
# return color
|
|
1620
|
+
|
|
1605
1621
|
def _check_hex_color(color, n=None, cmap='Set1'):
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
if isinstance(color,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1622
|
+
seq_types = (list, np.ndarray, pd.Series, StringArray)
|
|
1623
|
+
|
|
1624
|
+
# Single string
|
|
1625
|
+
if isinstance(color, str):
|
|
1626
|
+
if len(color) != 7 or not color.startswith('#'):
|
|
1627
|
+
logger.warning('Invalid [color] format. Expected "#000000" <auto-fixing>')
|
|
1628
|
+
return get_hex_color(color, cmap=cmap)[0]
|
|
1629
|
+
return color
|
|
1630
|
+
|
|
1631
|
+
# Sequence input
|
|
1632
|
+
if isinstance(color, seq_types):
|
|
1633
|
+
|
|
1634
|
+
if len(color) == 0:
|
|
1635
|
+
logger.warning('Invalid [color] sequence. Expected ["#000000", ...] <auto-fixing>')
|
|
1636
|
+
return get_hex_color(color, cmap=cmap)[0]
|
|
1637
|
+
|
|
1638
|
+
valid = np.all([
|
|
1639
|
+
isinstance(x, str) and len(x) == 7 and x.startswith('#')
|
|
1640
|
+
for x in color
|
|
1641
|
+
])
|
|
1642
|
+
|
|
1643
|
+
if not valid:
|
|
1644
|
+
logger.warning('Invalid hex colors in [color]. Expected ["#000000", ...] <auto-fixing>')
|
|
1645
|
+
return get_hex_color(color, cmap=cmap)[0]
|
|
1646
|
+
|
|
1647
|
+
if (n is not None) and (len(color) != n):
|
|
1648
|
+
logger.warning(f'Invalid [color] length. Expected length={n} <auto-fixing>')
|
|
1649
|
+
return get_hex_color(color, cmap=cmap)[0]
|
|
1650
|
+
|
|
1619
1651
|
return color
|
|
1620
1652
|
|
|
1621
1653
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|