@micheeeeel/yinyangapp 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/bundle.js +1 -1
  2. package/package.json +7 -6
package/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3")):"function"==typeof define&&define.amd?define(["d3"],e):"object"==typeof exports?exports.YinYangApp=e(require("d3")):t.YinYangApp=e(t.d3)}(this,(t=>(()=>{"use strict";var e={5:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationsMngr=void 0;var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subscribers=[]}var e,r;return e=t,r=[{key:"subscribe",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;this.subscribers.push({component:t,clockWise:e,time:r})}},{key:"startAll",value:function(){var t=this;this.subscribers.forEach((function(e){var r=e.component,i=e.clockWise,n=e.time;return t.animate(r,i,n)}))}},{key:"revertRotation",value:function(t){var e=this.subscribers.find((function(e){return e.component===t}));e&&(t.view.viewInitializer.yinYangGroup.interruptAllAnimation(),e.clockWise=!e.clockWise,this.animate(t,e.clockWise,e.time))}},{key:"animate",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,i=t.view.viewInitializer,n=i.yinYangGroup,o=i.yinOrYangGroup,a=i.positionX,s=i.positionY;n.applyContinuousRotation(r,a,s,e),Object.values(o).forEach((function(t){var n=t.type,o=i.yinOrYangGroup.yin.centerY,s=i.yinOrYangGroup.yang.centerY,c=i.yinOrYangGroup.yin.radius,l=i.yinOrYangGroup.yang.radius,u="yang"===n?c:-l,y="yang"===n?s:o;t.graphElementGroup.applyTranslationAndRotationAltogether(r,a,y,u,e,n)}))}}],r&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.AnimationsMngr=o},839:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangController=void 0;var o=function(){function t(e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.model=e,this.view=r,this.factory=i,this.animator=r.viewInitializer.graphicStrategy.animator}var e,r;return e=t,(r=[{key:"getBorderNb",value:function(){try{return this.model.borderNb}catch(t){throw console.error("Error getting border number:",t),t}}},{key:"getSortedData",value:function(){try{return this.model.sortedData}catch(t){throw console.error("Error getting sorted data:",t),t}}},{key:"getCategories",value:function(){try{return this.model.categories}catch(t){throw console.error("Error getting categories:",t),t}}},{key:"getKey",value:function(){try{return this.model.key}catch(t){throw console.error("Error getting key:",t),t}}},{key:"getParentKey",value:function(){try{return this.model.parentKey}catch(t){throw console.error("Error getting parent key:",t),t}}},{key:"getIsEnemy",value:function(){try{return this.model.isEnemy}catch(t){throw console.error("Error getting isEnemy status:",t),t}}},{key:"calculateAverageScore",value:function(){try{return this.model.calculateAverageScore()}catch(t){throw console.error("Error calculating average score:",t),t}}},{key:"generateChildKey",value:function(){try{return this.model.generateChildKey()}catch(t){throw console.error("Error generating child key:",t),t}}},{key:"createYinYangChildren",value:function(){var t=this;try{this.model.getSmallCircleData().forEach((function(e,r){e.score,e.angle;var i={minEdge:2*t.view.viewInitializer.smallCircleRadius,containerId:t.view.viewData.containerId,borderAnimationDuration:t.view.viewData.borderAnimationDuration};t.factory.create([t.model.sortedData[r]],i,t.model.isEnemy,t.getKey());var n=t.view.viewInitializer.borderOuterRadius,o=n/(2*t.view.viewInitializer.smallCircleRadius+n);t.view.viewInitializer.resizeWholePattern(o)}))}catch(t){throw console.error("Error drawing YinYang children:",t),t}}},{key:"InitializeAnimations",value:function(){var t=this;try{this.factory.animator.subscribe(this),this.view.addClickEventToYinYangGroup((function(){return t.factory.animator.revertRotation(t)})),["yang","yin"].forEach((function(e){t.view.addClickEventToArcGroups(e,(function(){return t.factory.animator.revertRotation(t)}))}))}catch(t){throw console.error("Error initializing animations:",t),t}}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangController=o},578:(t,e,r)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}function o(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangAppFactory=void 0;var a=r(573),s=r(535),c=r(839),l=r(5),u=r(892),y=r(948),p=r(528),f=r(67),h=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.idCounter=0,this.graphicsStrategy=e,this.instances=new Map,this.animator=this.createAnimationsManager()}var e,r;return e=t,r=[{key:"generateUniqueId",value:function(){return"".concat(this.idCounter++)}},{key:"getInstances",value:function(){return this.instances}},{key:"createModel",value:function(t){var e,r,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var o=n?null!==(r=null===(e=this.instances.get(n))||void 0===e?void 0:e.generateChildKey())&&void 0!==r?r:"":this.generateUniqueId();return new a.YinYangModel(t,o,n,i)}catch(t){throw console.error("Error creating model:",t),t}}},{key:"createView",value:function(){try{var t=new y.ViewInitializer(this.graphicsStrategy),e=new f.YinYangDrawer(t),r=new u.SpikeDrawer(t),i=new p.BorderDrawer(t);return new s.YinYangView(t,e,r,i)}catch(t){throw console.error("Error creating view:",t),t}}},{key:"createController",value:function(t,e){try{return new c.YinYangController(t,e,this)}catch(t){throw console.error("Error creating controller:",t),t}}},{key:"createAnimationsManager",value:function(){try{return new l.AnimationsMngr}catch(t){throw console.error("Error creating animations manager:",t),t}}},{key:"create",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;try{var n=this.createModel(t,r,i),o=this.createView(),a=this.createController(n,o);return o.initialize(a,e,this.instances.get(null!=i?i:"")),this.instances.set(n.key,a),a.InitializeAnimations(),a}catch(t){throw console.error("Error creating app:",t),t}}}],r&&n(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangAppFactory=h},573:(t,e,r)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,a(i.key),i)}}function a(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangModel=void 0;var s=r(468),c=function(){function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sortedData=e.sort((function(t,e){return t.categorie.localeCompare(e.categorie)})),this.categories=this.setupCategories(e),this.key=r,this.parentKey=i,this.childCounter=0,this.borderNb=2,this.isEnemy=n}var e,r;return e=t,(r=[{key:"generateChildKey",value:function(){return"".concat(this.key,".").concat(this.childCounter++)}},{key:"calculateAverageScore",value:function(){var t=this.sortedData.reduce((function(t,e){return t+e.score}),0);return Math.round(t/this.sortedData.length*10)/10}},{key:"getSmallCircleData",value:function(){var t=this;return this.sortedData.map((function(e,r){return{score:e.score,angle:r*(2*Math.PI/t.sortedData.length)}}))}},{key:"setupCategories",value:function(t){var e=t.reduce((function(t,e){return t[e.categorie]=(t[e.categorie]||0)+1,t}),{}),r=t.length,i=[],o=0;return Object.entries(e).map((function(t){var e,a,c=(a=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var i,n,o,a,s=[],c=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(i=o.call(r)).done)&&(s.push(i.value),s.length!==e);c=!0);}catch(t){l=!0,n=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}(e,a)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=c[0],u=c[1],y=2*Math.PI*o,p=u/r;o+=p;var f=y+2*Math.PI*p;i.push({category:l,color:s.categoryColorNames[l]||"grey",percentage:p,angles:{startAngle:y,endAngle:f}})})),i}}])&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangModel=c},528:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.BorderDrawer=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ViewInitializer=e}var e,r;return e=t,r=[{key:"initialize",value:function(){this.viewData=this.ViewInitializer.viewData,this.yinYangGroup=this.ViewInitializer.yinYangGroup,this.graphicStrategy=this.ViewInitializer.graphicStrategy,this.positionX=this.ViewInitializer.positionX,this.positionY=this.ViewInitializer.positionY,this.borderThickness=this.ViewInitializer.borderThickness,this.innerRadius=this.ViewInitializer.borderInnerRadius,this.outerRadius=this.ViewInitializer.borderOuterRadius,this.categories=this.ViewInitializer.categories,this.isChild=this.ViewInitializer.isChild,this.containerId=this.ViewInitializer.containerId,this.key=this.ViewInitializer.key}},{key:"createBorders",value:function(){this.graphicStrategy.drawArc(this.yinYangGroup,this.positionX,this.positionY,this.innerRadius,this.outerRadius,0,2*Math.PI,this.ViewInitializer.isEnemy?"black":"white");for(var t=this.ViewInitializer.controller.getBorderNb(),e=0;e<t;e++){var r=this.innerRadius+this.borderThickness*e,i=r+this.borderThickness;this.drawBorder(r,i,e)}}},{key:"drawBorder",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.categories[0].color,n="";if(!this.isChild){var o=this.CreateBorderMaskAndGradient(t,e,r),a=o.border_gradient_id,s=o.borderMaskId;i="url(#".concat(a,")"),n="url(#".concat(s,")")}var c=this.yinYangGroup.appendElement("g"),l=this.graphicStrategy.drawCircle(c,this.positionX,this.positionY,t+this.borderThickness/2,"none",1);l.setStyle("stroke",i).setStyle("stroke-width",this.borderThickness.toString()),this.isChild||c.setStyle("filter","url(#rainbow-filter)"),this.isChild?l.setStyle("opacity","0.2"):l.setStyle("mask",n)}},{key:"CreateBorderMaskAndGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.categories.map((function(t){return t.color})),n=[{offset:"0%",color:i[0],opacity:1},{offset:"100%",color:i[i.length-1],opacity:1}],o="".concat(this.containerId,"-borderGradient-").concat(this.key,"-").concat(r),a=this.graphicStrategy.createLinearGradient(o,"0%","0%","100%","0%",n,"objectBoundingBox");this.graphicStrategy.changeBorderColors(a,this.viewData.borderAnimationDuration,i);var s="".concat(this.containerId,"-borderMaskId-").concat(this.key,"-").concat(r);return this.graphicStrategy.createBorderMask(s,this.positionX,this.positionY,t,e),{border_gradient_id:o,borderMaskId:s}}}],r&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.BorderDrawer=o},892:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SpikeDrawer=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ViewInitializer=e}var e,r;return e=t,(r=[{key:"initialize",value:function(){this.viewData=this.ViewInitializer.viewData,this.categories=this.ViewInitializer.categories,this.isChild=this.ViewInitializer.isChild,this.yinOrYangGroup=this.ViewInitializer.yinOrYangGroup,this.sortedData=this.ViewInitializer.controller.getSortedData(),this.positionX=this.ViewInitializer.positionX,this.containerId=this.ViewInitializer.containerId,this.key=this.ViewInitializer.key,this.graphicStrategy=this.ViewInitializer.graphicStrategy}},{key:"createSpikes",value:function(){this.drawYinYangSpikes(this.yinOrYangGroup)}},{key:"drawYinYangSpikes",value:function(t){var e=this;Object.values(t).forEach((function(t){e.drawYinOrYangSpikes(t.centerY,t.radius,t.type)}))}},{key:"drawYinOrYangSpikes",value:function(t,e,r){var i=this;this.categories.forEach((function(n){i.isChild||i.drawSpikes(n,t,e/i.yinOrYangGroup[r].smallRadiusRatio,e,r,n.angles.startAngle,n.angles.endAngle)}))}},{key:"drawSpikes",value:function(t,e,r,i,n,o,a){var s=this,c=this.sortedData.filter((function(e){return e.categorie===t.category}));c.forEach((function(l,u){var y=o+(a-o)*((u+1)/(c.length+1));y="yang"===n?-y+Math.PI:y;var p=s.positionX+r*Math.sin(y),f=e+r*Math.cos(y),h="yang"===n?s.ViewInitializer.borderInnerRadius*l.score:s.ViewInitializer.borderInnerRadius*(1-l.score),d=p+(h=h>i-r?i-r:h)*Math.sin(y),g=f+h*Math.cos(y),v=p.toString(),b=f.toString(),m=d.toString(),w=g.toString(),S="".concat(s.containerId,"-gradientSpike-").concat(s.key,"-").concat(n,"-").concat(t.category,"-").concat(u);s.graphicStrategy.createLinearGradient(S,v,b,m,w,[{offset:"0%",color:"yin"===n?"black":"white",opacity:1},{offset:"80%",color:t.color,opacity:1},{offset:"100%",color:t.color,opacity:0}],"userSpaceOnUse"),s.graphicStrategy.drawLineWithGradient(s.yinOrYangGroup[n].graphElementGroup,p,f,d,g,S)}))}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SpikeDrawer=o},948:(t,e,r)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}function o(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ViewInitializer=void 0;var a=r(939),s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.borderThicknessRatio=10,this.offsetfromBorder=0,this.graphicStrategy=e}var e,r;return e=t,(r=[{key:"initializeGraphicElements",value:function(t,e,r){this.containerId=e.containerId,this.controller=t,this.viewData=e,this.borderOuterRadius=this.viewData.minEdge/2,this.borderThickness=this.borderOuterRadius/this.borderThicknessRatio,this.borderInnerRadius=this.borderOuterRadius-this.borderThickness*t.getBorderNb(),this.smallCircleRadius=a.GeometryUtils.calculateSmallCircleRadius(this.borderInnerRadius,this.controller.getSortedData().length),this.distanceFromChild=r?0:this.borderOuterRadius+this.smallCircleRadius+this.offsetfromBorder,this.graphicContainer=r?r.view.viewInitializer.graphicContainer:this.createGraphicContainer(this.containerId),this.globalGroup=r?r.view.viewInitializer.globalGroup:this.graphicContainer.appendElement("g"),this.yinYangGroup=this.globalGroup.appendElement("g"),this.averageScore=this.controller.calculateAverageScore(),this.categories=this.controller.getCategories(),this.key=t.getKey(),this.isChild=!!r;var i=this.getPatternPosition(r);this.positionX=i.positionX,this.positionY=i.positionY,this.yinOrYangGroup=this.createYinOrYangGroups(),this.isEnemy=t.getIsEnemy()}},{key:"resizeWholePattern",value:function(t){this.graphicStrategy.resizeGroup(this.globalGroup,t,this.positionX,this.positionY)}},{key:"createGraphicContainer",value:function(t){return this.graphicStrategy.initialize(t,this.viewData.minEdge)}},{key:"createYinOrYangGroups",value:function(){var t=this.borderInnerRadius*this.averageScore,e=this.borderInnerRadius-t,r=this.positionY-e,i=this.positionY+t;return{yang:{type:"yang",graphElementGroup:this.globalGroup.appendElement("g"),centerY:r,radius:t,smallRadiusRatio:5},yin:{type:"yin",graphElementGroup:this.globalGroup.appendElement("g"),centerY:i,radius:e,smallRadiusRatio:5}}}},{key:"getPatternPosition",value:function(t){return t?this.GetChildPosition(t.view):this.centerMotif()}},{key:"GetChildPosition",value:function(t){var e,r=(Number(null===(e=this.controller)||void 0===e?void 0:e.getKey().split(".").pop())||0)*(2*Math.PI/t.controller.getSortedData().length);return{positionX:t.viewInitializer.positionX+t.viewInitializer.distanceFromChild*Math.cos(r),positionY:t.viewInitializer.positionY+t.viewInitializer.distanceFromChild*Math.sin(r)}}},{key:"centerMotif",value:function(){var t=this.graphicContainer.getDimensions();return{positionX:t.width/2,positionY:t.height/2}}}])&&n(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.ViewInitializer=s},67:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangDrawer=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ViewInitializer=e}var e,r;return e=t,(r=[{key:"initialize",value:function(){this.viewData=this.ViewInitializer.viewData,this.yinYangGroup=this.ViewInitializer.yinYangGroup,this.yinOrYangGroup=this.ViewInitializer.yinOrYangGroup,this.graphicStrategy=this.ViewInitializer.graphicStrategy,this.positionX=this.ViewInitializer.positionX,this.positionY=this.ViewInitializer.positionY,this.categories=this.ViewInitializer.categories,this.containerId=this.ViewInitializer.containerId,this.key=this.ViewInitializer.key}},{key:"createYinYangPattern",value:function(){this.drawMainCircle(),this.drawSemiCircle(),this.drawYinYangSymbols(this.yinOrYangGroup)}},{key:"drawMainCircle",value:function(){this.graphicStrategy.drawCircle(this.yinYangGroup,this.positionX,this.positionY,this.ViewInitializer.borderInnerRadius,"white"),this.yinYangGroup.select("circle").setAttribute("stroke","black")}},{key:"drawSemiCircle",value:function(){this.graphicStrategy.drawArc(this.yinYangGroup,this.positionX,this.positionY,0,this.ViewInitializer.borderInnerRadius,0,Math.PI,"black")}},{key:"drawYinYangSymbols",value:function(t){var e=this;Object.values(t).forEach((function(t){e.drawYinOrYang(t.centerY,t.radius,t.type)}))}},{key:"drawYinOrYang",value:function(t,e,r){this.graphicStrategy.drawCircle(this.yinYangGroup,this.positionX,t,e,"yin"===r?"black":"white");var i=e/this.yinOrYangGroup[r].smallRadiusRatio;this.drawCategoryArcs(t,e,r,i),this.graphicStrategy.drawCircle(this.yinOrYangGroup[r].graphElementGroup,this.positionX,t,i,"yin"===r?"white":"black",1)}},{key:"drawCategoryArcs",value:function(t,e,r,i){var n=this;this.categories.forEach((function(o){var a="".concat(n.containerId,"-").concat(o.category,"-").concat(n.key,"-").concat(r),s="".concat(n.containerId,"-categoryArcMask-").concat(a);n.categories.length>1&&n.graphicStrategy.createYinOrYangArcMask(s,n.positionX,t,i,e,o.angles.startAngle,o.angles.endAngle,r);var c="".concat(n.containerId,"-categoryArcGradientId-").concat(a);n.graphicStrategy.createUnderlyingCircleGradient(c,o.color),n.graphicStrategy.createUnderlyingCircleWithArcMask(s,c,n.yinOrYangGroup[r].graphElementGroup,n.positionX,t,e)}))}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangDrawer=o},535:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangView=void 0;var o=function(){function t(e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._positionX=0,this._positionY=0,this.viewInitializer=e,this.yinYangDrawer=r,this.spikeDrawer=i,this.borderDrawer=n}var e,r;return e=t,(r=[{key:"controller",get:function(){return this._controller},set:function(t){this._controller=t}},{key:"viewData",get:function(){return this._viewData},set:function(t){this._viewData=t}},{key:"positionX",get:function(){return this._positionX},set:function(t){this._positionX=t}},{key:"positionY",get:function(){return this._positionY},set:function(t){this._positionY=t}},{key:"viewInitializer",get:function(){return this._viewInitializer},set:function(t){this._viewInitializer=t}},{key:"yinYangDrawer",get:function(){return this._yinYangDrawer},set:function(t){this._yinYangDrawer=t}},{key:"spikeDrawer",get:function(){return this._spikeDrawer},set:function(t){this._spikeDrawer=t}},{key:"borderDrawer",get:function(){return this._borderDrawer},set:function(t){this._borderDrawer=t}},{key:"initialize",value:function(t,e,r){this.controller=t,this.viewData=e,this.viewInitializer.initializeGraphicElements(t,e,r),this.yinYangDrawer.initialize(),this.yinYangDrawer.createYinYangPattern(),this.spikeDrawer.initialize(),this.spikeDrawer.createSpikes(),this.borderDrawer.initialize(),this.borderDrawer.createBorders()}},{key:"addClickEventToYinYangGroup",value:function(t){this.viewInitializer.yinYangGroup.addEventListener("click",t)}},{key:"addClickEventToArcGroups",value:function(t,e){this.viewInitializer.yinOrYangGroup[t].graphElementGroup.addEventListener("click",e)}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangView=o},468:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.categoryColorNames=void 0,e.categoryColorNames={Environment:"green",Economy:"blue",Wellbeing:"red",Peace:"orange",Cooperation:"cyan"}},462:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[{categorie:"Environment",composante:"Déforestation de la forêt tropicale",score:.1,description:"Destruction massive de la forêt tropicale, menaçant les habitats naturels."},{categorie:"Environment",composante:"Drainage des tourbières",score:.2,description:"Assèchement des tourbières, perturbant l'écosystème et augmentant les émissions de CO2."},{categorie:"Environment",composante:"Plantations d'eucalyptus et d'acacias",score:.3,description:"Établissement de monocultures avec impact négatif sur la biodiversité."},{categorie:"Economy",composante:"Création d'emplois temporaires",score:.4,description:"Offre d'emplois à court terme mais sans développement durable à long terme."},{categorie:"Economy",composante:"Production de matières premières pour le papier",score:.5,description:"Contribution économique par la production de papier, mais avec des pratiques non durables."},{categorie:"Wellbeing",composante:"Violation des droits des indigènes Dayak",score:.1,description:"Vol des terres et déplacement des communautés locales, affectant leur mode de vie."},{categorie:"Wellbeing",composante:"Impact sur la santé des travailleurs",score:.3,description:"Conditions de travail potentiellement dangereuses sans mesures de protection adéquates."},{categorie:"Peace",composante:"Conflits avec les communautés locales",score:.2,description:"Tensions et conflits dus au vol des terres et à la destruction des ressources naturelles."},{categorie:"Peace",composante:"Manque de transparence financière",score:.2,description:"Absence de divulgation des informations sur les dirigeants et les pratiques de l'entreprise."},{categorie:"Cooperation",composante:"Relations avec les organisations environnementales",score:.1,description:"Faibles collaborations avec les ONG, malgré les appels à l'action."},{categorie:"Cooperation",composante:"Engagement envers la chaîne d’approvisionnement sans déforestation",score:.3,description:"Déclaration d'engagement par RGE, mais non-respecté par PT Mayawana Persada."}]},441:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.initializeYinYangApp=void 0;var n=r(578),o=i(r(462)),a=r(317);e.initializeYinYangApp=function(t){var e={modelDataEnemy:o.default,viewDataEnemy:t},r=new a.D3GraphicsStrategy;new n.YinYangAppFactory(r).create(e.modelDataEnemy,e.viewDataEnemy,!0).createYinYangChildren()}},620:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.D3Animator=void 0;var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,(r=[{key:"applyColorAnimation",value:function(t,e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","animate");i.setAttribute("attributeName","stop-color"),i.setAttribute("values",r.join(";")),i.setAttribute("dur","".concat(e,"ms")),i.setAttribute("repeatCount","indefinite"),t.appendChild(i)}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.D3Animator=o},601:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.D3Element=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.selection=e}var e,r;return e=t,r=[{key:"appendElement",value:function(e){return new t(this.selection.append(e))}},{key:"setStyle",value:function(t,e){return this.selection.style(t,e),this}},{key:"setAttribute",value:function(t,e){return this.selection.attr(t,e),this}},{key:"addEventListener",value:function(t,e){this.selection.on(t,e)}},{key:"getSelection",value:function(){return this.selection}},{key:"select",value:function(e){return new t(this.selection.select(e))}},{key:"node",value:function(){return this.selection.node()}},{key:"getDimensions",value:function(){var t=this.selection.node();if(t instanceof SVGSVGElement){var e=t.getBoundingClientRect();return{width:e.width,height:e.height}}return{width:0,height:0}}},{key:"interruptAllAnimation",value:function(){this.selection.interrupt().selectAll("*").interrupt()}},{key:"applyContinuousRotation",value:function(t,e,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.selection.transition().duration(t).attrTween("transform",(function(){return function(t){return"rotate(".concat(t*(i?360:-360),",").concat(e,",").concat(r,")")}}))}},{key:"applyTranslationAndRotationAltogether",value:function(t,e,r,i,n,o){this.selection.transition().duration(t).attrTween("transform",(function(){return function(t){var a=2*t*Math.PI*(n?1:-1),s=i*Math.sin(a),c=i-i*Math.cos(a),l=e+s,u=r+c,y="yang"===o?3:-1,p=180*a/Math.PI;return"rotate(".concat(y*p,", ").concat(l,", ").concat(u,") translate(").concat(s,", ").concat(c,")")}}))}}],r&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.D3Element=o},317:function(t,e,r){function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,a(i.key),i)}}function a(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}var s=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),c=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),l=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&s(e,t,r);return c(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.D3GraphicsStrategy=void 0;var u=l(r(893)),y=r(601),p=r(620),f=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.animator=new p.D3Animator,this.currentScale=1,this.currentY=0,this.currentX=0}var e,r;return e=t,r=[{key:"initialize",value:function(t,e){var r=u.select("#".concat(t)).append("svg").attr("width",e).attr("height",e);return this.defs=new y.D3Element(r.append("defs")),new y.D3Element(r)}},{key:"resizeGroup",value:function(t,e,r,i){t.setAttribute("transform","translate(".concat(r,", ").concat(i,") \n scale(").concat(e,") \n translate(").concat(-r,", ").concat(-i,") "))}},{key:"drawArc",value:function(t,e,r,i,n,o,a,s){var c=u.arc().innerRadius(i).outerRadius(n).startAngle(o).endAngle(a);t.appendElement("path").setAttribute("d",c).setAttribute("transform","translate(".concat(e,",").concat(r,")")).setStyle("fill",s)}},{key:"drawCircle",value:function(t,e,r,i,n){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return t.appendElement("circle").setAttribute("cx",e.toString()).setAttribute("cy",r.toString()).setAttribute("r",i.toString()).setStyle("fill",n).setStyle("opacity",o.toString())}},{key:"createLinearGradient",value:function(t,e,r,i,n,o,a){var s=this.defs.appendElement("linearGradient").setAttribute("id",t).setAttribute("x1",e).setAttribute("y1",r).setAttribute("x2",i).setAttribute("y2",n).setAttribute("gradientUnits",a);return o.forEach((function(t){s.appendElement("stop").setAttribute("offset",t.offset).setAttribute("stop-color",t.color).setAttribute("stop-opacity",t.opacity.toString())})),s}},{key:"createArc",value:function(t,e,r,i){return u.arc().innerRadius(t).outerRadius(e).startAngle(r).endAngle(i)}},{key:"createYinOrYangArcMask",value:function(t,e,r,i,n,o,a,s){var c=Math.PI-o,l=Math.PI-a,u=this.createArc(i,n,"yang"===s?o:c,"yang"===s?a:l),y=this.defs.appendElement("mask").setAttribute("id",t);this.createLinearGradient("start","0%","0%","100%","0%",[{offset:"0%",color:"white",opacity:1},{offset:"100%",color:"white",opacity:0}],"objectBoundingBox"),this.createLinearGradient("end","0%","0%","100%","0%",[{offset:"0%",color:"white",opacity:0},{offset:"100%",color:"white",opacity:1}],"objectBoundingBox");var p=180+180*("yang"===s?o:c)/Math.PI,f=.1*n;y.appendElement("rect").setAttribute("x",(e-("yang"===s?0:f)).toString()).setAttribute("y",r.toString()).setAttribute("transform","rotate(".concat(p,",").concat(e,",").concat(r,")")).setAttribute("width",f.toString()).setAttribute("height",n.toString()).setAttribute("fill","yang"===s?"url(#start)":"url(#end)");var h=180+180*("yang"===s?a:l)/Math.PI;return y.appendElement("rect").setAttribute("x",(e-("yang"===s?f:0)).toString()).setAttribute("y",r.toString()).setAttribute("transform","rotate(".concat(h,",").concat(e,",").concat(r.toString(),")")).setAttribute("width",f.toString()).setAttribute("height",n.toString()).setAttribute("fill","yang"===s?"url(#end)":"url(#start)"),y.appendElement("path").setAttribute("d",u({})||"").setAttribute("transform","translate(".concat(e,", ").concat(r.toString(),")")).setAttribute("fill","white"),y}},{key:"createBorderMask",value:function(t,e,r,i,n){var o=this.createArc(i,n,0,2*Math.PI),a=this.defs.appendElement("mask").setAttribute("id",t),s=this.defs.appendElement("radialGradient").setAttribute("id","borderMaskGradient").setAttribute("cx","50%").setAttribute("cy","50%").setAttribute("r","50%"),c=i/n,l=100*c,u=l+100*(1-c)*.7;s.appendElement("stop").setAttribute("offset","".concat(l,"%")).setAttribute("stop-color","white").setAttribute("stop-opacity","1"),s.appendElement("stop").setAttribute("offset","".concat(u,"%")).setAttribute("stop-color","white").setAttribute("stop-opacity","0"),a.appendElement("path").setAttribute("d",o({})||"").setAttribute("transform","translate(".concat(e,", ").concat(r,")")).setAttribute("fill","url(#borderMaskGradient)")}},{key:"changeBorderColors",value:function(t,e,r){var i=e;r.push(r[0]),this.animator.applyColorAnimation(t.select("stop:first-child").node(),i,r);var o,a=(o=r,function(t){if(Array.isArray(t))return n(t)}(o)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(o)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(t){return void 0!==t}));a.length>0&&a.unshift(a.pop()),a.push(a[0]),this.animator.applyColorAnimation(t.select("stop:last-child").node(),i,a)}},{key:"drawLineWithGradient",value:function(t,e,r,i,n,o){t.appendElement("line").setAttribute("x1",e.toString()).setAttribute("y1",r.toString()).setAttribute("x2",i.toString()).setAttribute("y2",n.toString()).setStyle("stroke","url(#".concat(o,")"))}},{key:"createUnderlyingCircleGradient",value:function(t,e){var r=this.defs.appendElement("radialGradient").setAttribute("id",t).setAttribute("cx","50%").setAttribute("cy","50%").setAttribute("r","50%");r.appendElement("stop").setAttribute("offset","0%").setAttribute("stop-color",e).setAttribute("stop-opacity","1"),r.appendElement("stop").setAttribute("offset","100%").setAttribute("stop-color",e).setAttribute("stop-opacity","0")}},{key:"createUnderlyingCircleWithArcMask",value:function(t,e,r,i,n,o){this.drawCircle(r,i,n,o,"url(#".concat(e,")")).setAttribute("mask","url(#".concat(t,")"))}}],r&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.D3GraphicsStrategy=f},939:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryUtils=void 0;var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{key:"calculateSpikeLength",value:function(t,e){return t*e*.5}},{key:"calculateSmallCircleRadius",value:function(t,e){return 2*Math.PI*t/e/2}}],null&&i(e.prototype,null),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.GeometryUtils=o},893:e=>{e.exports=t}},r={};return function t(i){var n=r[i];if(void 0!==n)return n.exports;var o=r[i]={exports:{}};return e[i].call(o.exports,o,o.exports,t),o.exports}(441)})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3")):"function"==typeof define&&define.amd?define(["d3"],e):"object"==typeof exports?exports.YinYangApp=e(require("d3")):t.YinYangApp=e(t.d3)}(this,(t=>(()=>{"use strict";var e={5:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.AnimationsMngr=void 0;var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.subscribers=[]}var e,r;return e=t,r=[{key:"subscribe",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;this.subscribers.push({component:t,clockWise:e,time:r})}},{key:"startAll",value:function(){var t=this;this.subscribers.forEach((function(e){var r=e.component,i=e.clockWise,n=e.time;return t.animate(r,i,n)}))}},{key:"revertRotation",value:function(t){var e=this.subscribers.find((function(e){return e.component===t}));e&&(t.view.viewInitializer.yinYangGroup.interruptAllAnimation(),e.clockWise=!e.clockWise,this.animate(t,e.clockWise,e.time))}},{key:"animate",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,i=t.view.viewInitializer,n=i.yinYangGroup,o=i.yinOrYangGroup,a=i.positionX,s=i.positionY;n.applyContinuousRotation(r,a,s,e),Object.values(o).forEach((function(t){var n=t.type,o=i.yinOrYangGroup.yin.centerY,s=i.yinOrYangGroup.yang.centerY,c=i.yinOrYangGroup.yin.radius,l=i.yinOrYangGroup.yang.radius,u="yang"===n?c:-l,y="yang"===n?s:o;t.graphElementGroup.applyTranslationAndRotationAltogether(r,a,y,u,e,n)}))}}],r&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.AnimationsMngr=o},839:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangController=void 0;var o=function(){function t(e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.model=e,this.view=r,this.factory=i,this.animator=r.viewInitializer.graphicStrategy.animator}var e,r;return e=t,(r=[{key:"getBorderNb",value:function(){try{return this.model.borderNb}catch(t){throw console.error("Error getting border number:",t),t}}},{key:"getSortedData",value:function(){try{return this.model.sortedData}catch(t){throw console.error("Error getting sorted data:",t),t}}},{key:"getCategories",value:function(){try{return this.model.categories}catch(t){throw console.error("Error getting categories:",t),t}}},{key:"getKey",value:function(){try{return this.model.key}catch(t){throw console.error("Error getting key:",t),t}}},{key:"getParentKey",value:function(){try{return this.model.parentKey}catch(t){throw console.error("Error getting parent key:",t),t}}},{key:"getIsEnemy",value:function(){try{return this.model.isEnemy}catch(t){throw console.error("Error getting isEnemy status:",t),t}}},{key:"calculateAverageScore",value:function(){try{return this.model.calculateAverageScore()}catch(t){throw console.error("Error calculating average score:",t),t}}},{key:"generateChildKey",value:function(){try{return this.model.generateChildKey()}catch(t){throw console.error("Error generating child key:",t),t}}},{key:"createYinYangChildren",value:function(){var t=this;try{this.model.getSmallCircleData().forEach((function(e,r){e.score,e.angle;var i={minEdge:2*t.view.viewInitializer.smallCircleRadius,containerId:t.view.viewData.containerId,borderAnimationDuration:t.view.viewData.borderAnimationDuration};t.factory.create([t.model.sortedData[r]],i,t.model.isEnemy,t.getKey());var n=t.view.viewInitializer.borderOuterRadius,o=n/(2*t.view.viewInitializer.smallCircleRadius+n);t.view.viewInitializer.resizeWholePattern(o)}))}catch(t){throw console.error("Error drawing YinYang children:",t),t}}},{key:"InitializeAnimations",value:function(){var t=this;try{this.factory.animator.subscribe(this),this.view.addClickEventToYinYangGroup((function(){return t.factory.animator.revertRotation(t)})),["yang","yin"].forEach((function(e){t.view.addClickEventToArcGroups(e,(function(){return t.factory.animator.revertRotation(t)}))}))}catch(t){throw console.error("Error initializing animations:",t),t}}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangController=o},578:(t,e,r)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}function o(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangAppFactory=void 0;var a=r(573),s=r(535),c=r(839),l=r(5),u=r(892),y=r(948),p=r(528),f=r(67),h=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.idCounter=0,this.graphicsStrategy=e,this.instances=new Map,this.animator=this.createAnimationsManager()}var e,r;return e=t,r=[{key:"generateUniqueId",value:function(){return"".concat(this.idCounter++)}},{key:"getInstances",value:function(){return this.instances}},{key:"createModel",value:function(t){var e,r,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var o=n?null!==(r=null===(e=this.instances.get(n))||void 0===e?void 0:e.generateChildKey())&&void 0!==r?r:"":this.generateUniqueId();return new a.YinYangModel(t,o,n,i)}catch(t){throw console.error("Error creating model:",t),t}}},{key:"createView",value:function(){try{var t=new y.ViewInitializer(this.graphicsStrategy),e=new f.YinYangDrawer(t),r=new u.SpikeDrawer(t),i=new p.BorderDrawer(t);return new s.YinYangView(t,e,r,i)}catch(t){throw console.error("Error creating view:",t),t}}},{key:"createController",value:function(t,e){try{return new c.YinYangController(t,e,this)}catch(t){throw console.error("Error creating controller:",t),t}}},{key:"createAnimationsManager",value:function(){try{return new l.AnimationsMngr}catch(t){throw console.error("Error creating animations manager:",t),t}}},{key:"create",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;try{var n=this.createModel(t,r,i),o=this.createView(),a=this.createController(n,o);return o.initialize(a,e,this.instances.get(null!=i?i:"")),this.instances.set(n.key,a),a.InitializeAnimations(),a}catch(t){throw console.error("Error creating app:",t),t}}}],r&&n(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangAppFactory=h},573:(t,e,r)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,a(i.key),i)}}function a(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangModel=void 0;var s=r(468),c=function(){function t(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sortedData=e.sort((function(t,e){return t.categorie.localeCompare(e.categorie)})),this.categories=this.setupCategories(e),this.key=r,this.parentKey=i,this.childCounter=0,this.borderNb=2,this.isEnemy=n}var e,r;return e=t,(r=[{key:"generateChildKey",value:function(){return"".concat(this.key,".").concat(this.childCounter++)}},{key:"calculateAverageScore",value:function(){var t=this.sortedData.reduce((function(t,e){return t+e.score}),0);return Math.round(t/this.sortedData.length*10)/10}},{key:"getSmallCircleData",value:function(){var t=this;return this.sortedData.map((function(e,r){return{score:e.score,angle:r*(2*Math.PI/t.sortedData.length)}}))}},{key:"setupCategories",value:function(t){var e=t.reduce((function(t,e){return t[e.categorie]=(t[e.categorie]||0)+1,t}),{}),r=t.length,i=[],o=0;return Object.entries(e).map((function(t){var e,a,c=(a=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var i,n,o,a,s=[],c=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(i=o.call(r)).done)&&(s.push(i.value),s.length!==e);c=!0);}catch(t){l=!0,n=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}(e,a)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(e,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=c[0],u=c[1],y=2*Math.PI*o,p=u/r;o+=p;var f=y+2*Math.PI*p;i.push({category:l,color:s.categoryColorNames[l]||"grey",percentage:p,angles:{startAngle:y,endAngle:f}})})),i}}])&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangModel=c},528:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.BorderDrawer=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ViewInitializer=e}var e,r;return e=t,r=[{key:"initialize",value:function(){this.viewData=this.ViewInitializer.viewData,this.yinYangGroup=this.ViewInitializer.yinYangGroup,this.graphicStrategy=this.ViewInitializer.graphicStrategy,this.positionX=this.ViewInitializer.positionX,this.positionY=this.ViewInitializer.positionY,this.borderThickness=this.ViewInitializer.borderThickness,this.innerRadius=this.ViewInitializer.borderInnerRadius,this.outerRadius=this.ViewInitializer.borderOuterRadius,this.categories=this.ViewInitializer.categories,this.isChild=this.ViewInitializer.isChild,this.containerId=this.ViewInitializer.containerId,this.key=this.ViewInitializer.key}},{key:"createBorders",value:function(){this.graphicStrategy.drawArc(this.yinYangGroup,this.positionX,this.positionY,this.innerRadius,this.outerRadius,0,2*Math.PI,this.ViewInitializer.isEnemy?"black":"white");for(var t=this.ViewInitializer.controller.getBorderNb(),e=0;e<t;e++){var r=this.innerRadius+this.borderThickness*e,i=r+this.borderThickness;this.drawBorder(r,i,e)}}},{key:"drawBorder",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.categories[0].color,n="";if(!this.isChild){var o=this.CreateBorderMaskAndGradient(t,e,r),a=o.border_gradient_id,s=o.borderMaskId;i="url(#".concat(a,")"),n="url(#".concat(s,")")}var c=this.yinYangGroup.appendElement("g"),l=this.graphicStrategy.drawCircle(c,this.positionX,this.positionY,t+this.borderThickness/2,"none",1);l.setStyle("stroke",i).setStyle("stroke-width",this.borderThickness.toString()),this.isChild||c.setStyle("filter","url(#rainbow-filter)"),this.isChild?l.setStyle("opacity","0.2"):l.setStyle("mask",n)}},{key:"CreateBorderMaskAndGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.categories.map((function(t){return t.color})),n=[{offset:"0%",color:i[0],opacity:1},{offset:"100%",color:i[i.length-1],opacity:1}],o="".concat(this.containerId,"-borderGradient-").concat(this.key,"-").concat(r),a=this.graphicStrategy.createLinearGradient(o,"0%","0%","100%","0%",n,"objectBoundingBox");this.graphicStrategy.changeBorderColors(a,this.viewData.borderAnimationDuration,i);var s="".concat(this.containerId,"-borderMaskId-").concat(this.key,"-").concat(r);return this.graphicStrategy.createBorderMask(s,this.positionX,this.positionY,t,e),{border_gradient_id:o,borderMaskId:s}}}],r&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.BorderDrawer=o},892:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SpikeDrawer=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ViewInitializer=e}var e,r;return e=t,(r=[{key:"initialize",value:function(){this.viewData=this.ViewInitializer.viewData,this.categories=this.ViewInitializer.categories,this.isChild=this.ViewInitializer.isChild,this.yinOrYangGroup=this.ViewInitializer.yinOrYangGroup,this.sortedData=this.ViewInitializer.controller.getSortedData(),this.positionX=this.ViewInitializer.positionX,this.containerId=this.ViewInitializer.containerId,this.key=this.ViewInitializer.key,this.graphicStrategy=this.ViewInitializer.graphicStrategy}},{key:"createSpikes",value:function(){this.drawYinYangSpikes(this.yinOrYangGroup)}},{key:"drawYinYangSpikes",value:function(t){var e=this;Object.values(t).forEach((function(t){e.drawYinOrYangSpikes(t.centerY,t.radius,t.type)}))}},{key:"drawYinOrYangSpikes",value:function(t,e,r){var i=this;this.categories.forEach((function(n){i.isChild||i.drawSpikes(n,t,e/i.yinOrYangGroup[r].smallRadiusRatio,e,r,n.angles.startAngle,n.angles.endAngle)}))}},{key:"drawSpikes",value:function(t,e,r,i,n,o,a){var s=this,c=this.sortedData.filter((function(e){return e.categorie===t.category}));c.forEach((function(l,u){var y=o+(a-o)*((u+1)/(c.length+1));y="yang"===n?-y+Math.PI:y;var p=s.positionX+r*Math.sin(y),f=e+r*Math.cos(y),h="yang"===n?s.ViewInitializer.borderInnerRadius*l.score:s.ViewInitializer.borderInnerRadius*(1-l.score),d=p+(h=h>i-r?i-r:h)*Math.sin(y),g=f+h*Math.cos(y),v=p.toString(),b=f.toString(),m=d.toString(),w=g.toString(),S="".concat(s.containerId,"-gradientSpike-").concat(s.key,"-").concat(n,"-").concat(t.category,"-").concat(u);s.graphicStrategy.createLinearGradient(S,v,b,m,w,[{offset:"0%",color:"yin"===n?"black":"white",opacity:1},{offset:"80%",color:t.color,opacity:1},{offset:"100%",color:t.color,opacity:0}],"userSpaceOnUse"),s.graphicStrategy.drawLineWithGradient(s.yinOrYangGroup[n].graphElementGroup,p,f,d,g,S)}))}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SpikeDrawer=o},948:(t,e,r)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o(i.key),i)}}function o(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ViewInitializer=void 0;var a=r(939),s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.borderThicknessRatio=10,this.offsetfromBorder=0,this.graphicStrategy=e}var e,r;return e=t,(r=[{key:"initializeGraphicElements",value:function(t,e,r){this.containerId=e.containerId,this.controller=t,this.viewData=e,this.borderOuterRadius=this.viewData.minEdge/2,this.borderThickness=this.borderOuterRadius/this.borderThicknessRatio,this.borderInnerRadius=this.borderOuterRadius-this.borderThickness*t.getBorderNb(),this.smallCircleRadius=a.GeometryUtils.calculateSmallCircleRadius(this.borderInnerRadius,this.controller.getSortedData().length),this.distanceFromChild=r?0:this.borderOuterRadius+this.smallCircleRadius+this.offsetfromBorder,this.graphicContainer=r?r.view.viewInitializer.graphicContainer:this.createGraphicContainer(this.containerId),this.globalGroup=r?r.view.viewInitializer.globalGroup:this.graphicContainer.appendElement("g"),this.yinYangGroup=this.globalGroup.appendElement("g"),this.averageScore=this.controller.calculateAverageScore(),this.categories=this.controller.getCategories(),this.key=t.getKey(),this.isChild=!!r;var i=this.getPatternPosition(r);this.positionX=i.positionX,this.positionY=i.positionY,this.yinOrYangGroup=this.createYinOrYangGroups(),this.isEnemy=t.getIsEnemy()}},{key:"resizeWholePattern",value:function(t){this.graphicStrategy.resizeGroup(this.globalGroup,t,this.positionX,this.positionY)}},{key:"createGraphicContainer",value:function(t){return this.graphicStrategy.initialize(t,this.viewData.minEdge)}},{key:"createYinOrYangGroups",value:function(){var t=this.borderInnerRadius*this.averageScore,e=this.borderInnerRadius-t,r=this.positionY-e,i=this.positionY+t;return{yang:{type:"yang",graphElementGroup:this.globalGroup.appendElement("g"),centerY:r,radius:t,smallRadiusRatio:5},yin:{type:"yin",graphElementGroup:this.globalGroup.appendElement("g"),centerY:i,radius:e,smallRadiusRatio:5}}}},{key:"getPatternPosition",value:function(t){return t?this.GetChildPosition(t.view):this.centerMotif()}},{key:"GetChildPosition",value:function(t){var e,r=(Number(null===(e=this.controller)||void 0===e?void 0:e.getKey().split(".").pop())||0)*(2*Math.PI/t.controller.getSortedData().length);return{positionX:t.viewInitializer.positionX+t.viewInitializer.distanceFromChild*Math.cos(r),positionY:t.viewInitializer.positionY+t.viewInitializer.distanceFromChild*Math.sin(r)}}},{key:"centerMotif",value:function(){var t=this.graphicContainer.getDimensions();return{positionX:t.width/2,positionY:t.height/2}}}])&&n(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.ViewInitializer=s},67:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangDrawer=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ViewInitializer=e}var e,r;return e=t,(r=[{key:"initialize",value:function(){this.viewData=this.ViewInitializer.viewData,this.yinYangGroup=this.ViewInitializer.yinYangGroup,this.yinOrYangGroup=this.ViewInitializer.yinOrYangGroup,this.graphicStrategy=this.ViewInitializer.graphicStrategy,this.positionX=this.ViewInitializer.positionX,this.positionY=this.ViewInitializer.positionY,this.categories=this.ViewInitializer.categories,this.containerId=this.ViewInitializer.containerId,this.key=this.ViewInitializer.key}},{key:"createYinYangPattern",value:function(){this.drawMainCircle(),this.drawSemiCircle(),this.drawYinYangSymbols(this.yinOrYangGroup)}},{key:"drawMainCircle",value:function(){this.graphicStrategy.drawCircle(this.yinYangGroup,this.positionX,this.positionY,this.ViewInitializer.borderInnerRadius,"white"),this.yinYangGroup.select("circle").setAttribute("stroke","black")}},{key:"drawSemiCircle",value:function(){this.graphicStrategy.drawArc(this.yinYangGroup,this.positionX,this.positionY,0,this.ViewInitializer.borderInnerRadius,0,Math.PI,"black")}},{key:"drawYinYangSymbols",value:function(t){var e=this;Object.values(t).forEach((function(t){e.drawYinOrYang(t.centerY,t.radius,t.type)}))}},{key:"drawYinOrYang",value:function(t,e,r){this.graphicStrategy.drawCircle(this.yinYangGroup,this.positionX,t,e,"yin"===r?"black":"white");var i=e/this.yinOrYangGroup[r].smallRadiusRatio;this.drawCategoryArcs(t,e,r,i),this.graphicStrategy.drawCircle(this.yinOrYangGroup[r].graphElementGroup,this.positionX,t,i,"yin"===r?"white":"black",1)}},{key:"drawCategoryArcs",value:function(t,e,r,i){var n=this;this.categories.forEach((function(o){var a="".concat(n.containerId,"-").concat(o.category,"-").concat(n.key,"-").concat(r),s="".concat(n.containerId,"-categoryArcMask-").concat(a);n.categories.length>1&&n.graphicStrategy.createYinOrYangArcMask(s,n.positionX,t,i,e,o.angles.startAngle,o.angles.endAngle,r);var c="".concat(n.containerId,"-categoryArcGradientId-").concat(a);n.graphicStrategy.createUnderlyingCircleGradient(c,o.color),n.graphicStrategy.createUnderlyingCircleWithArcMask(s,c,n.yinOrYangGroup[r].graphElementGroup,n.positionX,t,e)}))}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangDrawer=o},535:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.YinYangView=void 0;var o=function(){function t(e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._positionX=0,this._positionY=0,this.viewInitializer=e,this.yinYangDrawer=r,this.spikeDrawer=i,this.borderDrawer=n}var e,r;return e=t,(r=[{key:"controller",get:function(){return this._controller},set:function(t){this._controller=t}},{key:"viewData",get:function(){return this._viewData},set:function(t){this._viewData=t}},{key:"positionX",get:function(){return this._positionX},set:function(t){this._positionX=t}},{key:"positionY",get:function(){return this._positionY},set:function(t){this._positionY=t}},{key:"viewInitializer",get:function(){return this._viewInitializer},set:function(t){this._viewInitializer=t}},{key:"yinYangDrawer",get:function(){return this._yinYangDrawer},set:function(t){this._yinYangDrawer=t}},{key:"spikeDrawer",get:function(){return this._spikeDrawer},set:function(t){this._spikeDrawer=t}},{key:"borderDrawer",get:function(){return this._borderDrawer},set:function(t){this._borderDrawer=t}},{key:"initialize",value:function(t,e,r){this.controller=t,this.viewData=e,this.viewInitializer.initializeGraphicElements(t,e,r),this.yinYangDrawer.initialize(),this.yinYangDrawer.createYinYangPattern(),this.spikeDrawer.initialize(),this.spikeDrawer.createSpikes(),this.borderDrawer.initialize(),this.borderDrawer.createBorders()}},{key:"addClickEventToYinYangGroup",value:function(t){this.viewInitializer.yinYangGroup.addEventListener("click",t)}},{key:"addClickEventToArcGroups",value:function(t,e){this.viewInitializer.yinOrYangGroup[t].graphElementGroup.addEventListener("click",e)}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.YinYangView=o},468:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.categoryColorNames=void 0,e.categoryColorNames={Environment:"green",Economy:"blue",Wellbeing:"red",Peace:"orange",Cooperation:"cyan"}},462:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[{categorie:"Environment",composante:"Déforestation de la forêt tropicale",score:.1,description:"Destruction massive de la forêt tropicale, menaçant les habitats naturels."},{categorie:"Environment",composante:"Drainage des tourbières",score:.2,description:"Assèchement des tourbières, perturbant l'écosystème et augmentant les émissions de CO2."},{categorie:"Environment",composante:"Plantations d'eucalyptus et d'acacias",score:.3,description:"Établissement de monocultures avec impact négatif sur la biodiversité."},{categorie:"Economy",composante:"Création d'emplois temporaires",score:.4,description:"Offre d'emplois à court terme mais sans développement durable à long terme."},{categorie:"Economy",composante:"Production de matières premières pour le papier",score:.5,description:"Contribution économique par la production de papier, mais avec des pratiques non durables."},{categorie:"Wellbeing",composante:"Violation des droits des indigènes Dayak",score:.1,description:"Vol des terres et déplacement des communautés locales, affectant leur mode de vie."},{categorie:"Wellbeing",composante:"Impact sur la santé des travailleurs",score:.3,description:"Conditions de travail potentiellement dangereuses sans mesures de protection adéquates."},{categorie:"Peace",composante:"Conflits avec les communautés locales",score:.2,description:"Tensions et conflits dus au vol des terres et à la destruction des ressources naturelles."},{categorie:"Peace",composante:"Manque de transparence financière",score:.2,description:"Absence de divulgation des informations sur les dirigeants et les pratiques de l'entreprise."},{categorie:"Cooperation",composante:"Relations avec les organisations environnementales",score:.1,description:"Faibles collaborations avec les ONG, malgré les appels à l'action."},{categorie:"Cooperation",composante:"Engagement envers la chaîne d’approvisionnement sans déforestation",score:.3,description:"Déclaration d'engagement par RGE, mais non-respecté par PT Mayawana Persada."}]},441:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.initializeYinYangApp=void 0;var n=r(578),o=i(r(462)),a=r(317);function s(t){var e={modelDataEnemy:o.default,viewDataEnemy:t},r=new a.D3GraphicsStrategy;new n.YinYangAppFactory(r).create(e.modelDataEnemy,e.viewDataEnemy,!0)}e.initializeYinYangApp=s,document.addEventListener("DOMContentLoaded",(function(){try{var t=document.getElementById("svg-container");if(!t)throw new Error("#svg-container non trouvé");var e=t.clientWidth,r=t.clientHeight;s({minEdge:Math.min(e,r),containerId:"svg-container",borderAnimationDuration:15e3})}catch(t){console.error("An error occurred during initialization:",t)}}))},620:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.D3Animator=void 0;var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,(r=[{key:"applyColorAnimation",value:function(t,e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","animate");i.setAttribute("attributeName","stop-color"),i.setAttribute("values",r.join(";")),i.setAttribute("dur","".concat(e,"ms")),i.setAttribute("repeatCount","indefinite"),t.appendChild(i)}}])&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.D3Animator=o},601:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.D3Element=void 0;var o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.selection=e}var e,r;return e=t,r=[{key:"appendElement",value:function(e){return new t(this.selection.append(e))}},{key:"setStyle",value:function(t,e){return this.selection.style(t,e),this}},{key:"setAttribute",value:function(t,e){return this.selection.attr(t,e),this}},{key:"addEventListener",value:function(t,e){this.selection.on(t,e)}},{key:"getSelection",value:function(){return this.selection}},{key:"select",value:function(e){return new t(this.selection.select(e))}},{key:"node",value:function(){return this.selection.node()}},{key:"getDimensions",value:function(){var t=this.selection.node();if(t instanceof SVGSVGElement){var e=t.getBoundingClientRect();return{width:e.width,height:e.height}}return{width:0,height:0}}},{key:"interruptAllAnimation",value:function(){this.selection.interrupt().selectAll("*").interrupt()}},{key:"applyContinuousRotation",value:function(t,e,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.selection.transition().duration(t).attrTween("transform",(function(){return function(t){return"rotate(".concat(t*(i?360:-360),",").concat(e,",").concat(r,")")}}))}},{key:"applyTranslationAndRotationAltogether",value:function(t,e,r,i,n,o){this.selection.transition().duration(t).attrTween("transform",(function(){return function(t){var a=2*t*Math.PI*(n?1:-1),s=i*Math.sin(a),c=i-i*Math.cos(a),l=e+s,u=r+c,y="yang"===o?3:-1,p=180*a/Math.PI;return"rotate(".concat(y*p,", ").concat(l,", ").concat(u,") translate(").concat(s,", ").concat(c,")")}}))}}],r&&i(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.D3Element=o},317:function(t,e,r){function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function o(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,a(i.key),i)}}function a(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:String(e)}var s=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),c=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),l=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&s(e,t,r);return c(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.D3GraphicsStrategy=void 0;var u=l(r(893)),y=r(601),p=r(620),f=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.animator=new p.D3Animator,this.currentScale=1,this.currentY=0,this.currentX=0}var e,r;return e=t,r=[{key:"initialize",value:function(t,e){var r=u.select("#".concat(t)).append("svg").attr("width",e).attr("height",e);return this.defs=new y.D3Element(r.append("defs")),new y.D3Element(r)}},{key:"resizeGroup",value:function(t,e,r,i){t.setAttribute("transform","translate(".concat(r,", ").concat(i,") \n scale(").concat(e,") \n translate(").concat(-r,", ").concat(-i,") "))}},{key:"drawArc",value:function(t,e,r,i,n,o,a,s){var c=u.arc().innerRadius(i).outerRadius(n).startAngle(o).endAngle(a);t.appendElement("path").setAttribute("d",c).setAttribute("transform","translate(".concat(e,",").concat(r,")")).setStyle("fill",s)}},{key:"drawCircle",value:function(t,e,r,i,n){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;return t.appendElement("circle").setAttribute("cx",e.toString()).setAttribute("cy",r.toString()).setAttribute("r",i.toString()).setStyle("fill",n).setStyle("opacity",o.toString())}},{key:"createLinearGradient",value:function(t,e,r,i,n,o,a){var s=this.defs.appendElement("linearGradient").setAttribute("id",t).setAttribute("x1",e).setAttribute("y1",r).setAttribute("x2",i).setAttribute("y2",n).setAttribute("gradientUnits",a);return o.forEach((function(t){s.appendElement("stop").setAttribute("offset",t.offset).setAttribute("stop-color",t.color).setAttribute("stop-opacity",t.opacity.toString())})),s}},{key:"createArc",value:function(t,e,r,i){return u.arc().innerRadius(t).outerRadius(e).startAngle(r).endAngle(i)}},{key:"createYinOrYangArcMask",value:function(t,e,r,i,n,o,a,s){var c=Math.PI-o,l=Math.PI-a,u=this.createArc(i,n,"yang"===s?o:c,"yang"===s?a:l),y=this.defs.appendElement("mask").setAttribute("id",t);this.createLinearGradient("start","0%","0%","100%","0%",[{offset:"0%",color:"white",opacity:1},{offset:"100%",color:"white",opacity:0}],"objectBoundingBox"),this.createLinearGradient("end","0%","0%","100%","0%",[{offset:"0%",color:"white",opacity:0},{offset:"100%",color:"white",opacity:1}],"objectBoundingBox");var p=180+180*("yang"===s?o:c)/Math.PI,f=.1*n;y.appendElement("rect").setAttribute("x",(e-("yang"===s?0:f)).toString()).setAttribute("y",r.toString()).setAttribute("transform","rotate(".concat(p,",").concat(e,",").concat(r,")")).setAttribute("width",f.toString()).setAttribute("height",n.toString()).setAttribute("fill","yang"===s?"url(#start)":"url(#end)");var h=180+180*("yang"===s?a:l)/Math.PI;return y.appendElement("rect").setAttribute("x",(e-("yang"===s?f:0)).toString()).setAttribute("y",r.toString()).setAttribute("transform","rotate(".concat(h,",").concat(e,",").concat(r.toString(),")")).setAttribute("width",f.toString()).setAttribute("height",n.toString()).setAttribute("fill","yang"===s?"url(#end)":"url(#start)"),y.appendElement("path").setAttribute("d",u({})||"").setAttribute("transform","translate(".concat(e,", ").concat(r.toString(),")")).setAttribute("fill","white"),y}},{key:"createBorderMask",value:function(t,e,r,i,n){var o=this.createArc(i,n,0,2*Math.PI),a=this.defs.appendElement("mask").setAttribute("id",t),s=this.defs.appendElement("radialGradient").setAttribute("id","borderMaskGradient").setAttribute("cx","50%").setAttribute("cy","50%").setAttribute("r","50%"),c=i/n,l=100*c,u=l+100*(1-c)*.7;s.appendElement("stop").setAttribute("offset","".concat(l,"%")).setAttribute("stop-color","white").setAttribute("stop-opacity","1"),s.appendElement("stop").setAttribute("offset","".concat(u,"%")).setAttribute("stop-color","white").setAttribute("stop-opacity","0"),a.appendElement("path").setAttribute("d",o({})||"").setAttribute("transform","translate(".concat(e,", ").concat(r,")")).setAttribute("fill","url(#borderMaskGradient)")}},{key:"changeBorderColors",value:function(t,e,r){var i=e;r.push(r[0]),this.animator.applyColorAnimation(t.select("stop:first-child").node(),i,r);var o,a=(o=r,function(t){if(Array.isArray(t))return n(t)}(o)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(o)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(t){return void 0!==t}));a.length>0&&a.unshift(a.pop()),a.push(a[0]),this.animator.applyColorAnimation(t.select("stop:last-child").node(),i,a)}},{key:"drawLineWithGradient",value:function(t,e,r,i,n,o){t.appendElement("line").setAttribute("x1",e.toString()).setAttribute("y1",r.toString()).setAttribute("x2",i.toString()).setAttribute("y2",n.toString()).setStyle("stroke","url(#".concat(o,")"))}},{key:"createUnderlyingCircleGradient",value:function(t,e){var r=this.defs.appendElement("radialGradient").setAttribute("id",t).setAttribute("cx","50%").setAttribute("cy","50%").setAttribute("r","50%");r.appendElement("stop").setAttribute("offset","0%").setAttribute("stop-color",e).setAttribute("stop-opacity","1"),r.appendElement("stop").setAttribute("offset","100%").setAttribute("stop-color",e).setAttribute("stop-opacity","0")}},{key:"createUnderlyingCircleWithArcMask",value:function(t,e,r,i,n,o){this.drawCircle(r,i,n,o,"url(#".concat(e,")")).setAttribute("mask","url(#".concat(t,")"))}}],r&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.D3GraphicsStrategy=f},939:(t,e)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:String(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.GeometryUtils=void 0;var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r;return e=t,r=[{key:"calculateSpikeLength",value:function(t,e){return t*e*.5}},{key:"calculateSmallCircleRadius",value:function(t,e){return 2*Math.PI*t/e/2}}],null&&i(e.prototype,null),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.GeometryUtils=o},893:e=>{e.exports=t}},r={};return function t(i){var n=r[i];if(void 0!==n)return n.exports;var o=r[i]={exports:{}};return e[i].call(o.exports,o,o.exports,t),o.exports}(441)})()));
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@micheeeeel/yinyangapp",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A program to visualize human activity balance to reach Sustainable Development Objectives",
5
5
  "main": "dist/bundle.js",
6
6
  "types": "dist/types/script.d.ts",
7
+ "files": [
8
+ "dist/bundle.js",
9
+ "dist/types",
10
+ "README.md"
11
+ ],
7
12
  "scripts": {
8
13
  "test": "echo \"Error: no test specified\" && exit 1",
9
14
  "build": "tsc -p tsconfig.types.json && webpack --mode production",
@@ -28,9 +33,5 @@
28
33
  "webpack": "^5.90.3",
29
34
  "webpack-cli": "^5.1.4",
30
35
  "webpack-dev-server": "^5.0.4"
31
- },
32
- "files": [
33
- "dist",
34
- "README.md"
35
- ]
36
+ }
36
37
  }