From 60c4d70a53363e082aa1474347e1b122f285ab43 Mon Sep 17 00:00:00 2001 From: Alessio Del Conte Date: Wed, 11 Dec 2024 10:41:56 +0100 Subject: [PATCH] Add dasharray for continuous features --- projects/ngx-features-viewer/package.json | 2 +- projects/ngx-features-viewer/src/lib/features/continuous.ts | 1 + projects/ngx-features-viewer/src/lib/services/draw.service.ts | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/ngx-features-viewer/package.json b/projects/ngx-features-viewer/package.json index cb5a161..cfcd126 100644 --- a/projects/ngx-features-viewer/package.json +++ b/projects/ngx-features-viewer/package.json @@ -1,6 +1,6 @@ { "name": "ngx-features-viewer", - "version": "0.1.16", + "version": "0.1.17", "license": "MIT", "author": { "name": "Damiano Clementel", diff --git a/projects/ngx-features-viewer/src/lib/features/continuous.ts b/projects/ngx-features-viewer/src/lib/features/continuous.ts index aab50dc..a5f1195 100644 --- a/projects/ngx-features-viewer/src/lib/features/continuous.ts +++ b/projects/ngx-features-viewer/src/lib/features/continuous.ts @@ -16,6 +16,7 @@ export interface Continuous extends BaseFeature { max?: number; "stroke-width"?: number; "stroke-color"?: string; + "stroke-dasharray"?: string; curveType?: 'curveStep' | 'curveBasis' | 'curveLinear'; showArea?: boolean; } diff --git a/projects/ngx-features-viewer/src/lib/services/draw.service.ts b/projects/ngx-features-viewer/src/lib/services/draw.service.ts index 8999d57..c063c49 100644 --- a/projects/ngx-features-viewer/src/lib/services/draw.service.ts +++ b/projects/ngx-features-viewer/src/lib/services/draw.service.ts @@ -653,7 +653,8 @@ export class DrawService { 'fill-opacity' : feature.opacity || 1, }; - appendElementWithAttributes(container, 'path', pathAttributes); + const line = appendElementWithAttributes(container, 'path', pathAttributes); + line.style('stroke-dasharray', feature["stroke-dasharray"] || ''); } if (feature.type === 'pin') {