From 2a1dccf5986805a2d7c33e9d6b2864d236885784 Mon Sep 17 00:00:00 2001 From: Sean Lynch Date: Tue, 7 Jan 2025 13:23:42 -0500 Subject: [PATCH] Fix `pnpm check` errors/warnings --- packages/layerchart/src/lib/components/GeoTile.svelte | 2 +- packages/layerchart/src/lib/components/Points.svelte | 3 +-- packages/layerchart/src/lib/utils/canvas.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/layerchart/src/lib/components/GeoTile.svelte b/packages/layerchart/src/lib/components/GeoTile.svelte index b365eec7..5aab2e67 100644 --- a/packages/layerchart/src/lib/components/GeoTile.svelte +++ b/packages/layerchart/src/lib/components/GeoTile.svelte @@ -46,7 +46,7 @@ }); } - $: if (renderContext === 'canvas' && url) { + $: if (renderContext === 'canvas') { canvasContext.register(render); } diff --git a/packages/layerchart/src/lib/components/Points.svelte b/packages/layerchart/src/lib/components/Points.svelte index 6bb9efd2..6b6ee8bf 100644 --- a/packages/layerchart/src/lib/components/Points.svelte +++ b/packages/layerchart/src/lib/components/Points.svelte @@ -15,7 +15,7 @@ import Link from './Link.svelte'; import { isScaleBand, type AnyScale } from '../utils/scales.js'; import { getCanvasContext } from './layout/Canvas.svelte'; - import { DEFAULT_FILL, renderPathData } from '../utils/canvas.js'; + import { renderPathData } from '../utils/canvas.js'; import { circlePath } from 'layerchart/utils/path.js'; const context = chartContext() as any; @@ -47,7 +47,6 @@ export let fill: string | undefined = undefined; export let stroke: string | undefined = undefined; - export let strokeWidth: number | string | undefined = undefined; /** Render to canvas */ export let render: ((ctx: CanvasRenderingContext2D, points: Point[]) => any) | undefined = diff --git a/packages/layerchart/src/lib/utils/canvas.ts b/packages/layerchart/src/lib/utils/canvas.ts index 621a0201..acf0ea38 100644 --- a/packages/layerchart/src/lib/utils/canvas.ts +++ b/packages/layerchart/src/lib/utils/canvas.ts @@ -4,7 +4,7 @@ export const DEFAULT_FILL = 'rgb(0, 0, 0)'; export function renderPathData( canvasCtx: CanvasRenderingContext2D, pathData: string | null | undefined, - styles: Partial = {} + styles: Partial & { strokeWidth?: number | string }> = {} ) { const path = new Path2D(pathData ?? '');