-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbfc107
commit cad484f
Showing
5 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# enable/disable | ||
|
||
## Introduction | ||
|
||
- `enable(...)` Turn on a feature | ||
- `disable(...)` Turn off a feature | ||
|
||
## Arguments | ||
|
||
- `{IDrawFeature}` `feat` Feature type | ||
- `'ruler'`: Ruler feature | ||
- `-` Other features are to be developed... | ||
|
||
```ts | ||
type IDrawFeature = 'ruler' | string; // TODO other features | ||
``` | ||
|
||
## Returns | ||
|
||
> N/A | ||
## Usage | ||
|
||
```js | ||
import { iDraw } from 'idraw'; | ||
|
||
const app = document.querySelector('#app'); | ||
const options = { | ||
width: 600, | ||
height: 400, | ||
devicePixelRatio: 2 | ||
}; | ||
const idraw = new iDraw(app, options); | ||
idraw.setData(data); | ||
idraw.disable('ruler'); | ||
|
||
setTimeout(() => { | ||
idraw.enable('ruler'); | ||
}, 1000); | ||
``` | ||
|
||
## Example | ||
|
||
[More Demo >>](https://idrawjs.com/playground/?demo=api-enable) | ||
|
||
<iframe class="idraw-playground-preview" | ||
src="https://idrawjs.com/playground/?demo=api-enable&header=false&sider=false&default-editor-split=50" | ||
width="1000" height="480" frameborder="no" border="0" | ||
style="border: 1px solid #cecece; margin: 0px auto;" | ||
></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# enable/disable | ||
|
||
## 说明 | ||
|
||
- `enable(...)` 开启某个功能 | ||
- `disable(...)` 关闭某个功能 | ||
|
||
## 参数 | ||
|
||
- `{IDrawFeature}` `feat` 功能类型 | ||
- `'ruler'`: 标尺功能 | ||
- `-` 其它功能待开发 ... | ||
|
||
```ts | ||
type IDrawFeature = 'ruler' | string; // TODO other feature | ||
``` | ||
|
||
## 返回值 | ||
|
||
> 无返回值 | ||
## 用法 | ||
|
||
```js | ||
import { iDraw } from 'idraw'; | ||
|
||
const app = document.querySelector('#app'); | ||
const options = { | ||
width: 600, | ||
height: 400, | ||
devicePixelRatio: 2 | ||
}; | ||
const idraw = new iDraw(app, options); | ||
idraw.setData(data); | ||
idraw.disable('ruler'); | ||
|
||
setTimeout(() => { | ||
idraw.enable('ruler'); | ||
}, 1000); | ||
``` | ||
|
||
## 示例 | ||
|
||
[Demo完整预览 Playground >>](https://idrawjs.com/playground/?demo=api-enable) | ||
|
||
<iframe class="idraw-playground-preview" | ||
src="https://idrawjs.com/playground/?demo=api-enable&header=false&sider=false&default-editor-split=50" | ||
width="1000" height="480" frameborder="no" border="0" | ||
style="border: 1px solid #cecece; margin: 0px auto;" | ||
></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters