@antv/g 5.15.10 → 5.15.12
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 +3 -3
- package/dist/index.umd.min.js +1 -1
- package/package.json +8 -8
package/dist/index.umd.js
CHANGED
|
@@ -8098,7 +8098,7 @@
|
|
|
8098
8098
|
*/;_proto.contain=function contain(other){return this.contains(other);};_proto.contains=function contains(other){// the node itself, one of its direct children
|
|
8099
8099
|
var tmp=other;// @see https://developer.mozilla.org/en-US/docs/Web/API/Node/contains
|
|
8100
8100
|
while(tmp&&this!==tmp){tmp=tmp.parentNode;}return !!tmp;};_proto.getAncestor=function getAncestor(n){// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
8101
|
-
var temp=this;while(n>0&&temp){temp=temp.parentNode;n--;}return temp;};_proto.forEach=function forEach(callback){if(!callback(this)){this.childNodes.forEach(function(child){child.forEach(callback);});}};_createClass(Node,[{key:"textContent",get:/**
|
|
8101
|
+
var temp=this;while(n>0&&temp){temp=temp.parentNode;n--;}return temp;};_proto.forEach=function forEach(callback,assigned){if(assigned===void 0){assigned=false;}if(!callback(this)){(assigned?this.childNodes.slice():this.childNodes).forEach(function(child){child.forEach(callback);});}};_createClass(Node,[{key:"textContent",get:/**
|
|
8102
8102
|
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/Node/textContent
|
|
8103
8103
|
*/function get(){var out='';if(this.nodeName===exports.Shape.TEXT){// @ts-ignore
|
|
8104
8104
|
out+=this.style.text;}for(var _iterator=_createForOfIteratorHelperLoose(this.childNodes),_step;!(_step=_iterator()).done;){var child=_step.value;if(child.nodeName===exports.Shape.TEXT){out+=child.nodeValue;}else {out+=child.textContent;}}return out;},set:function set(content){var _this2=this;// remove all children
|
|
@@ -8120,7 +8120,7 @@
|
|
|
8120
8120
|
* @example const circle = document.createElement('circle', { style: { r: 10 } });
|
|
8121
8121
|
*/_proto.createElement=function createElement(tagName,options){// @observablehq/plot will create <svg>
|
|
8122
8122
|
if(tagName==='svg'){return this.documentElement;}// d3 will use <tspan>
|
|
8123
|
-
var clazz=this.defaultView.customElements.get(tagName);if(!clazz){console.warn('Unsupported tagName: ',tagName);clazz=tagName==='tspan'?Text:Group;}var shape=new clazz(options);shape.ownerDocument=this;return shape;};_proto.createElementNS=function createElementNS(namespaceURI,tagName,options){return this.createElement(tagName,options);};_proto.cloneNode=function cloneNode(deep){throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);};_proto.destroy=function destroy(){try{
|
|
8123
|
+
var clazz=this.defaultView.customElements.get(tagName);if(!clazz){console.warn('Unsupported tagName: ',tagName);clazz=tagName==='tspan'?Text:Group;}var shape=new clazz(options);shape.ownerDocument=this;return shape;};_proto.createElementNS=function createElementNS(namespaceURI,tagName,options){return this.createElement(tagName,options);};_proto.cloneNode=function cloneNode(deep){throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);};_proto.destroy=function destroy(){try{this.documentElement.childNodes.slice().forEach(function(child){child.forEach(function(object){object.destroy();},true);});this.timeline.destroy();}catch(e){}}/**
|
|
8124
8124
|
* Picking 2D graphics with RBush based on BBox, fast but inaccurate.
|
|
8125
8125
|
*/;_proto.elementsFromBBox=function elementsFromBBox(minX,minY,maxX,maxY){var rBush=this.defaultView.context.rBushRoot;var rBushNodes=rBush.search({minX:minX,minY:minY,maxX:maxX,maxY:maxY});var hitTestList=[];rBushNodes.forEach(function(_ref2){var id=_ref2.id;var displayObject=runtime.displayObjectPool.getByEntity(id);var pointerEvents=displayObject.parsedStyle.pointerEvents;// account for `visibility`
|
|
8126
8126
|
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events
|
|
@@ -9288,7 +9288,7 @@
|
|
|
9288
9288
|
*
|
|
9289
9289
|
* 对应 g 原版的 translate 2D
|
|
9290
9290
|
* @see https://github.com/antvis/g/blob/master/packages/g-base/src/abstract/element.ts#L665-L676
|
|
9291
|
-
*/;_proto.setLocalRotation=function setLocalRotation(element,rotation,y,z,w){if(typeof rotation==='number'){rotation=fromValues$4(rotation,y,z,w);}var transform=element.transformable;copy$3(transform.localRotation,rotation);this.dirtifyLocal(element,transform);};_proto.setLocalSkew=function setLocalSkew(element,skew,y){if(typeof skew==='number'){skew=fromValues$5(skew,y);}var transform=element.transformable;copy$4(transform.localSkew,skew);this.dirtifyLocal(element,transform);};_proto.dirtifyLocal=function dirtifyLocal(element,transform){if(!transform.localDirtyFlag){transform.localDirtyFlag=true;if(!transform.dirtyFlag){this.dirtifyWorld(element,transform);}}};_proto.dirtifyWorld=function dirtifyWorld(element,transform){if(!transform.dirtyFlag){this.unfreezeParentToRoot(element);}this.dirtifyWorldInternal(element,transform);this.dirtifyToRoot(element,true);};_proto.triggerPendingEvents=function triggerPendingEvents(){var _this2=this;var set=new Set();var trigger=function trigger(element,detail){if(element.isConnected&&!set.has(element.entity)){_this2.boundsChangedEvent.detail=detail;_this2.boundsChangedEvent.target=element;element.ownerDocument.defaultView.dispatchEvent(_this2.boundsChangedEvent,true);set.add(element.entity);}};this.pendingEvents.forEach(function(_ref){var element=_ref[0],detail=_ref[1];if(detail.affectChildren){element.forEach(function(e){trigger(e,detail);});}else {trigger(element,detail);}});this.clearPendingEvents();set.clear();};_proto.clearPendingEvents=function clearPendingEvents(){this.pendingEvents=[];};_proto.dirtifyToRoot=function dirtifyToRoot(element,affectChildren){if(affectChildren===void 0){affectChildren=false;}var p=element;// only need to re-render itself
|
|
9291
|
+
*/;_proto.setLocalRotation=function setLocalRotation(element,rotation,y,z,w){if(typeof rotation==='number'){rotation=fromValues$4(rotation,y,z,w);}var transform=element.transformable;copy$3(transform.localRotation,rotation);this.dirtifyLocal(element,transform);};_proto.setLocalSkew=function setLocalSkew(element,skew,y){if(typeof skew==='number'){skew=fromValues$5(skew,y);}var transform=element.transformable;copy$4(transform.localSkew,skew);this.dirtifyLocal(element,transform);};_proto.dirtifyLocal=function dirtifyLocal(element,transform){if(!transform.localDirtyFlag){transform.localDirtyFlag=true;if(!transform.dirtyFlag){this.dirtifyWorld(element,transform);}}};_proto.dirtifyWorld=function dirtifyWorld(element,transform){if(!transform.dirtyFlag){this.unfreezeParentToRoot(element);}this.dirtifyWorldInternal(element,transform);this.dirtifyToRoot(element,true);};_proto.triggerPendingEvents=function triggerPendingEvents(){var _this2=this;var set=new Set();var trigger=function trigger(element,detail){if(element.isConnected&&!set.has(element.entity)){_this2.boundsChangedEvent.detail=detail;_this2.boundsChangedEvent.target=element;if(element.isMutationObserved){element.dispatchEvent(_this2.boundsChangedEvent);}else {element.ownerDocument.defaultView.dispatchEvent(_this2.boundsChangedEvent,true);}set.add(element.entity);}};this.pendingEvents.forEach(function(_ref){var element=_ref[0],detail=_ref[1];if(detail.affectChildren){element.forEach(function(e){trigger(e,detail);});}else {trigger(element,detail);}});this.clearPendingEvents();set.clear();};_proto.clearPendingEvents=function clearPendingEvents(){this.pendingEvents=[];};_proto.dirtifyToRoot=function dirtifyToRoot(element,affectChildren){if(affectChildren===void 0){affectChildren=false;}var p=element;// only need to re-render itself
|
|
9292
9292
|
if(p.renderable){p.renderable.dirty=true;}while(p){markRenderableDirty(p);p=p.parentNode;}if(affectChildren){element.forEach(function(e){markRenderableDirty(e);});}// inform dependencies
|
|
9293
9293
|
this.informDependentDisplayObjects(element);// reuse the same custom event
|
|
9294
9294
|
this.pendingEvents.push([element,{affectChildren:affectChildren}]);};_proto.updateDisplayObjectDependency=function updateDisplayObjectDependency(name,oldPath,newPath,object){// clear ref to old clip path
|