Skip to content

Commit 647df87

Browse files
authored
Remove list inversions (#27)
Closes #26 There was some customs list inversion for the colour palette management on the table side.
1 parent 82f5ef3 commit 647df87

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

panel/simdec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def create_color_pickers(states, colors):
185185
@pn.cache
186186
def palette(res, colors_picked):
187187
cmaps = [single_color_to_colormap(color_picked) for color_picked in colors_picked]
188-
return sd.palette(res.states[::-1], cmaps=cmaps[::-1])
188+
return sd.palette(res.states, cmaps=cmaps)
189189

190190

191191
@pn.cache
@@ -224,7 +224,7 @@ def tableau(res, states, palette):
224224
var_names=res.var_names,
225225
states=states,
226226
bins=res.bins,
227-
palette=palette[::-1],
227+
palette=palette,
228228
)
229229
return styler
230230

src/simdec/visualization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515

1616
SEQUENTIAL_PALETTES = [
17+
"#26DCD1",
1718
"#DC267F",
1819
"#E8EA2F",
19-
"#26DCD1",
2020
"#C552E4",
2121
"#3F45D0",
2222
"Oranges",
@@ -253,7 +253,7 @@ def tableau(
253253
table.insert(loc=0, column="N°", value=np.arange(1, stop=len(table) + 1)[::-1])
254254

255255
# style the colour background with palette
256-
cmap = mpl.colors.ListedColormap(palette[::-1])
256+
cmap = mpl.colors.ListedColormap(palette)
257257
styler = table.style
258258
styler.format(precision=2)
259259
styler.background_gradient(subset=["colour"], cmap=cmap)

0 commit comments

Comments
 (0)