@visactor/vgrammar-core 0.12.9 → 0.12.11

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.
@@ -9,12 +9,16 @@ const vutils_1 = require("@visactor/vutils"), vgrammar_util_1 = require("@visact
9
9
  }, update = (element, options, animationParameters) => {
10
10
  const from = Object.assign({}, element.getPrevGraphicAttributes()), to = Object.assign({}, element.getNextGraphicAttributes());
11
11
  let excludeChannels;
12
- return options && (0, vutils_1.array)(options.excludeChannels).forEach((key => {
12
+ options && (0, vutils_1.array)(options.excludeChannels).forEach((key => {
13
13
  delete from[key], delete to[key];
14
14
  })), element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType]) && excludeChannels.forEach((key => {
15
15
  delete from[key], delete to[key];
16
16
  })), Object.keys(to).forEach((key => {
17
17
  (0, vgrammar_util_1.isEqual)(key, from, to) && (delete from[key], delete to[key]);
18
+ }));
19
+ const final = element.getFinalGraphicAttributes();
20
+ return Object.keys(from).forEach((key => {
21
+ (0, vutils_1.isNil)(to[key]) && ((0, vutils_1.isNil)(final[key]) || (0, vutils_1.isEqual)(from[key], final[key]) ? delete from[key] : to[key] = final[key]);
18
22
  })), {
19
23
  from: from,
20
24
  to: to
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graph/animation/animation/update.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,2DAAkD;AAQlD,MAAM,yBAAyB,GAAG;IAChC,MAAM,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;CACjC,CAAC;AAEK,MAAM,MAAM,GAA4B,CAC7C,OAAiB,EACjB,OAAgC,EAChC,mBAAyC,EACzC,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACjE,IAAI,OAAO,EAAE;QACX,IAAA,cAAK,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IACD,IAAI,eAAyB,CAAC;IAC9B,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;QACjH,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,IAAI,IAAA,uBAAO,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;SAChB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACtB,CAAC,CAAC;AA5BW,QAAA,MAAM,UA4BjB","file":"update.js","sourcesContent":["import { array } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type { IElement } from '../../../types';\nimport type { IAnimationParameters, TypeAnimation } from '../../../types/animate';\n\nexport interface IUpdateAnimationOptions {\n excludeChannels: string[];\n}\n\nconst BUILT_IN_EXCLUDE_CHANNELS = {\n symbol: ['_mo_hide_', 'visible']\n};\n\nexport const update: TypeAnimation<IElement> = (\n element: IElement,\n options: IUpdateAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const from = Object.assign({}, element.getPrevGraphicAttributes());\n const to = Object.assign({}, element.getNextGraphicAttributes());\n if (options) {\n array(options.excludeChannels).forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n let excludeChannels: string[];\n if (element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType])) {\n excludeChannels.forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n\n Object.keys(to).forEach(key => {\n if (isEqual(key, from, to)) {\n delete from[key];\n delete to[key];\n }\n });\n return { from, to };\n};\n"]}
1
+ {"version":3,"sources":["../src/graph/animation/animation/update.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AACzD,2DAAkE;AAQlE,MAAM,yBAAyB,GAAG;IAChC,MAAM,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;CACjC,CAAC;AAEK,MAAM,MAAM,GAA4B,CAC7C,OAAiB,EACjB,OAAgC,EAChC,mBAAyC,EACzC,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACjE,IAAI,OAAO,EAAE;QACX,IAAA,cAAK,EAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IACD,IAAI,eAAyB,CAAC;IAC9B,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;QACjH,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,IAAI,IAAA,uBAAY,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;SAChB;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAElD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC9B,IAAI,IAAA,cAAK,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;YAClB,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,IAAA,gBAAO,EAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBACvD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;aAClB;iBAAM;gBACL,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACtB,CAAC,CAAC;AAzCW,QAAA,MAAM,UAyCjB","file":"update.js","sourcesContent":["import { array, isNil, isEqual } from '@visactor/vutils';\nimport { isEqual as isEmptyByKey } from '@visactor/vgrammar-util';\nimport type { IElement } from '../../../types';\nimport type { IAnimationParameters, TypeAnimation } from '../../../types/animate';\n\nexport interface IUpdateAnimationOptions {\n excludeChannels: string[];\n}\n\nconst BUILT_IN_EXCLUDE_CHANNELS = {\n symbol: ['_mo_hide_', 'visible']\n};\n\nexport const update: TypeAnimation<IElement> = (\n element: IElement,\n options: IUpdateAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const from = Object.assign({}, element.getPrevGraphicAttributes());\n const to = Object.assign({}, element.getNextGraphicAttributes());\n if (options) {\n array(options.excludeChannels).forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n let excludeChannels: string[];\n if (element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType])) {\n excludeChannels.forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n\n Object.keys(to).forEach(key => {\n if (isEmptyByKey(key, from, to)) {\n delete from[key];\n delete to[key];\n }\n });\n\n const final = element.getFinalGraphicAttributes();\n\n Object.keys(from).forEach(key => {\n if (isNil(to[key])) {\n if (isNil(final[key]) || isEqual(from[key], final[key])) {\n delete from[key];\n } else {\n to[key] = final[key];\n }\n }\n });\n\n return { from, to };\n};\n"]}
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.12.9";
1
+ export declare const version = "0.12.11";
2
2
  export * from './graph';
3
3
  export * from './interactions';
4
4
  export { View } from './view';
package/cjs/index.js CHANGED
@@ -18,7 +18,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), exports.vglobal = exports.ThemeManager = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.registerCoordinate = exports.Coordinate = exports.registerScale = exports.Scale = exports.View = exports.version = void 0,
21
- exports.version = "0.12.9", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
21
+ exports.version = "0.12.11", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
22
22
 
23
23
  var view_1 = require("./view");
24
24
 
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.12.9\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAGjB,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.12.11\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
@@ -1,6 +1,6 @@
1
- import { array } from "@visactor/vutils";
1
+ import { array, isNil, isEqual } from "@visactor/vutils";
2
2
 
3
- import { isEqual } from "@visactor/vgrammar-util";
3
+ import { isEqual as isEmptyByKey } from "@visactor/vgrammar-util";
4
4
 
5
5
  const BUILT_IN_EXCLUDE_CHANNELS = {
6
6
  symbol: [ "_mo_hide_", "visible" ]
@@ -9,12 +9,16 @@ const BUILT_IN_EXCLUDE_CHANNELS = {
9
9
  export const update = (element, options, animationParameters) => {
10
10
  const from = Object.assign({}, element.getPrevGraphicAttributes()), to = Object.assign({}, element.getNextGraphicAttributes());
11
11
  let excludeChannels;
12
- return options && array(options.excludeChannels).forEach((key => {
12
+ options && array(options.excludeChannels).forEach((key => {
13
13
  delete from[key], delete to[key];
14
14
  })), element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType]) && excludeChannels.forEach((key => {
15
15
  delete from[key], delete to[key];
16
16
  })), Object.keys(to).forEach((key => {
17
- isEqual(key, from, to) && (delete from[key], delete to[key]);
17
+ isEmptyByKey(key, from, to) && (delete from[key], delete to[key]);
18
+ }));
19
+ const final = element.getFinalGraphicAttributes();
20
+ return Object.keys(from).forEach((key => {
21
+ isNil(to[key]) && (isNil(final[key]) || isEqual(from[key], final[key]) ? delete from[key] : to[key] = final[key]);
18
22
  })), {
19
23
  from: from,
20
24
  to: to
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graph/animation/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAQlD,MAAM,yBAAyB,GAAG;IAChC,MAAM,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA4B,CAC7C,OAAiB,EACjB,OAAgC,EAChC,mBAAyC,EACzC,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACjE,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IACD,IAAI,eAAyB,CAAC;IAC9B,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;QACjH,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,IAAI,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;SAChB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACtB,CAAC,CAAC","file":"update.js","sourcesContent":["import { array } from '@visactor/vutils';\nimport { isEqual } from '@visactor/vgrammar-util';\nimport type { IElement } from '../../../types';\nimport type { IAnimationParameters, TypeAnimation } from '../../../types/animate';\n\nexport interface IUpdateAnimationOptions {\n excludeChannels: string[];\n}\n\nconst BUILT_IN_EXCLUDE_CHANNELS = {\n symbol: ['_mo_hide_', 'visible']\n};\n\nexport const update: TypeAnimation<IElement> = (\n element: IElement,\n options: IUpdateAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const from = Object.assign({}, element.getPrevGraphicAttributes());\n const to = Object.assign({}, element.getNextGraphicAttributes());\n if (options) {\n array(options.excludeChannels).forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n let excludeChannels: string[];\n if (element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType])) {\n excludeChannels.forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n\n Object.keys(to).forEach(key => {\n if (isEqual(key, from, to)) {\n delete from[key];\n delete to[key];\n }\n });\n return { from, to };\n};\n"]}
1
+ {"version":3,"sources":["../src/graph/animation/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAQlE,MAAM,yBAAyB,GAAG;IAChC,MAAM,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAA4B,CAC7C,OAAiB,EACjB,OAAgC,EAChC,mBAAyC,EACzC,EAAE;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACnE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC;IACjE,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IACD,IAAI,eAAyB,CAAC;IAC9B,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE;QACjH,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC5B,IAAI,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;SAChB;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAElD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC9B,IAAI,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;YAClB,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;gBACvD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;aAClB;iBAAM;gBACL,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACtB,CAAC,CAAC","file":"update.js","sourcesContent":["import { array, isNil, isEqual } from '@visactor/vutils';\nimport { isEqual as isEmptyByKey } from '@visactor/vgrammar-util';\nimport type { IElement } from '../../../types';\nimport type { IAnimationParameters, TypeAnimation } from '../../../types/animate';\n\nexport interface IUpdateAnimationOptions {\n excludeChannels: string[];\n}\n\nconst BUILT_IN_EXCLUDE_CHANNELS = {\n symbol: ['_mo_hide_', 'visible']\n};\n\nexport const update: TypeAnimation<IElement> = (\n element: IElement,\n options: IUpdateAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const from = Object.assign({}, element.getPrevGraphicAttributes());\n const to = Object.assign({}, element.getNextGraphicAttributes());\n if (options) {\n array(options.excludeChannels).forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n let excludeChannels: string[];\n if (element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType])) {\n excludeChannels.forEach(key => {\n delete from[key];\n delete to[key];\n });\n }\n\n Object.keys(to).forEach(key => {\n if (isEmptyByKey(key, from, to)) {\n delete from[key];\n delete to[key];\n }\n });\n\n const final = element.getFinalGraphicAttributes();\n\n Object.keys(from).forEach(key => {\n if (isNil(to[key])) {\n if (isNil(final[key]) || isEqual(from[key], final[key])) {\n delete from[key];\n } else {\n to[key] = final[key];\n }\n }\n });\n\n return { from, to };\n};\n"]}
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.12.9";
1
+ export declare const version = "0.12.11";
2
2
  export * from './graph';
3
3
  export * from './interactions';
4
4
  export { View } from './view';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.12.9";
1
+ export const version = "0.12.11";
2
2
 
3
3
  export * from "./graph";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.12.9\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.12.11\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\n"]}
@@ -42,5 +42,4 @@ export class DrillDown extends BrushBase {
42
42
  DrillDown.type = "drill-down", DrillDown.defaultOptions = {
43
43
  brush: !1,
44
44
  trigger: "click"
45
- };
46
- //# sourceMappingURL=drill-down.js.map
45
+ };
@@ -54,4 +54,5 @@ ElementHighlightByGroup.type = "element-highlight-by-group", ElementHighlightByG
54
54
  blurState: InteractionStateEnum.blur,
55
55
  trigger: "pointerover",
56
56
  triggerOff: "pointerout"
57
- };
57
+ };
58
+ //# sourceMappingURL=element-highlight-by-group.js.map
@@ -63,4 +63,4 @@ ElementSelect.type = "element-select", ElementSelect.defaultOptions = {
63
63
  state: InteractionStateEnum.selected,
64
64
  trigger: "click"
65
65
  };
66
- //# sourceMappingURL=element-select.js.map
66
+ //# sourceMappingURL=element-select.js.map
@@ -28,4 +28,4 @@ export class Filter extends BaseInteraction {
28
28
  }
29
29
 
30
30
  Filter.defaultOptions = {};
31
- //# sourceMappingURL=filter.js.map
31
+ //# sourceMappingURL=filter.js.map
@@ -96,4 +96,4 @@ FishEye.type = "fish-eye", FishEye.defaultOptions = {
96
96
  distortionY: 2,
97
97
  throttle: 100
98
98
  };
99
- //# sourceMappingURL=fish-eye.js.map
99
+ //# sourceMappingURL=fish-eye.js.map
@@ -66,4 +66,4 @@ Cell.markType = GrammarMarkType.cell;
66
66
  export const registerCellMark = () => {
67
67
  Factory.registerMark(GrammarMarkType.cell, Cell);
68
68
  };
69
- //# sourceMappingURL=cell.js.map
69
+ //# sourceMappingURL=cell.js.map
@@ -92,4 +92,4 @@ Interval.markType = GrammarMarkType.interval;
92
92
  export const registerIntervalMark = () => {
93
93
  Factory.registerMark(GrammarMarkType.interval, Interval);
94
94
  };
95
- //# sourceMappingURL=interval.js.map
95
+ //# sourceMappingURL=interval.js.map
@@ -15,4 +15,4 @@ export class Text extends Mark {
15
15
  }
16
16
 
17
17
  Text.markType = GrammarMarkType.text;
18
- //# sourceMappingURL=text.js.map
18
+ //# sourceMappingURL=text.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vgrammar-core",
3
- "version": "0.12.9",
3
+ "version": "0.12.11",
4
4
  "description": "VGrammar is a visual grammar library",
5
5
  "keywords": [
6
6
  "grammar",
@@ -24,12 +24,12 @@
24
24
  "dist"
25
25
  ],
26
26
  "dependencies": {
27
- "@visactor/vgrammar-coordinate": "0.12.9",
28
- "@visactor/vgrammar-util": "0.12.9",
27
+ "@visactor/vgrammar-coordinate": "0.12.11",
28
+ "@visactor/vgrammar-util": "0.12.11",
29
29
  "@visactor/vscale": "~0.18.1",
30
- "@visactor/vrender-core": "0.18.13",
31
- "@visactor/vrender-kits": "0.18.13",
32
- "@visactor/vrender-components": "0.18.13",
30
+ "@visactor/vrender-core": "0.18.14",
31
+ "@visactor/vrender-kits": "0.18.14",
32
+ "@visactor/vrender-components": "0.18.14",
33
33
  "@visactor/vutils": "~0.18.1",
34
34
  "@visactor/vdataset": "~0.18.1"
35
35
  },
@@ -44,10 +44,10 @@
44
44
  "ts-jest": "~29.1.0",
45
45
  "@types/jest": "~29.5.0",
46
46
  "typescript": "4.9.5",
47
- "@internal/eslint-config": "0.0.1",
48
- "@internal/ts-config": "0.0.1",
49
47
  "@internal/bundler": "0.0.1",
50
- "@internal/jest-config": "0.0.1"
48
+ "@internal/eslint-config": "0.0.1",
49
+ "@internal/jest-config": "0.0.1",
50
+ "@internal/ts-config": "0.0.1"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",