vislite 1.2.0-beta.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.
Files changed (78) hide show
  1. package/CHANGELOG +279 -274
  2. package/README.md +175 -175
  3. package/lib/Buffer/index.es.js +1 -1
  4. package/lib/Buffer/index.es.min.js +1 -1
  5. package/lib/Canvas/index.es.js +1 -1
  6. package/lib/Canvas/index.es.min.js +1 -1
  7. package/lib/Cardinal/index.es.js +1 -1
  8. package/lib/Cardinal/index.es.min.js +1 -1
  9. package/lib/Eoap/index.es.js +1 -1
  10. package/lib/Eoap/index.es.min.js +1 -1
  11. package/lib/Hermite/index.es.js +1 -1
  12. package/lib/Hermite/index.es.min.js +1 -1
  13. package/lib/Matrix4/index.es.js +1 -1
  14. package/lib/Matrix4/index.es.min.js +1 -1
  15. package/lib/Mercator/index.es.js +1 -1
  16. package/lib/Mercator/index.es.min.js +1 -1
  17. package/lib/RawCanvas/index.es.js +1 -1
  18. package/lib/RawCanvas/index.es.min.js +1 -1
  19. package/lib/SVG/index.es.js +1 -1
  20. package/lib/SVG/index.es.min.js +1 -1
  21. package/lib/Shader/index.es.js +1 -1
  22. package/lib/Shader/index.es.min.js +1 -1
  23. package/lib/Texture/index.es.js +1 -1
  24. package/lib/Texture/index.es.min.js +1 -1
  25. package/lib/TreeLayout/index.es.js +1 -1
  26. package/lib/TreeLayout/index.es.min.js +1 -1
  27. package/lib/animation/index.es.js +1 -1
  28. package/lib/animation/index.es.min.js +1 -1
  29. package/lib/assemble/index.es.js +1 -1
  30. package/lib/assemble/index.es.min.js +1 -1
  31. package/lib/getLoopColors/index.es.js +1 -1
  32. package/lib/getLoopColors/index.es.min.js +1 -1
  33. package/lib/getWebGLContext/index.es.js +1 -1
  34. package/lib/getWebGLContext/index.es.min.js +1 -1
  35. package/lib/index.umd.js +1 -1
  36. package/lib/index.umd.min.js +1 -1
  37. package/lib/initOption/index.es.js +1 -1
  38. package/lib/initOption/index.es.min.js +1 -1
  39. package/lib/mergeOption/index.es.js +1 -1
  40. package/lib/mergeOption/index.es.min.js +1 -1
  41. package/lib/move/index.es.js +1 -1
  42. package/lib/move/index.es.min.js +1 -1
  43. package/lib/rotate/index.es.js +1 -1
  44. package/lib/rotate/index.es.min.js +1 -1
  45. package/lib/ruler/index.es.js +1 -1
  46. package/lib/ruler/index.es.min.js +1 -1
  47. package/lib/scale/index.es.js +1 -1
  48. package/lib/scale/index.es.min.js +1 -1
  49. package/lib/throttle/index.es.js +1 -1
  50. package/lib/throttle/index.es.min.js +1 -1
  51. package/minialipay/ui-canvas/drawImage.js +35 -35
  52. package/minialipay/ui-canvas/index.acss +4 -4
  53. package/minialipay/ui-canvas/index.axml +3 -3
  54. package/minialipay/ui-canvas/index.d.ts +1 -1
  55. package/minialipay/ui-canvas/index.js +100 -100
  56. package/minialipay/ui-canvas/index.json +6 -6
  57. package/miniprogram/ui-canvas/index.js +117 -117
  58. package/package.json +2 -2
  59. package/src/Canvas.ts +84 -84
  60. package/src/common/canvas/default.ts +61 -61
  61. package/src/common/canvas/gradient.ts +31 -31
  62. package/src/common/canvas/index.ts +188 -188
  63. package/src/common/canvas/painter.ts +430 -430
  64. package/src/common/svg/config.ts +194 -194
  65. package/src/common/svg/default.ts +26 -26
  66. package/src/common/svg/index.ts +332 -332
  67. package/src/common/svg/tool.ts +42 -42
  68. package/src/common/type.ts +26 -26
  69. package/src/getLoopColors.ts +42 -42
  70. package/types/Canvas.d.ts +344 -344
  71. package/types/CanvasConfig.d.ts +116 -116
  72. package/types/SVGConfig.d.ts +89 -89
  73. package/types/assemble.d.ts +5 -5
  74. package/types/getLoopColors.d.ts +5 -5
  75. package/types/index.d.ts +165 -160
  76. package/types/option.d.ts +12 -12
  77. package/types/painterConfig.d.ts +4 -4
  78. package/types/uni-canvas.d.ts +3 -3
@@ -1,43 +1,43 @@
1
- import type SVGConfigType from '../../../types/SVGConfig'
2
-
3
- import { XLINK_ATTRIBUTE } from "./dictionary"
4
-
5
- // 新建节点
6
- export function toNode(tagname: string) {
7
- return document.createElementNS('http://www.w3.org/2000/svg', tagname)
8
- }
9
-
10
- // 设置属性
11
- const _setAttribute = function (el: SVGElement, key: string, value: string | number) {
12
-
13
- // 需要使用xlink命名空间的xml属性
14
- if (XLINK_ATTRIBUTE.indexOf(key) > -1) {
15
- el.setAttributeNS("http://www.w3.org/1999/xlink", 'xlink:' + key, value + "")
16
- }
17
-
18
- // 否则
19
- else {
20
- el.setAttribute(key, value + "")
21
- }
22
- }
23
- export const setAttribute = _setAttribute
24
-
25
- // 获取属性
26
- export function getAttribute(el: SVGElement, key: string) {
27
- if (XLINK_ATTRIBUTE.indexOf(key) > -1) key = 'xlink:' + key
28
- return el.getAttribute(key)
29
- }
30
-
31
- export function full(el: SVGElement, config: SVGConfigType) {
32
- _setAttribute(el, "stroke", config.strokeStyle as string)
33
- _setAttribute(el, "fill", config.fillStyle as string)
34
- }
35
-
36
- export function fill(el: SVGElement, config: SVGConfigType) {
37
- _setAttribute(el, "fill", config.fillStyle as string)
38
- }
39
-
40
- export function stroke(el: SVGElement, config: SVGConfigType) {
41
- _setAttribute(el, "stroke", config.strokeStyle as string)
42
- _setAttribute(el, "fill", "none")
1
+ import type SVGConfigType from '../../../types/SVGConfig'
2
+
3
+ import { XLINK_ATTRIBUTE } from "./dictionary"
4
+
5
+ // 新建节点
6
+ export function toNode(tagname: string) {
7
+ return document.createElementNS('http://www.w3.org/2000/svg', tagname)
8
+ }
9
+
10
+ // 设置属性
11
+ const _setAttribute = function (el: SVGElement, key: string, value: string | number) {
12
+
13
+ // 需要使用xlink命名空间的xml属性
14
+ if (XLINK_ATTRIBUTE.indexOf(key) > -1) {
15
+ el.setAttributeNS("http://www.w3.org/1999/xlink", 'xlink:' + key, value + "")
16
+ }
17
+
18
+ // 否则
19
+ else {
20
+ el.setAttribute(key, value + "")
21
+ }
22
+ }
23
+ export const setAttribute = _setAttribute
24
+
25
+ // 获取属性
26
+ export function getAttribute(el: SVGElement, key: string) {
27
+ if (XLINK_ATTRIBUTE.indexOf(key) > -1) key = 'xlink:' + key
28
+ return el.getAttribute(key)
29
+ }
30
+
31
+ export function full(el: SVGElement, config: SVGConfigType) {
32
+ _setAttribute(el, "stroke", config.strokeStyle as string)
33
+ _setAttribute(el, "fill", config.fillStyle as string)
34
+ }
35
+
36
+ export function fill(el: SVGElement, config: SVGConfigType) {
37
+ _setAttribute(el, "fill", config.fillStyle as string)
38
+ }
39
+
40
+ export function stroke(el: SVGElement, config: SVGConfigType) {
41
+ _setAttribute(el, "stroke", config.strokeStyle as string)
42
+ _setAttribute(el, "fill", "none")
43
43
  }
@@ -1,27 +1,27 @@
1
- let toString = Object.prototype.toString
2
-
3
- // 获取一个值的类型字符串[object type]
4
- export function getType(value: any) {
5
- if (value == null) {
6
- return value === undefined ? '[object Undefined]' : '[object Null]'
7
- }
8
- return toString.call(value)
9
- }
10
-
11
- // 判断一个值是不是一个朴素的'对象'
12
- export function isPlainObject(value: any) {
13
- if (value === null || typeof value !== 'object' || getType(value) != '[object Object]') {
14
- return false
15
- }
16
-
17
- // 如果原型为null
18
- if (Object.getPrototypeOf(value) === null) {
19
- return true
20
- }
21
-
22
- let proto = value
23
- while (Object.getPrototypeOf(proto) !== null) {
24
- proto = Object.getPrototypeOf(proto)
25
- }
26
- return Object.getPrototypeOf(value) === proto
1
+ let toString = Object.prototype.toString
2
+
3
+ // 获取一个值的类型字符串[object type]
4
+ export function getType(value: any) {
5
+ if (value == null) {
6
+ return value === undefined ? '[object Undefined]' : '[object Null]'
7
+ }
8
+ return toString.call(value)
9
+ }
10
+
11
+ // 判断一个值是不是一个朴素的'对象'
12
+ export function isPlainObject(value: any) {
13
+ if (value === null || typeof value !== 'object' || getType(value) != '[object Object]') {
14
+ return false
15
+ }
16
+
17
+ // 如果原型为null
18
+ if (Object.getPrototypeOf(value) === null) {
19
+ return true
20
+ }
21
+
22
+ let proto = value
23
+ while (Object.getPrototypeOf(proto) !== null) {
24
+ proto = Object.getPrototypeOf(proto)
25
+ }
26
+ return Object.getPrototypeOf(value) === proto
27
27
  }
@@ -1,42 +1,42 @@
1
- // 获取一组循环色彩
2
- export default function (num: number, alpha: number = 1, colorsFactory?: (alpha: number) => Array<string>) {
3
- // 颜色集合
4
- const colorList = colorsFactory ? colorsFactory(alpha) : [
5
- 'rgba(84,112,198,' + alpha + ")", 'rgba(145,204,117,' + alpha + ")",
6
- 'rgba(250,200,88,' + alpha + ")", 'rgba(238,102,102,' + alpha + ")",
7
- 'rgba(115,192,222,' + alpha + ")", 'rgba(59,162,114,' + alpha + ")",
8
- 'rgba(252,132,82,' + alpha + ")", 'rgba(154,96,180,' + alpha + ")",
9
- 'rgba(234,124,204,' + alpha + ")"
10
- ]
11
-
12
- let colors: string[] = []
13
-
14
- // 根据情况返回颜色数组
15
- if (num <= colorList.length) {
16
- // 这种情况就不需要任何处理
17
- return colorList
18
- } else {
19
- // 如果正好是集合长度的倍数
20
- if (num % colorList.length == 0) {
21
- // 将颜色数组循环加入后再返回
22
- for (let i = 0; i < (num / colorList.length); i++) {
23
- colors = colors.concat(colorList)
24
- }
25
- } else {
26
- for (let j = 1; j < (num / colorList.length); j++) {
27
- colors = colors.concat(colorList)
28
- }
29
- // 防止最后一个颜色和第一个颜色重复
30
- if (num % colorList.length == 1) {
31
- colors = colors.concat(colorList[4])
32
- } else {
33
- for (let k = 0; k < num % colorList.length; k++) {
34
- colors = colors.concat(colorList[k])
35
- }
36
- }
37
- }
38
- }
39
-
40
- // 返回结果
41
- return colors
42
- }
1
+ // 获取一组循环色彩
2
+ export default function (num: number, alpha: number = 1, colorsFactory?: (alpha: number) => Array<string>) {
3
+ // 颜色集合
4
+ const colorList = colorsFactory ? colorsFactory(alpha) : [
5
+ 'rgba(84,112,198,' + alpha + ")", 'rgba(145,204,117,' + alpha + ")",
6
+ 'rgba(250,200,88,' + alpha + ")", 'rgba(238,102,102,' + alpha + ")",
7
+ 'rgba(115,192,222,' + alpha + ")", 'rgba(59,162,114,' + alpha + ")",
8
+ 'rgba(252,132,82,' + alpha + ")", 'rgba(154,96,180,' + alpha + ")",
9
+ 'rgba(234,124,204,' + alpha + ")"
10
+ ]
11
+
12
+ let colors: string[] = []
13
+
14
+ // 根据情况返回颜色数组
15
+ if (num <= colorList.length) {
16
+ // 这种情况就不需要任何处理
17
+ return colorList
18
+ } else {
19
+ // 如果正好是集合长度的倍数
20
+ if (num % colorList.length == 0) {
21
+ // 将颜色数组循环加入后再返回
22
+ for (let i = 0; i < (num / colorList.length); i++) {
23
+ colors = colors.concat(colorList)
24
+ }
25
+ } else {
26
+ for (let j = 1; j < (num / colorList.length); j++) {
27
+ colors = colors.concat(colorList)
28
+ }
29
+ // 防止最后一个颜色和第一个颜色重复
30
+ if (num % colorList.length == 1) {
31
+ colors = colors.concat(colorList[4])
32
+ } else {
33
+ for (let k = 0; k < num % colorList.length; k++) {
34
+ colors = colors.concat(colorList[k])
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ // 返回结果
41
+ return colors
42
+ }