mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QComboBox" name="gradient_selector"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -375,14 +375,6 @@ class Preferences(QDialog):
|
||||||
self.form.color_blind.setChecked(self.mw.pm.color_blind())
|
self.form.color_blind.setChecked(self.mw.pm.color_blind())
|
||||||
qconnect(self.form.color_blind.stateChanged, self.on_color_blind_checkbox_changed)
|
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_language()
|
||||||
self.setup_video_driver()
|
self.setup_video_driver()
|
||||||
|
|
||||||
|
|
|
@ -540,12 +540,6 @@ create table if not exists profiles
|
||||||
|
|
||||||
def color_blind(self) -> bool:
|
def color_blind(self) -> bool:
|
||||||
return self.meta.get("color_blind", False)
|
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:
|
def reduce_motion(self) -> bool:
|
||||||
return self.meta.get("reduce_motion", True)
|
return self.meta.get("reduce_motion", True)
|
||||||
|
|
|
@ -142,9 +142,6 @@ class NewDeckStats(QDialog):
|
||||||
def on_load_finished(success: bool) -> None:
|
def on_load_finished(success: bool) -> None:
|
||||||
if success:
|
if success:
|
||||||
is_color_blind = self.mw.pm.color_blind()
|
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()};"
|
js_code = f"window.colorBlindMode = {str(is_color_blind).lower()};"
|
||||||
self.form.web.eval(js_code)
|
self.form.web.eval(js_code)
|
||||||
# Disconnect after running once to avoid multiple triggers
|
# Disconnect after running once to avoid multiple triggers
|
||||||
|
|
|
@ -123,32 +123,6 @@ export function buildHistogram(
|
||||||
adjustedRange = scaleLinear().range([0.7, 0.3]);
|
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);
|
const total = sum(bins as any, getNumericMapBinValue);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue