mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
fix invalid cumulative path when no data available
This commit is contained in:
parent
572e2d10dc
commit
38838a6d0b
2 changed files with 2 additions and 2 deletions
|
@ -102,7 +102,7 @@ export function histogramGraph(
|
||||||
const areaData = cumsum(areaCounts);
|
const areaData = cumsum(areaCounts);
|
||||||
const yAreaScale = y.copy().domain([0, data.total]);
|
const yAreaScale = y.copy().domain([0, data.total]);
|
||||||
|
|
||||||
if (data.showArea && data.bins.length) {
|
if (data.showArea && data.bins.length && areaData.slice(-1)[0]) {
|
||||||
svg.select("path.area")
|
svg.select("path.area")
|
||||||
.datum(areaData as any)
|
.datum(areaData as any)
|
||||||
.attr(
|
.attr(
|
||||||
|
|
|
@ -309,7 +309,7 @@ export function renderReviews(
|
||||||
const areaData = cumsum(areaCounts);
|
const areaData = cumsum(areaCounts);
|
||||||
const yAreaScale = y.copy().domain([0, areaData.slice(-1)[0]]);
|
const yAreaScale = y.copy().domain([0, areaData.slice(-1)[0]]);
|
||||||
|
|
||||||
if (bins.length) {
|
if (areaData.slice(-1)[0]) {
|
||||||
svg.select("path.area")
|
svg.select("path.area")
|
||||||
.datum(areaData as any)
|
.datum(areaData as any)
|
||||||
.attr(
|
.attr(
|
||||||
|
|
Loading…
Reference in a new issue