diff --git a/timeline-chart/src/components/time-graph-row-element.ts b/timeline-chart/src/components/time-graph-row-element.ts index 45d044a..22cfe75 100644 --- a/timeline-chart/src/components/time-graph-row-element.ts +++ b/timeline-chart/src/components/time-graph-row-element.ts @@ -34,7 +34,7 @@ export class TimeGraphRowElement extends TimeGraphComponent { x: this.range.start, y: this._row.position.y + ((this.row.height - this.height) / 2) }; - // min width of a state should never be less than 1(for visibility) + // min width of a state should never be less than 1 (for visibility) const width = Math.max(1, this.range.end - this.range.start); this._options = { color: _style.color, @@ -142,4 +142,4 @@ export class TimeGraphRowElement extends TimeGraphComponent { this.rect(this._options); this.renderLabel(); } -} \ No newline at end of file +} diff --git a/timeline-chart/src/layer/time-graph-chart.ts b/timeline-chart/src/layer/time-graph-chart.ts index c35276b..266ab64 100644 --- a/timeline-chart/src/layer/time-graph-chart.ts +++ b/timeline-chart/src/layer/time-graph-chart.ts @@ -263,7 +263,7 @@ export class TimeGraphChart extends TimeGraphChartLayer { x: this.getPixels(start - this.unitController.viewRange.start), y: el.position.y }, - // min width of a state should never be less than (for visibility) + // min width of a state should never be less than 1 (for visibility) width: Math.max(1, this.getPixels(end - start)) } el.update(opts); @@ -433,4 +433,4 @@ export class TimeGraphChart extends TimeGraphChartLayer { } this.handleSelectedRowElementChange(); } -} \ No newline at end of file +}