From 1d0aa763de4381c799d10ea148d24d8cfc0c0cef Mon Sep 17 00:00:00 2001 From: Yokozuna59 Date: Sun, 18 Jun 2023 17:53:28 +0300 Subject: [PATCH] document pie useWidth and update other pie config attributes --- docs/config/setup/modules/defaultConfig.md | 2 +- packages/mermaid/src/defaultConfig.ts | 31 ++++++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/config/setup/modules/defaultConfig.md b/docs/config/setup/modules/defaultConfig.md index d95ec4e92..0b3fa60d7 100644 --- a/docs/config/setup/modules/defaultConfig.md +++ b/docs/config/setup/modules/defaultConfig.md @@ -14,7 +14,7 @@ #### Defined in -[defaultConfig.ts:2293](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L2293) +[defaultConfig.ts:2308](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts#L2308) --- diff --git a/packages/mermaid/src/defaultConfig.ts b/packages/mermaid/src/defaultConfig.ts index c9407828f..4780712af 100644 --- a/packages/mermaid/src/defaultConfig.ts +++ b/packages/mermaid/src/defaultConfig.ts @@ -1254,28 +1254,43 @@ const config: Partial = { /** The object containing configurations specific for pie diagrams */ pie: { - useWidth: undefined, + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------ | -------- | ------------------- | + * | useWidth | See Notes | number | Optional | Any positive number | + * + * **Notes:** + * + * Width of the chart. + * + * Default value: 1200 + */ + useWidth: 1200, /** * | Parameter | Description | Type | Required | Values | * | ----------- | ----------- | ------- | -------- | ----------- | - * | useMaxWidth | See Notes | boolean | Required | true, false | + * | useMaxWidth | See Notes | boolean | Optional | true, false | * * **Notes:** * - * When this flag is set to true, the diagram width is locked to 100% and scaled based on - * available space. If set to false, the diagram reserves its absolute width. + * When this flag is set to true, the chart width is locked to 100% and scaled based on + * available space. If set to false, the chart reserves its absolute width. * * Default value: true */ useMaxWidth: true, /** - * | Parameter | Description | Type | Required | Values | - * | ------------ | -------------------------------------------------------------------------------- | ------- | -------- | ------------------- | - * | textPosition | Axial position of slice's label from zero at the center to 1 at the outside edge | Number | Optional | Decimal from 0 to 1 | + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------- | ------- | -------- | ------------------- | + * | textPosition | See Notes | number | Optional | Decimal from 0 to 1 | * - * **Notes:** Default value: 0.75 + * **Notes:** + * + * Axial position of slice's label from zero at the center to 1 at the outside edge. + * + * Default value: 0.75 */ textPosition: 0.75, },