marsilea 0.3.4__py3-none-any.whl → 0.3.5__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.
marsilea/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Create x-layout visualization"""
2
2
 
3
- __version__ = "0.3.4"
3
+ __version__ = "0.3.5"
4
4
 
5
5
  import marsilea.plotter as plotter
6
6
  from ._deform import Deformation
marsilea/base.py CHANGED
@@ -80,7 +80,7 @@ class LegendMaker:
80
80
  """
81
81
  if name is None:
82
82
  name = str(uuid4())
83
- self._user_legends[name] = legend
83
+ self._user_legends[name] = [legend]
84
84
 
85
85
  def add_legends(
86
86
  self,
@@ -2,7 +2,7 @@ import pandas as pd
2
2
  import seaborn
3
3
  from legendkit import CatLegend
4
4
  from seaborn import color_palette
5
- from typing import Mapping
5
+ from typing import Mapping, Sequence
6
6
 
7
7
  from .base import StatsBase
8
8
  from ..utils import ECHARTS16
@@ -51,6 +51,8 @@ class _SeabornBase(StatsBase):
51
51
  # kwargs['palette'] = "dark:C0"
52
52
  if palette is not None:
53
53
  kwargs["palette"] = palette
54
+ if isinstance(palette, Sequence):
55
+ self.set_params({"palette": palette})
54
56
 
55
57
  kwargs.pop("x", None)
56
58
  kwargs.pop("y", None)
@@ -80,6 +82,7 @@ class _SeabornBase(StatsBase):
80
82
  ax = spec.ax
81
83
  data = spec.data
82
84
  gp = spec.group_params
85
+
83
86
  if gp is None:
84
87
  gp = {}
85
88
  x, y = "var", "value"
@@ -106,6 +109,9 @@ class _SeabornBase(StatsBase):
106
109
  x, y = y, x
107
110
  self.kws["x"] = x
108
111
  self.kws["y"] = y
112
+ if spec.params is not None:
113
+ palette = [p.get("palette", "C0") for p in spec.params]
114
+ self.kws["palette"] = palette
109
115
  options = {**self.kws, **gp}
110
116
  if options.get("palette") is not None:
111
117
  options["hue"] = "var"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: marsilea
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: Create x-layout visualization
5
5
  Author: Zhihang Zheng
6
6
  Author-email: Mr-Milk <yzheng@cemm.at>
@@ -1,7 +1,7 @@
1
- marsilea/__init__.py,sha256=xBHLXhwY1QPzu_IVW4za0u8ZUWG6gfQCP3V6O-UEEf0,533
1
+ marsilea/__init__.py,sha256=MK00zrdKPjFGFcfH0KfoZz9MZhkYffJ-QTwDtzELohs,533
2
2
  marsilea/_api.py,sha256=tymWZHfjhx8-0NNd9762znfdIu36NrARRweEIr5L1mA,283
3
3
  marsilea/_deform.py,sha256=SKXLvhyUrwTRAw7Fl--OpupDLk6T3S5DRfwCAdewHQs,14138
4
- marsilea/base.py,sha256=t11XDYIjQmeK3tkhY2WFtJrASooY4PGJheEYnWYDVuY,45867
4
+ marsilea/base.py,sha256=YQNgkLPX2RoQzhLdEaxf6ZLFECjAqXdye9G5XG64sAY,45869
5
5
  marsilea/dataset.py,sha256=a0mXjPu9_tRGHofnnQaTryFpxftkfqldq_ZLXMSBf7A,4410
6
6
  marsilea/dendrogram.py,sha256=WUnV2JMSY9mPt1sfkFAEikkl2ta7xHFD13teas_iZgE,14767
7
7
  marsilea/exceptions.py,sha256=Wxy31eCWkoXTPwqaa7R5F7cJ3uCtzqhJXmxVqqX8eAA,661
@@ -12,7 +12,7 @@ marsilea/upset.py,sha256=12ExZ6yUQocd3bSLYtizEblJgILn_QCQaoeP-SP2q9E,30138
12
12
  marsilea/utils.py,sha256=IaAaOBdE668XuGiA-k_gmOtHYqfpIxPv_-molMSBPfs,2851
13
13
  marsilea/plotter/__init__.py,sha256=aEN-Yta4USY5_l-D97XYySALEgxMmFieA08DzK3xdB4,737
14
14
  marsilea/plotter/_images.py,sha256=BC9iyWBLVY-nmUW1pSZq06pwHZN1MrW2psMIDreLReg,3062
15
- marsilea/plotter/_seaborn.py,sha256=wC2sqVokSsk_uqYkjtg6HNrsifawLwqsQoDgJWIkSPs,7834
15
+ marsilea/plotter/_seaborn.py,sha256=XePOYnIFf9lDXXZffSL-YKSV162hKOWsvuxAvH2oHQo,8111
16
16
  marsilea/plotter/_utils.py,sha256=Efhdk-TrrAanhbXRiEVWThMYvZ4vVHZMVYMs5X3JvIM,710
17
17
  marsilea/plotter/arc.py,sha256=iBAvQeYLMNaXsykkpE6BJN1CTaBNntlfispFV2LvSUE,8102
18
18
  marsilea/plotter/area.py,sha256=UOI8xdXMORXdgEG7fT9Lmx3Zk0_7XZl9nMw9A_CZkKA,2590
@@ -21,7 +21,7 @@ marsilea/plotter/base.py,sha256=Kzp0474WlXQse5jK4kLPtkVQLH9zpEwYNocV4c0CD-A,1962
21
21
  marsilea/plotter/bio.py,sha256=_pZkGoAei7eirFCpu7AcZJhebBneNjUKcZlI36bpqUE,5044
22
22
  marsilea/plotter/mesh.py,sha256=JctVkK5xjsUnRjX2ik3ntL-k-Didi7OAUfdmgkZu6IQ,23116
23
23
  marsilea/plotter/text.py,sha256=oYJ5py3_nGHKi60DSVzFgPg4drnTSTw__IcYs0cut4M,36222
24
- marsilea-0.3.4.dist-info/LICENSE,sha256=2TLD8FnLJqXzg8YBRs7W3VZBwfWfp4ArDfBl-rn96Qc,1074
25
- marsilea-0.3.4.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
26
- marsilea-0.3.4.dist-info/METADATA,sha256=yKF08xe5gV0zrcW_KgA8hpA84DH1HxJ5bMx-5l4Whbw,4055
27
- marsilea-0.3.4.dist-info/RECORD,,
24
+ marsilea-0.3.5.dist-info/LICENSE,sha256=2TLD8FnLJqXzg8YBRs7W3VZBwfWfp4ArDfBl-rn96Qc,1074
25
+ marsilea-0.3.5.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
26
+ marsilea-0.3.5.dist-info/METADATA,sha256=WNby0TTARbfq5zrKSbelRLRchsPRURRraukRSnZYO64,4055
27
+ marsilea-0.3.5.dist-info/RECORD,,