Skip to content

Commit

Permalink
Filter null values from get_series.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Mar 3, 2024
1 parent 0dde0ce commit a85a43c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Tests](https://github.com/Daveiano/weewx-wdc/actions/workflows/test.yml/badge.svg)](https://github.com/Daveiano/weewx-wdc/actions/workflows/test.yml)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Daveiano/weewx-wdc?label=latest%20release&sort=semver)
![GitHub milestone](https://img.shields.io/github/milestones/issues-open/Daveiano/weewx-wdc/18)
![GitHub milestone](https://img.shields.io/github/milestones/issues-open/Daveiano/weewx-wdc/19)
![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/Daveiano/weewx-wdc/latest)
![GitHub all releases](https://img.shields.io/github/downloads/Daveiano/weewx-wdc/total)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/Daveiano/weewx-wdc)
Expand Down
9 changes: 3 additions & 6 deletions skins/weewx-wdc/src/js/diagrams/d3/line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export const D3LineDiagram: FunctionComponent<LineDiagramBaseProps> = (
svgElement
.append("g")
.selectAll("dot")
.data(dataSet.data.filter((d: any) => d.y !== null))
.data(dataSet.data)
.enter()
.append("circle")
.attr("cx", (d: any) => {
Expand All @@ -456,7 +456,7 @@ export const D3LineDiagram: FunctionComponent<LineDiagramBaseProps> = (
if (observationProps.enableArea) {
svgElement
.append("path")
.datum(dataSet.data.filter((d: any) => d.y !== null) as any)
.datum(dataSet.data as any)
.attr("fill", colors[index])
.attr(
"fill-opacity",
Expand Down Expand Up @@ -490,10 +490,7 @@ export const D3LineDiagram: FunctionComponent<LineDiagramBaseProps> = (
"stroke-width",
observationProps.lineWidth ? observationProps.lineWidth : 2
)
.attr(
"d",
lineGenerator(dataSet.data.filter((d: any) => d.y !== null) as any)
);
.attr("d", lineGenerator(dataSet.data as any));
});

// Markers.
Expand Down
2 changes: 2 additions & 0 deletions skins/weewx-wdc/src/js/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ diagrams.forEach((diagram) => {
diagram.dataset.value.replace(/'/g, '"')
);

// Filter out null values.
// @see https://groups.google.com/g/weewx-development/c/frA0Vc9Ku9Q
series.forEach((serie, index) => {
data = [
...data,
Expand Down

0 comments on commit a85a43c

Please sign in to comment.