vislite 1.2.0 → 1.2.1-alpha.0
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/AUTHORS.txt +6 -6
- package/CHANGELOG +279 -274
- package/LICENSE +20 -20
- package/README.md +175 -175
- package/lib/Buffer/index.es.js +1 -1
- package/lib/Buffer/index.es.min.js +1 -1
- package/lib/Canvas/index.es.js +1 -1
- package/lib/Canvas/index.es.min.js +1 -1
- package/lib/Cardinal/index.es.js +1 -1
- package/lib/Cardinal/index.es.min.js +1 -1
- package/lib/Eoap/index.es.js +1 -1
- package/lib/Eoap/index.es.min.js +1 -1
- package/lib/Hermite/index.es.js +1 -1
- package/lib/Hermite/index.es.min.js +1 -1
- package/lib/Matrix4/index.es.js +1 -1
- package/lib/Matrix4/index.es.min.js +1 -1
- package/lib/Mercator/index.es.js +1 -1
- package/lib/Mercator/index.es.min.js +1 -1
- package/lib/RawCanvas/index.es.js +1 -1
- package/lib/RawCanvas/index.es.min.js +1 -1
- package/lib/SVG/index.es.js +1 -1
- package/lib/SVG/index.es.min.js +1 -1
- package/lib/Shader/index.es.js +1 -1
- package/lib/Shader/index.es.min.js +1 -1
- package/lib/Texture/index.es.js +1 -1
- package/lib/Texture/index.es.min.js +1 -1
- package/lib/TreeLayout/index.es.js +1 -1
- package/lib/TreeLayout/index.es.min.js +1 -1
- package/lib/animation/index.es.js +1 -1
- package/lib/animation/index.es.min.js +1 -1
- package/lib/assemble/index.es.js +1 -1
- package/lib/assemble/index.es.min.js +1 -1
- package/lib/getLoopColors/index.es.js +1 -1
- package/lib/getLoopColors/index.es.min.js +1 -1
- package/lib/getWebGLContext/index.es.js +1 -1
- package/lib/getWebGLContext/index.es.min.js +1 -1
- package/lib/index.umd.js +1 -1
- package/lib/index.umd.min.js +1 -1
- package/lib/initOption/index.es.js +1 -1
- package/lib/initOption/index.es.min.js +1 -1
- package/lib/mergeOption/index.es.js +1 -1
- package/lib/mergeOption/index.es.min.js +1 -1
- package/lib/move/index.es.js +1 -1
- package/lib/move/index.es.min.js +1 -1
- package/lib/rotate/index.es.js +1 -1
- package/lib/rotate/index.es.min.js +1 -1
- package/lib/ruler/index.es.js +1 -1
- package/lib/ruler/index.es.min.js +1 -1
- package/lib/scale/index.es.js +1 -1
- package/lib/scale/index.es.min.js +1 -1
- package/lib/throttle/index.es.js +1 -1
- package/lib/throttle/index.es.min.js +1 -1
- package/minialipay/ui-canvas/drawImage.js +35 -35
- package/minialipay/ui-canvas/index.acss +4 -4
- package/minialipay/ui-canvas/index.axml +3 -3
- package/minialipay/ui-canvas/index.d.ts +1 -1
- package/minialipay/ui-canvas/index.js +100 -100
- package/minialipay/ui-canvas/index.json +6 -6
- package/miniprogram/ui-canvas/drawImage.js +35 -35
- package/miniprogram/ui-canvas/index.js +117 -117
- package/miniprogram/ui-canvas/index.json +4 -4
- package/miniprogram/ui-canvas/index.wxml +4 -4
- package/miniprogram/ui-canvas/index.wxss +5 -5
- package/package/Buffer/index.ts +2 -2
- package/package/Canvas/index.ts +2 -2
- package/package/Cardinal/index.ts +2 -2
- package/package/Eoap/index.ts +2 -2
- package/package/Hermite/index.ts +2 -2
- package/package/Matrix4/index.ts +2 -2
- package/package/Mercator/index.ts +2 -2
- package/package/RawCanvas/index.ts +2 -2
- package/package/SVG/index.ts +2 -2
- package/package/Shader/index.ts +2 -2
- package/package/Texture/index.ts +2 -2
- package/package/TreeLayout/index.ts +2 -2
- package/package/animation/index.ts +2 -2
- package/package/assemble/index.ts +2 -2
- package/package/getLoopColors/index.ts +2 -2
- package/package/getWebGLContext/index.ts +40 -40
- package/package/index.ts +75 -75
- package/package/initOption/index.ts +2 -2
- package/package/mergeOption/index.ts +2 -2
- package/package/move/index.ts +2 -2
- package/package/rotate/index.ts +2 -2
- package/package/ruler/index.ts +2 -2
- package/package/scale/index.ts +2 -2
- package/package/throttle/index.ts +2 -2
- package/package.json +78 -78
- package/src/Canvas.ts +84 -84
- package/src/Eoap.ts +66 -66
- package/src/Matrix4/index.ts +84 -84
- package/src/Matrix4/move.ts +12 -12
- package/src/Matrix4/rotate.ts +15 -15
- package/src/Matrix4/scale.ts +11 -11
- package/src/Matrix4/transform.ts +64 -64
- package/src/Mercator.ts +27 -27
- package/src/SVG.ts +24 -24
- package/src/common/assemble.ts +22 -22
- package/src/common/canvas/arc.ts +51 -51
- package/src/common/canvas/config.ts +158 -158
- package/src/common/canvas/default.ts +61 -61
- package/src/common/canvas/gradient.ts +31 -31
- package/src/common/canvas/index.ts +188 -188
- package/src/common/canvas/painter.ts +430 -430
- package/src/common/canvas/texts.ts +18 -18
- package/src/common/option.ts +29 -29
- package/src/common/setStyle.ts +5 -5
- package/src/common/svg/config.ts +194 -194
- package/src/common/svg/default.ts +26 -26
- package/src/common/svg/gradient.ts +53 -53
- package/src/common/svg/index.ts +332 -332
- package/src/common/svg/tool.ts +42 -42
- package/src/common/tree/index.ts +25 -25
- package/src/common/tree/toInnerTree.ts +59 -59
- package/src/common/tree/toPlainTree.ts +132 -132
- package/src/common/type.ts +26 -26
- package/src/common/webgl/buffer.ts +79 -79
- package/src/common/webgl/getWebGLContext.ts +45 -45
- package/src/common/webgl/shader.ts +75 -75
- package/src/common/webgl/texture.ts +97 -97
- package/src/getLoopColors.ts +42 -42
- package/src/interpolation/Cardinal.ts +110 -110
- package/src/interpolation/Hermite.ts +65 -65
- package/src/layout/TreeLayout.ts +188 -188
- package/src/move.ts +7 -7
- package/src/rotate.ts +7 -7
- package/src/ruler.ts +209 -209
- package/src/scale.ts +6 -6
- package/types/Buffer.d.ts +23 -23
- package/types/Canvas.d.ts +344 -344
- package/types/CanvasConfig.d.ts +116 -116
- package/types/CanvasOption.d.ts +8 -8
- package/types/CanvasOpts.d.ts +9 -9
- package/types/Cardinal.d.ts +13 -13
- package/types/Gradient.d.ts +14 -14
- package/types/Hermite.d.ts +18 -18
- package/types/Map.d.ts +9 -9
- package/types/Matrix4.d.ts +47 -47
- package/types/SVG.d.ts +243 -243
- package/types/SVGConfig.d.ts +89 -89
- package/types/Shader.d.ts +16 -16
- package/types/Texture.d.ts +16 -16
- package/types/Tree.d.ts +69 -69
- package/types/TreeConfig.d.ts +36 -36
- package/types/TreeLayout.d.ts +54 -54
- package/types/TreeOption.d.ts +48 -48
- package/types/animation.d.ts +5 -5
- package/types/assemble.d.ts +5 -5
- package/types/getLoopColors.d.ts +5 -5
- package/types/getWebGLContext.d.ts +7 -7
- package/types/index.d.ts +165 -160
- package/types/move.d.ts +5 -5
- package/types/option.d.ts +12 -12
- package/types/painterConfig.d.ts +4 -4
- package/types/rotate.d.ts +5 -5
- package/types/ruler.d.ts +10 -10
- package/types/scale.d.ts +5 -5
- package/types/throttle.d.ts +5 -5
- package/types/ui-canvas.d.ts +4 -4
- package/types/uni-canvas.d.ts +3 -3
- package/uni-app/drawImage.js +19 -19
- package/uni-app/ui-canvas.vue +284 -284
package/types/index.d.ts
CHANGED
|
@@ -1,161 +1,166 @@
|
|
|
1
|
-
/// <reference path="./uni-canvas.d.ts" />
|
|
2
|
-
|
|
3
|
-
import CardinalType from './Cardinal'
|
|
4
|
-
import HermiteType from './Hermite'
|
|
5
|
-
|
|
6
|
-
import Matrix4Type from './Matrix4'
|
|
7
|
-
import rotateType from './rotate'
|
|
8
|
-
import moveType from './move'
|
|
9
|
-
import scaleType from './scale'
|
|
10
|
-
|
|
11
|
-
import getLoopColorsType from './getLoopColors'
|
|
12
|
-
import animationType from './animation'
|
|
13
|
-
import rulerType from './ruler'
|
|
14
|
-
|
|
15
|
-
import SVGType from './SVG'
|
|
16
|
-
import CanvasType from './Canvas'
|
|
17
|
-
|
|
18
|
-
import CanvasOptionType from './CanvasOption'
|
|
19
|
-
|
|
20
|
-
import getWebGLContextType from './getWebGLContext'
|
|
21
|
-
import ShaderType from './Shader'
|
|
22
|
-
import BufferType from './Buffer'
|
|
23
|
-
import TextureType from './Texture'
|
|
24
|
-
|
|
25
|
-
import MapType from './Map'
|
|
26
|
-
|
|
27
|
-
import throttleType from './throttle'
|
|
28
|
-
import assembleType from './assemble'
|
|
29
|
-
|
|
30
|
-
import TreeLayoutType from './TreeLayout'
|
|
31
|
-
import TreeConfigType from './TreeConfig'
|
|
32
|
-
|
|
33
|
-
import { initOptionType, mergeOptionType } from './option'
|
|
34
|
-
|
|
35
|
-
// 插值
|
|
36
|
-
interface NewCardinalType extends CardinalType {
|
|
37
|
-
new(t?: number): this
|
|
38
|
-
}
|
|
39
|
-
interface NewHermiteType extends HermiteType {
|
|
40
|
-
new(u?: number): this
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 变换
|
|
44
|
-
interface NewMatrix4Type extends Matrix4Type {
|
|
45
|
-
new(initMatrix4?: number[]): this
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// 画笔
|
|
49
|
-
interface NewSVGType extends SVGType {
|
|
50
|
-
new(el: HTMLElement | null): this
|
|
51
|
-
}
|
|
52
|
-
interface NewCanvasType extends CanvasType {
|
|
53
|
-
new(el: HTMLElement | null, option?: CanvasOptionType, width?: number, height?: number): this
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
interface
|
|
61
|
-
new(painter: WebGLRenderingContext
|
|
62
|
-
}
|
|
63
|
-
interface
|
|
64
|
-
new(painter: WebGLRenderingContext,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
interface
|
|
72
|
-
new(scale?: number, center?: number[]): this
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
static
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
static
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
static
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
static
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
static
|
|
103
|
-
static
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
static
|
|
109
|
-
static
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
static
|
|
113
|
-
static
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
static
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
static
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
//
|
|
128
|
-
export let
|
|
129
|
-
export let
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export let
|
|
135
|
-
export let
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
export let
|
|
140
|
-
export let
|
|
141
|
-
|
|
142
|
-
//
|
|
143
|
-
export let
|
|
144
|
-
export let
|
|
145
|
-
export let
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
export let
|
|
150
|
-
export let
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
export let
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
1
|
+
/// <reference path="./uni-canvas.d.ts" />
|
|
2
|
+
|
|
3
|
+
import CardinalType from './Cardinal'
|
|
4
|
+
import HermiteType from './Hermite'
|
|
5
|
+
|
|
6
|
+
import Matrix4Type from './Matrix4'
|
|
7
|
+
import rotateType from './rotate'
|
|
8
|
+
import moveType from './move'
|
|
9
|
+
import scaleType from './scale'
|
|
10
|
+
|
|
11
|
+
import getLoopColorsType from './getLoopColors'
|
|
12
|
+
import animationType from './animation'
|
|
13
|
+
import rulerType from './ruler'
|
|
14
|
+
|
|
15
|
+
import SVGType from './SVG'
|
|
16
|
+
import CanvasType from './Canvas'
|
|
17
|
+
|
|
18
|
+
import CanvasOptionType from './CanvasOption'
|
|
19
|
+
|
|
20
|
+
import getWebGLContextType from './getWebGLContext'
|
|
21
|
+
import ShaderType from './Shader'
|
|
22
|
+
import BufferType from './Buffer'
|
|
23
|
+
import TextureType from './Texture'
|
|
24
|
+
|
|
25
|
+
import MapType from './Map'
|
|
26
|
+
|
|
27
|
+
import throttleType from './throttle'
|
|
28
|
+
import assembleType from './assemble'
|
|
29
|
+
|
|
30
|
+
import TreeLayoutType from './TreeLayout'
|
|
31
|
+
import TreeConfigType from './TreeConfig'
|
|
32
|
+
|
|
33
|
+
import { initOptionType, mergeOptionType } from './option'
|
|
34
|
+
|
|
35
|
+
// 插值
|
|
36
|
+
interface NewCardinalType extends CardinalType {
|
|
37
|
+
new(t?: number): this
|
|
38
|
+
}
|
|
39
|
+
interface NewHermiteType extends HermiteType {
|
|
40
|
+
new(u?: number): this
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 变换
|
|
44
|
+
interface NewMatrix4Type extends Matrix4Type {
|
|
45
|
+
new(initMatrix4?: number[]): this
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 画笔
|
|
49
|
+
interface NewSVGType extends SVGType {
|
|
50
|
+
new(el: HTMLElement | null): this
|
|
51
|
+
}
|
|
52
|
+
interface NewCanvasType extends CanvasType {
|
|
53
|
+
new(el: HTMLElement | null, option?: CanvasOptionType, width?: number, height?: number): this
|
|
54
|
+
}
|
|
55
|
+
interface NewRawCanvasType extends CanvasType {
|
|
56
|
+
new(canvas: any, region?: any, scaleSize?: number): this
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// WebGL
|
|
60
|
+
interface NewShaderType extends ShaderType {
|
|
61
|
+
new(painter: WebGLRenderingContext): this
|
|
62
|
+
}
|
|
63
|
+
interface NewBufferType extends BufferType {
|
|
64
|
+
new(painter: WebGLRenderingContext, isElement?: boolean): this
|
|
65
|
+
}
|
|
66
|
+
interface NewTextureType extends TextureType {
|
|
67
|
+
new(painter: WebGLRenderingContext, type: string, unit?: number): this
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 投影
|
|
71
|
+
interface NewEoapType extends MapType {
|
|
72
|
+
new(scale?: number, center?: number[]): this
|
|
73
|
+
}
|
|
74
|
+
interface NewMercatorType extends MapType {
|
|
75
|
+
new(scale?: number, center?: number[]): this
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 布局
|
|
79
|
+
interface NewTreeLayoutType extends TreeLayoutType {
|
|
80
|
+
new(config?: TreeConfigType): this
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default class VISLite {
|
|
84
|
+
|
|
85
|
+
// 插值
|
|
86
|
+
static Cardinal: NewCardinalType
|
|
87
|
+
static Hermite: NewHermiteType
|
|
88
|
+
|
|
89
|
+
// 变换
|
|
90
|
+
static Matrix4: NewMatrix4Type
|
|
91
|
+
static rotate: rotateType
|
|
92
|
+
static move: moveType
|
|
93
|
+
static scale: scaleType
|
|
94
|
+
|
|
95
|
+
// 工具
|
|
96
|
+
static getLoopColors: getLoopColorsType
|
|
97
|
+
static animation: animationType
|
|
98
|
+
static ruler: rulerType
|
|
99
|
+
|
|
100
|
+
// 画笔
|
|
101
|
+
static SVG: NewSVGType
|
|
102
|
+
static Canvas: NewCanvasType
|
|
103
|
+
static RawCanvas: NewRawCanvasType
|
|
104
|
+
|
|
105
|
+
// WebGL
|
|
106
|
+
static getWebGLContext: getWebGLContextType
|
|
107
|
+
static Shader: NewShaderType
|
|
108
|
+
static Buffer: NewBufferType
|
|
109
|
+
static Texture: NewTextureType
|
|
110
|
+
|
|
111
|
+
// 投影
|
|
112
|
+
static Eoap: NewEoapType
|
|
113
|
+
static Mercator: NewMercatorType
|
|
114
|
+
|
|
115
|
+
// 辅助
|
|
116
|
+
static throttle: throttleType
|
|
117
|
+
static assemble: assembleType
|
|
118
|
+
|
|
119
|
+
// 布局
|
|
120
|
+
static TreeLayout: NewTreeLayoutType
|
|
121
|
+
|
|
122
|
+
// 配置项
|
|
123
|
+
static initOption: initOptionType
|
|
124
|
+
static mergeOption: mergeOptionType
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 插值
|
|
128
|
+
export let Cardinal: NewCardinalType
|
|
129
|
+
export let Hermite: NewHermiteType
|
|
130
|
+
|
|
131
|
+
// 变换
|
|
132
|
+
export let Matrix4: NewMatrix4Type
|
|
133
|
+
export let rotate: rotateType
|
|
134
|
+
export let move: moveType
|
|
135
|
+
export let scale: scaleType
|
|
136
|
+
|
|
137
|
+
// 工具
|
|
138
|
+
export let getLoopColors: getLoopColorsType
|
|
139
|
+
export let animation: animationType
|
|
140
|
+
export let ruler: rulerType
|
|
141
|
+
|
|
142
|
+
// 画笔
|
|
143
|
+
export let SVG: NewSVGType
|
|
144
|
+
export let Canvas: NewCanvasType
|
|
145
|
+
export let RawCanvas: NewRawCanvasType
|
|
146
|
+
|
|
147
|
+
// WebGL
|
|
148
|
+
export let getWebGLContext: getWebGLContextType
|
|
149
|
+
export let Shader: NewShaderType
|
|
150
|
+
export let Buffer: NewBufferType
|
|
151
|
+
export let Texture: NewTextureType
|
|
152
|
+
|
|
153
|
+
// 投影
|
|
154
|
+
export let Eoap: NewEoapType
|
|
155
|
+
export let Mercator: NewMercatorType
|
|
156
|
+
|
|
157
|
+
// 辅助
|
|
158
|
+
export let throttle: throttleType
|
|
159
|
+
export let assemble: assembleType
|
|
160
|
+
|
|
161
|
+
// 布局
|
|
162
|
+
export let TreeLayout: NewTreeLayoutType
|
|
163
|
+
|
|
164
|
+
// 配置项
|
|
165
|
+
export let initOption: initOptionType
|
|
161
166
|
export let mergeOption: mergeOptionType
|
package/types/move.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 移动
|
|
3
|
-
*/
|
|
4
|
-
export default interface moveType {
|
|
5
|
-
(ax: number, ay: number, d: number, x: number, y: number): [number, number]
|
|
1
|
+
/**
|
|
2
|
+
* 移动
|
|
3
|
+
*/
|
|
4
|
+
export default interface moveType {
|
|
5
|
+
(ax: number, ay: number, d: number, x: number, y: number): [number, number]
|
|
6
6
|
}
|
package/types/option.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 初始化配置
|
|
3
|
-
*/
|
|
4
|
-
export interface initOptionType {
|
|
5
|
-
(setOption: any, defaultOption: any): any
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 合并配置
|
|
10
|
-
*/
|
|
11
|
-
export interface mergeOptionType {
|
|
12
|
-
(oldOption: any, newOption: any): void
|
|
1
|
+
/**
|
|
2
|
+
* 初始化配置
|
|
3
|
+
*/
|
|
4
|
+
export interface initOptionType {
|
|
5
|
+
(setOption: any, defaultOption: any): any
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 合并配置
|
|
10
|
+
*/
|
|
11
|
+
export interface mergeOptionType {
|
|
12
|
+
(oldOption: any, newOption: any): void
|
|
13
13
|
}
|
package/types/painterConfig.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type arcCapType = "butt" | "round" | "-round"
|
|
2
|
-
export type textAlignType = "left" | "center" | "right"
|
|
3
|
-
export type textBaselineType = "top" | "middle" | "bottom"
|
|
4
|
-
export type lineCapType = "butt" | "round" | "square"
|
|
1
|
+
export type arcCapType = "butt" | "round" | "-round"
|
|
2
|
+
export type textAlignType = "left" | "center" | "right"
|
|
3
|
+
export type textBaselineType = "top" | "middle" | "bottom"
|
|
4
|
+
export type lineCapType = "butt" | "round" | "square"
|
|
5
5
|
export type lineJoinType = "miter" | "bevel" | "round"
|
package/types/rotate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 旋转
|
|
3
|
-
*/
|
|
4
|
-
export default interface rotateType {
|
|
5
|
-
(cx: number, cy: number, deg: number, x: number, y: number): [number, number]
|
|
1
|
+
/**
|
|
2
|
+
* 旋转
|
|
3
|
+
*/
|
|
4
|
+
export default interface rotateType {
|
|
5
|
+
(cx: number, cy: number, deg: number, x: number, y: number): [number, number]
|
|
6
6
|
}
|
package/types/ruler.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export interface rulerOptionType {
|
|
2
|
-
max?: number
|
|
3
|
-
min?: number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 刻度尺刻度运算,返回一个数组,表示刻度尺上应该显示的刻度
|
|
8
|
-
*/
|
|
9
|
-
export default interface rulerType {
|
|
10
|
-
(maxValue: number, minValue: number, num: number, option?: rulerOptionType): number[]
|
|
1
|
+
export interface rulerOptionType {
|
|
2
|
+
max?: number
|
|
3
|
+
min?: number
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 刻度尺刻度运算,返回一个数组,表示刻度尺上应该显示的刻度
|
|
8
|
+
*/
|
|
9
|
+
export default interface rulerType {
|
|
10
|
+
(maxValue: number, minValue: number, num: number, option?: rulerOptionType): number[]
|
|
11
11
|
}
|
package/types/scale.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 缩放
|
|
3
|
-
*/
|
|
4
|
-
export default interface scaleType {
|
|
5
|
-
(cx: number, cy: number, times: number, x: number, y: number): [number, number]
|
|
1
|
+
/**
|
|
2
|
+
* 缩放
|
|
3
|
+
*/
|
|
4
|
+
export default interface scaleType {
|
|
5
|
+
(cx: number, cy: number, times: number, x: number, y: number): [number, number]
|
|
6
6
|
}
|
package/types/throttle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { throttleType } from "@oipage/core.js/src/throttle"
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 节流函数
|
|
5
|
-
*/
|
|
1
|
+
import { throttleType } from "@oipage/core.js/src/throttle"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 节流函数
|
|
5
|
+
*/
|
|
6
6
|
export default throttleType
|
package/types/ui-canvas.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CanvasType from "./Canvas"
|
|
2
|
-
|
|
3
|
-
export default interface UiCanvasType {
|
|
4
|
-
fetch(): Promise<CanvasType>
|
|
1
|
+
import CanvasType from "./Canvas"
|
|
2
|
+
|
|
3
|
+
export default interface UiCanvasType {
|
|
4
|
+
fetch(): Promise<CanvasType>
|
|
5
5
|
}
|
package/types/uni-canvas.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ui-canvas
|
|
3
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* ui-canvas
|
|
3
|
+
*/
|
|
4
4
|
declare module "vislite/uni-app/ui-canvas.vue";
|
package/uni-app/drawImage.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export default function (_this, drawImage) {
|
|
2
|
-
return function (imgUrl, x, y, w, h) {
|
|
3
|
-
return new Promise((resolve) => {
|
|
4
|
-
if (/^http/.test(imgUrl)) {
|
|
5
|
-
uni.downloadFile({
|
|
6
|
-
url: imgUrl,
|
|
7
|
-
success: function (res) {
|
|
8
|
-
drawImage.call(_this, res.tempFilePath, x, y, w, h, true).then(() => {
|
|
9
|
-
resolve({});
|
|
10
|
-
});
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
} else {
|
|
14
|
-
drawImage.call(_this, imgUrl, x, y, w, h, true).then(() => {
|
|
15
|
-
resolve({});
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
1
|
+
export default function (_this, drawImage) {
|
|
2
|
+
return function (imgUrl, x, y, w, h) {
|
|
3
|
+
return new Promise((resolve) => {
|
|
4
|
+
if (/^http/.test(imgUrl)) {
|
|
5
|
+
uni.downloadFile({
|
|
6
|
+
url: imgUrl,
|
|
7
|
+
success: function (res) {
|
|
8
|
+
drawImage.call(_this, res.tempFilePath, x, y, w, h, true).then(() => {
|
|
9
|
+
resolve({});
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
} else {
|
|
14
|
+
drawImage.call(_this, imgUrl, x, y, w, h, true).then(() => {
|
|
15
|
+
resolve({});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
20
|
};
|