feat(markdown): Docs for new/updated core methods
This commit is contained in:
parent
a2800dddda
commit
57d50c42da
8 changed files with 256 additions and 20 deletions
24
markdown/dev/reference/api/pattern/getlogs/en.md
Normal file
24
markdown/dev/reference/api/pattern/getlogs/en.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: Pattern.getLogs()
|
||||
---
|
||||
|
||||
The `Pattern.getLogs()` method will return an object holding
|
||||
the logs generated by the pattern.
|
||||
It should only be called after calling `Pattern.draft()`.
|
||||
|
||||
## Pattern.getLogs() signature
|
||||
|
||||
```js
|
||||
Object pattern.getLogs()
|
||||
```
|
||||
|
||||
## Returned object properties
|
||||
|
||||
The `Pattern.getLogs()` method returns an object with
|
||||
the following properties:
|
||||
|
||||
| Property | Description |
|
||||
| --------:| ----------- |
|
||||
| `pattern` | The logs of the pattern itself |
|
||||
| `sets` | The logs per (set of) settings used to draft the pattern |
|
||||
|
|
@ -3,8 +3,9 @@ title: Pattern.getRenderProps()
|
|||
---
|
||||
|
||||
The `Pattern.getRenderProps()` method will return an object that
|
||||
facilitates rendered the pattern by an external renderer such as
|
||||
a React component. It should only be called after calling `Pattern.draft()`.
|
||||
facilitates rendering the pattern by an external renderer such as
|
||||
[our Pattern React component](/fixme).
|
||||
It should only be called after calling `Pattern.draft()`.
|
||||
|
||||
## Pattern.getRenderProps() signature
|
||||
|
||||
|
@ -12,20 +13,7 @@ a React component. It should only be called after calling `Pattern.draft()`.
|
|||
Object pattern.getRenderProps()
|
||||
```
|
||||
|
||||
## Pattern.getRenderProps() example
|
||||
|
||||
```js
|
||||
import { Aaron } from "@freesewing/aaron"
|
||||
import { cisFemaleAdult34 } from "@freesewing/models"
|
||||
|
||||
const pattern = new Aaron({
|
||||
measurements: cisFemaleAdult34
|
||||
})
|
||||
|
||||
const props = pattern.draft().getRenderProps()
|
||||
```
|
||||
|
||||
## Pattern.getRenderProps() returned object
|
||||
## Returned object properties
|
||||
|
||||
The `Pattern.getRenderProps()` method returns an object with
|
||||
the following properties:
|
||||
|
@ -34,9 +22,8 @@ the following properties:
|
|||
| --------:| ----------- |
|
||||
| `autoLayout` | An object describing the (automated) pattern layout |
|
||||
| `height` | Height of the drafted pattern in `mm` |
|
||||
| `logs` | The logs generated by the pattern |
|
||||
| `parts` | A plain object holding the drafted parts |
|
||||
| `width` | Width of the drafted pattern in `mm` |
|
||||
| `settings` | The (sets of) settings used to draft the pattern |
|
||||
| `stacks` | A plain object holding the drafted stacks |
|
||||
| `svg` | An [Svg Object](/reference/api/svg/) object with the `preRender` hook applied |
|
||||
| `width` | Width of the drafted pattern in `mm` |
|
||||
| `svg` | The [Svg Object](/reference/api/svg/) object with the `preRender` hook applied as [Svg.asRenderProps()](/reference/api/svg/asrenderprops) |
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue