{"version":3,"sources":["https://lively-kernel.org/lively4/lively4-leo/templates/d3-hello-world.js"],"names":["Morph","D3HelloWorld","initialize","registerButtons","addEventListener","evt","onDblClick","animate","backgroundColor","duration","livelyPrepareSave","setAttribute","get","livelyPreMigrate","livelyMigrate","other","livelyInspect","contentNode","inspector","livelyExample","appendChild"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAEOA,W;;;;;;;;;;;;;;AAAAA,gS;;;;;;;;;;;;;;;;;;AAEQ,YAAMC,YAAN,SAA2BD,KAA3B,CAAiC;AAC9C,cAAME,UAAN,GAAmB;AACjB,0CAAmB,cAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADiB;AAEjB,eAAKC,eAAL;;AAEA,4IAAyB,IAAzB,GAJiB,CAIe;;AAJf;AAMjB,oFAAOC,gBAAP,CAAwB,UAAxB,EAAoC,IAApC,EAA0C,UAA1C,EACEC;AAAA;AAAO,qGAAKC,UAAL,EAAgBD,GAAhB,YAAgBA,GAAhB,gFAAgBA,GAAhB,EAAgBA,GAAhB;AAAP;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AATA;AANiB;AAiBlB;;AAEDC,qBAAa;AAAA;;AACX,eAAKC,OAAL,CAAa,CACX,EAACC,iBAAiB,WAAlB,EADW,EAEX,EAACA,iBAAiB,KAAlB,EAFW,EAGX,EAACA,iBAAiB,WAAlB,EAHW,CAAb,EAIG;AACDC,sBAAU;AADT,WAJH;AAOD;;AAGD;;AAEA;AACAC,4BAAoB;AAAA;;AAClB,eAAKC,YAAL,CAAkB,aAAlB,oFAAiC,KAAKC,GAAL,CAAS,YAAT,CAAjC;AACD;;AAEDC,2BAAmB;AACjB;AACD;;AAEDC,sBAAcC,KAAd,EAAqB;AAAA;;AACnB;AACA;AACA,iEAA8BA,KAA9B,YAA8BA,KAA9B,oFAA8BA,KAA9B,EAA8BA,KAA9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACD;;AAEDC,sBAAcC,WAAd,EAA2BC,SAA3B,EAAsC;AACpC;AACD;;AAED,cAAMC,aAAN,GAAsB;AACpB;AACA;AACA,mEAA6B,WAA7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qDAA8B,EAA9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAJoB;AAKpB,eAAKC,WAAL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACD;;AA1D6C;;yBAA3BnB,Y;;;;;;;;;;6BAAAA,6R","file":"d3-hello-world.js","sourcesContent":["\"enable aexpr\";\n\nimport Morph from 'src/components/widgets/lively-morph.js';\n\nexport default class D3HelloWorld extends Morph {\n  async initialize() {\n    this.windowTitle = \"D3HelloWorld\";\n    this.registerButtons()\n\n    lively.html.registerKeys(this); // automatically installs handler for some methods\n    \n    lively.addEventListener(\"template\", this, \"dblclick\", \n      evt => this.onDblClick(evt))\n    // #Note 1\n    // ``lively.addEventListener`` automatically registers the listener\n    // so that the the handler can be deactivated using:\n    // ``lively.removeEventListener(\"template\", this)``\n    // #Note 1\n    // registering a closure instead of the function allows the class to make \n    // use of a dispatch at runtime. That means the ``onDblClick`` method can be\n    // replaced during development\n    \n  }\n  \n  onDblClick() {\n    this.animate([\n      {backgroundColor: \"lightgray\"},\n      {backgroundColor: \"red\"},\n      {backgroundColor: \"lightgray\"},\n    ], {\n      duration: 1000\n    })\n  }\n  \n\n  /* Lively-specific API */\n\n  // store something that would be lost\n  livelyPrepareSave() {\n    this.setAttribute(\"data-mydata\", this.get(\"#textField\").value)\n  }\n  \n  livelyPreMigrate() {\n    // is called on the old object before the migration\n  }\n  \n  livelyMigrate(other) {\n    // whenever a component is replaced with a newer version during development\n    // this method is called on the new object during migration, but before initialization\n    this.someJavaScriptProperty = other.someJavaScriptProperty\n  }\n  \n  livelyInspect(contentNode, inspector) {\n    // do nothing\n  }\n  \n  async livelyExample() {\n    // this customizes a default instance to a pretty example\n    // this is used by the \n    this.style.backgroundColor = \"lightgray\"\n    this.someJavaScriptProperty = 42\n    this.appendChild(<div>This is my content</div>)\n  }\n  \n  \n}"]}