Skip to content

Commit f462aca

Browse files
committed
chore: add series
1 parent e7d775f commit f462aca

3 files changed

Lines changed: 27 additions & 15 deletions

File tree

backend/static/collections/5-3_global-warming-levels.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ explorer_cards:
4848
diagnostic: climate-at-global-warming-levels
4949
title: "Global Mean Temperature Change at Warming Levels"
5050
span: 2
51-
placeholder: true

backend/static/collections/5-4_fire-climate-drivers.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ explorer_cards:
7373
grouping_config:
7474
group_by: statistic
7575
hue: statistic
76-
- type: series-chart
77-
provider: ilamb
78-
diagnostic: burntfractionall-gfed
79-
title: "Global Burnt Fraction Time Series"
80-
description: >-
81-
Time series of global mean burnt fraction for each model compared with
82-
GFED reference data.
83-
span: 2
84-
other_filters:
85-
metric: trace
86-
region: global
87-
grouping_config:
88-
group_by: source_id
89-
hue: source_id
76+
# - type: series-chart
77+
# provider: ilamb
78+
# diagnostic: burntfractionall-gfed
79+
# title: "Global Burnt Fraction Time Series"
80+
# description: >-
81+
# Time series of global mean burnt fraction for each model compared with
82+
# GFED reference data.
83+
# span: 2
84+
# other_filters:
85+
# metric: trace
86+
# region: global
87+
# grouping_config:
88+
# group_by: source_id
89+
# hue: source_id
9090
- type: series-chart
9191
provider: ilamb
9292
diagnostic: burntfractionall-gfed
@@ -118,3 +118,4 @@ explorer_cards:
118118
Spatial maps of burnt fraction bias, RMSE, and model-observation
119119
comparison for individual models.
120120
span: 2
121+
filters: global_bias

frontend/src/components/execution/values/series/useChartScales.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as d3 from "d3";
2+
import { parseJSON } from "date-fns/parseJSON";
23
import { useMemo } from "react";
34
import type { SeriesMetadata } from "../types";
45
import type { ChartDataPoint } from "./utils";
@@ -44,6 +45,17 @@ export function useChartScales(
4445
// X domain from index values
4546
const xValues = chartData
4647
.map((d) => d[indexName])
48+
.map((v) => {
49+
if (typeof v === "number" && Number.isFinite(v)) {
50+
return v;
51+
}
52+
if (typeof v === "string") {
53+
const parsed = parseJSON(v);
54+
const ts = parsed.getTime();
55+
return Number.isFinite(ts) ? ts : null;
56+
}
57+
return null;
58+
})
4759
.filter((v): v is number => typeof v === "number");
4860

4961
const xDomain: [number, number] =

0 commit comments

Comments
 (0)