@antv/g 5.16.17 → 5.16.18

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
@@ -7697,7 +7697,7 @@
7697
7697
  if(useStartOffset){return "M "+(params[1]-defX+startOffsetX)+","+(params[2]-defY+startOffsetY)+" L "+(params[1]-defX)+","+(params[2]-defY);}else {return "M "+(params[1]-defX)+","+(params[2]-defY);}case'L':return "L "+(params[1]-defX+(useEndOffset?endOffsetX:0))+","+(params[2]-defY+(useEndOffset?endOffsetY:0));case'Q':return "Q "+(params[1]-defX)+" "+(params[2]-defY)+","+(params[3]-defX)+" "+(params[4]-defY)+(useEndOffset?" L "+(params[3]-defX+endOffsetX)+","+(params[4]-defY+endOffsetY):'');case'C':return "C "+(params[1]-defX)+" "+(params[2]-defY)+","+(params[3]-defX)+" "+(params[4]-defY)+","+(params[5]-defX)+" "+(params[6]-defY)+(useEndOffset?" L "+(params[5]-defX+endOffsetX)+","+(params[6]-defY+endOffsetY):'');case'A':return "A "+params[1]+" "+params[2]+" "+params[3]+" "+params[4]+" "+params[5]+" "+(params[6]-defX)+" "+(params[7]-defY)+(useEndOffset?" L "+(params[6]-defX+endOffsetX)+","+(params[7]-defY+endOffsetY):'');case'Z':return 'Z';}}).join(' ');if(~newValue.indexOf('NaN')){return '';}return newValue;}function isFillOrStrokeAffected(pointerEvents,fill,stroke){// account for pointerEvents
7698
7698
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events
7699
7699
  var hasFill=false;var hasStroke=false;var isFillOtherThanNone=!!fill&&!fill.isNone;var isStrokeOtherThanNone=!!stroke&&!stroke.isNone;if(pointerEvents==='visiblepainted'||pointerEvents==='painted'||pointerEvents==='auto'){hasFill=isFillOtherThanNone;hasStroke=isStrokeOtherThanNone;}else if(pointerEvents==='visiblefill'||pointerEvents==='fill'){hasFill=true;}else if(pointerEvents==='visiblestroke'||pointerEvents==='stroke'){hasStroke=true;}else if(pointerEvents==='visible'||pointerEvents==='all'){// The values of the fill and stroke do not affect event processing.
7700
- hasFill=true;hasStroke=true;}return [hasFill,hasStroke];}var AsyncParallelHook=/*#__PURE__*/function(){function AsyncParallelHook(){this.callbacks=[];}var _proto=AsyncParallelHook.prototype;_proto.tapPromise=function tapPromise(options,fn){this.callbacks.push(fn);};_proto.promise=/*#__PURE__*/function(){var _promise=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _len,args,_key,_args=arguments;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:for(_len=_args.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=_args[_key];}_context.next=3;return Promise.all(this.callbacks.map(function(callback){return callback.apply(void 0,args);}));case 3:case"end":return _context.stop();}},_callee,this);}));function promise(){return _promise.apply(this,arguments);}return promise;}();return AsyncParallelHook;}();var AsyncSeriesWaterfallHook=/*#__PURE__*/function(){function AsyncSeriesWaterfallHook(){this.callbacks=[];}var _proto=AsyncSeriesWaterfallHook.prototype;_proto.tapPromise=function tapPromise(options,fn){this.callbacks.push(fn);};_proto.promise=/*#__PURE__*/function(){var _promise=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this$callbacks,result,i,callback,_args=arguments;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!this.callbacks.length){_context.next=14;break;}_context.next=3;return (_this$callbacks=this.callbacks)[0].apply(_this$callbacks,_args);case 3:result=_context.sent;i=0;case 5:if(!(i<this.callbacks.length-1)){_context.next=13;break;}callback=this.callbacks[i];// @ts-ignore
7700
+ hasFill=true;hasStroke=true;}return [hasFill,hasStroke];}var AsyncParallelHook=/*#__PURE__*/function(){function AsyncParallelHook(){this.callbacks=[];}var _proto=AsyncParallelHook.prototype;_proto.tapPromise=function tapPromise(options,fn){this.callbacks.push(fn);};_proto.promise=function promise(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return Promise.all(this.callbacks.map(function(callback){return callback.apply(void 0,args);}));};return AsyncParallelHook;}();var AsyncSeriesWaterfallHook=/*#__PURE__*/function(){function AsyncSeriesWaterfallHook(){this.callbacks=[];}var _proto=AsyncSeriesWaterfallHook.prototype;_proto.tapPromise=function tapPromise(options,fn){this.callbacks.push(fn);};_proto.promise=/*#__PURE__*/function(){var _promise=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _this$callbacks,result,i,callback,_args=arguments;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!this.callbacks.length){_context.next=14;break;}_context.next=3;return (_this$callbacks=this.callbacks)[0].apply(_this$callbacks,_args);case 3:result=_context.sent;i=0;case 5:if(!(i<this.callbacks.length-1)){_context.next=13;break;}callback=this.callbacks[i];// @ts-ignore
7701
7701
  _context.next=9;return callback(result);case 9:result=_context.sent;case 10:i++;_context.next=5;break;case 13:return _context.abrupt("return",result);case 14:return _context.abrupt("return",null);case 15:case"end":return _context.stop();}},_callee,this);}));function promise(){return _promise.apply(this,arguments);}return promise;}();return AsyncSeriesWaterfallHook;}();var SyncHook=/*#__PURE__*/function(){function SyncHook(){this.callbacks=[];}var _proto=SyncHook.prototype;_proto.tap=function tap(options,fn){this.callbacks.push(fn);};_proto.call=function call(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}this.callbacks.forEach(function(callback){callback.apply(void 0,args);});};return SyncHook;}();var SyncWaterfallHook=/*#__PURE__*/function(){function SyncWaterfallHook(){this.callbacks=[];}var _proto=SyncWaterfallHook.prototype;_proto.tap=function tap(options,fn){this.callbacks.push(fn);};_proto.call=function call(){if(this.callbacks.length){var _this$callbacks;var result=(_this$callbacks=this.callbacks)[0].apply(_this$callbacks,arguments);for(var i=0;i<this.callbacks.length-1;i++){var callback=this.callbacks[i];// @ts-ignore
7702
7702
  result=callback(result);}return result;}return null;};return SyncWaterfallHook;}();var genericFontFamilies=['serif','sans-serif','monospace','cursive','fantasy','system-ui'];var stringRegExp=/([\"\'])[^\'\"]+\1/;function toFontString(attributes){var fontSize=attributes.fontSize,fontFamily=attributes.fontFamily,fontStyle=attributes.fontStyle,fontVariant=attributes.fontVariant,fontWeight=attributes.fontWeight;// build canvas api font setting from individual components. Convert a numeric this.fontSize to px
7703
7703
  // const fontSizeString: string = isNumber(fontSize) ? `${fontSize}px` : fontSize.toString();
@@ -8530,10 +8530,10 @@
8530
8530
  // };
8531
8531
  if(_this.config.visible!=null){_this.config.style.visibility=_this.config.visible===false?'hidden':'visible';}if(_this.config.interactive!=null){_this.config.style.pointerEvents=_this.config.interactive===false?'none':'auto';}// merge parsed value
8532
8532
  Object.assign(_this.parsedStyle,runtime.enableCSSParsing?DEFAULT_PARSED_STYLE_PROPS:DEFAULT_PARSED_STYLE_PROPS_CSS_DISABLED,_this.config.initialParsedStyle);if(runtime.enableCSSParsing){Object.assign(_this.attributes,DEFAULT_STYLE_PROPS);}// start to process attributes
8533
- _this.initAttributes(_this.config.style);var Proxy=runtime.globalThis.Proxy?runtime.globalThis.Proxy:function(){};_this.dataset=new Proxy({},{get:function get(target,name){var formattedName=""+DATASET_PREFIX+kebabize(name);if(target[formattedName]!==undefined){return target[formattedName];}return _this.getAttribute(formattedName);},set:function set(_,prop,value){_this.setAttribute(""+DATASET_PREFIX+kebabize(prop),value);return true;}});_this.style=new Proxy(// @ts-ignore
8533
+ _this.initAttributes(_this.config.style);var Proxy=runtime.globalThis.Proxy?runtime.globalThis.Proxy:function(){};if(runtime.enableDataset){_this.dataset=new Proxy({},{get:function get(target,name){var formattedName=""+DATASET_PREFIX+kebabize(name);if(target[formattedName]!==undefined){return target[formattedName];}return _this.getAttribute(formattedName);},set:function set(_,prop,value){_this.setAttribute(""+DATASET_PREFIX+kebabize(prop),value);return true;}});}if(runtime.enableStyleSyntax){_this.style=new Proxy(// @ts-ignore
8534
8534
  {// ...this.attributes,
8535
8535
  setProperty:function setProperty(propertyName,value){_this.setAttribute(propertyName,value);},getPropertyValue:function getPropertyValue(propertyName){return _this.getAttribute(propertyName);},removeProperty:function removeProperty(propertyName){_this.removeAttribute(propertyName);},item:function item(){return '';}},{get:function get(target,name){if(target[name]!==undefined){// if (name in target) {
8536
- return target[name];}return _this.getAttribute(name);},set:function set(_,prop,value){_this.setAttribute(prop,value);return true;}});return _this;}var _proto=DisplayObject.prototype;_proto.destroy=function destroy(){_Element.prototype.destroy.call(this);// stop all active animations
8536
+ return target[name];}return _this.getAttribute(name);},set:function set(_,prop,value){_this.setAttribute(prop,value);return true;}});}return _this;}var _proto=DisplayObject.prototype;_proto.destroy=function destroy(){_Element.prototype.destroy.call(this);// stop all active animations
8537
8537
  this.getAnimations().forEach(function(animation){animation.cancel();});// FIXME
8538
8538
  // this.renderable = null;
8539
8539
  // this.cullable = null;
@@ -9473,7 +9473,7 @@
9473
9473
  * `g-camera-api` will provide an advanced implementation
9474
9474
  */runtime.CameraContribution=Camera;/**
9475
9475
  * `g-web-animations-api` will provide an AnimationTimeline
9476
- */runtime.AnimationTimeline=null;runtime.EasingFunction=null;runtime.offscreenCanvas=new OffscreenCanvasCreator();runtime.nativeHTMLMap=new WeakMap();runtime.sceneGraphSelector=new DefaultSceneGraphSelector();runtime.sceneGraphService=new DefaultSceneGraphService(runtime);runtime.textService=new TextService(runtime);runtime.geometryUpdaterFactory=geometryUpdaterFactory;runtime.CSSPropertySyntaxFactory=CSSPropertySyntaxFactory;runtime.styleValueRegistry=new DefaultStyleValueRegistry();runtime.layoutRegistry=null;runtime.globalThis=getGlobalThis();runtime.enableCSSParsing=true;var AbstractRendererPlugin=/*#__PURE__*/function(){function AbstractRendererPlugin(){this.context=void 0;this.plugins=[];}var _proto=AbstractRendererPlugin.prototype;_proto.addRenderingPlugin=function addRenderingPlugin(plugin){this.plugins.push(plugin);this.context.renderingPlugins.push(plugin);};_proto.removeAllRenderingPlugins=function removeAllRenderingPlugins(){var _this=this;this.plugins.forEach(function(plugin){var index=_this.context.renderingPlugins.indexOf(plugin);if(index>=0){_this.context.renderingPlugins.splice(index,1);}});};return AbstractRendererPlugin;}();var AbstractRenderer=/*#__PURE__*/function(){function AbstractRenderer(config){this.plugins=[];this.config=void 0;this.config=_extends({/**
9476
+ */runtime.AnimationTimeline=null;runtime.EasingFunction=null;runtime.offscreenCanvas=new OffscreenCanvasCreator();runtime.nativeHTMLMap=new WeakMap();runtime.sceneGraphSelector=new DefaultSceneGraphSelector();runtime.sceneGraphService=new DefaultSceneGraphService(runtime);runtime.textService=new TextService(runtime);runtime.geometryUpdaterFactory=geometryUpdaterFactory;runtime.CSSPropertySyntaxFactory=CSSPropertySyntaxFactory;runtime.styleValueRegistry=new DefaultStyleValueRegistry();runtime.layoutRegistry=null;runtime.globalThis=getGlobalThis();runtime.enableCSSParsing=true;runtime.enableDataset=false;runtime.enableStyleSyntax=true;var AbstractRendererPlugin=/*#__PURE__*/function(){function AbstractRendererPlugin(){this.context=void 0;this.plugins=[];}var _proto=AbstractRendererPlugin.prototype;_proto.addRenderingPlugin=function addRenderingPlugin(plugin){this.plugins.push(plugin);this.context.renderingPlugins.push(plugin);};_proto.removeAllRenderingPlugins=function removeAllRenderingPlugins(){var _this=this;this.plugins.forEach(function(plugin){var index=_this.context.renderingPlugins.indexOf(plugin);if(index>=0){_this.context.renderingPlugins.splice(index,1);}});};return AbstractRendererPlugin;}();var AbstractRenderer=/*#__PURE__*/function(){function AbstractRenderer(config){this.plugins=[];this.config=void 0;this.config=_extends({/**
9477
9477
  * only dirty object will cause re-render
9478
9478
  */enableDirtyCheck:true,enableCulling:false,/**
9479
9479
  * enable auto rendering by default