mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
chore: remove the gradient selector
Signed-off-by: David Brenn <davidbrenn@t-online.de>
This commit is contained in:
parent
c530a024e2
commit
efa3b2f4de
5 changed files with 0 additions and 46 deletions
|
@ -180,9 +180,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="gradient_selector"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -375,14 +375,6 @@ class Preferences(QDialog):
|
|||
self.form.color_blind.setChecked(self.mw.pm.color_blind())
|
||||
qconnect(self.form.color_blind.stateChanged, self.on_color_blind_checkbox_changed)
|
||||
|
||||
self.form.gradient_selector.setVisible(not is_win)
|
||||
self.form.gradient_selector.addItems(["Default","Viridis","Inferno","Magma","Plasma","Cividis",])
|
||||
self.form.gradient_selector.setCurrentIndex(self.mw.pm.get_gradient_index())
|
||||
qconnect(
|
||||
self.form.gradient_selector.currentIndexChanged,
|
||||
self.mw.pm.set_gradient_index,
|
||||
)
|
||||
|
||||
self.setup_language()
|
||||
self.setup_video_driver()
|
||||
|
||||
|
|
|
@ -540,12 +540,6 @@ create table if not exists profiles
|
|||
|
||||
def color_blind(self) -> bool:
|
||||
return self.meta.get("color_blind", False)
|
||||
|
||||
def set_gradient_index(self, index: int) -> None:
|
||||
self.meta["gradient_index"] = index
|
||||
|
||||
def get_gradient_index(self) -> int:
|
||||
return self.meta.get("gradient_index", 0)
|
||||
|
||||
def reduce_motion(self) -> bool:
|
||||
return self.meta.get("reduce_motion", True)
|
||||
|
|
|
@ -142,9 +142,6 @@ class NewDeckStats(QDialog):
|
|||
def on_load_finished(success: bool) -> None:
|
||||
if success:
|
||||
is_color_blind = self.mw.pm.color_blind()
|
||||
selected_gradient = self.mw.pm.get_gradient_index()
|
||||
js_code = f"window.selectedGradient = {str(selected_gradient).lower()};"
|
||||
self.form.web.eval(js_code)
|
||||
js_code = f"window.colorBlindMode = {str(is_color_blind).lower()};"
|
||||
self.form.web.eval(js_code)
|
||||
# Disconnect after running once to avoid multiple triggers
|
||||
|
|
|
@ -123,32 +123,6 @@ export function buildHistogram(
|
|||
adjustedRange = scaleLinear().range([0.7, 0.3]);
|
||||
}
|
||||
|
||||
const selectedGradient = (window as any).selectedGradient;
|
||||
console.log("Gradient selector:", selectedGradient);
|
||||
|
||||
switch (selectedGradient) {
|
||||
case 0:
|
||||
colourScale = scaleSequential((n) => interpolateGreens(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
case 1:
|
||||
colourScale = scaleSequential((n) => interpolateViridis(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
case 2:
|
||||
colourScale = scaleSequential((n) => interpolateInferno(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
case 3:
|
||||
colourScale = scaleSequential((n) => interpolateMagma(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
case 4:
|
||||
colourScale = scaleSequential((n) => interpolatePlasma(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
case 5:
|
||||
colourScale = scaleSequential((n) => interpolateCividis(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
default:
|
||||
colourScale = scaleSequential((n) => interpolateGreens(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
break;
|
||||
}
|
||||
|
||||
const total = sum(bins as any, getNumericMapBinValue);
|
||||
|
||||
|
|
Loading…
Reference in a new issue