-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
6 changed files
with
210 additions
and
264 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,44 @@ | ||
| 颜色 | 作用 | | ||
| --- | --- | | ||
| isHex | 判断是否是hex | | ||
| isRgb | 判断是否是rgb | | ||
| isRbga | 判断是否是rgba | | ||
| isHsl | 判断是否是hsl | | ||
| isHsla | 判断是否是hsla | | ||
| toHex | 转化为hex(支持keyword\rgb\rgba\hex,支持多种空格、分号、斜杠分隔) | | ||
| toRgba | 转化为rgba(支持object、array、string输出格式) | | ||
| toHsl | 转化为Hsla(支持object、array、string输出格式) | | ||
| toRgb\toRgbaByCanvas | 转化为rgb(支持object、array、string输出格式),支持颜色融合 | | ||
| getKeywordColor | 获取关键词配色,比如red: #FF0000 | | ||
| range | 颜色色阶推荐 | | ||
| darken、lighten | 线性颜色百分比取值 | | ||
| getOpacity | 获取透明度,支持transparent | | ||
| getLuminance | 亮度 | | ||
| getGrayLevel | 灰度 | | ||
| opacity | 修改透明度 | | ||
| textColor | 根据灰度情况显示文本颜色 | | ||
| gray | 当前颜色灰度情况 | | ||
|
||
|
||
## Usage | ||
|
||
``` | ||
import { | ||
toHex, | ||
toRgba, | ||
darken, | ||
lighten, | ||
getOpacity, | ||
isHex, | ||
isRgb, | ||
isRgba, | ||
getKeywordColor | ||
} from "@dpdfe/event-utils"; | ||
``` | ||
|
||
|
||
#### 更多颜色使用方法参考exampe、test测试用例 | ||
|
||
#### [example](https://github.com/DPDFE/react-layout/blob/main/src/example/event/color/computed.tsx) | ||
|
||
#### [test](https://github.com/DPDFE/react-layout/tree/main/packages/event/__tests__) |
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,32 @@ | ||
## Feature | ||
| 方法 | 作用 | | ||
| --- | --- | | ||
| hasCycle | 成环检测 | | ||
| findParents | 获取一个节点的所有父元素 | | ||
| findChildren | 获取一个节点的所有子元素 | | ||
| removeNode | 删除一个节点以及它的关联关系 | | ||
|
||
|
||
## Usage | ||
|
||
``` | ||
const dag = new DAG({ | ||
nodes: [1, 2, 3, 4, 5, 6], | ||
links: [ | ||
{ parent_id: 1, child_id: 2, type: 'link' }, | ||
{ parent_id: 2, child_id: 3, type: 'drill' }, | ||
{ parent_id: 2, child_id: 4, type: 'filter' }, | ||
{ parent_id: 3, child_id: 1, type: 'filter' }, | ||
{ parent_id: 4, child_id: 5, type: 'link' }, | ||
{ parent_id: 4, child_id: 6, type: 'filter' } | ||
], | ||
link_key: { | ||
start: 'parent_id', | ||
end: 'child_id' | ||
} | ||
}); | ||
``` | ||
|
||
#### 使用方法参考test测试用例 | ||
|
||
#### [test](https://github.com/DPDFE/react-layout/tree/main/packages/event/__tests__/da g.test.ts) |
Oops, something went wrong.