diff --git a/src/renderers/draw-features.ts b/src/renderers/draw-features.ts index 0f823691..a0e82b59 100644 --- a/src/renderers/draw-features.ts +++ b/src/renderers/draw-features.ts @@ -4,10 +4,6 @@ import { clipPoly, round } from "../utils"; declare global { var drawFeatures: () => void; - - var defs: d3.Selection; - var coastline: d3.Selection; - var lakes: d3.Selection; var simplify: ( points: [number, number][], tolerance: number, @@ -95,7 +91,7 @@ function getFeaturePath(feature: PackedGraphFeature): string { } const simplifiedPoints = simplify(points, 0.3); - const clippedPoints = clipPoly(simplifiedPoints, graphWidth, graphHeight); + const clippedPoints = clipPoly(simplifiedPoints, graphWidth, graphHeight, 1); const lineGen = line().curve(curveBasisClosed); const path = `${round(lineGen(clippedPoints) || "")}Z`; diff --git a/src/types/global.ts b/src/types/global.ts index 69add8f9..2272196d 100644 --- a/src/types/global.ts +++ b/src/types/global.ts @@ -42,6 +42,9 @@ declare global { var terrs: Selection; var temperature: Selection; var markers: Selection; + var defs: Selection; + var coastline: Selection; + var lakes: Selection; var getColorScheme: (scheme: string | null) => (t: number) => string; var getColor: (height: number, scheme: (t: number) => string) => string; var svgWidth: number;