@antv/g 5.8.10 → 5.8.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.
package/dist/index.umd.js CHANGED
@@ -10981,7 +10981,7 @@
10981
10981
  * eg. 'initial'
10982
10982
  * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSKeywordValue
10983
10983
  * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_keyword_value.idl
10984
- */var CSSKeywordValue=/*#__PURE__*/function(_CSSStyleValue){_inheritsLoose(CSSKeywordValue,_CSSStyleValue);function CSSKeywordValue(value){var _this;_this=_CSSStyleValue.call(this)||this;_this.value=void 0;_this.value=value;return _this;}var _proto=CSSKeywordValue.prototype;_proto.clone=function clone(){return new CSSKeywordValue(this.value);};_proto.getType=function getType(){return CSSStyleValueType.kKeywordType;};_proto.buildCSSText=function buildCSSText(n,p,result){return result+this.value;};return CSSKeywordValue;}(CSSStyleValue);var camelCase=memoize(function(str){if(str===void 0){str='';}return str.replace(/-([a-z])/g,function(g){return g[1].toUpperCase();});});function DCHECK(bool){if(!bool){throw new Error();}}function DCHECK_EQ(a,b){if(a!==b){throw new Error();}}function DCHECK_NE(a,b){if(a===b){throw new Error();}}var definedProps=function definedProps(obj){return Object.fromEntries(Object.entries(obj).filter(function(_ref){var v=_ref[1];return v!==undefined;}));};var FORMAT_ATTR_MAP={d:{alias:'path'},strokeDasharray:{alias:'lineDash'},strokeWidth:{alias:'lineWidth'},textAnchor:{alias:'textAlign',values:{middle:'center'}},src:{alias:'img'}};var formatAttributeName=memoize(function(name){var attributeName=camelCase(name);var map=FORMAT_ATTR_MAP[attributeName];attributeName=(map===null||map===void 0?void 0:map.alias)||attributeName;return [attributeName,map];});function formatAttribute(name,value){var _map$values;var _formatAttributeName=formatAttributeName(name),attributeName=_formatAttributeName[0],map=_formatAttributeName[1];var attributeValue=isString(value)&&(map===null||map===void 0?void 0:(_map$values=map.values)===null||_map$values===void 0?void 0:_map$values[value])||value;return [attributeName,attributeValue];}var CSSMathOperator;(function(CSSMathOperator){CSSMathOperator["kAdd"]="+";CSSMathOperator["kSubtract"]="-";CSSMathOperator["kMultiply"]="*";CSSMathOperator["kDivide"]="/";CSSMathOperator["kMin"]="min";CSSMathOperator["kMax"]="max";CSSMathOperator["kClamp"]="clamp";CSSMathOperator["kInvalid"]="";})(CSSMathOperator||(CSSMathOperator={}));// export function parseCSSArithmeticOperator(token: CSSParserToken) {
10984
+ */var CSSKeywordValue=/*#__PURE__*/function(_CSSStyleValue){_inheritsLoose(CSSKeywordValue,_CSSStyleValue);function CSSKeywordValue(value){var _this;_this=_CSSStyleValue.call(this)||this;_this.value=void 0;_this.value=value;return _this;}var _proto=CSSKeywordValue.prototype;_proto.clone=function clone(){return new CSSKeywordValue(this.value);};_proto.getType=function getType(){return CSSStyleValueType.kKeywordType;};_proto.buildCSSText=function buildCSSText(n,p,result){return result+this.value;};return CSSKeywordValue;}(CSSStyleValue);var camelCase=memoize(function(str){if(str===void 0){str='';}return str.replace(/-([a-z])/g,function(g){return g[1].toUpperCase();});});function DCHECK(bool){if(!bool){throw new Error();}}function DCHECK_EQ(a,b){if(a!==b){throw new Error();}}function DCHECK_NE(a,b){if(a===b){throw new Error();}}function isFunction$1(func){return typeof func==='function';}var definedProps=function definedProps(obj){return Object.fromEntries(Object.entries(obj).filter(function(_ref){var v=_ref[1];return v!==undefined;}));};var FORMAT_ATTR_MAP={d:{alias:'path'},strokeDasharray:{alias:'lineDash'},strokeWidth:{alias:'lineWidth'},textAnchor:{alias:'textAlign',values:{middle:'center'}},src:{alias:'img'}};var formatAttributeName=memoize(function(name){var attributeName=camelCase(name);var map=FORMAT_ATTR_MAP[attributeName];attributeName=(map===null||map===void 0?void 0:map.alias)||attributeName;return [attributeName,map];});function formatAttribute(name,value){var _map$values;var _formatAttributeName=formatAttributeName(name),attributeName=_formatAttributeName[0],map=_formatAttributeName[1];var attributeValue=isString(value)&&(map===null||map===void 0?void 0:(_map$values=map.values)===null||_map$values===void 0?void 0:_map$values[value])||value;return [attributeName,attributeValue];}var CSSMathOperator;(function(CSSMathOperator){CSSMathOperator["kAdd"]="+";CSSMathOperator["kSubtract"]="-";CSSMathOperator["kMultiply"]="*";CSSMathOperator["kDivide"]="/";CSSMathOperator["kMin"]="min";CSSMathOperator["kMax"]="max";CSSMathOperator["kClamp"]="clamp";CSSMathOperator["kInvalid"]="";})(CSSMathOperator||(CSSMathOperator={}));// export function parseCSSArithmeticOperator(token: CSSParserToken) {
10985
10985
  var BaseType;(function(BaseType){BaseType[BaseType["kLength"]=0]="kLength";BaseType[BaseType["kAngle"]=1]="kAngle";BaseType[BaseType["kTime"]=2]="kTime";BaseType[BaseType["kFrequency"]=3]="kFrequency";BaseType[BaseType["kResolution"]=4]="kResolution";BaseType[BaseType["kFlex"]=5]="kFlex";BaseType[BaseType["kPercent"]=6]="kPercent";BaseType[BaseType["kNumBaseTypes"]=7]="kNumBaseTypes";})(BaseType||(BaseType={}));function unitTypeToBaseType(unit){DCHECK_NE(unit,exports.UnitType.kNumber);switch(unit){case exports.UnitType.kEms:// case UnitType.kExs:
10986
10986
  case exports.UnitType.kPixels:// case UnitType.kCentimeters:
10987
10987
  // case UnitType.kMillimeters:
@@ -11750,15 +11750,15 @@
11750
11750
  */_proto.on=function on(type,listener,options){this.addEventListener(type,listener,options);return this;}/**
11751
11751
  * support `capture` & `once` in options
11752
11752
  * @see https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener
11753
- */;_proto.addEventListener=function addEventListener(type,listener,options){var capture=isBoolean(options)&&options||isObject(options)&&options.capture;var once=isObject(options)&&options.once;var context=isFunction(listener)?undefined:listener;// compatible with G 3.0
11753
+ */;_proto.addEventListener=function addEventListener(type,listener,options){var capture=isBoolean(options)&&options||isObject(options)&&options.capture;var once=isObject(options)&&options.once;var context=isFunction$1(listener)?undefined:listener;// compatible with G 3.0
11754
11754
  // support using delegate name in event type, eg. 'node:click'
11755
- var useDelegatedName=false;var delegatedName='';if(type.indexOf(DELEGATION_SPLITTER)>-1){var _type$split=type.split(DELEGATION_SPLITTER),name=_type$split[0],eventType=_type$split[1];type=eventType;delegatedName=name;useDelegatedName=true;}type=capture?type+"capture":type;listener=isFunction(listener)?listener:listener.handleEvent;// compatible with G 3.0
11755
+ var useDelegatedName=false;var delegatedName='';if(type.indexOf(DELEGATION_SPLITTER)>-1){var _type$split=type.split(DELEGATION_SPLITTER),name=_type$split[0],eventType=_type$split[1];type=eventType;delegatedName=name;useDelegatedName=true;}type=capture?type+"capture":type;listener=isFunction$1(listener)?listener:listener.handleEvent;// compatible with G 3.0
11756
11756
  if(useDelegatedName){var originListener=listener;listener=function listener(){var _args$0$target;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}if(((_args$0$target=args[0].target)===null||_args$0$target===void 0?void 0:_args$0$target.name)!==delegatedName){return;}// @ts-ignore
11757
11757
  originListener.apply(void 0,args);};}if(once){this.emitter.once(type,listener,context);}else {this.emitter.on(type,listener,context);}return this;}/**
11758
11758
  * @deprecated
11759
11759
  * @alias removeEventListener
11760
11760
  */;_proto.off=function off(type,listener,options){if(type){this.removeEventListener(type,listener,options);}else {// remove all listeners
11761
- this.removeAllEventListeners();}return this;};_proto.removeAllEventListeners=function removeAllEventListeners(){this.emitter.removeAllListeners();};_proto.removeEventListener=function removeEventListener(type,listener,options){var _listener;var capture=isBoolean(options)&&options||isObject(options)&&options.capture;var context=isFunction(listener)?undefined:listener;type=capture?type+"capture":type;listener=isFunction(listener)?listener:(_listener=listener)===null||_listener===void 0?void 0:_listener.handleEvent;this.emitter.off(type,listener,context);return this;}/**
11761
+ this.removeAllEventListeners();}return this;};_proto.removeAllEventListeners=function removeAllEventListeners(){this.emitter.removeAllListeners();};_proto.removeEventListener=function removeEventListener(type,listener,options){var _listener;var capture=isBoolean(options)&&options||isObject(options)&&options.capture;var context=isFunction$1(listener)?undefined:listener;type=capture?type+"capture":type;listener=isFunction$1(listener)?listener:(_listener=listener)===null||_listener===void 0?void 0:_listener.handleEvent;this.emitter.off(type,listener,context);return this;}/**
11762
11762
  * @deprecated
11763
11763
  * @alias dispatchEvent
11764
11764
  */ // eslint-disable-next-line @typescript-eslint/ban-types
@@ -11822,7 +11822,7 @@
11822
11822
  * for inherited properties, the initial value is used on the root element only,
11823
11823
  * as long as no specified value is supplied.
11824
11824
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial_value
11825
- */var initialStyle={};BUILT_IN_PROPERTIES.forEach(function(_ref){var n=_ref.n,inh=_ref.inh,d=_ref.d;if(inh&&d){initialStyle[n]=isFunction(d)?d(exports.Shape.GROUP):d;}});// like <html> in DOM tree
11825
+ */var initialStyle={};BUILT_IN_PROPERTIES.forEach(function(_ref){var n=_ref.n,inh=_ref.inh,d=_ref.d;if(inh&&d){initialStyle[n]=isFunction$1(d)?d(exports.Shape.GROUP):d;}});// like <html> in DOM tree
11826
11826
  _this.documentElement=new Group({id:'g-root',style:initialStyle});_this.documentElement.ownerDocument=_assertThisInitialized(_this);_this.documentElement.parentNode=_assertThisInitialized(_this);_this.childNodes=[_this.documentElement];return _this;}var _proto=Document.prototype;/**
11827
11827
  * @example const circle = document.createElement('circle', { style: { r: 10 } });
11828
11828
  */_proto.createElement=function createElement(tagName,options){// @observablehq/plot will create <svg>
@@ -12170,7 +12170,13 @@
12170
12170
  */;_proto.setMatrix=function setMatrix(mat){var _decompose=decompose(mat),tx=_decompose[0],ty=_decompose[1],scalingX=_decompose[2],scalingY=_decompose[3],angle=_decompose[4];this.setEulerAngles(angle).setPosition(tx,ty).setLocalScale(scalingX,scalingY);}/**
12171
12171
  * set 3x3 matrix in local space
12172
12172
  * @deprecated
12173
- */;_proto.setLocalMatrix=function setLocalMatrix(mat){var _decompose2=decompose(mat),tx=_decompose2[0],ty=_decompose2[1],scalingX=_decompose2[2],scalingY=_decompose2[3],angle=_decompose2[4];this.setLocalEulerAngles(angle).setLocalPosition(tx,ty).setLocalScale(scalingX,scalingY);};_createClass$5(DisplayObject,[{key:"interactive",get:function get(){return this.isInteractive();},set:function set(b){this.style.pointerEvents=b?'auto':'none';}}]);return DisplayObject;}(Element);var _excluded=["style"];var Circle=/*#__PURE__*/function(_DisplayObject){_inheritsLoose(Circle,_DisplayObject);function Circle(_temp){var _ref=_temp===void 0?{}:_temp,style=_ref.style,rest=_objectWithoutPropertiesLoose(_ref,_excluded);return _DisplayObject.call(this,_extends({type:exports.Shape.CIRCLE,style:_extends({cx:'',cy:'',r:''},style),initialParsedStyle:{anchor:[0.5,0.5]}},rest))||this;}return Circle;}(DisplayObject);var _excluded$1=["style"];/**
12173
+ */;_proto.setLocalMatrix=function setLocalMatrix(mat){var _decompose2=decompose(mat),tx=_decompose2[0],ty=_decompose2[1],scalingX=_decompose2[2],scalingY=_decompose2[3],angle=_decompose2[4];this.setLocalEulerAngles(angle).setLocalPosition(tx,ty).setLocalScale(scalingX,scalingY);}/**
12174
+ * Use `visibility: visible` instead.
12175
+ * @deprecated
12176
+ */;_proto.show=function show(){this.style.visibility='visible';}/**
12177
+ * Use `visibility: hidden` instead.
12178
+ * @deprecated
12179
+ */;_proto.hide=function hide(){this.style.visibility='hidden';};_createClass$5(DisplayObject,[{key:"interactive",get:function get(){return this.isInteractive();},set:function set(b){this.style.pointerEvents=b?'auto':'none';}}]);return DisplayObject;}(Element);var _excluded=["style"];var Circle=/*#__PURE__*/function(_DisplayObject){_inheritsLoose(Circle,_DisplayObject);function Circle(_temp){var _ref=_temp===void 0?{}:_temp,style=_ref.style,rest=_objectWithoutPropertiesLoose(_ref,_excluded);return _DisplayObject.call(this,_extends({type:exports.Shape.CIRCLE,style:_extends({cx:'',cy:'',r:''},style),initialParsedStyle:{anchor:[0.5,0.5]}},rest))||this;}return Circle;}(DisplayObject);var _excluded$1=["style"];/**
12174
12180
  * shadow root
12175
12181
  * @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
12176
12182
  */var CustomElement=/*#__PURE__*/function(_DisplayObject){_inheritsLoose(CustomElement,_DisplayObject);// static get observedAttributes(): string[] {
@@ -12754,7 +12760,7 @@
12754
12760
  var used=computed;if(metadata){var syntax=metadata.syntax,inherited=metadata.inh,defaultValue=metadata.d;if(computed instanceof CSSKeywordValue){var value=computed.value;/**
12755
12761
  * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/unset
12756
12762
  */if(value==='unset'){if(inherited&&!isDocumentElement){value='inherit';}else {value='initial';}}if(value==='initial'){// @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial
12757
- if(!isNil(defaultValue)){computed=this.parseProperty(name,isFunction(defaultValue)?defaultValue(object.nodeName):defaultValue,object);}}else if(value==='inherit'){// @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit
12763
+ if(!isNil(defaultValue)){computed=this.parseProperty(name,isFunction$1(defaultValue)?defaultValue(object.nodeName):defaultValue,object);}}else if(value==='inherit'){// @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit
12758
12764
  // behave like `inherit`
12759
12765
  var resolved=this.tryToResolveProperty(object,name,{inherited:true});if(!isNil(resolved)){// object.parsedStyle[name] = resolved;
12760
12766
  // return false;
@@ -13055,7 +13061,7 @@
13055
13061
  */
13056
13062
 
13057
13063
 
13058
- var isFunction$1 = function isFunction(value) {
13064
+ var isFunction$2 = function isFunction(value) {
13059
13065
  return isType$1(value, 'Function');
13060
13066
  };
13061
13067
 
@@ -13121,7 +13127,7 @@
13121
13127
  } : function (obj) {
13122
13128
  var result = [];
13123
13129
  each(obj, function (value, key) {
13124
- if (!(isFunction$1(obj) && key === 'prototype')) {
13130
+ if (!(isFunction$2(obj) && key === 'prototype')) {
13125
13131
  result.push(value);
13126
13132
  }
13127
13133
  });
@@ -13135,7 +13141,7 @@
13135
13141
  */
13136
13142
 
13137
13143
  var memoize$1 = function memoize(f, resolver) {
13138
- if (!isFunction$1(f)) {
13144
+ if (!isFunction$2(f)) {
13139
13145
  throw new TypeError('Expected a function');
13140
13146
  }
13141
13147
 
@@ -17104,7 +17110,7 @@
17104
17110
  */
17105
17111
 
17106
17112
 
17107
- var isFunction$2 = function isFunction(value) {
17113
+ var isFunction$3 = function isFunction(value) {
17108
17114
  return isType$2(value, 'Function');
17109
17115
  }; // isFinite,
17110
17116
 
@@ -17180,7 +17186,7 @@
17180
17186
  } : function (obj) {
17181
17187
  var result = [];
17182
17188
  each$1(obj, function (value, key) {
17183
- if (!(isFunction$2(obj) && key === 'prototype')) {
17189
+ if (!(isFunction$3(obj) && key === 'prototype')) {
17184
17190
  result.push(value);
17185
17191
  }
17186
17192
  });
@@ -17194,7 +17200,7 @@
17194
17200
  */
17195
17201
 
17196
17202
  var memoize$2 = function memoize(f, resolver) {
17197
- if (!isFunction$2(f)) {
17203
+ if (!isFunction$3(f)) {
17198
17204
  throw new TypeError('Expected a function');
17199
17205
  }
17200
17206