{"version":3,"sources":["https://lively-kernel.org/lively4/BP2019RH1/all-in-one-product/actionChainExample.js"],"names":["ColorAction","FilterAction","SelectAction","ActionChain","AVFParser","DataProcessor","ColorStore","colorStore","dataProcessor","data","loadCovidData","initializeWithIndividualsFromKenia","valuesByAttribute","getValuesByAttribute","loadDefaultColors","initializeWithValuesByAttribute","actions","actionChain","console","log","runOn"],"mappings":";;;;;;AACEA,iB,kDAAAA,W;AACAC,kB,kDAAAA,Y;AACAC,kB,kDAAAA,Y;AACAC,iB,kDAAAA,W;;AAGOC,e,qDAAAA,S;;AAEFC,mB;;AACAC,gB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEP,UAAIC,aAAa,IAAID,UAAJ,EAAjB;;;;;;;;;;;;;;AACA,UAAIE,gBAAgB,IAAIH,aAAJ,EAApB;;;;;;;;;;;;;;;AAEA,OAAC,YAAY;AACX,YAAII,OAAO,MAAML,UAAUM,aAAV,EAAjB;AACAF,sBAAcG,kCAAd,CAAiDF,IAAjD;AACA,YAAIG,oBAAoBJ,cAAcK,oBAAd,EAAxB;AACA,cAAMN,WAAWO,iBAAX,EAAN;AACAP,mBAAWQ,+BAAX,CAA2CH,iBAA3C;;AAEA,YAAII,UAAU,CACZ,IAAIhB,WAAJ,CAAgB,QAAhB,EAA0B,IAA1B,EAAgCQ,aAAhC,EAA+CD,UAA/C,CADY,EAEZ,IAAIN,YAAJ,CAAiB,QAAjB,EAA2B,CAAC,QAAD,EAAW,SAAX,CAA3B,EAAkD,IAAlD,EAAwDO,aAAxD,CAFY,EAGZ,IAAIP,YAAJ,CAAiB,KAAjB,EAAwB,CAAC,SAAD,CAAxB,EAAqC,IAArC,EAA2CO,aAA3C,CAHY,EAIZ,IAAIN,YAAJ,CAAiBO,KAAK,CAAL,CAAjB,EAA0B,IAA1B,CAJY,CAAd;;AAOA,YAAIQ,cAAc,IAAId,WAAJ,CAAgBa,OAAhB,CAAlB;AACAE,gBAAQC,GAAR,CAAYF,YAAYG,KAAZ,CAAkBX,IAAlB,CAAZ;AACD,OAhBD","file":"actionChainExample.js","sourcesContent":["import {\n  ColorAction,\n  FilterAction,\n  SelectAction,\n  ActionChain\n} from \"../src/internal/individuals-as-points/common/actions.js\"\n\nimport { AVFParser } from \"https://lively-kernel.org/voices/parsing-data/avf-parser.js\"\n\nimport DataProcessor from \"../src/internal/individuals-as-points/common/data-processor.js\"\nimport ColorStore from \"../src/internal/individuals-as-points/common/color-store.js\"\n\nlet colorStore = new ColorStore()\nlet dataProcessor = new DataProcessor();\n\n(async () => {\n  let data = await AVFParser.loadCovidData()\n  dataProcessor.initializeWithIndividualsFromKenia(data);\n  let valuesByAttribute = dataProcessor.getValuesByAttribute()\n  await colorStore.loadDefaultColors()\n  colorStore.initializeWithValuesByAttribute(valuesByAttribute);\n\n  let actions = [\n    new ColorAction(\"gender\", true, dataProcessor, colorStore),\n    new FilterAction(\"gender\", [\"female\", \"missing\"], true, dataProcessor),\n    new FilterAction(\"age\", [\"missing\"], true, dataProcessor),\n    new SelectAction(data[0], true)\n  ]\n  \n  let actionChain = new ActionChain(actions)\n  console.log(actionChain.runOn(data))\n})();"]}