@antv/g 5.0.23-alpha.8 → 5.0.23-alpha.9

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.
@@ -1,4 +1,4 @@
1
- import { CSSUnitValue } from '../cssom';
1
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
2
2
  export declare function numberToString(x: number): string;
3
3
  /**
4
4
  * parse string or number to CSSUnitValue(numeric)
@@ -1,5 +1,5 @@
1
1
  import { clamp, isString } from '../../utils';
2
- import { CSSUnitValue } from '../cssom';
2
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
3
3
  export function numberToString(x) {
4
4
  // scale(0.00000001) -> scale(0)
5
5
  // return x.toFixed(6).replace(/0+$/, '').replace(/\.$/, '');
@@ -2,6 +2,7 @@ import { UnitType } from '../cssom/types';
2
2
  import { CSSUnitValue, Opx, Odeg } from '../cssom/CSSNumericValue';
3
3
  import { mergeDimensions, parseAngle, parseLength, parseLengthOrPercentage } from './dimension';
4
4
  import { mergeNumbers, parseNumber } from './numeric';
5
+ import { CSS } from '../CSS';
5
6
  var _ = null;
6
7
 
7
8
  function cast(pattern) {
@@ -28,10 +29,10 @@ var transformFunctions = {
28
29
  rotatez: ['A'],
29
30
  rotate3d: ['NNNA'],
30
31
  // perspective: ['L'],
31
- scale: ['Nn', cast([_, _, new CSSUnitValue(1)]), id],
32
- scalex: ['N', cast([_, new CSSUnitValue(1), new CSSUnitValue(1)]), cast([_, new CSSUnitValue(1)])],
33
- scaley: ['N', cast([new CSSUnitValue(1), _, new CSSUnitValue(1)]), cast([new CSSUnitValue(1), _])],
34
- scalez: ['N', cast([new CSSUnitValue(1), new CSSUnitValue(1), _])],
32
+ scale: ['Nn', cast([_, _, CSS.number(1)]), id],
33
+ scalex: ['N', cast([_, CSS.number(1), CSS.number(1)]), cast([_, CSS.number(1)])],
34
+ scaley: ['N', cast([CSS.number(1), _, CSS.number(1)]), cast([CSS.number(1), _])],
35
+ scalez: ['N', cast([CSS.number(1), CSS.number(1), _])],
35
36
  scale3d: ['NNN', id],
36
37
  // skew: ['Aa', null, id],
37
38
  // skewx: ['A', null, cast([_, Odeg])],
@@ -1,4 +1,4 @@
1
- import { CSSUnitValue } from '../cssom';
1
+ import { CSSUnitValue } from '../cssom/CSSNumericValue';
2
2
  export declare function numberToString(x: number): string;
3
3
  /**
4
4
  * parse string or number to CSSUnitValue(numeric)
@@ -12,7 +12,7 @@ exports.parseNumberList = parseNumberList;
12
12
 
13
13
  var _utils = require("../../utils");
14
14
 
15
- var _cssom = require("../cssom");
15
+ var _CSSNumericValue = require("../cssom/CSSNumericValue");
16
16
 
17
17
  function numberToString(x) {
18
18
  // scale(0.00000001) -> scale(0)
@@ -30,13 +30,13 @@ function numberToString(x) {
30
30
 
31
31
  function parseNumber(string) {
32
32
  if (typeof string === 'number') {
33
- return new _cssom.CSSUnitValue(string);
33
+ return new _CSSNumericValue.CSSUnitValue(string);
34
34
  }
35
35
 
36
36
  if (/^\s*[-+]?(\d*\.)?\d+\s*$/.test(string)) {
37
- return new _cssom.CSSUnitValue(Number(string));
37
+ return new _CSSNumericValue.CSSUnitValue(Number(string));
38
38
  } else {
39
- return new _cssom.CSSUnitValue(0);
39
+ return new _CSSNumericValue.CSSUnitValue(0);
40
40
  }
41
41
  }
42
42
  /**
@@ -14,6 +14,8 @@ var _dimension = require("./dimension");
14
14
 
15
15
  var _numeric = require("./numeric");
16
16
 
17
+ var _CSS = require("../CSS");
18
+
17
19
  var _ = null;
18
20
 
19
21
  function cast(pattern) {
@@ -40,10 +42,10 @@ var transformFunctions = {
40
42
  rotatez: ['A'],
41
43
  rotate3d: ['NNNA'],
42
44
  // perspective: ['L'],
43
- scale: ['Nn', cast([_, _, new _CSSNumericValue.CSSUnitValue(1)]), id],
44
- scalex: ['N', cast([_, new _CSSNumericValue.CSSUnitValue(1), new _CSSNumericValue.CSSUnitValue(1)]), cast([_, new _CSSNumericValue.CSSUnitValue(1)])],
45
- scaley: ['N', cast([new _CSSNumericValue.CSSUnitValue(1), _, new _CSSNumericValue.CSSUnitValue(1)]), cast([new _CSSNumericValue.CSSUnitValue(1), _])],
46
- scalez: ['N', cast([new _CSSNumericValue.CSSUnitValue(1), new _CSSNumericValue.CSSUnitValue(1), _])],
45
+ scale: ['Nn', cast([_, _, _CSS.CSS.number(1)]), id],
46
+ scalex: ['N', cast([_, _CSS.CSS.number(1), _CSS.CSS.number(1)]), cast([_, _CSS.CSS.number(1)])],
47
+ scaley: ['N', cast([_CSS.CSS.number(1), _, _CSS.CSS.number(1)]), cast([_CSS.CSS.number(1), _])],
48
+ scalez: ['N', cast([_CSS.CSS.number(1), _CSS.CSS.number(1), _])],
47
49
  scale3d: ['NNN', id],
48
50
  // skew: ['Aa', null, id],
49
51
  // skewx: ['A', null, cast([_, Odeg])],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g",
3
- "version": "5.0.23-alpha.8",
3
+ "version": "5.0.23-alpha.9",
4
4
  "description": "A core module including ECS and DI container.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://github.com/antvis/g#readme",
40
40
  "dependencies": {
41
- "@antv/g-math": "^1.0.20-alpha.8",
41
+ "@antv/g-math": "^1.0.20-alpha.9",
42
42
  "@antv/util": "^3.0.0",
43
43
  "@types/offscreencanvas": "^2019.6.4",
44
44
  "d3-color": "^1.4.0",