diff --git a/README.md b/README.md index 49b000f..78af349 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ idraw.addElement({ h: 100, type: "rect", desc: { - color: "#f7d3c1", + bgColor: "#f7d3c1", borderRadius: 20, borderWidth: 4, borderColor: "#ff6032", @@ -93,5 +93,4 @@ To contribute, please follow the steps: - `npm run serve` for starting a server - http://127.0.0.1:8080 - http://127.0.0.1:8080/packages/idraw/examples/features/ - - http://127.0.0.1:8080/packages/core/examples/features/ - - http://127.0.0.1:8080/packages/board/examples/features/ \ No newline at end of file + - http://127.0.0.1:8080/packages/core/examples/features/ \ No newline at end of file diff --git a/packages/idraw/README.md b/packages/idraw/README.md index 290ee06..dd8ba72 100644 --- a/packages/idraw/README.md +++ b/packages/idraw/README.md @@ -21,5 +21,51 @@
-- [Documents](https://idrawjs.github.io/docs/en/) | [中文文档](https://idrawjs.github.io/docs/zh/) (`//TODO`) -- [Playground](https://idrawjs.github.io/playground/) \ No newline at end of file +- [Documents](https://idraw.js.org/docs/en/) | [中文文档](https://idraw.js.org/docs/zh/) +- [Online Playground](https://idraw.js.org/playground/) | [在线API示例](https://idraw.js.org/playground/) +- [Online Studio](https://idraw.js.org/studio/) | [在线绘图演示](https://idraw.js.org/studio/) + +## @idraw/studio Preview + +The preview of `@idraw/studo`. Click [here](https://github.com/idrawjs/studio) to get it. + +
+ +
+ +## Install + +``` +npm i idraw +``` + +## Getting Started + +```js +import iDraw from 'idraw'; + +const idraw = new iDraw( + document.querySelector('#app'), + { + width: 600, + height: 400, + contextWidth: 600, + contextHeight: 400, + devicePixelRatio: 4, + } +); +idraw.addElement({ + name: "rect-1", + x: 140, + y: 120, + w: 200, + h: 100, + type: "rect", + desc: { + bgColor: "#f7d3c1", + borderRadius: 20, + borderWidth: 4, + borderColor: "#ff6032", + }, +}); +```