mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
chore: test how color can be changed
This commit is contained in:
parent
344cac1ef4
commit
d3dad32067
4 changed files with 39 additions and 23 deletions
|
@ -60,6 +60,7 @@ preferences-full-screen-only = Full screen only
|
|||
preferences-appearance = Appearance
|
||||
preferences-general = General
|
||||
preferences-style = Style
|
||||
preferences-color-blind = Color Blind Mode
|
||||
preferences-review = Review
|
||||
preferences-answer-keys = Answer keys
|
||||
preferences-distractions = Distractions
|
||||
|
|
|
@ -104,6 +104,23 @@
|
|||
<string>preferences_user_interface</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="styleLabel">
|
||||
<property name="text">
|
||||
<string>preferences_style</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>styleComboBox</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="styleComboBox">
|
||||
<property name="currentText">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="theme"/>
|
||||
</item>
|
||||
|
@ -123,23 +140,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="styleComboBox">
|
||||
<property name="currentText">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="styleLabel">
|
||||
<property name="text">
|
||||
<string>preferences_style</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>styleComboBox</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="themeLabel">
|
||||
<property name="text">
|
||||
|
@ -160,13 +160,26 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="resetWindowSizes">
|
||||
<property name="text">
|
||||
<string>preferences_reset_window_sizes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="color_blind">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>preferences_color_blind</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
timeSaturday,
|
||||
timeSunday,
|
||||
timeYear,
|
||||
interpolateMagma
|
||||
} from "d3";
|
||||
|
||||
import type { GraphBounds, SearchDispatch } from "./graph-helpers";
|
||||
|
@ -136,10 +137,10 @@ export function renderCalendar(
|
|||
}
|
||||
}
|
||||
const data = Array.from(dayMap.values());
|
||||
const cappedRange = scaleLinear().range([0.2, nightMode ? 0.8 : 1]);
|
||||
const cappedRange = scaleLinear().range([1,0]);
|
||||
const blues = scaleSequentialSqrt()
|
||||
.domain([0, maxCount])
|
||||
.interpolator((n) => interpolateBlues(cappedRange(n)!));
|
||||
.interpolator((n) => interpolateMagma(cappedRange(n)!));
|
||||
|
||||
function tooltipText(d: DayDatum): string {
|
||||
const date = localizedDate(d.date, {
|
||||
|
|
|
@ -10,7 +10,7 @@ import * as tr from "@generated/ftl";
|
|||
import { localizedNumber } from "@tslib/i18n";
|
||||
import { dayLabel } from "@tslib/time";
|
||||
import type { Bin } from "d3";
|
||||
import { bin, extent, interpolateGreens, scaleLinear, scaleSequential, sum } from "d3";
|
||||
import { bin, extent, interpolateGreens, scaleLinear, scaleSequential, sum, interpolateViridis } from "d3";
|
||||
|
||||
import type { SearchDispatch, TableDatum } from "./graph-helpers";
|
||||
import { getNumericMapBinValue, GraphRange, numericMap } from "./graph-helpers";
|
||||
|
@ -108,8 +108,9 @@ export function buildHistogram(
|
|||
}
|
||||
|
||||
const xTickFormat = (n: number): string => localizedNumber(n);
|
||||
const adjustedRange = scaleLinear().range([0.7, 0.3]);
|
||||
const colourScale = scaleSequential((n) => interpolateGreens(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
|
||||
const adjustedRange = scaleLinear().range([0.0, 1]);
|
||||
const colourScale = scaleSequential((n) => interpolateViridis(adjustedRange(n)!)).domain([xMin!, xMax!]);
|
||||
|
||||
const total = sum(bins as any, getNumericMapBinValue);
|
||||
|
||||
|
|
Loading…
Reference in a new issue