diff --git a/docs/changelog.md b/docs/changelog.md index 7568bc2c1..b50f313ac 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +- Bug: Use correct curve type +- Bug: include `@types/d3-shape` as a dependency in published package. + ## 18.0.0 - Breaking: Improve typing diff --git a/package-lock.json b/package-lock.json index 2275734f4..f298f7faa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1741,6 +1741,21 @@ "integrity": "sha512-6/u32ZMAsk1j2LCYwhDV/cZ7FO5PYnRDNL12RVzlph9IkezuskkRvn0yL99ottZGXQOzCpmpOswkEeWg5HtPyQ==", "dev": true }, + "@types/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-NaIeSIBiFgSC6IGUBjZWcscUJEq7vpVu7KthHN8eieTV9d9MqkSOZLH4chq1PmcKy06PNe3axLeKmRIyxJ+PZQ==", + "dev": true + }, + "@types/d3-shape": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-2.0.0.tgz", + "integrity": "sha512-NLzD02m5PiD1KLEDjLN+MtqEcFYn4ZL9+Rqc9ZwARK1cpKZXd91zBETbe6wpBB6Ia0D0VZbpmbW3+BsGPGnCpA==", + "dev": true, + "requires": { + "@types/d3-path": "^1" + } + }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", diff --git a/package.json b/package.json index 34360be0c..1c75773e6 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "@angular/compiler-cli": "~11.0.5", "@angular/language-service": "~11.0.5", "@swimlane/prettier-config-swimlane": "^3.0.2", + "@types/d3-shape": "^2.0.0", "@types/jasmine": "^3.6.0", "@types/jasminewd2": "~2.0.3", "@types/json-schema": "^7.0.4", diff --git a/projects/swimlane/ngx-charts/package.json b/projects/swimlane/ngx-charts/package.json index 765364f95..723edf26c 100644 --- a/projects/swimlane/ngx-charts/package.json +++ b/projects/swimlane/ngx-charts/package.json @@ -56,6 +56,7 @@ "d3-shape": "^2.0.0", "d3-time-format": "^3.0.0", "d3-transition": "^2.0.0", - "tslib": "^2.0.0" + "tslib": "^2.0.0", + "@types/d3-shape": "^2.0.0" } } diff --git a/projects/swimlane/ngx-charts/src/lib/area-chart/area-chart.component.ts b/projects/swimlane/ngx-charts/src/lib/area-chart/area-chart.component.ts index 5b1bfbaaa..8d0293b75 100644 --- a/projects/swimlane/ngx-charts/src/lib/area-chart/area-chart.component.ts +++ b/projects/swimlane/ngx-charts/src/lib/area-chart/area-chart.component.ts @@ -10,7 +10,7 @@ import { TemplateRef } from '@angular/core'; import { scaleLinear, scalePoint, scaleTime } from 'd3-scale'; -import { curveLinear, CurveLinear } from 'd3-shape'; +import { curveLinear, CurveFactory } from 'd3-shape'; import { calculateViewDimensions } from '../common/view-dimensions.helper'; import { ColorHelper } from '../common/color.helper'; @@ -173,7 +173,7 @@ export class AreaChartComponent extends BaseChartComponent { @Input() timeline: boolean = false; @Input() gradient: boolean; @Input() showGridLines: boolean = true; - @Input() curve: CurveLinear = curveLinear; + @Input() curve: CurveFactory = curveLinear; @Input() activeEntries: any[] = []; @Input() schemeType: ScaleType; @Input() trimXAxisTicks: boolean = true; diff --git a/projects/swimlane/ngx-charts/src/lib/pie-chart/pie-label.component.ts b/projects/swimlane/ngx-charts/src/lib/pie-chart/pie-label.component.ts index b20e9ea70..1587a6822 100644 --- a/projects/swimlane/ngx-charts/src/lib/pie-chart/pie-label.component.ts +++ b/projects/swimlane/ngx-charts/src/lib/pie-chart/pie-label.component.ts @@ -8,13 +8,13 @@ import { PLATFORM_ID, Inject } from '@angular/core'; -import { arc } from 'd3-shape'; +import { arc, DefaultArcObject } from 'd3-shape'; import { trimLabel } from '../common/trim-label.helper'; import { TextAnchor } from '../common/types'; import { DataItem } from '../models/chart-data.model'; -export interface PieData { +export interface PieData extends DefaultArcObject { data: DataItem; endAngle: number; index: number;