Skip to content

Commit

Permalink
fix d3-shape typing and package (#1621)
Browse files Browse the repository at this point in the history
* fix d3-shape typing and package
  • Loading branch information
Hypercubed authored May 12, 2021
1 parent 9ecef0f commit 3a506dd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion projects/swimlane/ngx-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3a506dd

Please sign in to comment.