You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pl.render_shapes do not support normal hex color #391
Hi,
An normal hex color is a string include seven chars, such as "#DD4958", but pl.render_shapes uses nine chars when using datashader, which is not compatible with palette in stored in sdata["table"].uns["leiden_colors"]:
This is my palette:
['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b']
So ian error occurred when using customized palette:
Besides, I must run sdata.pl.render_shapes without groups and palette first , then run sdata.pl.render_shapes with groups and palette for the second time. If I run sdata.pl.render_shapes with groups and palette directly, this error will occur:
Another question, we can only set groups as one "string" or all the categories. Such as if we have "0", "1", "2", "3", "4", "5" categories, we can only set groups="3" or groups=["0", "1","2","3","4","5"], we cannot set groups=["1","2"] and so on.
The same issue persists. Besides that, why is it mandatory to specify groups when providing a palette? This restriction prevents me from customizing cell group colors freely, which is very inconvenient.
The same issue persists. Besides that, why is it mandatory to specify groups when providing a palette? This restriction prevents me from customizing cell group colors freely, which is very inconvenient.
Hi,
I'm on version 0.2.14.dev13+gc796afbb7.d20260117 and I don't see this issue. the pallet I input was the same type as yours, a list ["#1474B2", "#7BCCC4", "#DF65B0", "#AA0649", "#FEDA7E"], from
NICO_CT_COLORS = {
"CTB": "#1474B2",
"STB": "#7BCCC4",
"VEC": "#DF65B0",
"Fibroblast": "#AA0649",
"Hofbauer cells": "#FEDA7E"
}
present_groups = table.obs[CELLTYPE_KEY].dropna().unique().tolist()
groups = [g for g in present_groups if g in NICO_CT_COLORS]
palette = [NICO_CT_COLORS[g] for g in groups]
In my case I have color uns in the table so there's a info:
INFO Successfully extracted 6 colors from 'nico_ct_leiden_0.1_colors' in
table 'cells_nico_table_leiden_0.1_feature_selection'.
while it is override by the input palette in render_shapes, not the uns (different colors in the list)
the traceback you suggested there's character drop somewhere so that the len of the color code is no long 7. -- Not sure how.
I'm not sure if I get your customize palette correctly? you can specify group and palette to be the same, is that fully customizable?
Activity
wangjiawen2013 commentedon Dec 2, 2024
Besides, I must run
sdata.pl.render_shapeswithoutgroupsandpalettefirst , then runsdata.pl.render_shapeswithgroupsandpalettefor the second time. If I runsdata.pl.render_shapeswithgroupsandpalettedirectly, this error will occur:wangjiawen2013 commentedon Dec 2, 2024
Another question, we can only set groups as one "string" or all the categories. Such as if we have "0", "1", "2", "3", "4", "5" categories, we can only set
groups="3"orgroups=["0", "1","2","3","4","5"], we cannot setgroups=["1","2"]and so on.LucaMarconato commentedon Jan 5, 2025
Thanks for reporting. It seems to be related to #375. @timtreis any take?
timtreis commentedon Jan 7, 2025
hm, odd. Will investigate
christophechu commentedon Feb 14, 2025
The same issue persists. Besides that, why is it mandatory to specify groups when providing a palette? This restriction prevents me from customizing cell group colors freely, which is very inconvenient.
@LucaMarconato @timtreis
LucaMarconato commentedon Dec 26, 2025
@timtreis is this still open?
mamyAndrianteranagna commentedon Feb 6, 2026
Hello,
Is this issue solved ?
I'm facing the same problem.
Thanks !
brainfo commentedon Feb 15, 2026
Hi,
I'm on version 0.2.14.dev13+gc796afbb7.d20260117 and I don't see this issue. the pallet I input was the same type as yours, a list
["#1474B2", "#7BCCC4", "#DF65B0", "#AA0649", "#FEDA7E"], fromIn my case I have color uns in the table so there's a info:
while it is override by the input palette in render_shapes, not the uns (different colors in the list)
the traceback you suggested there's character drop somewhere so that the len of the color code is no long 7. -- Not sure how.
I'm not sure if I get your customize palette correctly? you can specify group and palette to be the same, is that fully customizable?
timtreis commentedon Mar 25, 2026
Works with
0.3.0now