ebaoferc 0.3.3-beta.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +43 -43
- package/dist/components/ImageViewTrigger/index.d.ts +4 -0
- package/dist/components/ImageViewTrigger/index.js +14 -6
- package/dist/components/ImageViewTrigger/index.less +25 -25
- package/dist/components/MindGraph/core/graphic/drag.js +15 -15
- package/dist/components/MindGraph/core/graphic/index.js +105 -105
- package/dist/components/MindGraph/core/helper/depth-first-walk-tree.js +4 -4
- package/dist/components/MindGraph/core/helper/descendant.js +3 -3
- package/dist/components/MindGraph/core/helper/get-layout-calc-children.js +6 -6
- package/dist/components/MindGraph/core/helper/judge-if-all-child-fold.js +4 -4
- package/dist/components/MindGraph/core/helper/judge-if-heir-and-fold.js +6 -6
- package/dist/components/MindGraph/core/helper/judge-if-visual-leaf.js +3 -3
- package/dist/components/MindGraph/core/index.d.ts +2 -6
- package/dist/components/MindGraph/core/index.js +26 -26
- package/dist/components/MindGraph/core/process/layout/structured/get-node-cross-boundary.js +7 -7
- package/dist/components/MindGraph/core/process/layout/type.js +20 -20
- package/dist/components/MindGraph/core/process/visible.js +3 -3
- package/dist/components/MindGraph/react/component/index.module.less +71 -71
- package/dist/components/MindGraph/react/scrollbar/axis/index.module.less +47 -47
- package/dist/components/QueryProCard/index.less +9 -9
- package/dist/components/SectionTitleBar/index.less +31 -31
- package/dist/components/SliderVerify/style.module.less +119 -119
- package/dist/components/StyledQueryFilter/index.less +34 -34
- package/dist/components/StyledTable/index.less +17 -17
- package/dist/components/ThemeStatusTag/index.less +11 -11
- package/dist/utils/file/index.d.ts +0 -1
- package/dist/utils/file/index.js +1 -2
- package/dist/utils/format/index.js +14 -14
- package/package.json +100 -100
- package/dist/utils/file/file-upload.d.ts +0 -1
- package/dist/utils/file/file-upload.js +0 -15
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
# ebaoferc
|
|
2
|
-
|
|
3
|
-
[](https://npmjs.org/package/ebaoferc)
|
|
4
|
-
[](https://npmjs.org/package/ebaoferc)
|
|
5
|
-
|
|
6
|
-
A react library developed with dumi
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
TODO
|
|
11
|
-
|
|
12
|
-
## Options
|
|
13
|
-
|
|
14
|
-
TODO
|
|
15
|
-
|
|
16
|
-
## Development
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# install dependencies
|
|
20
|
-
$ pnpm install
|
|
21
|
-
|
|
22
|
-
# develop library by docs demo
|
|
23
|
-
$ pnpm start
|
|
24
|
-
|
|
25
|
-
# build library source code
|
|
26
|
-
$ pnpm run build
|
|
27
|
-
|
|
28
|
-
# build library source code in watch mode
|
|
29
|
-
$ pnpm run build:watch
|
|
30
|
-
|
|
31
|
-
# build docs
|
|
32
|
-
$ pnpm run docs:build
|
|
33
|
-
|
|
34
|
-
# Locally preview the production build.
|
|
35
|
-
$ pnpm run docs:preview
|
|
36
|
-
|
|
37
|
-
# check your project for potential problems
|
|
38
|
-
$ pnpm run doctor
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## LICENSE
|
|
42
|
-
|
|
43
|
-
MIT
|
|
1
|
+
# ebaoferc
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.org/package/ebaoferc)
|
|
4
|
+
[](https://npmjs.org/package/ebaoferc)
|
|
5
|
+
|
|
6
|
+
A react library developed with dumi
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
TODO
|
|
11
|
+
|
|
12
|
+
## Options
|
|
13
|
+
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# install dependencies
|
|
20
|
+
$ pnpm install
|
|
21
|
+
|
|
22
|
+
# develop library by docs demo
|
|
23
|
+
$ pnpm start
|
|
24
|
+
|
|
25
|
+
# build library source code
|
|
26
|
+
$ pnpm run build
|
|
27
|
+
|
|
28
|
+
# build library source code in watch mode
|
|
29
|
+
$ pnpm run build:watch
|
|
30
|
+
|
|
31
|
+
# build docs
|
|
32
|
+
$ pnpm run docs:build
|
|
33
|
+
|
|
34
|
+
# Locally preview the production build.
|
|
35
|
+
$ pnpm run docs:preview
|
|
36
|
+
|
|
37
|
+
# check your project for potential problems
|
|
38
|
+
$ pnpm run doctor
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## LICENSE
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Image } from 'antd';
|
|
1
2
|
import { ReactElement } from 'react';
|
|
2
3
|
import './index.less';
|
|
3
4
|
type RenderTriggerPayload = {
|
|
@@ -8,10 +9,13 @@ type TAlbumThumbnailSize = {
|
|
|
8
9
|
width?: number;
|
|
9
10
|
height?: number;
|
|
10
11
|
};
|
|
12
|
+
type PreviewGroupProps = React.ComponentProps<typeof Image.PreviewGroup>;
|
|
13
|
+
type TPreviewOptions = Exclude<PreviewGroupProps['preview'], boolean>;
|
|
11
14
|
export type TImageViewTriggerProps = {
|
|
12
15
|
links?: string[];
|
|
13
16
|
albumThumbnailSize?: TAlbumThumbnailSize;
|
|
14
17
|
children?: (payload: RenderTriggerPayload) => ReactElement;
|
|
18
|
+
previewOptions?: TPreviewOptions;
|
|
15
19
|
};
|
|
16
20
|
export type TImageViewTriggerRef = {
|
|
17
21
|
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -15,7 +15,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
16
|
import { EyeOutlined } from '@ant-design/icons';
|
|
17
17
|
import { Image, message } from 'antd';
|
|
18
|
-
import { arrayToSingleValue, isNullOrUndefined } from "
|
|
18
|
+
import { arrayToSingleValue, isNullOrUndefined } from "../..";
|
|
19
19
|
import { forwardRef, memo, useImperativeHandle, useMemo, useState } from 'react';
|
|
20
20
|
import "./index.less";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -29,7 +29,9 @@ var ImageViewTriggerCpn = function ImageViewTriggerCpn(props, ref) {
|
|
|
29
29
|
var children = props.children,
|
|
30
30
|
links = props.links,
|
|
31
31
|
_props$albumThumbnail = props.albumThumbnailSize,
|
|
32
|
-
originAlbumThumbnailSize = _props$albumThumbnail === void 0 ? {} : _props$albumThumbnail
|
|
32
|
+
originAlbumThumbnailSize = _props$albumThumbnail === void 0 ? {} : _props$albumThumbnail,
|
|
33
|
+
_props$previewOptions = props.previewOptions,
|
|
34
|
+
previewOptions = _props$previewOptions === void 0 ? {} : _props$previewOptions;
|
|
33
35
|
var albumThumbnailSize = useMemo(function () {
|
|
34
36
|
var composeValue = _objectSpread(_objectSpread({}, AlbumThumbnailSizeDefaultValue), originAlbumThumbnailSize);
|
|
35
37
|
if (!isNullOrUndefined(originAlbumThumbnailSize === null || originAlbumThumbnailSize === void 0 ? void 0 : originAlbumThumbnailSize.width) && isNullOrUndefined(originAlbumThumbnailSize === null || originAlbumThumbnailSize === void 0 ? void 0 : originAlbumThumbnailSize.height)) {
|
|
@@ -108,12 +110,18 @@ var ImageViewTriggerCpn = function ImageViewTriggerCpn(props, ref) {
|
|
|
108
110
|
loading: loading
|
|
109
111
|
}), /*#__PURE__*/_jsx(Image.PreviewGroup, {
|
|
110
112
|
items: links || items,
|
|
111
|
-
preview: {
|
|
113
|
+
preview: _objectSpread(_objectSpread({}, previewOptions), {}, {
|
|
112
114
|
visible: visible,
|
|
113
|
-
onVisibleChange: function onVisibleChange(
|
|
114
|
-
|
|
115
|
+
onVisibleChange: function onVisibleChange() {
|
|
116
|
+
var _previewOptions$onVis;
|
|
117
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
118
|
+
args[_key] = arguments[_key];
|
|
119
|
+
}
|
|
120
|
+
var visible = args[0];
|
|
121
|
+
setVisible(visible);
|
|
122
|
+
previewOptions === null || previewOptions === void 0 || (_previewOptions$onVis = previewOptions.onVisibleChange) === null || _previewOptions$onVis === void 0 || _previewOptions$onVis.call.apply(_previewOptions$onVis, [previewOptions].concat(args));
|
|
115
123
|
}
|
|
116
|
-
},
|
|
124
|
+
}),
|
|
117
125
|
children: links && /*#__PURE__*/_jsxs("div", {
|
|
118
126
|
className: "thumbnail-mode-trigger",
|
|
119
127
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
.thumbnail-mode-trigger {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: inline-block;
|
|
4
|
-
|
|
5
|
-
.thumbnail-mask {
|
|
6
|
-
position: absolute;
|
|
7
|
-
z-index: 1;
|
|
8
|
-
inset: 0;
|
|
9
|
-
display: flex;
|
|
10
|
-
gap: 4px;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
color: #fff;
|
|
14
|
-
background: rgba(0, 0, 0, 50%);
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
opacity: 0;
|
|
17
|
-
transition: opacity 0.3s;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&:hover {
|
|
21
|
-
.thumbnail-mask {
|
|
22
|
-
opacity: 1;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
.thumbnail-mode-trigger {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
|
|
5
|
+
.thumbnail-mask {
|
|
6
|
+
position: absolute;
|
|
7
|
+
z-index: 1;
|
|
8
|
+
inset: 0;
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
color: #fff;
|
|
14
|
+
background: rgba(0, 0, 0, 50%);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transition: opacity 0.3s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
.thumbnail-mask {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -28,13 +28,13 @@ export var Drag = /*#__PURE__*/_createClass(function Drag(context) {
|
|
|
28
28
|
_defineProperty(this, "temporaryLine", void 0);
|
|
29
29
|
_defineProperty(this, "container", void 0);
|
|
30
30
|
_defineProperty(this, "draggableLayout", void 0);
|
|
31
|
-
/**
|
|
32
|
-
* 获取拖动节点插入到关联节点子代的下标
|
|
33
|
-
* @param attachedNodeChildren 关联节点的子代
|
|
34
|
-
* @param dropPosition 拖动节点镜像中心位置
|
|
35
|
-
* @param dragNode 拖动节点
|
|
36
|
-
* @param attachedNode 被关联的节点
|
|
37
|
-
* @return 期望插入位置
|
|
31
|
+
/**
|
|
32
|
+
* 获取拖动节点插入到关联节点子代的下标
|
|
33
|
+
* @param attachedNodeChildren 关联节点的子代
|
|
34
|
+
* @param dropPosition 拖动节点镜像中心位置
|
|
35
|
+
* @param dragNode 拖动节点
|
|
36
|
+
* @param attachedNode 被关联的节点
|
|
37
|
+
* @return 期望插入位置
|
|
38
38
|
*/
|
|
39
39
|
_defineProperty(this, "calcDropIndex", function (attachedNodeChildren, dropPosition, dragNode, attachedNode) {
|
|
40
40
|
return _this.draggableLayout.calcDropIndex({
|
|
@@ -47,12 +47,12 @@ export var Drag = /*#__PURE__*/_createClass(function Drag(context) {
|
|
|
47
47
|
root: _this.root
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
/**
|
|
51
|
-
* 拖动操作
|
|
52
|
-
* - 根节点不可拖拽
|
|
53
|
-
* @param position 拖动节点镜像中心位置
|
|
54
|
-
* @param canBeAttachedNodes 需要搜索的可关联节点
|
|
55
|
-
* @return 链接关联信息
|
|
50
|
+
/**
|
|
51
|
+
* 拖动操作
|
|
52
|
+
* - 根节点不可拖拽
|
|
53
|
+
* @param position 拖动节点镜像中心位置
|
|
54
|
+
* @param canBeAttachedNodes 需要搜索的可关联节点
|
|
55
|
+
* @return 链接关联信息
|
|
56
56
|
*/
|
|
57
57
|
_defineProperty(this, "drag", function (position, canBeAttachedNodes) {
|
|
58
58
|
var cache = _this.cacheMap.get(_this.dragNode.id);
|
|
@@ -88,8 +88,8 @@ export var Drag = /*#__PURE__*/_createClass(function Drag(context) {
|
|
|
88
88
|
return undefined;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
/**
|
|
92
|
-
* 通知控制器拖动操作结束
|
|
91
|
+
/**
|
|
92
|
+
* 通知控制器拖动操作结束
|
|
93
93
|
*/
|
|
94
94
|
_defineProperty(this, "end", function () {
|
|
95
95
|
_this.temporaryLine.destroy();
|
|
@@ -14,20 +14,20 @@ import { Drag } from "./drag";
|
|
|
14
14
|
import { nodeTranslateTo } from "./node-translate-to";
|
|
15
15
|
import { Zoom } from "./zoom";
|
|
16
16
|
export var Graphic = /*#__PURE__*/_createClass(
|
|
17
|
-
/**
|
|
18
|
-
* 脑图管理器
|
|
19
|
-
* - `viewport`用作判断可视区域
|
|
20
|
-
* - svg连线将会自动注入到`container`中
|
|
21
|
-
* - transform 相关信息将会自动注入到`container`中
|
|
22
|
-
* @param viewport 视窗
|
|
23
|
-
* @param container 容器
|
|
24
|
-
* @param options 配置参数
|
|
17
|
+
/**
|
|
18
|
+
* 脑图管理器
|
|
19
|
+
* - `viewport`用作判断可视区域
|
|
20
|
+
* - svg连线将会自动注入到`container`中
|
|
21
|
+
* - transform 相关信息将会自动注入到`container`中
|
|
22
|
+
* @param viewport 视窗
|
|
23
|
+
* @param container 容器
|
|
24
|
+
* @param options 配置参数
|
|
25
25
|
*/
|
|
26
26
|
function Graphic(viewport, _container, _options) {
|
|
27
27
|
var _this = this;
|
|
28
28
|
_classCallCheck(this, Graphic);
|
|
29
|
-
/**
|
|
30
|
-
* 节点相关信息缓存,树形结构拍平
|
|
29
|
+
/**
|
|
30
|
+
* 节点相关信息缓存,树形结构拍平
|
|
31
31
|
*/
|
|
32
32
|
_defineProperty(this, "cacheMap", new Map());
|
|
33
33
|
_defineProperty(this, "options", void 0);
|
|
@@ -39,16 +39,16 @@ function Graphic(viewport, _container, _options) {
|
|
|
39
39
|
_defineProperty(this, "resizeObserver", void 0);
|
|
40
40
|
_defineProperty(this, "unbindCache", []);
|
|
41
41
|
_defineProperty(this, "zoom", void 0);
|
|
42
|
-
/**
|
|
43
|
-
* 同步 options 中的 zoom extent
|
|
42
|
+
/**
|
|
43
|
+
* 同步 options 中的 zoom extent
|
|
44
44
|
*/
|
|
45
45
|
_defineProperty(this, "syncZoomExtentOptions", function () {
|
|
46
46
|
_this.zoom.syncZoomExtentOptions({
|
|
47
47
|
options: _this.options
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
/**
|
|
51
|
-
* 获取当前可见的节点
|
|
50
|
+
/**
|
|
51
|
+
* 获取当前可见的节点
|
|
52
52
|
*/
|
|
53
53
|
_defineProperty(this, "getVisibleNodes", function () {
|
|
54
54
|
var nodes = [];
|
|
@@ -65,10 +65,10 @@ function Graphic(viewport, _container, _options) {
|
|
|
65
65
|
}
|
|
66
66
|
return nodes;
|
|
67
67
|
});
|
|
68
|
-
/**
|
|
69
|
-
* 获取节点定位锚点(左上角)位置,可在节点绘制的时候确定其位置
|
|
70
|
-
* - 推荐所有节点使用`position:absolute;left:0;top:0;`并且配合`transform`来定位,避免出现绘制异常
|
|
71
|
-
* @param id 节点对应id
|
|
68
|
+
/**
|
|
69
|
+
* 获取节点定位锚点(左上角)位置,可在节点绘制的时候确定其位置
|
|
70
|
+
* - 推荐所有节点使用`position:absolute;left:0;top:0;`并且配合`transform`来定位,避免出现绘制异常
|
|
71
|
+
* @param id 节点对应id
|
|
72
72
|
*/
|
|
73
73
|
_defineProperty(this, "getNodeAnchorCoordinate", function (id) {
|
|
74
74
|
var cache = _this.cacheMap.get(id);
|
|
@@ -132,9 +132,9 @@ function Graphic(viewport, _container, _options) {
|
|
|
132
132
|
// 回调事件,通知外部 transform 改变
|
|
133
133
|
_this.options.callback.onTransformChange(transform);
|
|
134
134
|
});
|
|
135
|
-
/**
|
|
136
|
-
* - 计算节点可见是否改变,如改变,则通知外部
|
|
137
|
-
* - 重渲染连线,销毁不必要的连线
|
|
135
|
+
/**
|
|
136
|
+
* - 计算节点可见是否改变,如改变,则通知外部
|
|
137
|
+
* - 重渲染连线,销毁不必要的连线
|
|
138
138
|
*/
|
|
139
139
|
_defineProperty(this, "refreshVisible", function () {
|
|
140
140
|
if (_this.cacheMap.size) {
|
|
@@ -150,9 +150,9 @@ function Graphic(viewport, _container, _options) {
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
_defineProperty(this, "throttleRefreshVisible", throttle(this.refreshVisible, 100));
|
|
153
|
-
/**
|
|
154
|
-
* 视窗尺寸变化
|
|
155
|
-
* @private
|
|
153
|
+
/**
|
|
154
|
+
* 视窗尺寸变化
|
|
155
|
+
* @private
|
|
156
156
|
*/
|
|
157
157
|
_defineProperty(this, "onViewportResize", function () {
|
|
158
158
|
_this.zoom.syncZoomExtent({
|
|
@@ -162,9 +162,9 @@ function Graphic(viewport, _container, _options) {
|
|
|
162
162
|
// 避免频繁的刷新可视区域导致界面卡顿
|
|
163
163
|
_this.throttleRefreshVisible();
|
|
164
164
|
});
|
|
165
|
-
/**
|
|
166
|
-
* 注销事件绑定
|
|
167
|
-
* - 请在销毁组件之前调用
|
|
165
|
+
/**
|
|
166
|
+
* 注销事件绑定
|
|
167
|
+
* - 请在销毁组件之前调用
|
|
168
168
|
*/
|
|
169
169
|
_defineProperty(this, "unbind", function () {
|
|
170
170
|
_this.unbindCache.forEach(function (dispose) {
|
|
@@ -172,9 +172,9 @@ function Graphic(viewport, _container, _options) {
|
|
|
172
172
|
});
|
|
173
173
|
_this.unbindCache = [];
|
|
174
174
|
});
|
|
175
|
-
/**
|
|
176
|
-
* 判断节点是否可视
|
|
177
|
-
* @param id 节点对应id
|
|
175
|
+
/**
|
|
176
|
+
* 判断节点是否可视
|
|
177
|
+
* @param id 节点对应id
|
|
178
178
|
*/
|
|
179
179
|
_defineProperty(this, "judgeNodeVisible", function (id) {
|
|
180
180
|
var cache = _this.cacheMap.get(id);
|
|
@@ -184,11 +184,11 @@ function Graphic(viewport, _container, _options) {
|
|
|
184
184
|
return false;
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
/**
|
|
188
|
-
* 设定 `options`
|
|
189
|
-
* - 函数不会自动执行重渲染,如果改变的`options`需要重新计算布局等操作,推荐使用 `setData` 驱动数据重渲染
|
|
190
|
-
* @param options 设定选项
|
|
191
|
-
* @param isMerge 是否与之前的`options`做合并操作
|
|
187
|
+
/**
|
|
188
|
+
* 设定 `options`
|
|
189
|
+
* - 函数不会自动执行重渲染,如果改变的`options`需要重新计算布局等操作,推荐使用 `setData` 驱动数据重渲染
|
|
190
|
+
* @param options 设定选项
|
|
191
|
+
* @param isMerge 是否与之前的`options`做合并操作
|
|
192
192
|
*/
|
|
193
193
|
_defineProperty(this, "setOptions", function (options) {
|
|
194
194
|
var isMerge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -199,14 +199,14 @@ function Graphic(viewport, _container, _options) {
|
|
|
199
199
|
}
|
|
200
200
|
_this.syncZoomExtentOptions();
|
|
201
201
|
});
|
|
202
|
-
/**
|
|
203
|
-
* 生成拖动控制器
|
|
204
|
-
* - 根节点不可拖拽
|
|
205
|
-
* - 当前暂时只有`Mind.ChildAlignMode.structured`布局算法支持拖拽功能
|
|
206
|
-
* @param drag 拖动节点node对象或id
|
|
207
|
-
* @return
|
|
208
|
-
* - 当root(没有调用`setData`)不存在时,或者`drag`为根节点时,返回`undefined`
|
|
209
|
-
* - 正常情况返回 `Drag` 类对象
|
|
202
|
+
/**
|
|
203
|
+
* 生成拖动控制器
|
|
204
|
+
* - 根节点不可拖拽
|
|
205
|
+
* - 当前暂时只有`Mind.ChildAlignMode.structured`布局算法支持拖拽功能
|
|
206
|
+
* @param drag 拖动节点node对象或id
|
|
207
|
+
* @return
|
|
208
|
+
* - 当root(没有调用`setData`)不存在时,或者`drag`为根节点时,返回`undefined`
|
|
209
|
+
* - 正常情况返回 `Drag` 类对象
|
|
210
210
|
*/
|
|
211
211
|
_defineProperty(this, "dragControllerBuilder", function (drag) {
|
|
212
212
|
var _this$cacheMap$get;
|
|
@@ -223,8 +223,8 @@ function Graphic(viewport, _container, _options) {
|
|
|
223
223
|
return undefined;
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
|
-
/**
|
|
227
|
-
* 获取渲染层尺寸
|
|
226
|
+
/**
|
|
227
|
+
* 获取渲染层尺寸
|
|
228
228
|
*/
|
|
229
229
|
_defineProperty(this, "getLayoutSize", function () {
|
|
230
230
|
var _this$root;
|
|
@@ -235,70 +235,70 @@ function Graphic(viewport, _container, _options) {
|
|
|
235
235
|
return undefined;
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
|
-
/**
|
|
239
|
-
* 获取`id`对应节点
|
|
240
|
-
* @param id 节点`id`
|
|
238
|
+
/**
|
|
239
|
+
* 获取`id`对应节点
|
|
240
|
+
* @param id 节点`id`
|
|
241
241
|
*/
|
|
242
242
|
_defineProperty(this, "getNode", function (id) {
|
|
243
243
|
var _this$cacheMap$get2;
|
|
244
244
|
return (_this$cacheMap$get2 = _this.cacheMap.get(id)) === null || _this$cacheMap$get2 === void 0 ? void 0 : _this$cacheMap$get2.node;
|
|
245
245
|
});
|
|
246
|
-
/**
|
|
247
|
-
* 获取`id`对应节点父级
|
|
248
|
-
* @param id 节点`id`
|
|
246
|
+
/**
|
|
247
|
+
* 获取`id`对应节点父级
|
|
248
|
+
* @param id 节点`id`
|
|
249
249
|
*/
|
|
250
250
|
_defineProperty(this, "getParent", function (id) {
|
|
251
251
|
var _this$cacheMap$get3;
|
|
252
252
|
return (_this$cacheMap$get3 = _this.cacheMap.get(id)) === null || _this$cacheMap$get3 === void 0 ? void 0 : _this$cacheMap$get3.parent;
|
|
253
253
|
});
|
|
254
|
-
/**
|
|
255
|
-
* 获取`id`对应节点渲染方位
|
|
256
|
-
* @param id 节点`id`
|
|
254
|
+
/**
|
|
255
|
+
* 获取`id`对应节点渲染方位
|
|
256
|
+
* @param id 节点`id`
|
|
257
257
|
*/
|
|
258
258
|
_defineProperty(this, "getNodeOrientation", function (id) {
|
|
259
259
|
var _this$cacheMap$get4;
|
|
260
260
|
return (_this$cacheMap$get4 = _this.cacheMap.get(id)) === null || _this$cacheMap$get4 === void 0 ? void 0 : _this$cacheMap$get4.orientation;
|
|
261
261
|
});
|
|
262
|
-
/**
|
|
263
|
-
* 主动设置位移缩放
|
|
264
|
-
* - 会与之前的`transform`做深度合并
|
|
265
|
-
* - 请注意:`setTransform` 之后 `onTransformChange` 事件依旧会触发
|
|
266
|
-
* - 此方法不受 `zoomExtent.translate`、`zoomExtent.scale` 限制
|
|
267
|
-
* @param transform 位移缩放数据
|
|
268
|
-
* @param duration 周期,如果配置,则执行变换会附带动画效果
|
|
262
|
+
/**
|
|
263
|
+
* 主动设置位移缩放
|
|
264
|
+
* - 会与之前的`transform`做深度合并
|
|
265
|
+
* - 请注意:`setTransform` 之后 `onTransformChange` 事件依旧会触发
|
|
266
|
+
* - 此方法不受 `zoomExtent.translate`、`zoomExtent.scale` 限制
|
|
267
|
+
* @param transform 位移缩放数据
|
|
268
|
+
* @param duration 周期,如果配置,则执行变换会附带动画效果
|
|
269
269
|
*/
|
|
270
270
|
_defineProperty(this, "setTransform", function (transform, duration) {
|
|
271
271
|
_this.transform = merge({}, _this.transform, transform);
|
|
272
272
|
_this.zoom.setTransform(_this.transform, duration);
|
|
273
273
|
});
|
|
274
|
-
/**
|
|
275
|
-
* 设定位移
|
|
276
|
-
* - 此方法受到 `zoomExtent.translate` 限制
|
|
277
|
-
* @param translate 位移差(屏幕尺度)
|
|
278
|
-
* @param duration 周期,如果配置,则执行变换会附带动画效果
|
|
274
|
+
/**
|
|
275
|
+
* 设定位移
|
|
276
|
+
* - 此方法受到 `zoomExtent.translate` 限制
|
|
277
|
+
* @param translate 位移差(屏幕尺度)
|
|
278
|
+
* @param duration 周期,如果配置,则执行变换会附带动画效果
|
|
279
279
|
*/
|
|
280
280
|
_defineProperty(this, "translate", function (translate, duration) {
|
|
281
281
|
_this.zoom.translate(translate, duration);
|
|
282
282
|
});
|
|
283
|
-
/**
|
|
284
|
-
* 设定缩放
|
|
285
|
-
* - 此方法受到 `zoomExtent.translate` 限制
|
|
286
|
-
* - 此方法受到 `zoomExtent.scale` 限制
|
|
287
|
-
* @param scale 缩放比
|
|
288
|
-
* @param point 缩放相对点(如不配置或为`undefined`,则默认相对于`viewport`中心缩放)
|
|
289
|
-
* @param duration 动画周期,如配置,则位移会附带动画效果
|
|
283
|
+
/**
|
|
284
|
+
* 设定缩放
|
|
285
|
+
* - 此方法受到 `zoomExtent.translate` 限制
|
|
286
|
+
* - 此方法受到 `zoomExtent.scale` 限制
|
|
287
|
+
* @param scale 缩放比
|
|
288
|
+
* @param point 缩放相对点(如不配置或为`undefined`,则默认相对于`viewport`中心缩放)
|
|
289
|
+
* @param duration 动画周期,如配置,则位移会附带动画效果
|
|
290
290
|
*/
|
|
291
291
|
_defineProperty(this, "scale", function (scale, point, duration) {
|
|
292
292
|
_this.zoom.scale(scale, point, duration);
|
|
293
293
|
});
|
|
294
|
-
/**
|
|
295
|
-
* 将某一个节点中心从某个相对位置做位移(其尺度为屏幕尺度)操作
|
|
296
|
-
* - 此方法不受 `zoomExtent.translate` 限制
|
|
297
|
-
* @param config 配置参数
|
|
298
|
-
* @param config.id 节点id
|
|
299
|
-
* @param config.diff 位移差
|
|
300
|
-
* @param config.relative 相对位置
|
|
301
|
-
* @param duration 动画周期,如配置,则位移会附带动画效果
|
|
294
|
+
/**
|
|
295
|
+
* 将某一个节点中心从某个相对位置做位移(其尺度为屏幕尺度)操作
|
|
296
|
+
* - 此方法不受 `zoomExtent.translate` 限制
|
|
297
|
+
* @param config 配置参数
|
|
298
|
+
* @param config.id 节点id
|
|
299
|
+
* @param config.diff 位移差
|
|
300
|
+
* @param config.relative 相对位置
|
|
301
|
+
* @param duration 动画周期,如配置,则位移会附带动画效果
|
|
302
302
|
*/
|
|
303
303
|
_defineProperty(this, "nodeTranslateTo", function (config, duration) {
|
|
304
304
|
var id = config.id,
|
|
@@ -314,24 +314,24 @@ function Graphic(viewport, _container, _options) {
|
|
|
314
314
|
zoom: _this.zoom
|
|
315
315
|
}, duration);
|
|
316
316
|
});
|
|
317
|
-
/**
|
|
318
|
-
* 获取位移缩放信息
|
|
317
|
+
/**
|
|
318
|
+
* 获取位移缩放信息
|
|
319
319
|
*/
|
|
320
320
|
_defineProperty(this, "getTransform", function () {
|
|
321
321
|
return _objectSpread({}, _this.transform);
|
|
322
322
|
});
|
|
323
|
-
/**
|
|
324
|
-
* 设置锚点节点
|
|
325
|
-
* @param id 锚定节点id(如不设定,则清空锚点,根节点居中,缩放比归一)
|
|
323
|
+
/**
|
|
324
|
+
* 设置锚点节点
|
|
325
|
+
* @param id 锚定节点id(如不设定,则清空锚点,根节点居中,缩放比归一)
|
|
326
326
|
*/
|
|
327
327
|
_defineProperty(this, "setAnchor", function (id) {
|
|
328
328
|
_this.anchor = id;
|
|
329
329
|
});
|
|
330
|
-
/**
|
|
331
|
-
* 设置/更新数据,启动重渲染
|
|
332
|
-
* - 在重计算定位时,将保持 `anchor` 对应节点在屏幕上的相对位置不变
|
|
333
|
-
* - 如果 `anchor` 没有设定,或者找不到对应节点,则,根节点居中,缩放比重置为1
|
|
334
|
-
* @param root 根数据
|
|
330
|
+
/**
|
|
331
|
+
* 设置/更新数据,启动重渲染
|
|
332
|
+
* - 在重计算定位时,将保持 `anchor` 对应节点在屏幕上的相对位置不变
|
|
333
|
+
* - 如果 `anchor` 没有设定,或者找不到对应节点,则,根节点居中,缩放比重置为1
|
|
334
|
+
* @param root 根数据
|
|
335
335
|
*/
|
|
336
336
|
_defineProperty(this, "setData", function (root) {
|
|
337
337
|
_this.root = root;
|
|
@@ -346,17 +346,17 @@ function Graphic(viewport, _container, _options) {
|
|
|
346
346
|
// 设定数据后,通知外部可见节点
|
|
347
347
|
_this.options.callback.onNodeVisibleChange(_this.getVisibleNodes());
|
|
348
348
|
});
|
|
349
|
-
/**
|
|
350
|
-
* 刷新
|
|
349
|
+
/**
|
|
350
|
+
* 刷新
|
|
351
351
|
*/
|
|
352
352
|
_defineProperty(this, "refresh", function () {
|
|
353
353
|
if (_this.root) {
|
|
354
354
|
_this.setData(_this.root);
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
|
-
/**
|
|
358
|
-
* 渲染链接到某个`container`下
|
|
359
|
-
* @param container 容器
|
|
357
|
+
/**
|
|
358
|
+
* 渲染链接到某个`container`下
|
|
359
|
+
* @param container 容器
|
|
360
360
|
*/
|
|
361
361
|
_defineProperty(this, "connectTo", function (container) {
|
|
362
362
|
Render.connect({
|
|
@@ -366,8 +366,8 @@ function Graphic(viewport, _container, _options) {
|
|
|
366
366
|
root: _this.root
|
|
367
367
|
});
|
|
368
368
|
});
|
|
369
|
-
/**
|
|
370
|
-
* 同步渲染层尺寸到 container 中
|
|
369
|
+
/**
|
|
370
|
+
* 同步渲染层尺寸到 container 中
|
|
371
371
|
*/
|
|
372
372
|
_defineProperty(this, "syncLayoutSize", function () {
|
|
373
373
|
var _this$cacheMap$get5, _this$root2;
|
|
@@ -378,15 +378,15 @@ function Graphic(viewport, _container, _options) {
|
|
|
378
378
|
_this.container.style.width = "".concat(layoutSize.width, "px");
|
|
379
379
|
_this.container.style.height = "".concat(layoutSize.height, "px");
|
|
380
380
|
});
|
|
381
|
-
/**
|
|
382
|
-
* 链接各个节点
|
|
381
|
+
/**
|
|
382
|
+
* 链接各个节点
|
|
383
383
|
*/
|
|
384
384
|
_defineProperty(this, "connect", function () {
|
|
385
385
|
_this.connectTo(_this.container);
|
|
386
386
|
});
|
|
387
|
-
/**
|
|
388
|
-
* 计算脑图布局
|
|
389
|
-
* - 请保证调用之前 data 已经通过 setData 设置完备
|
|
387
|
+
/**
|
|
388
|
+
* 计算脑图布局
|
|
389
|
+
* - 请保证调用之前 data 已经通过 setData 设置完备
|
|
390
390
|
*/
|
|
391
391
|
_defineProperty(this, "layout", function () {
|
|
392
392
|
Render.layout({
|
|
@@ -400,8 +400,8 @@ function Graphic(viewport, _container, _options) {
|
|
|
400
400
|
zoom: _this.zoom
|
|
401
401
|
});
|
|
402
402
|
});
|
|
403
|
-
/**
|
|
404
|
-
* 计算各节点可见性,以及链接可见性
|
|
403
|
+
/**
|
|
404
|
+
* 计算各节点可见性,以及链接可见性
|
|
405
405
|
*/
|
|
406
406
|
_defineProperty(this, "calcVisible", function () {
|
|
407
407
|
return Render.calcVisible({
|