Skip to content

Commit

Permalink
document pie useWidth and update other pie config attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yokozuna59 committed Jun 18, 2023
1 parent f6dc089 commit 1d0aa76
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/config/setup/modules/defaultConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---

Expand Down
31 changes: 23 additions & 8 deletions packages/mermaid/src/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1254,28 +1254,43 @@ const config: Partial<MermaidConfig> = {

/** 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:**
*
* Axial position of slice's label from zero at the center to 1 at the outside edge.
*
* **Notes:** Default value: 0.75
* Default value: 0.75
*/
textPosition: 0.75,
},
Expand Down

0 comments on commit 1d0aa76

Please sign in to comment.