@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 1.27 kB
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import e from"./../../../vendor/events.js";import r from"./../../../vendor/debug.js";import t from"./../../../utils/define-nonenumerable-read-only-property.js";import n from"./../../../utils/inherit.js";import i from"./../../../assert/instance-of.js";import a from"./../../../vendor/virtual-dom/h.js";var o=r,s=a,m=o("annotations:render"),p="g";function d(){var e,r;return m("Rendering..."),r={namespace:"http://www.w3.org/2000/svg",property:"annotations",className:"annotations",attributes:{transform:"translate(0,0)"}},m("Generating a virtual DOM tree (%s) with properties: %s.",p,JSON.stringify(r)),e=s(p,r,[]),this.emit("_render",e),e}var v=e.EventEmitter,f=r,h=t,l=n,u=i,c=d,g=f("annotations:main");function w(){var e;return u(this,w)?(e=this,g("Creating an instance..."),v.call(this),this.on("change",(function(){g("Received a change event."),e.render()})),this.on("_render",(function(){var r,t;for(g("Received a render event. Re-emitting..."),(r=new Array(arguments.length+1))[0]="render",t=0;t<arguments.length;t++)r[t+1]=arguments[t];e.emit.apply(e,r)})),this):new w}l(w,v),h(w.prototype,"render",c);var y=w;export default y;
//# sourceMappingURL=annotations.js.map