From b3e7f943ad54d0f602cfc67fc0871c36a1082945 Mon Sep 17 00:00:00 2001 From: vargburz Date: Wed, 11 Sep 2024 13:11:24 +0300 Subject: [PATCH] 0.7.8 && render segments if exists --- package.json | 2 +- src/index.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e993309..babb7ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chartwerk/line-pod", - "version": "0.7.7", + "version": "0.7.8", "description": "Chartwerk line chart", "main": "dist/index.js", "files": [ diff --git a/src/index.ts b/src/index.ts index 5b209d2..d66ff42 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,13 +45,15 @@ class LinePod extends ChartwerkPod { const generator = this.getRenderGenerator(serie.renderArea, serie.yOrientation); this._renderMetric(serie, generator); } - if(this._markersConf !== undefined) { + if(!_.isEmpty(this._markersConf)) { this._markersLayer = new Markers(this.d3Node, this._markersConf, this.state, this.margin); this._markersLayer.render(this.metricContainer, this.height); } - this._segmentsLayer = new Segments(this._segmentSeries, this.state); - this._segmentsLayer.render(this.metricContainer, this.chartContainer); + if(!_.isEmpty(this._segmentSeries)) { + this._segmentsLayer = new Segments(this._segmentSeries, this.state); + this._segmentsLayer.render(this.metricContainer, this.chartContainer); + } } clearAllMetrics(): void {