diff --git a/.changeset/loud-masks-glow.md b/.changeset/loud-masks-glow.md new file mode 100644 index 0000000..8f86b76 --- /dev/null +++ b/.changeset/loud-masks-glow.md @@ -0,0 +1,5 @@ +--- +"simple-pie": patch +--- + +Bug fix: Doughnut inner option ignored (https://github.com/serjilyashenko/simple-pie-project/issues/11) diff --git a/packages/pie-math/src/index.ts b/packages/pie-math/src/index.ts index 0826b81..4d88d26 100644 --- a/packages/pie-math/src/index.ts +++ b/packages/pie-math/src/index.ts @@ -13,7 +13,7 @@ export function buildPieSectors(values: Array): Array { export function buildDoughnutSectors( values: Array, - inner: number = 0.5, + inner: number, ): Array { const angleCoordinates: Array = castValuesToAngles(values); diff --git a/packages/simple-pie/src/simple-pie.ts b/packages/simple-pie/src/simple-pie.ts index f7cf2ba..232f5ad 100644 --- a/packages/simple-pie/src/simple-pie.ts +++ b/packages/simple-pie/src/simple-pie.ts @@ -88,10 +88,13 @@ export function simpleDoughnutElement( options: TDoughnutOptions = {}, ): SVGElement { const resultOptions = { ...defaultDoughnutOptions, ...options }; - // eslint-disable-next-line @typescript-eslint/no-unused-vars const { inner, ...pieOptions } = resultOptions; - return _buildSvgElement(buildDoughnutSectors, values, pieOptions); + return _buildSvgElement( + (_values) => buildDoughnutSectors(_values, inner), + values, + pieOptions, + ); } export const simplePie = simplePieElement;