1
0
Fork 0
freesewing/markdown/dev/reference/api/pattern/render/en.md

27 lines
527 B
Markdown
Raw Normal View History

---
title: Pattern.render()
---
2022-09-20 18:09:28 +02:00
The `Pattern.render()` method will render the pattern to SVG and return
that SVG as a string. It should only be called after calling
2021-09-25 17:05:18 +02:00
[Pattern.draft()](/reference/api/pattern/draft/) first.
2022-09-20 18:09:28 +02:00
## Pattern.render() signature
2021-09-25 17:05:18 +02:00
```js
string pattern.render()
2022-02-19 08:04:25 +01:00
```
2022-09-20 18:09:28 +02:00
## Pattern.render() example
2021-09-25 17:05:18 +02:00
```js
2022-09-20 18:09:28 +02:00
import { Aaron } from "@freesewing/aaron"
import { cisFemaleAdult34 } from "@freesewing/models"
2021-09-25 17:05:18 +02:00
const pattern = new Aaron({
2022-09-20 18:09:28 +02:00
measurements: cisFemaleAdult34
2021-09-25 17:05:18 +02:00
})
const svg = pattern.draft().render()
2022-02-19 08:04:25 +01:00
```