Add es2019.array to TypeScript libs, so we can use .flatten and .flatMap
This commit is contained in:
parent
b76639c2e3
commit
38a5f64150
@ -197,7 +197,7 @@ export function renderCards(
|
||||
|
||||
x.range([bounds.marginLeft, bounds.width - bounds.marginRight]);
|
||||
|
||||
const tableData = (data as any).flatMap((d: SummedDatum, idx: number) => {
|
||||
const tableData = data.flatMap((d: SummedDatum, idx: number) => {
|
||||
const percent = ((d.count / xMax) * 100).toFixed(1);
|
||||
return d.show
|
||||
? ({
|
||||
|
@ -108,9 +108,7 @@ export function prepareIntervalData(
|
||||
|
||||
const bins = histogram()
|
||||
.domain(scale.domain() as [number, number])
|
||||
.thresholds((scale.ticks(desiredBars) as any).flatMap(adjustTicks))(
|
||||
allIntervals
|
||||
);
|
||||
.thresholds(scale.ticks(desiredBars).flatMap(adjustTicks))(allIntervals);
|
||||
|
||||
// empty graph?
|
||||
const totalInPeriod = sum(bins, (bin) => bin.length);
|
||||
|
@ -3,7 +3,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "es6",
|
||||
"lib": ["es2016", "dom"],
|
||||
"lib": ["es2016", "es2019.array", "dom"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"anki/*": ["../bazel-bin/ts/lib/*"]
|
||||
|
Loading…
Reference in New Issue
Block a user