From c940c388bd845691f19a41bcff6d0b1ae923d271 Mon Sep 17 00:00:00 2001 From: AnilJWagh <144349102+AnilJWagh@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:55:38 +0530 Subject: [PATCH] updated URLs and added new component correlation-metrics --- .storybook/mstar-apis-sdk.js | 20 +- src/assets/badge.svg | 3 + .../asset-allocation/doc-americas.mdx | 2 +- src/components/asset-allocation/doc-emea.mdx | 2 +- src/components/carbon-score/CarbonScore.vue | 82 + .../carbon-score/config/dataPoints.json | 14 + .../carbon-score/config/sampleData.json | 100 + .../carbon-score/doc-global-async.mdx | 1002 +++ .../correlation-matrix/CorrelationMatrix.vue | 314 + .../correlation-matrix/config/sampleData.json | 666 ++ .../correlation-matrix/doc-americas.mdx | 1565 +++++ .../correlation-matrix/doc-emea.mdx | 881 +++ src/components/esg-risk/EsgRisk.vue | 512 ++ .../assets/images/esg-environmental.svg | 17 + .../esg-risk/assets/images/esg-governance.svg | 14 + .../esg-risk/assets/images/esg-social.svg | 15 + .../assets/images/esg-unallocated.svg | 22 + src/components/esg-risk/config/mapping.json | 10 + .../esg-risk/config/sampleEsgData.json | 89 + src/components/esg-risk/doc-global-async.mdx | 1029 +++ src/components/fees-expenses/doc-americas.mdx | 2 +- src/components/fixed-income-country/doc.mdx | 8 +- .../fixed-income-sectors/doc-americas.mdx | 4 +- .../fixed-income-sectors/doc-emea.mdx | 10 +- .../performance-graph/PerformanceGraph.vue | 2 +- .../docs/doc-growth-chart-americas.mdx | 4 +- .../docs/doc-growth-chart-emea.mdx | 20 +- .../portfolio-holdings/PortfolioHoldings.vue | 129 +- .../portfolio-holdings/doc-americas.mdx | 2 +- .../portfolio-holdings/doc-emea.mdx | 10 +- src/components/portfolio-srri/doc.mdx | 8 +- .../product-involvement/doc-global-async.mdx | 902 +++ .../questionnaire/Questionnaire.vue | 265 + src/components/questionnaire/doc.mdx | 143 + .../questionnaire/questionairre.json | 237 + src/components/risk-score/RiskScore.vue | 444 +- src/components/risk-score/RiskScoreTable.vue | 302 + .../risk-score/config/sampleRiskScore.json | 26 +- src/components/risk-score/doc.mdx | 33 +- .../risk-score/styles/risk-score.scss | 321 + .../risk-score/styles/variables.scss | 31 + src/components/risk-statistics/doc.mdx | 2 +- src/components/screener/Screener.vue | 49 +- src/components/screener/components/Filter.vue | 10 +- .../screener/components/SecurityList.vue | 69 +- src/components/shared/async-api-template.js | 221 + src/components/shared/async-api-utility.js | 42 + .../shared/portfolio-analysis-helper.js | 89 +- src/components/shared/portfolio/Portfolio.vue | 9 +- .../shared/portfolio/config/mapping.json | 7 +- src/components/shared/scss/mixin.scss | 17 + src/components/stock-regions/StockRegions.vue | 2 +- src/components/stock-regions/doc-americas.mdx | 56 +- src/components/stock-regions/doc-emea.mdx | 22 +- src/components/stock-sectors/doc-americas.mdx | 2 +- src/components/stock-sectors/doc-emea.mdx | 10 +- src/components/stock-stats/doc-americas.mdx | 2 +- src/components/stock-stats/doc-emea.mdx | 14 +- .../trailing-returns/doc-americas.mdx | 2 +- src/components/trailing-returns/doc-emea.mdx | 16 +- src/components/xray/Xray.vue | 4 + .../xray/config/xray-intl-data.json | 657 +- src/components/xray/config/xray-us-data.json | 630 +- src/components/xray/doc-americas.mdx | 1443 ++-- src/components/xray/doc-emea.mdx | 1005 ++- src/external-links.js | 16 +- src/main.js | 1 - src/plugins/vuetify.js | 2 +- src/sass/style.scss | 14 +- src/stories/CarbonScore.stories.js | 32 + src/stories/CorrelationMatrix.stories.js | 74 + src/stories/EsgRisk.stories.js | 32 + src/stories/Mifid.stories.js | 264 + src/stories/PortfolioSrri.stories.js | 4 +- src/stories/ProductInvolvement.stories.js | 89 +- src/stories/Questionnaire.stories.js | 32 + src/stories/RiskScore.stories.js | 5 +- src/stories/Xray.stories.js | 11 +- src/stories/docs/Introduction.stories.mdx | 511 +- src/stories/stories-helper.js | 469 +- .../Mifid/assetAllocationMappingEmea.json | 79 + src/workflow/Mifid/doc.mdx | 3588 ++++++++++ src/workflow/Mifid/fieldDefFeesExpenses.json | 47 + ...portfolio-holdings-field-defs-mifidii.json | 31 + src/workflow/Mifid/questionairre.json | 237 + .../Mifid/sampleFilterDataResponse.json | 2934 ++++++++ .../Mifid/sampleSecurityListDataResponse.json | 354 + src/workflow/Mifid/screenerDef.json | 69 + src/workflow/Mifid/xray-intl-data.json | 6081 +++++++++++++++++ tests/unit/carbon-score.spec.js | 20 + tests/unit/correlation-matrix.spec.js | 20 + tests/unit/esg-risk.spec.js | 20 + tests/unit/portfolio-holdings.spec.js | 2 + tests/unit/questionnaire.spec.js | 20 + tests/unit/risk-score.spec.js | 2 +- 95 files changed, 26380 insertions(+), 2322 deletions(-) create mode 100644 src/assets/badge.svg create mode 100644 src/components/carbon-score/CarbonScore.vue create mode 100644 src/components/carbon-score/config/dataPoints.json create mode 100644 src/components/carbon-score/config/sampleData.json create mode 100644 src/components/carbon-score/doc-global-async.mdx create mode 100644 src/components/correlation-matrix/CorrelationMatrix.vue create mode 100644 src/components/correlation-matrix/config/sampleData.json create mode 100644 src/components/correlation-matrix/doc-americas.mdx create mode 100644 src/components/correlation-matrix/doc-emea.mdx create mode 100644 src/components/esg-risk/EsgRisk.vue create mode 100644 src/components/esg-risk/assets/images/esg-environmental.svg create mode 100644 src/components/esg-risk/assets/images/esg-governance.svg create mode 100644 src/components/esg-risk/assets/images/esg-social.svg create mode 100644 src/components/esg-risk/assets/images/esg-unallocated.svg create mode 100644 src/components/esg-risk/config/mapping.json create mode 100644 src/components/esg-risk/config/sampleEsgData.json create mode 100644 src/components/esg-risk/doc-global-async.mdx create mode 100644 src/components/product-involvement/doc-global-async.mdx create mode 100644 src/components/questionnaire/Questionnaire.vue create mode 100644 src/components/questionnaire/doc.mdx create mode 100644 src/components/questionnaire/questionairre.json create mode 100644 src/components/risk-score/RiskScoreTable.vue create mode 100644 src/components/risk-score/styles/risk-score.scss create mode 100644 src/components/risk-score/styles/variables.scss create mode 100644 src/components/shared/async-api-template.js create mode 100644 src/components/shared/async-api-utility.js create mode 100644 src/stories/CarbonScore.stories.js create mode 100644 src/stories/CorrelationMatrix.stories.js create mode 100644 src/stories/EsgRisk.stories.js create mode 100644 src/stories/Mifid.stories.js create mode 100644 src/stories/Questionnaire.stories.js create mode 100644 src/workflow/Mifid/assetAllocationMappingEmea.json create mode 100644 src/workflow/Mifid/doc.mdx create mode 100644 src/workflow/Mifid/fieldDefFeesExpenses.json create mode 100644 src/workflow/Mifid/portfolio-holdings-field-defs-mifidii.json create mode 100644 src/workflow/Mifid/questionairre.json create mode 100644 src/workflow/Mifid/sampleFilterDataResponse.json create mode 100644 src/workflow/Mifid/sampleSecurityListDataResponse.json create mode 100644 src/workflow/Mifid/screenerDef.json create mode 100644 src/workflow/Mifid/xray-intl-data.json create mode 100644 tests/unit/carbon-score.spec.js create mode 100644 tests/unit/correlation-matrix.spec.js create mode 100644 tests/unit/esg-risk.spec.js create mode 100644 tests/unit/questionnaire.spec.js diff --git a/.storybook/mstar-apis-sdk.js b/.storybook/mstar-apis-sdk.js index 194cbab..af608f1 100644 --- a/.storybook/mstar-apis-sdk.js +++ b/.storybook/mstar-apis-sdk.js @@ -1,10 +1,10 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["mstar-apis-sdk"]=e():t.MstarApisSdk=e()}(window,(function(){return e=[function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var 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};function i(t,e){for(var n=0;n - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(){var o,u,a,c,s="Expected a function",f="__lodash_hash_undefined__",l="__lodash_placeholder__",p=9007199254740991,h=4294967295,g=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d="[object Arguments]",y="[object Array]",v="[object Boolean]",_="[object Date]",m="[object Error]",w="[object Function]",b="[object GeneratorFunction]",I="[object Map]",S="[object Number]",k="[object Object]",P="[object Promise]",A="[object RegExp]",O="[object Set]",R="[object String]",j="[object Symbol]",T="[object WeakMap]",x="[object ArrayBuffer]",E="[object DataView]",M="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",U="[object Int16Array]",N="[object Int32Array]",F="[object Uint8Array]",q="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",W=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,$=RegExp(J.source),X=RegExp(V.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,st=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",It="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\ufe0e\\ufe0f",kt="["+bt+"]",Pt="["+(xt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000")+"]",At="["+It+"]",Ot="["+(u="\\u2700-\\u27bf")+"]",Rt="["+(Gt="a-z\\xdf-\\xf6\\xf8-\\xff")+"]",jt="\\u200d",Tt="(?:"+Rt+"|"+(xt="[^"+bt+xt+"\\d+"+u+Gt+(a="A-Z\\xc0-\\xd6\\xd8-\\xde")+"]")+")",xt="(?:"+(a="["+a+"]")+"|"+xt+")",Et="(?:['’](?:d|ll|m|re|s|t|ve))?",Mt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Dt=(Dt="["+St+"]?")+(Ct="(?:"+At+"|"+(u="\\ud83c[\\udffb-\\udfff]")+")?")+"(?:\\u200d(?:"+[Gt="[^"+bt+"]",Yt="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]"].join("|")+")"+Dt+Ct+")*",Ct="(?:"+[Ot,Yt,c].join("|")+")"+Dt,Ut=(Ot="(?:"+[Gt+At+"?",At,Yt,c,kt].join("|")+")",RegExp("['’]","g")),Nt=RegExp(At,"g"),Ft=RegExp(u+"(?="+u+")|"+Ot+Dt,"g"),qt=RegExp([a+"?"+Rt+"+"+Et+"(?="+[Pt,a,"$"].join("|")+")",xt+"+"+Mt+"(?="+[Pt,a+Tt,"$"].join("|")+")",a+"?"+Tt+"+"+Et,a+"+"+Mt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Ct].join("|"),"g"),zt=RegExp("["+jt+bt+It+St+"]"),Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Lt=-1,Ht={},Jt=(Ht[M]=Ht[D]=Ht[C]=Ht[U]=Ht[N]=Ht[F]=Ht[q]=Ht[z]=Ht[B]=!0,Ht[d]=Ht[y]=Ht[x]=Ht[v]=Ht[E]=Ht[_]=Ht[m]=Ht[w]=Ht[I]=Ht[S]=Ht[k]=Ht[A]=Ht[O]=Ht[R]=Ht[T]=!1,{}),Vt=(Jt[d]=Jt[y]=Jt[x]=Jt[E]=Jt[v]=Jt[_]=Jt[M]=Jt[D]=Jt[C]=Jt[U]=Jt[N]=Jt[I]=Jt[S]=Jt[k]=Jt[A]=Jt[O]=Jt[R]=Jt[j]=Jt[F]=Jt[q]=Jt[z]=Jt[B]=!0,Jt[m]=Jt[w]=Jt[T]=!1,{"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"}),$t=parseFloat,Xt=parseInt,Gt="object"==typeof t&&t&&t.Object===Object&&t,Yt="object"==typeof self&&self&&self.Object===Object&&self,Zt=Gt||Yt||Function("return this")(),Kt=(c=e&&!e.nodeType&&e)&&"object"==typeof r&&r&&!r.nodeType&&r,Qt=Kt&&Kt.exports===c,te=Qt&&Gt.process,ee=(kt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||te&&te.binding&&te.binding("util")}catch(t){}}())&&kt.isArrayBuffer,ne=kt&&kt.isDate,re=kt&&kt.isMap,ie=kt&&kt.isRegExp,oe=kt&&kt.isSet,ue=kt&&kt.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ce(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i":">",'"':""","'":"'"});function ze(t){return"\\"+Vt[t]}function Be(t){return zt.test(t)}function We(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Le(t,e){return function(n){return t(e(n))}}function He(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"}),Ye=function t(e){var n=(e=null==e?Zt:Ye.defaults(Zt.Object(),e,Ye.pick(Zt,Wt))).Array,r=e.Date,i=e.Error,u=e.Function,a=e.Math,c=e.Object,it=e.RegExp,bt=e.String,It=e.TypeError,St=n.prototype,kt=u.prototype,Pt=c.prototype,At=e["__core-js_shared__"],Ot=kt.toString,Rt=Pt.hasOwnProperty,jt=0,Tt=(kt=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+kt:"",xt=Pt.toString,Et=Ot.call(c),Mt=Zt._,Dt=it("^"+Ot.call(Rt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ct=(kt=Qt?e.Buffer:o,e.Symbol),Ft=e.Uint8Array,zt=kt?kt.allocUnsafe:o,Vt=Le(c.getPrototypeOf,c),Gt=c.create,Yt=Pt.propertyIsEnumerable,Kt=St.splice,te=Ct?Ct.isConcatSpreadable:o,we=Ct?Ct.iterator:o,Re=Ct?Ct.toStringTag:o,Ze=function(){try{var t=Zi(c,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ke=e.clearTimeout!==Zt.clearTimeout&&e.clearTimeout,Qe=r&&r.now!==Zt.Date.now&&r.now,tn=e.setTimeout!==Zt.setTimeout&&e.setTimeout,en=a.ceil,nn=a.floor,rn=c.getOwnPropertySymbols,on=(kt=kt?kt.isBuffer:o,e.isFinite),un=St.join,an=Le(c.keys,c),cn=a.max,sn=a.min,fn=r.now,ln=e.parseInt,pn=a.random,hn=St.reverse,gn=(r=Zi(e,"DataView"),Zi(e,"Map")),dn=Zi(e,"Promise"),yn=Zi(e,"Set"),vn=(e=Zi(e,"WeakMap"),Zi(c,"create")),_n=e&&new e,mn={},wn=Po(r),bn=Po(gn),In=Po(dn),Sn=Po(yn),kn=Po(e),Pn=(Ct=Ct?Ct.prototype:o)?Ct.valueOf:o,An=Ct?Ct.toString:o;function On(t){if(Eu(t)&&!Iu(t)&&!(t instanceof En)){if(t instanceof xn)return t;if(Rt.call(t,"__wrapped__"))return Ao(t)}return new xn(t)}var Rn=function(t){return xu(t)?Gt?Gt(t):(jn.prototype=t,t=new jn,jn.prototype=o,t):{}};function jn(){}function Tn(){}function xn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function En(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Mn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e>>0,e>>>=0,n(o));++i>>1,u=t[o];null!==u&&!qu(u)&&(n?u<=e:u>>0)?(t=Gu(t))&&("string"==typeof e||null!=e&&!Uu(e))&&!(e=Gr(e))&&Be(t)?ai($e(t),0,n):t.split(e,n):[]},On.spread=function(t,e){if("function"!=typeof t)throw new It(s);return e=null==e?0:cn(Ju(e),0),Nr((function(n){var r=n[e];n=ai(n,0,e);return r&&ye(n,r),ae(t,this,n)}))},On.tail=function(t){var e=null==t?0:t.length;return e?Lr(t,1,e):[]},On.take=function(t,e,n){return t&&t.length?Lr(t,0,(e=n||e===o?1:Ju(e))<0?0:e):[]},On.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Lr(t,(e=r-(e=n||e===o?1:Ju(e)))<0?0:e,r):[]},On.takeRightWhile=function(t,e){return t&&t.length?Qr(t,Xi(e,3),!1,!0):[]},On.takeWhile=function(t,e){return t&&t.length?Qr(t,Xi(e,3)):[]},On.tap=function(t,e){return e(t),t},On.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new It(s);return xu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),lu(t,e,{leading:r,maxWait:e,trailing:i})},On.thru=$o,On.toArray=Lu,On.toPairs=da,On.toPairsIn=ya,On.toPath=function(t){return Iu(t)?de(t,ko):qu(t)?[t]:di(So(Gu(t)))},On.toPlainObject=Xu,On.transform=function(t,e,n){var r,i=Iu(t),o=i||Au(t)||zu(t);return e=Xi(e,4),null==n&&(r=t&&t.constructor,n=o?i?new r:[]:xu(t)&&Ru(r)?Rn(Vt(t)):{}),(o?se:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},On.unary=function(t){return au(t,1)},On.union=Co,On.unionBy=Uo,On.unionWith=No,On.uniq=function(t){return t&&t.length?Yr(t):[]},On.uniqBy=function(t,e){return t&&t.length?Yr(t,Xi(e,2)):[]},On.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Yr(t,o,e):[]},On.unset=function(t,e){return null==t||Zr(t,e)},On.unzip=Fo,On.unzipWith=qo,On.update=function(t,e,n){return null==t?t:Kr(t,e,ii(n))},On.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Kr(t,e,ii(n),r)},On.values=va,On.valuesIn=function(t){return null==t?[]:De(t,sa(t))},On.without=zo,On.words=Ra,On.wrap=function(t,e){return du(ii(e),t)},On.xor=Bo,On.xorBy=Wo,On.xorWith=Lo,On.zip=Ho,On.zipObject=function(t,e){return ni(t||[],e||[],Ln)},On.zipObjectDeep=function(t,e){return ni(t||[],e||[],zr)},On.zipWith=Jo,On.entries=da,On.entriesIn=ya,On.extend=Zu,On.extendWith=Ku,Fa(On,On),On.add=Ga,On.attempt=ja,On.camelCase=_a,On.capitalize=ma,On.ceil=Ya,On.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=$u(n))==n?n:0),e!==o&&(e=(e=$u(e))==e?e:0),Gn($u(t),e,n)},On.clone=function(t){return Yn(t,4)},On.cloneDeep=function(t){return Yn(t,5)},On.cloneDeepWith=function(t,e){return Yn(t,5,e="function"==typeof e?e:o)},On.cloneWith=function(t,e){return Yn(t,4,e="function"==typeof e?e:o)},On.conformsTo=function(t,e){return null==e||Zn(t,e,ca(e))},On.deburr=wa,On.defaultTo=function(t,e){return null==t||t!=t?e:t},On.divide=Za,On.endsWith=function(t,e,n){t=Gu(t),e=Gr(e);var r=t.length;r=n=n===o?r:Gn(Ju(n),0,r);return 0<=(n-=e.length)&&t.slice(n,r)==e},On.eq=_u,On.escape=function(t){return(t=Gu(t))&&X.test(t)?t.replace(V,qe):t},On.escapeRegExp=function(t){return(t=Gu(t))&&nt.test(t)?t.replace(et,"\\$&"):t},On.every=function(t,e,n){return(Iu(t)?le:nr)(t,Xi(e=n&&oo(t,e,n)?o:e,3))},On.find=Yo,On.findIndex=Oo,On.findKey=function(t,e){return be(t,Xi(e,3),cr)},On.findLast=Zo,On.findLastIndex=Ro,On.findLastKey=function(t,e){return be(t,Xi(e,3),sr)},On.floor=Ka,On.forEach=Ko,On.forEachRight=Qo,On.forIn=function(t,e){return null==t?t:ur(t,Xi(e,3),sa)},On.forInRight=function(t,e){return null==t?t:ar(t,Xi(e,3),sa)},On.forOwn=function(t,e){return t&&cr(t,Xi(e,3))},On.forOwnRight=function(t,e){return t&&sr(t,Xi(e,3))},On.get=ra,On.gt=mu,On.gte=wu,On.has=function(t,e){return null!=t&&eo(t,e,dr)},On.hasIn=ia,On.head=To,On.identity=Da,On.includes=function(t,e,n,r){return t=ku(t)?t:va(t),n=n&&!r?Ju(n):0,r=t.length,n<0&&(n=cn(r+n,0)),Fu(t)?n<=r&&-1=sn(e=e,n=n)&&t=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},On.prototype.plant=function(t){for(var e,n=this;n instanceof Tn;){var r=Ao(n),i=(r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r,r);n=n.__wrapped__}return i.__wrapped__=t,e},On.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof En?(t=t,(t=(t=this.__actions__.length?new En(this):t).reverse()).__actions__.push({func:$o,args:[Do],thisArg:o}),new xn(t,this.__chain__)):this.thru(Do)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,we&&(On.prototype[we]=function(){return this}),On}();Zt._=Ye,(i=function(){return Ye}.call(e,n,e,r))!==o&&(r.exports=i)}).call(this)}).call(this,n(4),n(5)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var r=n(1);function i(t,e){if(e instanceof Array)return e}e.merge=function(){for(var t=arguments.length,e=Array(t),n=0;nDate.now()}catch(t){return!1}}});Object.defineProperties(this,{abort:{value:function(t){return b.abort.call(e,t)},writable:!0},fetch:{value:function(){return b.send.call(e,0>>24&255,i[r++]=s>>>16&255,i[r++]=s>>>8&255,i[r++]=255&s,t=a/4294967296*1e4&268435455,i[r++]=t>>>8&255,i[r++]=255&t,i[r++]=t>>>24&15|16,i[r++]=t>>>16&255,i[r++]=n>>>8|128,i[r++]=255&n;for(var d=0;d<6;++d)i[r+d]=u[d];return e||p(i)},y=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};function v(t,e,n){function r(t,r,i,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n>>9<<4)+1}function m(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function w(t,e,n,r,i,o){return m((e=m(m(e,t),m(r,o)))<>>32-i,n)}function b(t,e,n,r,i,o,u){return w(e&n|~e&r,t,e,i,o,u)}function I(t,e,n,r,i,o,u){return w(e&r|n&~r,t,e,i,o,u)}function S(t,e,n,r,i,o,u){return w(e^n^r,t,e,i,o,u)}function k(t,e,n,r,i,o,u){return w(n^(e|~r),t,e,i,o,u)}var P=v("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n>5]|=128<>5]|=(255&t[r/8])<>5]>>>a%32&255;c=parseInt(u.charAt(c>>>4&15)+u.charAt(15&c),16);i.push(c)}return i})),A=function(t,e,n){var r=(t=t||{}).random||(t.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return p(r)};function O(t,e){return t<>>32-e}var R=v("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i>>0,m=_,_=v,v=O(y,30)>>>0,y=d,d=b}n[0]=n[0]+d>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+v>>>0,n[3]=n[3]+_>>>0,n[4]=n[4]+m>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),j="00000000-0000-0000-0000-000000000000",T=function(t){if(a(t))return parseInt(t.substr(14,1),16);throw TypeError("Invalid UUID")}},,function(t,e,n){t.exports=n(22)},function(t,e,n){"use strict";((n=n=n(3))&&n.__esModule?n:{default:n}).default.initialize()}],n={},t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=21);function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e,n})); - //# sourceMappingURL=mstar-apis-sdk.js.map \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["mstar-apis-sdk"]=e():t.MstarApisSdk=e()}(window,(function(){return e=[function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var 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};function i(t,e){for(var n=0;n + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var o,u,a,c,s="Expected a function",l="__lodash_hash_undefined__",f="__lodash_placeholder__",p=9007199254740991,h=4294967295,g=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d="[object Arguments]",y="[object Array]",v="[object Boolean]",_="[object Date]",m="[object Error]",w="[object Function]",b="[object GeneratorFunction]",I="[object Map]",S="[object Number]",P="[object Object]",k="[object Promise]",A="[object RegExp]",R="[object Set]",O="[object String]",j="[object Symbol]",T="[object WeakMap]",M="[object ArrayBuffer]",x="[object DataView]",E="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",U="[object Int16Array]",N="[object Int32Array]",F="[object Uint8Array]",z="[object Uint8ClampedArray]",q="[object Uint16Array]",B="[object Uint32Array]",W=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,V=/[&<>"']/g,X=RegExp(J.source),$=RegExp(V.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ct=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,st=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,dt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,_t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",It="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",St="\\ufe0e\\ufe0f",Pt="["+bt+"]",kt="["+(Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000")+"]",At="["+It+"]",Rt="["+(u="\\u2700-\\u27bf")+"]",Ot="["+(Gt="a-z\\xdf-\\xf6\\xf8-\\xff")+"]",jt="\\u200d",Tt="(?:"+Ot+"|"+(Mt="[^"+bt+Mt+"\\d+"+u+Gt+(a="A-Z\\xc0-\\xd6\\xd8-\\xde")+"]")+")",Mt="(?:"+(a="["+a+"]")+"|"+Mt+")",xt="(?:['’](?:d|ll|m|re|s|t|ve))?",Et="(?:['’](?:D|LL|M|RE|S|T|VE))?",Dt=(Dt="["+St+"]?")+(Ct="(?:"+At+"|"+(u="\\ud83c[\\udffb-\\udfff]")+")?")+"(?:\\u200d(?:"+[Gt="[^"+bt+"]",Yt="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]"].join("|")+")"+Dt+Ct+")*",Ct="(?:"+[Rt,Yt,c].join("|")+")"+Dt,Ut=(Rt="(?:"+[Gt+At+"?",At,Yt,c,Pt].join("|")+")",RegExp("['’]","g")),Nt=RegExp(At,"g"),Ft=RegExp(u+"(?="+u+")|"+Rt+Dt,"g"),zt=RegExp([a+"?"+Ot+"+"+xt+"(?="+[kt,a,"$"].join("|")+")",Mt+"+"+Et+"(?="+[kt,a+Tt,"$"].join("|")+")",a+"?"+Tt+"+"+xt,a+"+"+Et,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",Ct].join("|"),"g"),qt=RegExp("["+jt+bt+It+St+"]"),Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Lt=-1,Ht={},Jt=(Ht[E]=Ht[D]=Ht[C]=Ht[U]=Ht[N]=Ht[F]=Ht[z]=Ht[q]=Ht[B]=!0,Ht[d]=Ht[y]=Ht[M]=Ht[v]=Ht[x]=Ht[_]=Ht[m]=Ht[w]=Ht[I]=Ht[S]=Ht[P]=Ht[A]=Ht[R]=Ht[O]=Ht[T]=!1,{}),Vt=(Jt[d]=Jt[y]=Jt[M]=Jt[x]=Jt[v]=Jt[_]=Jt[E]=Jt[D]=Jt[C]=Jt[U]=Jt[N]=Jt[I]=Jt[S]=Jt[P]=Jt[A]=Jt[R]=Jt[O]=Jt[j]=Jt[F]=Jt[z]=Jt[q]=Jt[B]=!0,Jt[m]=Jt[w]=Jt[T]=!1,{"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"}),Xt=parseFloat,$t=parseInt,Gt="object"==typeof t&&t&&t.Object===Object&&t,Yt="object"==typeof self&&self&&self.Object===Object&&self,Zt=Gt||Yt||Function("return this")(),Kt=(c=e&&!e.nodeType&&e)&&"object"==typeof r&&r&&!r.nodeType&&r,Qt=Kt&&Kt.exports===c,te=Qt&&Gt.process,ee=(Pt=function(){try{var t=Kt&&Kt.require&&Kt.require("util").types;return t||te&&te.binding&&te.binding("util")}catch(t){}}())&&Pt.isArrayBuffer,ne=Pt&&Pt.isDate,re=Pt&&Pt.isMap,ie=Pt&&Pt.isRegExp,oe=Pt&&Pt.isSet,ue=Pt&&Pt.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ce(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i":">",'"':""","'":"'"});function qe(t){return"\\"+Vt[t]}function Be(t){return qt.test(t)}function We(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Le(t,e){return function(n){return t(e(n))}}function He(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"}),Ye=function t(e){var n=(e=null==e?Zt:Ye.defaults(Zt.Object(),e,Ye.pick(Zt,Wt))).Array,r=e.Date,i=e.Error,u=e.Function,a=e.Math,c=e.Object,it=e.RegExp,bt=e.String,It=e.TypeError,St=n.prototype,Pt=u.prototype,kt=c.prototype,At=e["__core-js_shared__"],Rt=Pt.toString,Ot=kt.hasOwnProperty,jt=0,Tt=(Pt=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+Pt:"",Mt=kt.toString,xt=Rt.call(c),Et=Zt._,Dt=it("^"+Rt.call(Ot).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ct=(Pt=Qt?e.Buffer:o,e.Symbol),Ft=e.Uint8Array,qt=Pt?Pt.allocUnsafe:o,Vt=Le(c.getPrototypeOf,c),Gt=c.create,Yt=kt.propertyIsEnumerable,Kt=St.splice,te=Ct?Ct.isConcatSpreadable:o,we=Ct?Ct.iterator:o,Oe=Ct?Ct.toStringTag:o,Ze=function(){try{var t=Zi(c,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ke=e.clearTimeout!==Zt.clearTimeout&&e.clearTimeout,Qe=r&&r.now!==Zt.Date.now&&r.now,tn=e.setTimeout!==Zt.setTimeout&&e.setTimeout,en=a.ceil,nn=a.floor,rn=c.getOwnPropertySymbols,on=(Pt=Pt?Pt.isBuffer:o,e.isFinite),un=St.join,an=Le(c.keys,c),cn=a.max,sn=a.min,ln=r.now,fn=e.parseInt,pn=a.random,hn=St.reverse,gn=(r=Zi(e,"DataView"),Zi(e,"Map")),dn=Zi(e,"Promise"),yn=Zi(e,"Set"),vn=(e=Zi(e,"WeakMap"),Zi(c,"create")),_n=e&&new e,mn={},wn=ko(r),bn=ko(gn),In=ko(dn),Sn=ko(yn),Pn=ko(e),kn=(Ct=Ct?Ct.prototype:o)?Ct.valueOf:o,An=Ct?Ct.toString:o;function Rn(t){if(xu(t)&&!Iu(t)&&!(t instanceof xn)){if(t instanceof Mn)return t;if(Ot.call(t,"__wrapped__"))return Ao(t)}return new Mn(t)}var On=function(t){return Mu(t)?Gt?Gt(t):(jn.prototype=t,t=new jn,jn.prototype=o,t):{}};function jn(){}function Tn(){}function Mn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function xn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function En(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e>>0,e>>>=0,n(o));++i>>1,u=t[o];null!==u&&!zu(u)&&(n?u<=e:u>>0)?(t=Gu(t))&&("string"==typeof e||null!=e&&!Uu(e))&&!(e=Gr(e))&&Be(t)?ai(Xe(t),0,n):t.split(e,n):[]},Rn.spread=function(t,e){if("function"!=typeof t)throw new It(s);return e=null==e?0:cn(Ju(e),0),Nr((function(n){var r=n[e];n=ai(n,0,e);return r&&ye(n,r),ae(t,this,n)}))},Rn.tail=function(t){var e=null==t?0:t.length;return e?Lr(t,1,e):[]},Rn.take=function(t,e,n){return t&&t.length?Lr(t,0,(e=n||e===o?1:Ju(e))<0?0:e):[]},Rn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Lr(t,(e=r-(e=n||e===o?1:Ju(e)))<0?0:e,r):[]},Rn.takeRightWhile=function(t,e){return t&&t.length?Qr(t,$i(e,3),!1,!0):[]},Rn.takeWhile=function(t,e){return t&&t.length?Qr(t,$i(e,3)):[]},Rn.tap=function(t,e){return e(t),t},Rn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new It(s);return Mu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),fu(t,e,{leading:r,maxWait:e,trailing:i})},Rn.thru=Xo,Rn.toArray=Lu,Rn.toPairs=da,Rn.toPairsIn=ya,Rn.toPath=function(t){return Iu(t)?de(t,Po):zu(t)?[t]:di(So(Gu(t)))},Rn.toPlainObject=$u,Rn.transform=function(t,e,n){var r,i=Iu(t),o=i||Au(t)||qu(t);return e=$i(e,4),null==n&&(r=t&&t.constructor,n=o?i?new r:[]:Mu(t)&&Ou(r)?On(Vt(t)):{}),(o?se:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Rn.unary=function(t){return au(t,1)},Rn.union=Co,Rn.unionBy=Uo,Rn.unionWith=No,Rn.uniq=function(t){return t&&t.length?Yr(t):[]},Rn.uniqBy=function(t,e){return t&&t.length?Yr(t,$i(e,2)):[]},Rn.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Yr(t,o,e):[]},Rn.unset=function(t,e){return null==t||Zr(t,e)},Rn.unzip=Fo,Rn.unzipWith=zo,Rn.update=function(t,e,n){return null==t?t:Kr(t,e,ii(n))},Rn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Kr(t,e,ii(n),r)},Rn.values=va,Rn.valuesIn=function(t){return null==t?[]:De(t,sa(t))},Rn.without=qo,Rn.words=Oa,Rn.wrap=function(t,e){return du(ii(e),t)},Rn.xor=Bo,Rn.xorBy=Wo,Rn.xorWith=Lo,Rn.zip=Ho,Rn.zipObject=function(t,e){return ni(t||[],e||[],Ln)},Rn.zipObjectDeep=function(t,e){return ni(t||[],e||[],qr)},Rn.zipWith=Jo,Rn.entries=da,Rn.entriesIn=ya,Rn.extend=Zu,Rn.extendWith=Ku,Fa(Rn,Rn),Rn.add=Ga,Rn.attempt=ja,Rn.camelCase=_a,Rn.capitalize=ma,Rn.ceil=Ya,Rn.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=Xu(n))==n?n:0),e!==o&&(e=(e=Xu(e))==e?e:0),Gn(Xu(t),e,n)},Rn.clone=function(t){return Yn(t,4)},Rn.cloneDeep=function(t){return Yn(t,5)},Rn.cloneDeepWith=function(t,e){return Yn(t,5,e="function"==typeof e?e:o)},Rn.cloneWith=function(t,e){return Yn(t,4,e="function"==typeof e?e:o)},Rn.conformsTo=function(t,e){return null==e||Zn(t,e,ca(e))},Rn.deburr=wa,Rn.defaultTo=function(t,e){return null==t||t!=t?e:t},Rn.divide=Za,Rn.endsWith=function(t,e,n){t=Gu(t),e=Gr(e);var r=t.length;r=n=n===o?r:Gn(Ju(n),0,r);return 0<=(n-=e.length)&&t.slice(n,r)==e},Rn.eq=_u,Rn.escape=function(t){return(t=Gu(t))&&$.test(t)?t.replace(V,ze):t},Rn.escapeRegExp=function(t){return(t=Gu(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Rn.every=function(t,e,n){return(Iu(t)?fe:nr)(t,$i(e=n&&oo(t,e,n)?o:e,3))},Rn.find=Yo,Rn.findIndex=Ro,Rn.findKey=function(t,e){return be(t,$i(e,3),cr)},Rn.findLast=Zo,Rn.findLastIndex=Oo,Rn.findLastKey=function(t,e){return be(t,$i(e,3),sr)},Rn.floor=Ka,Rn.forEach=Ko,Rn.forEachRight=Qo,Rn.forIn=function(t,e){return null==t?t:ur(t,$i(e,3),sa)},Rn.forInRight=function(t,e){return null==t?t:ar(t,$i(e,3),sa)},Rn.forOwn=function(t,e){return t&&cr(t,$i(e,3))},Rn.forOwnRight=function(t,e){return t&&sr(t,$i(e,3))},Rn.get=ra,Rn.gt=mu,Rn.gte=wu,Rn.has=function(t,e){return null!=t&&eo(t,e,dr)},Rn.hasIn=ia,Rn.head=To,Rn.identity=Da,Rn.includes=function(t,e,n,r){return t=Pu(t)?t:va(t),n=n&&!r?Ju(n):0,r=t.length,n<0&&(n=cn(r+n,0)),Fu(t)?n<=r&&-1=sn(e=e,n=n)&&t=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Rn.prototype.plant=function(t){for(var e,n=this;n instanceof Tn;){var r=Ao(n),i=(r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r,r);n=n.__wrapped__}return i.__wrapped__=t,e},Rn.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof xn?(t=t,(t=(t=this.__actions__.length?new xn(this):t).reverse()).__actions__.push({func:Xo,args:[Do],thisArg:o}),new Mn(t,this.__chain__)):this.thru(Do)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,we&&(Rn.prototype[we]=function(){return this}),Rn}();Zt._=Ye,(i=function(){return Ye}.call(e,n,e,r))!==o&&(r.exports=i)}).call(this)}).call(this,n(4),n(5)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;var r=n(1);function i(t,e){if(e instanceof Array)return e}e.merge=function(){for(var t=arguments.length,e=Array(t),n=0;nDate.now()}catch(t){return!1}}});Object.defineProperties(this,{abort:{value:function(t){return b.abort.call(e,t)},writable:!0},fetch:{value:function(){return b.send.call(e,0>>24&255,i[r++]=s>>>16&255,i[r++]=s>>>8&255,i[r++]=255&s,t=a/4294967296*1e4&268435455,i[r++]=t>>>8&255,i[r++]=255&t,i[r++]=t>>>24&15|16,i[r++]=t>>>16&255,i[r++]=n>>>8|128,i[r++]=255&n;for(var d=0;d<6;++d)i[r+d]=u[d];return e||p(i)},y=function(t){if(!a(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n};function v(t,e,n){function r(t,r,i,o){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n>>9<<4)+1}function m(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function w(t,e,n,r,i,o){return m((e=m(m(e,t),m(r,o)))<>>32-i,n)}function b(t,e,n,r,i,o,u){return w(e&n|~e&r,t,e,i,o,u)}function I(t,e,n,r,i,o,u){return w(e&r|n&~r,t,e,i,o,u)}function S(t,e,n,r,i,o,u){return w(e^n^r,t,e,i,o,u)}function P(t,e,n,r,i,o,u){return w(n^(e|~r),t,e,i,o,u)}var k=v("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n>5]|=128<>5]|=(255&t[r/8])<>5]>>>a%32&255;c=parseInt(u.charAt(c>>>4&15)+u.charAt(15&c),16);i.push(c)}return i})),A=function(t,e,n){var r=(t=t||{}).random||(t.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return p(r)};function R(t,e){return t<>>32-e}var O=v("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i>>0,m=_,_=v,v=R(y,30)>>>0,y=d,d=b}n[0]=n[0]+d>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+v>>>0,n[3]=n[3]+_>>>0,n[4]=n[4]+m>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]})),j="00000000-0000-0000-0000-000000000000",T=function(t){if(a(t))return parseInt(t.substr(14,1),16);throw TypeError("Invalid UUID")}},,function(t,e,n){t.exports=n(22)},function(t,e,n){"use strict";((n=n=n(3))&&n.__esModule?n:{default:n}).default.initialize()}],n={},t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(r,i,function(t){return e[t]}.bind(null,i));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=21);function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e,n})); +//# sourceMappingURL=mstar-apis-sdk.js.map \ No newline at end of file diff --git a/src/assets/badge.svg b/src/assets/badge.svg new file mode 100644 index 0000000..ca6aae0 --- /dev/null +++ b/src/assets/badge.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/asset-allocation/doc-americas.mdx b/src/components/asset-allocation/doc-americas.mdx index 9d31ced..360d61a 100644 --- a/src/components/asset-allocation/doc-americas.mdx +++ b/src/components/asset-allocation/doc-americas.mdx @@ -119,7 +119,7 @@ window.mstarApisSdk.xray.getAssetAllocationUsData({ portfolios: samplePortfolio, Requests to the API have the following format: ```javascript dark -https://www.us-api.morningstar.com/portfolioanalysis/v1/esg?langcult={{languageId}} +https://www.us-api.morningstar.com/portfolioanalysis/v1/xray?langcult={{languageId}} ``` diff --git a/src/components/asset-allocation/doc-emea.mdx b/src/components/asset-allocation/doc-emea.mdx index 886541c..5e6892c 100644 --- a/src/components/asset-allocation/doc-emea.mdx +++ b/src/components/asset-allocation/doc-emea.mdx @@ -123,7 +123,7 @@ window.mstarApisSdk.xray.getAssetAllocationBreakdown({ portfolios: samplePortfol Requests to the API have the following format: ```javascript dark -https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} +https://www.emea-api.morningstar.com/ecint/v2/xray?outputtype=json&languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} ``` diff --git a/src/components/carbon-score/CarbonScore.vue b/src/components/carbon-score/CarbonScore.vue new file mode 100644 index 0000000..e409caf --- /dev/null +++ b/src/components/carbon-score/CarbonScore.vue @@ -0,0 +1,82 @@ + + + + + Carbon Score + + + + No data available + + + + + + + Carbon + + + Portfolio + + + Benchmark + + + + + + {{ item.key }} + {{ item.portfolio }} + {{ item.benchmark }} + + + + + + + + + + + diff --git a/src/components/carbon-score/config/dataPoints.json b/src/components/carbon-score/config/dataPoints.json new file mode 100644 index 0000000..8be4f1b --- /dev/null +++ b/src/components/carbon-score/config/dataPoints.json @@ -0,0 +1,14 @@ +{ + "carbonRiskScore": "Carbon Risk Score", + "carbonRiskPercentageOfPortfolioCovered": "Carbon Risk Percentage of Portfolio Covered", + "carbonFootprintScope1And2TonnesPerUsdMillions": "Carbon Footprint Scope 1 and 2 Tonnes per USD millions", + "carbonFootprintScope1And2PercentageOfPortfolioCovered": "Carbon Footprint Scope 1 and 2 Percentage of Portfolio Covered", + "carbonFootprintScope1And2And3TonnesPerUsdMillions": "Carbon Footprint Scope 1 and 2 and 3 Tonnes per USD millions", + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": "Carbon Footprint Scope 1 and 2 and 3 Percentage of Portfolio Covered", + "carbonIntensityScope1And2AverageValueInUsdTerms": "Carbon intensity Scope 1 and 2 Average Value in USD Terms", + "carbonIntensityScope1And2PercentageOfPortfolioCovered": "Carbon intensity Scope 1 and 2 Percentage of Portfolio Covered", + "carbonIntensityScope1And2And3AverageValueInUsdTerms": "Carbon intensity Scope 1 and 2 and 3 Average Value in USD Terms", + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": "Carbon intensity Scope 1 and 2 and 3 Percentage of Portfolio Covered", + "fossilFuelPercentageOfPortfolioCovered": "Fossil Fuel Percentage of Portfolio Covered", + "fossilFuelPercentageOfCoveredPortfolioInvolved": "Fossil Fuel Percentage of Covered Portfolio Involved" +} \ No newline at end of file diff --git a/src/components/carbon-score/config/sampleData.json b/src/components/carbon-score/config/sampleData.json new file mode 100644 index 0000000..3a20e19 --- /dev/null +++ b/src/components/carbon-score/config/sampleData.json @@ -0,0 +1,100 @@ +{ + "portfolio": { + "date": "2023-05-31", + "carbonRiskScore": 10.17268, + "carbonRiskPercentageOfPortfolioCovered": 84.56575, + "carbonRiskLevelClassification": "Medium Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 10.46469, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 53.01051, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 29.50153, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 6.60135, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 0.42192, + "carbonRiskExposureScore": 21.47307, + "carbonRiskOperationsRiskScore": 5.44855, + "carbonRiskProductsAndServicesRiskScore": 1.95735, + "carbonStrandedAssetsExposureScore": 70.23348, + "historicalCarbonRiskScore": 10.17268, + "historicalCarbonRiskLevelClassification": "Medium Risk", + "lowCarbonDesignation": "False", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 4.62669, + "carbonFootprintScope1And2TonnesPerUsdMillions": 110.34228, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 73.84146, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 855.50373, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 73.8272, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 84.20385, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 1114.55836, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 84.02672, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 85.15153, + "carbonSolutionsPercentageOfPortfolioCovered": 84.59273, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 15.45745, + "fossilFuelPercentageOfPortfolioCovered": 84.9197, + "oilAndGasProductionPercentageOfPortfolioCovered": 85.15153, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 85.15153, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 85.15153, + "oilSandsExtractionPercentageOfPortfolioCovered": 85.15153, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 6.11892, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 85.15153, + "thermalCoalExtractionPercentageOfPortfolioCovered": 85.15153, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 85.15153, + "carbonRiskManagedRiskScore": 11.30043, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 15.45745, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 4.00005, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 2.40106, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 4.13598, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 4.57218, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 12.05435, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 8.4937, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 12.27627, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 13.60068, + "carbonIntensityScope1And2AverageValueInUsdTerms": 173.78179 + }, + "benchmark": { + "date": "2023-03-31", + "carbonRiskScore": 8.11, + "carbonRiskPercentageOfPortfolioCovered": 98.69094, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 20.08165, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 53.36606, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 20.87264, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 5.17963, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 0.50003, + "carbonRiskExposureScore": 14.93, + "carbonRiskOperationsRiskScore": 4.76, + "carbonRiskProductsAndServicesRiskScore": 0.76, + "carbonStrandedAssetsExposureScore": 76.51, + "historicalCarbonRiskScore": 8.15472, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "0", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 3.01773, + "carbonFootprintScope1And2TonnesPerUsdMillions": 37.25, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 93.24561, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 326.06, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 93.44802, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 97.8373, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 875.96902, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 98.17274, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 99.17357, + "carbonSolutionsPercentageOfPortfolioCovered": 98.52659, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 8.1853, + "fossilFuelPercentageOfPortfolioCovered": 96.66453, + "oilAndGasProductionPercentageOfPortfolioCovered": 99.17357, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 99.17357, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 99.17357, + "oilSandsExtractionPercentageOfPortfolioCovered": 99.17357, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 3.26898, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 99.17357, + "thermalCoalExtractionPercentageOfPortfolioCovered": 99.17357, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 99.17357, + "carbonRiskManagedRiskScore": 6.82, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 7.34188, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.3302, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.03856, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 2.21159, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 2.21159, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 15.12536, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 4.04154, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 8.03929, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 22.28312, + "carbonIntensityScope1And2AverageValueInUsdTerms": 123.0245 + } +} \ No newline at end of file diff --git a/src/components/carbon-score/doc-global-async.mdx b/src/components/carbon-score/doc-global-async.mdx new file mode 100644 index 0000000..daa9178 --- /dev/null +++ b/src/components/carbon-score/doc-global-async.mdx @@ -0,0 +1,1002 @@ +import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; +import CarbonScore from "@/components/carbon-score/CarbonScore.vue"; +import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external-links"; + + + + + +# Carbon Score + +- [Description](#description) +- [Properties](#properties) +- [Fetching Data](#fetching-data) +- [Data Transformation](#data-transformation) +- [Data Models](#data-models) + + +## Description +The asset-weighted average of the carbon risk scores for the portfolio's covered, corporate holdings. The carbon risk score indicates the overall material risk a company faces from the transition to a low-carbon economy. +A lower score is better. At least 67% of the portfolio's eligible assets must have carbon risk scores available in order for a score to be calculated. + + + + + +## Properties + + + +## Fetching Data + +The component is populated with data returned by calls to the +Portfolio Analysis Global API. + +### API Data Access Library + +The API Data Access Library is used to fetch data from the API. +Request header 'prefer: 'respond-async' allows to fetch the response asynchronously, which makes sure the response is +available without timeout issues + +``` javascript dark +window.mstarApisSdk.xray.getCarbonScoreData({ portfolios: samplePortfolio, languageId: 'en-US', prefer: 'respond-async' }); +``` + + Example + +``` javascript dark +const samplePortfolio = [ + { + Name: 'Test Portfolio1', + TotalValue: 10000, + Holdings: [ + { + SecurityId: 'F00000VPDY', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPE0', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3S', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3Q', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3R', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76W', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76Y', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76Z', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76X', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T770', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T772', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T773', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T771', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDQ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDR', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDS', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3Z', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK42', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK47', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4B', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4F', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4J', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4N', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4R', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3V', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T777', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T775', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T776', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T774', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000011DGV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000011DGU', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35Y', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35X', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35W', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000J8SX', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PQ2U', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA007RP', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00ABD', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05GYK', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00DEK', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA08N2L', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00KJW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00COA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00CTW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05HX7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW6', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW5', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIC', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000QSIZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000QSIX', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N79H', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N75J', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UDFO', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N1IS', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000XKG7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000XKG8', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUC', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKDA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKD9', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKKG', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6OZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6P0', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6P1', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIU', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZF1O', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010IS3', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05KKV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000YSY7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000YSY8', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WQUJ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010GIB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010GIA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000U3B0', + Type: 'FO', + Value: 100, + }, + ], + Benchmark: { + Type: 'Standard', + Holdings: [ + { + SecurityId: 'XIUSA0010V', + Type: 'XI', + Weight: 100, + }, + ], + }, + }, +]; + +window.mstarApisSdk.portfolioAnalysis.getcarbonScoreData({ + portfolios: samplePortfolio, + languageId: 'en-US', + headers: { + prefer: 'respond-async', + }, +}); + +``` + + +### Request Example +Asynchronous API Requests has below 3 steps to get the Sustainability data Response: +1. **Initiating Request**: Sustainability API will send back the jobId as shown in the below example. To make the request asynchronous + we need to pass the ‘prefer’ header in the request as shown in the example below. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/carbon-score?langcult={{languageId}} + ``` + + ### Request Payload Example + | Query Parameter | Description | Example | + | :-------------- | :---------- | :------ | + | `languageId` | ISO culture codes. If not provided, defaults to the language defined in settings. | `languageId=en-US` | + + | Request Header | Description | Example | + | :------------- | :---------- | :------ | + | `prefer` | Get the response in asynchronous format | `prefer=respond-async` | + + #### Sample JobId API Response Data Format + + ```javascript dark + { + "jobId": "efb3a071-cd29-41c6-86ce-fb1b3569b5e4", + "_links": [ + { + "href": "www.us-api.morningstar.com/dynamic-services-apis/jobs/efb3a071-cd29-41c6-86ce-fb1b3569b5e4", + "rel": "self", + "method": "GET" + } + ] + } + ``` +2. **Pooling Status**: Once JobId is received, use below API to get the status from the S3 server in the below format. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/dynamic-services-apis/jobs/:jobId + ``` + When the *Automatically follow redirects* setting is on(it’s true by default in postman as well as in all native browsers) + then it automatically redirects to step 3 and returns the response with the status code 200 when the response is available. + Otherwise, we need to keep polling the API until we get a final response. + + #### Sample response for the pending status. + + ```javascript dark + { + "id": "8d616381-9be9-4a2e-85ec-3f5bf244e7c8", + "created": "2023-05-11T10:12:08.3246921Z", + "status": "pending", + "isComplete": false, + "_links": [ + { + "href": "https://www.us-api.morningstar.com/jobs/8d616381-9be9-4a2e-85ec-3f5bf244e7c8", + "rel": "self", + "method": "GET" + } + ] + } + ``` + When the *Automatically follow redirects* setting is off then it returns the status code '302 Found' and the URL + provided will be returned in the response header. Follow Step 3 to get final response. + +3. **Getting Final Response**: Make the Get request to fetch final response from S3 server. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/:requestId + ``` + *Note: RequestId in below URl is received in the step 2 APIs 'location' response header* + + #### Sample final API Response Data Format + + + Code Snippet + + ```json dark + { + "sustainability": [ + { + "portfolio": { + "name": "Test Portfolio1", + "carbonScore": { + "date": "2023-05-31", + "carbonRiskScore": 9.36331, + "carbonRiskPercentageOfPortfolioCovered": 64.19894, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 17.59519, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 44.89535, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 33.33032, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 3.82639, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 0.35274, + "carbonRiskExposureScore": 16.70248, + "carbonRiskOperationsRiskScore": 5.04098, + "carbonRiskProductsAndServicesRiskScore": 0.80454, + "carbonStrandedAssetsExposureScore": 79.16836, + "historicalCarbonRiskScore": 9.36331, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "False", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 0.9629, + "carbonFootprintScope1And2TonnesPerUsdMillions": 61.45328, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 54.59251, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 550.8992, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 54.53375, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 66.05995, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 953.13381, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 64.93562, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 66.79881, + "carbonSolutionsPercentageOfPortfolioCovered": 64.10722, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 8.0773, + "fossilFuelPercentageOfPortfolioCovered": 64.59341, + "oilAndGasProductionPercentageOfPortfolioCovered": 66.79881, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 66.79881, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 66.79881, + "oilSandsExtractionPercentageOfPortfolioCovered": 66.79881, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 1.74249, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 66.79881, + "thermalCoalExtractionPercentageOfPortfolioCovered": 66.79881, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 66.79881, + "carbonRiskManagedRiskScore": 7.33925, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 8.0773, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.02422, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.55622, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 0.96042, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 0.88611, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 9.00199, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 4.29282, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 6.68589, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 12.30823, + "carbonIntensityScope1And2AverageValueInUsdTerms": 163.43113 + } + }, + "benchmark": { + "name": "Morningstar US Market TR USD", + "identifier": "XIUSA0010V", + "identifierType": "SecurityId", + "securityType": "XI", + "carbonScore": { + "date": "2023-03-31", + "carbonRiskScore": 8.11, + "carbonRiskPercentageOfPortfolioCovered": 98.69094, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 20.08165, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 53.36606, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 20.87264, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 5.17963, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 0.50003, + "carbonRiskExposureScore": 14.93, + "carbonRiskOperationsRiskScore": 4.76, + "carbonRiskProductsAndServicesRiskScore": 0.76, + "carbonStrandedAssetsExposureScore": 76.51, + "historicalCarbonRiskScore": 8.15472, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "0", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 3.01773, + "carbonFootprintScope1And2TonnesPerUsdMillions": 37.25, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 93.24561, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 326.06, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 93.44802, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 97.8373, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 875.96902, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 98.17274, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 99.17357, + "carbonSolutionsPercentageOfPortfolioCovered": 98.52659, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 8.1853, + "fossilFuelPercentageOfPortfolioCovered": 96.66453, + "oilAndGasProductionPercentageOfPortfolioCovered": 99.17357, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 99.17357, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 99.17357, + "oilSandsExtractionPercentageOfPortfolioCovered": 99.17357, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 3.26898, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 99.17357, + "thermalCoalExtractionPercentageOfPortfolioCovered": 99.17357, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 99.17357, + "carbonRiskManagedRiskScore": 6.82, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 7.34188, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.3302, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.03856, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 2.21159, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 2.21159, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 15.12536, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 4.04154, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 8.03929, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 22.28312, + "carbonIntensityScope1And2AverageValueInUsdTerms": 123.0245 + } + }, + "securityBreakdown": [ + { + "name": "1290 Diversified Bond A", + "identifier": "0P00015V9A", + "identifierType": "PerformanceId", + "securityType": "FO", + "carbonScore": { + "date": "2023-03-31", + "carbonRiskScore": 5.21, + "carbonRiskPercentageOfPortfolioCovered": 83.2759, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 77.67455, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 10.61177, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 5.56222, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 1.7697, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 4.38177, + "carbonRiskExposureScore": 20.48, + "carbonRiskOperationsRiskScore": 2.4, + "carbonRiskProductsAndServicesRiskScore": 0.38, + "carbonStrandedAssetsExposureScore": 78.96, + "historicalCarbonRiskScore": 11.34928, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "0", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 0.84124, + "carbonFootprintScope1And2TonnesPerUsdMillions": 47.47, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 4.16301, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 333.82, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 4.16301, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 20.25201, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 267.48881, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 20.25201, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 20.25201, + "carbonSolutionsPercentageOfPortfolioCovered": 19.19857, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 10.59521, + "fossilFuelPercentageOfPortfolioCovered": 19.0201, + "oilAndGasProductionPercentageOfPortfolioCovered": 20.25201, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 20.25201, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 20.25201, + "oilSandsExtractionPercentageOfPortfolioCovered": 20.25201, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 4.92358, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 20.25201, + "thermalCoalExtractionPercentageOfPortfolioCovered": 20.25201, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 20.25201, + "carbonRiskManagedRiskScore": 15.27, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 8.45146, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 0, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.88124, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 0, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 0, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 0, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.78352, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 8.7071, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 1.81205, + "carbonIntensityScope1And2AverageValueInUsdTerms": 62.48241 + } + }, + { + "name": "1290 Diversified Bond I", + "identifier": "0P00015V9B", + "identifierType": "PerformanceId", + "securityType": "FO", + "carbonScore": { + "date": "2023-03-31", + "carbonRiskScore": 5.21, + "carbonRiskPercentageOfPortfolioCovered": 83.2759, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 77.67455, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 10.61177, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 5.56222, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 1.7697, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 4.38177, + "carbonRiskExposureScore": 20.48, + "carbonRiskOperationsRiskScore": 2.4, + "carbonRiskProductsAndServicesRiskScore": 0.38, + "carbonStrandedAssetsExposureScore": 78.96, + "historicalCarbonRiskScore": 11.34928, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "0", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 0.84124, + "carbonFootprintScope1And2TonnesPerUsdMillions": 47.47, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 4.16301, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 333.82, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 4.16301, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 20.25201, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 267.48881, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 20.25201, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 20.25201, + "carbonSolutionsPercentageOfPortfolioCovered": 19.19857, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 10.59521, + "fossilFuelPercentageOfPortfolioCovered": 19.0201, + "oilAndGasProductionPercentageOfPortfolioCovered": 20.25201, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 20.25201, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 20.25201, + "oilSandsExtractionPercentageOfPortfolioCovered": 20.25201, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 4.92358, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 20.25201, + "thermalCoalExtractionPercentageOfPortfolioCovered": 20.25201, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 20.25201, + "carbonRiskManagedRiskScore": 15.27, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 8.45146, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 0, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.88124, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 0, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 0, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 0, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.78352, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 8.7071, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 1.81205, + "carbonIntensityScope1And2AverageValueInUsdTerms": 62.48241 + } + }, + { + "name": "1290 Diversified Bond R", + "identifier": "0P00015V9C", + "identifierType": "PerformanceId", + "securityType": "FO", + "carbonScore": { + "date": "2023-03-31", + "carbonRiskScore": 5.21, + "carbonRiskPercentageOfPortfolioCovered": 83.2759, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 77.67455, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 10.61177, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 5.56222, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 1.7697, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 4.38177, + "carbonRiskExposureScore": 20.48, + "carbonRiskOperationsRiskScore": 2.4, + "carbonRiskProductsAndServicesRiskScore": 0.38, + "carbonStrandedAssetsExposureScore": 78.96, + "historicalCarbonRiskScore": 11.34928, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "0", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 0.84124, + "carbonFootprintScope1And2TonnesPerUsdMillions": 47.47, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 4.16301, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 333.82, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 4.16301, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 20.25201, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 267.48881, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 20.25201, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 20.25201, + "carbonSolutionsPercentageOfPortfolioCovered": 19.19857, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 10.59521, + "fossilFuelPercentageOfPortfolioCovered": 19.0201, + "oilAndGasProductionPercentageOfPortfolioCovered": 20.25201, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 20.25201, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 20.25201, + "oilSandsExtractionPercentageOfPortfolioCovered": 20.25201, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 4.92358, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 20.25201, + "thermalCoalExtractionPercentageOfPortfolioCovered": 20.25201, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 20.25201, + "carbonRiskManagedRiskScore": 15.27, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 8.45146, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 0, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.88124, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 0, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 0, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 0, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.78352, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 8.7071, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 1.81205, + "carbonIntensityScope1And2AverageValueInUsdTerms": 62.48241 + } + } + ], + } + ] + "metadata": { + "requestId": "8e3629c0-d26b-425e-9596-5391ced96465" + } + } + ``` + +## Data Transformation + +Data returned by the API must be transformed to the format the component understands. + + +### Component Transformed Data Format + + + Code Snippet + +```json dark +{ + "portfolio": { + "date": "2023-05-31", + "carbonRiskScore": 10.17268, + "carbonRiskPercentageOfPortfolioCovered": 84.56575, + "carbonRiskLevelClassification": "Medium Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 10.46469, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 53.01051, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 29.50153, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 6.60135, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 0.42192, + "carbonRiskExposureScore": 21.47307, + "carbonRiskOperationsRiskScore": 5.44855, + "carbonRiskProductsAndServicesRiskScore": 1.95735, + "carbonStrandedAssetsExposureScore": 70.23348, + "historicalCarbonRiskScore": 10.17268, + "historicalCarbonRiskLevelClassification": "Medium Risk", + "lowCarbonDesignation": "False", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 4.62669, + "carbonFootprintScope1And2TonnesPerUsdMillions": 110.34228, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 73.84146, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 855.50373, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 73.8272, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 84.20385, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 1114.55836, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 84.02672, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 85.15153, + "carbonSolutionsPercentageOfPortfolioCovered": 84.59273, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 15.45745, + "fossilFuelPercentageOfPortfolioCovered": 84.9197, + "oilAndGasProductionPercentageOfPortfolioCovered": 85.15153, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 85.15153, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 85.15153, + "oilSandsExtractionPercentageOfPortfolioCovered": 85.15153, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 6.11892, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 85.15153, + "thermalCoalExtractionPercentageOfPortfolioCovered": 85.15153, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 85.15153, + "carbonRiskManagedRiskScore": 11.30043, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 15.45745, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 4.00005, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 2.40106, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 4.13598, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 4.57218, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 12.05435, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 8.4937, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 12.27627, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 13.60068, + "carbonIntensityScope1And2AverageValueInUsdTerms": 173.78179 + }, + "benchmark": { + "date": "2023-03-31", + "carbonRiskScore": 8.11, + "carbonRiskPercentageOfPortfolioCovered": 98.69094, + "carbonRiskLevelClassification": "Low Risk", + "carbonRiskPercentageOfCoveredPortfolioWithNegligibleCarbonRiskScores": 20.08165, + "carbonRiskPercentageOfCoveredPortfolioWithLowCarbonRiskScores": 53.36606, + "carbonRiskPercentageOfCoveredPortfolioWithMediumCarbonRiskScores": 20.87264, + "carbonRiskPercentageOfCoveredPortfolioWithHighCarbonRiskScores": 5.17963, + "carbonRiskPercentageOfCoveredPortfolioWithSevereCarbonRiskScores": 0.50003, + "carbonRiskExposureScore": 14.93, + "carbonRiskOperationsRiskScore": 4.76, + "carbonRiskProductsAndServicesRiskScore": 0.76, + "carbonStrandedAssetsExposureScore": 76.51, + "historicalCarbonRiskScore": 8.15472, + "historicalCarbonRiskLevelClassification": "Low Risk", + "lowCarbonDesignation": "0", + "carbonStrandedAssetsExposurePercentageOfPortfolioCovered": 3.01773, + "carbonFootprintScope1And2TonnesPerUsdMillions": 37.25, + "carbonFootprintScope1And2PercentageOfPortfolioCovered": 93.24561, + "carbonFootprintScope1And2And3TonnesPerUsdMillions": 326.06, + "carbonFootprintScope1And2And3PercentageOfPortfolioCovered": 93.44802, + "carbonIntensityScope1And2PercentageOfPortfolioCovered": 97.8373, + "carbonIntensityScope1And2And3AverageValueInUsdTerms": 875.96902, + "carbonIntensityScope1And2And3PercentageOfPortfolioCovered": 98.17274, + "arcticOilAndGasExplorationPercentageOfPortfolioCovered": 99.17357, + "carbonSolutionsPercentageOfPortfolioCovered": 98.52659, + "historicalFossilFuelPercentageOfCoveredPortfolioInvolved": 8.1853, + "fossilFuelPercentageOfPortfolioCovered": 96.66453, + "oilAndGasProductionPercentageOfPortfolioCovered": 99.17357, + "oilAndGasPowerGenerationPercentageOfPortfolioCovered": 99.17357, + "oilAndGasProductsAndServicesPercentageOfPortfolioCovered": 99.17357, + "oilSandsExtractionPercentageOfPortfolioCovered": 99.17357, + "shaleEnergyExtractionPercentageOfCoveredPortfolioInvolved": 3.26898, + "shaleEnergyExtractionPercentageOfPortfolioCovered": 99.17357, + "thermalCoalExtractionPercentageOfPortfolioCovered": 99.17357, + "thermalCoalPowerGenerationPercentageOfPortfolioCovered": 99.17357, + "carbonRiskManagedRiskScore": 6.82, + "fossilFuelPercentageOfCoveredPortfolioInvolved": 7.34188, + "thermalCoalPowerGenerationPercentageOfCoveredPortfolioInvolved": 3.3302, + "thermalCoalExtractionPercentageOfCoveredPortfolioInvolved": 0.03856, + "oilSandsExtractionPercentageOfCoveredPortfolioInvolved": 2.21159, + "arcticOilAndGasExplorationPercentageOfCoveredPortfolioInvolved": 2.21159, + "carbonSolutionsPercentageOfCoveredPortfolioInvolved": 15.12536, + "oilAndGasPowerGenerationPercentageOfCoveredPortfolioInvolved": 4.04154, + "oilAndGasProductionPercentageOfCoveredPortfolioInvolved": 8.03929, + "oilAndGasProductsAndServicesPercentageOfCoveredPortfolioInvolved": 22.28312, + "carbonIntensityScope1And2AverageValueInUsdTerms": 123.0245 + } +} +``` + + + +### Component Transformation Operation + + Code Snippet + +```json dark + parsedModelData() { + const { modelData } = this; + const carbonScoreData = modelData; + const keys = Object.keys(dataPoints); + return keys.map((key) => { + const dataPoint = key; + return { + key: dataPoints[dataPoint], + portfolio: this.formatNumber(get(carbonScoreData.portfolio, `${dataPoint}`, null)), + benchmark: this.formatNumber(get(carbonScoreData.benchmark, `${dataPoint}`, null)), + }; + }); + }, +``` + + diff --git a/src/components/correlation-matrix/CorrelationMatrix.vue b/src/components/correlation-matrix/CorrelationMatrix.vue new file mode 100644 index 0000000..0038ed8 --- /dev/null +++ b/src/components/correlation-matrix/CorrelationMatrix.vue @@ -0,0 +1,314 @@ + + + + + Correlation Matrix + + + + + + {{ tab }} + + + + + + + + + + + + + + + diff --git a/src/components/correlation-matrix/config/sampleData.json b/src/components/correlation-matrix/config/sampleData.json new file mode 100644 index 0000000..93a570d --- /dev/null +++ b/src/components/correlation-matrix/config/sampleData.json @@ -0,0 +1,666 @@ +{ + "securities": [ + "1290 Diversified Bond A (USD)", + "iShares MSCI ACWI ETF (USD)", + "Invesco FTSE RAFI Dev Mkts ex-US ETF", + "Aberdeen International Inc (USD)", + "iShares MSCI ACWI ETF (USD)", + "Black Diamond Group Ltd (USD)" + ], + "correlationMatrix":{ + "Year3": [ + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "1", + "value": 1 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "2", + "value": 0.29607228 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "3", + "value": 0.17232916 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "4", + "value": 0.38940946 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "5", + "value": 0.30768872 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "6", + "value": 0.13656596 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "1", + "value": 0.29607228 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "2", + "value": 1 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "3", + "value": -0.04401845 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "4", + "value": 0.25039432 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "5", + "value": 0.15332599 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "6", + "value": 0.07410212 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "1", + "value": 0.17232916 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "2", + "value": -0.04401845 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "3", + "value": 1 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "4", + "value": 0.69499175 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "5", + "value": 0.77625093 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "6", + "value": 0.71458901 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "1", + "value": 0.38940946 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "2", + "value": 0.25039432 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "3", + "value": 0.69499175 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "4", + "value": 1 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "5", + "value": 0.89501511 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "6", + "value": 0.77454346 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "1", + "value": 0.30768872 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "2", + "value": 0.15332599 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "3", + "value": 0.77625093 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "4", + "value": 0.89501511 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "5", + "value": 1 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "6", + "value": 0.86000327 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "1", + "value": 0.13656596 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "2", + "value": 0.07410212 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "3", + "value": 0.71458901 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "4", + "value": 0.77454346 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "5", + "value": 0.86000327 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "6", + "value": 1 + } + ], + "Year5": [ + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "1", + "value": 1 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "2", + "value": 0.40757458 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "3", + "value": 0.26772883 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "4", + "value": 0.43468514 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "5", + "value": 0.40869853 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "6", + "value": 0.42394346 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "1", + "value": 0.40757458 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "2", + "value": 1 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "3", + "value": -0.00300089 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "4", + "value": 0.22220599 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "5", + "value": 0.19243744 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "6", + "value": 0.09708888 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "1", + "value": 0.26772883 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "2", + "value": -0.00300089 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "3", + "value": 1 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "4", + "value": 0.69699001 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "5", + "value": 0.7714571 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "6", + "value": 0.6941816 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "1", + "value": 0.43468514 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "2", + "value": 0.22220599 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "3", + "value": 0.69699001 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "4", + "value": 1 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "5", + "value": 0.92079987 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "6", + "value": 0.777454 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "1", + "value": 0.40869853 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "2", + "value": 0.19243744 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "3", + "value": 0.7714571 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "4", + "value": 0.92079987 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "5", + "value": 1 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "6", + "value": 0.85724669 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "1", + "value": 0.42394346 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "2", + "value": 0.09708888 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "3", + "value": 0.6941816 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "4", + "value": 0.777454 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "5", + "value": 0.85724669 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "6", + "value": 1 + } + ], + "Year10": [ + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "1", + "value": 1 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "2", + "value": 0.26520165 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "3", + "value": 0.22785105 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "4", + "value": 0.43823804 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "5", + "value": 0.39196939 + }, + { + "SecurityId": "0P0000DZXU", + "x": "1", + "y": "6", + "value": 0 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "1", + "value": 0.26520165 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "2", + "value": 1 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "3", + "value": -0.01312991 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "4", + "value": 0.21376517 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "5", + "value": 0.18879276 + }, + { + "SecurityId": "0P0000JIAP", + "x": "2", + "y": "6", + "value": 0 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "1", + "value": 0.22785105 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "2", + "value": -0.01312991 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "3", + "value": 1 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "4", + "value": 0.67050032 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "5", + "value": 0.74307547 + }, + { + "SecurityId": "0P0000007E", + "x": "3", + "y": "6", + "value": 0 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "1", + "value": 0.43823804 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "2", + "value": 0.21376517 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "3", + "value": 0.67050032 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "4", + "value": 1 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "5", + "value": 0.92118583 + }, + { + "SecurityId": "FOUSA06IVV", + "x": "4", + "y": "6", + "value": 0 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "1", + "value": 0.39196939 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "2", + "value": 0.18879276 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "3", + "value": 0.74307547 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "4", + "value": 0.92118583 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "5", + "value": 1 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": "5", + "y": "6", + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "1", + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "2", + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "3", + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "4", + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "5", + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": "6", + "y": "6", + "value": 1 + } + ] + } +} diff --git a/src/components/correlation-matrix/doc-americas.mdx b/src/components/correlation-matrix/doc-americas.mdx new file mode 100644 index 0000000..164b250 --- /dev/null +++ b/src/components/correlation-matrix/doc-americas.mdx @@ -0,0 +1,1565 @@ +import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; +import CorrelationMatrix from "@/components/correlation-matrix/CorrelationMatrix.vue"; + +import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external-links"; + + + + + +# Correlation Matrix (Americas) + +- [Description](#description) +- [Properties](#properties) +- [Fetching Data](#fetching-data) +- [Data Transformation](#data-transformation) + +## Description + +The Correlation Matrix component displays the relationship of return patterns among investments. It is based upon the correlation coefficient, a number between -1.0 and 1.0. +A perfect negative relationship between two investments has a correlation of -1.0, whereas a perfect positive linear relationship exists with a correlation of 1.0. A correlation coefficient of 0.0 indicates no linear relationship between the investments. +Correlation information can be valuable in assessing the diversification effect of combining an investment with other options. + + + + + +## Properties + + + +## Fetching Data + +The component is populated with data returned by calls to the Portfolio Analysis API (Americas). + +### API Data Access Library + +The API Data Access Library is used to fetch data from the API. + +``` javascript dark +window.mstarApisSdk.xray.getCorrelationMatrixUsData({ portfolios: samplePortfolio, languageId: 'en-US' }); +``` + + Example + +``` javascript dark +const samplePortfolio = [ + { + name: 'US demo portfolio - weight', + totalValue: 10000, + currency: 'USD', + holdings: [ + { + securityId: 'FOUSA06OEZ', + weight: 30, + }, + { + securityId: 'FOUSA06IVV', + weight: 50, + }, + { + securityId: 'F00000T770', + weight: 20, + }, + ], + benchmark: { + type: 'Standard', + holdings: [ + { + securityId: 'XIUSA0010V', + weight: 100, + }, + ], + }, + }, +]; +window.mstarApisSdk.xray.getCorrelationMatrixUsData({ portfolios: samplePortfolio, languageId: 'en-US' }); +``` + + + +### Request Example + +```javascript dark +"https://www.us-api.morningstar.com/portfolioanalysis/v1/xray?langcult={{languageId}}" + +``` +### Request Payload Example + +| Query Parameter | Description|Example | +| :----------- | :--------| :----------- | +| `languageId` | ISO culture codes. If not provided, defaults to language defined in settings. |`languageId=en-US` | + +## Data Transformation + +Data returned by the API must be transformed to a format the component understands. + +### API Response Data Format + + Code Snippet + +```json dark +[ + { + "TrailingTimePeriod": "Year3", + "DataFrequency": "Monthly", + "StartDate": "2020-12-31T00:00:00", + "EndDate": "2023-12-31T00:00:00", + "Correlations": [ + { + "Id": 1, + "SecurityId": "F00000T770", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.07410212 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.77454346 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.86000327 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.71458901 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.13656596 + } + ] + }, + { + "Id": 2, + "SecurityId": "0P0000JIAP", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.07410212 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.25039432 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.15332599 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": -0.04401845 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.29607228 + } + ] + }, + { + "Id": 3, + "SecurityId": "FOUSA06IVV", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.77454346 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.25039432 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.89501511 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.69499175 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.38940946 + } + ] + }, + { + "Id": 4, + "SecurityId": "FOUSA06OEZ", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.86000327 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.15332599 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.89501511 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.77625093 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.30768872 + } + ] + }, + { + "Id": 5, + "SecurityId": "0P0000007E", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.71458901 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": -0.04401845 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.69499175 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.77625093 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.17232916 + } + ] + }, + { + "Id": 6, + "SecurityId": "0P0000DZXU", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.13656596 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.29607228 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.38940946 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.30768872 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.17232916 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 1 + } + ] + } + ] + }, + { + "TrailingTimePeriod": "Year5", + "DataFrequency": "Monthly", + "StartDate": "2018-12-31T00:00:00", + "EndDate": "2023-12-31T00:00:00", + "Correlations": [ + { + "Id": 1, + "SecurityId": "F00000T770", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.09708888 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.777454 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.85724669 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.6941816 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.42394346 + } + ] + }, + { + "Id": 2, + "SecurityId": "0P0000JIAP", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.09708888 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.22220599 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.19243744 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": -0.00300089 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.40757458 + } + ] + }, + { + "Id": 3, + "SecurityId": "FOUSA06IVV", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.777454 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.22220599 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.92079987 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.69699001 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.43468514 + } + ] + }, + { + "Id": 4, + "SecurityId": "FOUSA06OEZ", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.85724669 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.19243744 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.92079987 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.7714571 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.40869853 + } + ] + }, + { + "Id": 5, + "SecurityId": "0P0000007E", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.6941816 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": -0.00300089 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.69699001 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.7714571 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 0.26772883 + } + ] + }, + { + "Id": 6, + "SecurityId": "0P0000DZXU", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.42394346 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.40757458 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.43468514 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.40869853 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.26772883 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 1 + } + ] + } + ] + }, + { + "TrailingTimePeriod": "Year10", + "DataFrequency": "Monthly", + "StartDate": "2013-12-31T00:00:00", + "EndDate": "2023-12-31T00:00:00", + "Correlations": [ + { + "Id": 1, + "SecurityId": "0P0000JIAP", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.21376517 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.18879276 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": -0.01312991 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.26520165 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security" + } + ] + }, + { + "Id": 2, + "SecurityId": "FOUSA06IVV", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.21376517 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.92118583 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.67050032 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.43823804 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security" + } + ] + }, + { + "Id": 3, + "SecurityId": "FOUSA06OEZ", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.18879276 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.92118583 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.74307547 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.39196939 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security" + } + ] + }, + { + "Id": 4, + "SecurityId": "0P0000007E", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": -0.01312991 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.67050032 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.74307547 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 0.22785105 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security" + } + ] + }, + { + "Id": 5, + "SecurityId": "0P0000DZXU", + "UseExtendedReturns": false, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security", + "Value": 0.26520165 + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security", + "Value": 0.43823804 + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security", + "Value": 0.39196939 + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security", + "Value": 0.22785105 + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security", + "Value": 1 + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security" + } + ] + }, + { + "Id": 6, + "SecurityId": "F00000T770", + "UseExtendedReturns": true, + "Type": "Security", + "CorrelatedItemKey": [ + { + "CorrelatedItemKeyId": 1, + "Type": "Security" + }, + { + "CorrelatedItemKeyId": 2, + "Type": "Security" + }, + { + "CorrelatedItemKeyId": 3, + "Type": "Security" + }, + { + "CorrelatedItemKeyId": 4, + "Type": "Security" + }, + { + "CorrelatedItemKeyId": 5, + "Type": "Security" + }, + { + "CorrelatedItemKeyId": 6, + "Type": "Security", + "Value": 1 + } + ] + } + ] + } +] +``` + + + +### Integration Data Format + + Code Snippet + +```json dark +{ + "securities": [ + "iShares MSCI ACWI ETF (USD)", + "Invesco FTSE RAFI Dev Mkts ex-US ETF (USD)", + "1290 High Yield Bond A (USD)", + "Aberdeen International Inc (USD)", + "Black Diamond Group Ltd (USD)", + "Agilent Technologies Inc (USD)" + ], + "correlationMatrix": { + "Year3": [ + { + "SecurityId": "F00000T770", + "x": 1, + "y": 1, + "value": 1 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 2, + "value": 0.07410212 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 3, + "value": 0.77454346 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 4, + "value": 0.86000327 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 5, + "value": 0.71458901 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 6, + "value": 0.13656596 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 1, + "value": 0.07410212 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 2, + "value": 1 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 3, + "value": 0.25039432 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 4, + "value": 0.15332599 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 5, + "value": -0.04401845 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 6, + "value": 0.29607228 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 1, + "value": 0.77454346 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 2, + "value": 0.25039432 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 3, + "value": 1 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 4, + "value": 0.89501511 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 5, + "value": 0.69499175 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 6, + "value": 0.38940946 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 1, + "value": 0.86000327 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 2, + "value": 0.15332599 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 3, + "value": 0.89501511 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 4, + "value": 1 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 5, + "value": 0.77625093 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 6, + "value": 0.30768872 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 1, + "value": 0.71458901 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 2, + "value": -0.04401845 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 3, + "value": 0.69499175 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 4, + "value": 0.77625093 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 5, + "value": 1 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 6, + "value": 0.17232916 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 1, + "value": 0.13656596 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 2, + "value": 0.29607228 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 3, + "value": 0.38940946 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 4, + "value": 0.30768872 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 5, + "value": 0.17232916 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 6, + "value": 1 + } + ], + "Year5": [ + { + "SecurityId": "F00000T770", + "x": 1, + "y": 1, + "value": 1 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 2, + "value": 0.09708888 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 3, + "value": 0.777454 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 4, + "value": 0.85724669 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 5, + "value": 0.6941816 + }, + { + "SecurityId": "F00000T770", + "x": 1, + "y": 6, + "value": 0.42394346 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 1, + "value": 0.09708888 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 2, + "value": 1 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 3, + "value": 0.22220599 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 4, + "value": 0.19243744 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 5, + "value": -0.00300089 + }, + { + "SecurityId": "0P0000JIAP", + "x": 2, + "y": 6, + "value": 0.40757458 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 1, + "value": 0.777454 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 2, + "value": 0.22220599 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 3, + "value": 1 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 4, + "value": 0.92079987 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 5, + "value": 0.69699001 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 3, + "y": 6, + "value": 0.43468514 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 1, + "value": 0.85724669 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 2, + "value": 0.19243744 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 3, + "value": 0.92079987 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 4, + "value": 1 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 5, + "value": 0.7714571 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 4, + "y": 6, + "value": 0.40869853 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 1, + "value": 0.6941816 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 2, + "value": -0.00300089 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 3, + "value": 0.69699001 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 4, + "value": 0.7714571 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 5, + "value": 1 + }, + { + "SecurityId": "0P0000007E", + "x": 5, + "y": 6, + "value": 0.26772883 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 1, + "value": 0.42394346 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 2, + "value": 0.40757458 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 3, + "value": 0.43468514 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 4, + "value": 0.40869853 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 5, + "value": 0.26772883 + }, + { + "SecurityId": "0P0000DZXU", + "x": 6, + "y": 6, + "value": 1 + } + ], + "Year10": [ + { + "SecurityId": "0P0000JIAP", + "x": 1, + "y": 1, + "value": 1 + }, + { + "SecurityId": "0P0000JIAP", + "x": 1, + "y": 2, + "value": 0.21376517 + }, + { + "SecurityId": "0P0000JIAP", + "x": 1, + "y": 3, + "value": 0.18879276 + }, + { + "SecurityId": "0P0000JIAP", + "x": 1, + "y": 4, + "value": -0.01312991 + }, + { + "SecurityId": "0P0000JIAP", + "x": 1, + "y": 5, + "value": 0.26520165 + }, + { + "SecurityId": "0P0000JIAP", + "x": 1, + "y": 6, + "value": 0 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 2, + "y": 1, + "value": 0.21376517 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 2, + "y": 2, + "value": 1 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 2, + "y": 3, + "value": 0.92118583 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 2, + "y": 4, + "value": 0.67050032 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 2, + "y": 5, + "value": 0.43823804 + }, + { + "SecurityId": "FOUSA06IVV", + "x": 2, + "y": 6, + "value": 0 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 3, + "y": 1, + "value": 0.18879276 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 3, + "y": 2, + "value": 0.92118583 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 3, + "y": 3, + "value": 1 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 3, + "y": 4, + "value": 0.74307547 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 3, + "y": 5, + "value": 0.39196939 + }, + { + "SecurityId": "FOUSA06OEZ", + "x": 3, + "y": 6, + "value": 0 + }, + { + "SecurityId": "0P0000007E", + "x": 4, + "y": 1, + "value": -0.01312991 + }, + { + "SecurityId": "0P0000007E", + "x": 4, + "y": 2, + "value": 0.67050032 + }, + { + "SecurityId": "0P0000007E", + "x": 4, + "y": 3, + "value": 0.74307547 + }, + { + "SecurityId": "0P0000007E", + "x": 4, + "y": 4, + "value": 1 + }, + { + "SecurityId": "0P0000007E", + "x": 4, + "y": 5, + "value": 0.22785105 + }, + { + "SecurityId": "0P0000007E", + "x": 4, + "y": 6, + "value": 0 + }, + { + "SecurityId": "0P0000DZXU", + "x": 5, + "y": 1, + "value": 0.26520165 + }, + { + "SecurityId": "0P0000DZXU", + "x": 5, + "y": 2, + "value": 0.43823804 + }, + { + "SecurityId": "0P0000DZXU", + "x": 5, + "y": 3, + "value": 0.39196939 + }, + { + "SecurityId": "0P0000DZXU", + "x": 5, + "y": 4, + "value": 0.22785105 + }, + { + "SecurityId": "0P0000DZXU", + "x": 5, + "y": 5, + "value": 1 + }, + { + "SecurityId": "0P0000DZXU", + "x": 5, + "y": 6, + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": 6, + "y": 1, + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": 6, + "y": 2, + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": 6, + "y": 3, + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": 6, + "y": 4, + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": 6, + "y": 5, + "value": 0 + }, + { + "SecurityId": "F00000T770", + "x": 6, + "y": 6, + "value": 1 + } + ] + } +} +``` + + + +### Integration Transformation Operation + + Code Snippet + +```javascript dark +function getTrailingReturnsUsData(xrayData) { + const portfolioData = get(xrayData, 'Portfolio.TimePeriod', []); + const benchmarkData = get(xrayData, 'Benchmark.TimePeriod', []); + const portfolio = portfolioData.map((data) => ({ + timePeriod: data.Id, + value: data.Value, + })); + const benchmark = benchmarkData.map((data) => ({ + timePeriod: data.Id, + value: data.Value, + })); + return { + portfolio, + benchmark, + }; +} +``` + + + +### Component Transformation Operation + + Code Snippet + +```javascript dark + function getCorrelationMatrixUsData(xRayData) { + const correlationMatrix={}; + xRayData.correlationMatrix.forEach((timePeriod) => { + const chartData=[]; + timePeriod.Correlations.forEach((correlation, index) => { + correlation.CorrelatedItemKey.forEach((details) => { + const obj = {}; + obj.SecurityId = correlation.SecurityId, + obj.x = index + 1; + obj.y = details.CorrelatedItemKeyId; + obj.value = parseFloat(details.Value) || 0 + chartData.push(obj); + }); + correlationMatrix[timePeriod.TrailingTimePeriod] = chartData; + }); + }); + return { + securities: xRayData.securities, + correlationMatrix + }; + } +``` + + diff --git a/src/components/correlation-matrix/doc-emea.mdx b/src/components/correlation-matrix/doc-emea.mdx new file mode 100644 index 0000000..fd4c52b --- /dev/null +++ b/src/components/correlation-matrix/doc-emea.mdx @@ -0,0 +1,881 @@ +import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; +import CorrelationMatrix from "@/components/correlation-matrix/CorrelationMatrix.vue"; + +import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external-links"; + + + + + +# Correlation Matrix (APAC/EMEA) + +- [Description](#description) +- [Properties](#properties) +- [Fetching Data](#fetching-data) +- [Data Transformation](#data-transformation) + +## Description + +The Correlation Matrix component displays the relationship of return patterns among investments. It is based upon the correlation coefficient, a number between -1.0 and 1.0. +A perfect negative relationship between two investments has a correlation of -1.0, whereas a perfect positive linear relationship exists with a correlation of 1.0. A correlation coefficient of 0.0 indicates no linear relationship between the investments. +Correlation information can be valuable in assessing the diversification effect of combining an investment with other options. + + + + + +## Properties + + + +## Fetching Data + +The component is populated with data returned by calls to the Portfolio Analysis API (APAC/EMEA). + +### API Data Access Library + +The API Data Access Library is used to fetch data from the API. + +``` javascript dark +window.mstarApisSdk.xray.getCorrelationMatrixData({ portfolios: samplePortfolio, languageId: 'en-GB' }); +``` + + Example + +``` javascript dark +const samplePortfolio = [ + { + "type": 3, + "benchmarkId": "EUCA000555", + "currencyId": "GBP", + "holdings": [ + { + "identifier": "F0GBR052QA", + "identifierType": "MSID", + "amount": 5000 + }, + { + "identifier": "F000000EY1", + "identifierType": "MSID", + "amount": 2000 + }, + { + "identifier": "F00000OXG7", + "identifierType": "MSID", + "amount": 2000 + }, + { + "identifier": "F00000TWNO", + "identifierType": "MSID", + "amount": 1000 + } + ], + "calculatedDataPoints": [], + "name": "UK demo portfolio" + }, +]; +window.mstarApisSdk.xray.getCorrelationMatrixData({ portfolios: samplePortfolio, languageId: 'en-GB' }); +``` + + + +### Request Example + +```javascript dark +"https://www.emea-api.morningstar.com/ecint/v2/xray?outputtype=json&languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}}" + +``` +### Request Payload Example + +| Query Parameter | Description|Example | +| :----------- | :--------| :----------- | +| `languageId` | ISO culture codes. If not provided, defaults to language defined in settings. |`languageId=en-GB` | +| `portfolioDataPoints` |Comma-separated list of portfolio data points.|`portfolioDataPoints=AssetAllocationMorningstarEUR3` | +| `holdingDataPoints` |Comma-separated list of holding data points.|`HoldingDataPoints=` | +| `benchmarkDataPoints` | Comma-separated list of benchmark data points.|`benchmarkDataPoints=ShowBreakdown` | + +## Data Transformation + +Data returned by the API must be transformed to a format the component understands. + +### API Response Data Format + + Code Snippet + +```json dark +[ + { + "timePeriod": "M12", + "endDate": "2023-12-31", + "correlationMatrixDetail": [ + { + "id": "0", + "correlationDetail": [ + { + "id": "0", + "correlation": "1" + }, + { + "id": "1", + "correlation": "-0.07487" + }, + { + "id": "2", + "correlation": "0.71369" + }, + { + "id": "3", + "correlation": "0.73071" + } + ] + }, + { + "id": "1", + "correlationDetail": [ + { + "id": "0", + "correlation": "-0.07487" + }, + { + "id": "1", + "correlation": "1" + }, + { + "id": "2", + "correlation": "0.04081" + }, + { + "id": "3", + "correlation": "0.05649" + } + ] + }, + { + "id": "2", + "correlationDetail": [ + { + "id": "0", + "correlation": "0.71369" + }, + { + "id": "1", + "correlation": "0.04081" + }, + { + "id": "2", + "correlation": "1" + }, + { + "id": "3", + "correlation": "0.78643" + } + ] + }, + { + "id": "3", + "correlationDetail": [ + { + "id": "0", + "correlation": "0.73071" + }, + { + "id": "1", + "correlation": "0.05649" + }, + { + "id": "2", + "correlation": "0.78643" + }, + { + "id": "3", + "correlation": "1" + } + ] + } + ] + }, + { + "timePeriod": "M36", + "endDate": "2023-12-31", + "correlationMatrixDetail": [ + { + "id": "0", + "correlationDetail": [ + { + "id": "0", + "correlation": "1" + }, + { + "id": "1", + "correlation": "0.1715" + }, + { + "id": "2", + "correlation": "0.41017" + }, + { + "id": "3", + "correlation": "0.5419" + } + ] + }, + { + "id": "1", + "correlationDetail": [ + { + "id": "0", + "correlation": "0.1715" + }, + { + "id": "1", + "correlation": "1" + }, + { + "id": "2", + "correlation": "-0.14667" + }, + { + "id": "3", + "correlation": "-0.02214" + } + ] + }, + { + "id": "2", + "correlationDetail": [ + { + "id": "0", + "correlation": "0.41017" + }, + { + "id": "1", + "correlation": "-0.14667" + }, + { + "id": "2", + "correlation": "1" + }, + { + "id": "3", + "correlation": "0.73722" + } + ] + }, + { + "id": "3", + "correlationDetail": [ + { + "id": "0", + "correlation": "0.5419" + }, + { + "id": "1", + "correlation": "-0.02214" + }, + { + "id": "2", + "correlation": "0.73722" + }, + { + "id": "3", + "correlation": "1" + } + ] + } + ] + }, + { + "timePeriod": "M60", + "endDate": "2023-12-31", + "correlationMatrixDetail": [ + { + "id": "0", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + }, + { + "id": "1", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + }, + { + "id": "2", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + }, + { + "id": "3", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + } + ] + }, + { + "timePeriod": "M120", + "endDate": "2023-12-31", + "correlationMatrixDetail": [ + { + "id": "0", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + }, + { + "id": "1", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + }, + { + "id": "2", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + }, + { + "id": "3", + "correlationDetail": [ + { + "id": "0" + }, + { + "id": "1" + }, + { + "id": "2" + }, + { + "id": "3" + } + ] + } + ] + } +] +``` + + + +### Integration Data Format + + Code Snippet + +```json dark +{ + "securities": [ + "BlackRock Income and Growth Ord", + "Baronsmead Second Venture Trust Ord", + "BlackRock Dev Mkts Sust Eq Fund UK D Inc", + "London & Capital Global Bond I GBP Inc" + ], + "correlationMatrix": { + "year1": [ + { + "x": 1, + "y": 1, + "value": 1 + }, + { + "x": 1, + "y": 2, + "value": -0.07487 + }, + { + "x": 1, + "y": 3, + "value": 0.71369 + }, + { + "x": 1, + "y": 4, + "value": 0.73071 + }, + { + "x": 2, + "y": 1, + "value": -0.07487 + }, + { + "x": 2, + "y": 2, + "value": 1 + }, + { + "x": 2, + "y": 3, + "value": 0.04081 + }, + { + "x": 2, + "y": 4, + "value": 0.05649 + }, + { + "x": 3, + "y": 1, + "value": 0.71369 + }, + { + "x": 3, + "y": 2, + "value": 0.04081 + }, + { + "x": 3, + "y": 3, + "value": 1 + }, + { + "x": 3, + "y": 4, + "value": 0.78643 + }, + { + "x": 4, + "y": 1, + "value": 0.73071 + }, + { + "x": 4, + "y": 2, + "value": 0.05649 + }, + { + "x": 4, + "y": 3, + "value": 0.78643 + }, + { + "x": 4, + "y": 4, + "value": 1 + } + ], + "year3": [ + { + "x": 1, + "y": 1, + "value": 1 + }, + { + "x": 1, + "y": 2, + "value": 0.1715 + }, + { + "x": 1, + "y": 3, + "value": 0.41017 + }, + { + "x": 1, + "y": 4, + "value": 0.5419 + }, + { + "x": 2, + "y": 1, + "value": 0.1715 + }, + { + "x": 2, + "y": 2, + "value": 1 + }, + { + "x": 2, + "y": 3, + "value": -0.14667 + }, + { + "x": 2, + "y": 4, + "value": -0.02214 + }, + { + "x": 3, + "y": 1, + "value": 0.41017 + }, + { + "x": 3, + "y": 2, + "value": -0.14667 + }, + { + "x": 3, + "y": 3, + "value": 1 + }, + { + "x": 3, + "y": 4, + "value": 0.73722 + }, + { + "x": 4, + "y": 1, + "value": 0.5419 + }, + { + "x": 4, + "y": 2, + "value": -0.02214 + }, + { + "x": 4, + "y": 3, + "value": 0.73722 + }, + { + "x": 4, + "y": 4, + "value": 1 + } + ], + "year5": [ + { + "x": 1, + "y": 1, + "value": 0 + }, + { + "x": 1, + "y": 2, + "value": 0 + }, + { + "x": 1, + "y": 3, + "value": 0 + }, + { + "x": 1, + "y": 4, + "value": 0 + }, + { + "x": 2, + "y": 1, + "value": 0 + }, + { + "x": 2, + "y": 2, + "value": 0 + }, + { + "x": 2, + "y": 3, + "value": 0 + }, + { + "x": 2, + "y": 4, + "value": 0 + }, + { + "x": 3, + "y": 1, + "value": 0 + }, + { + "x": 3, + "y": 2, + "value": 0 + }, + { + "x": 3, + "y": 3, + "value": 0 + }, + { + "x": 3, + "y": 4, + "value": 0 + }, + { + "x": 4, + "y": 1, + "value": 0 + }, + { + "x": 4, + "y": 2, + "value": 0 + }, + { + "x": 4, + "y": 3, + "value": 0 + }, + { + "x": 4, + "y": 4, + "value": 0 + } + ], + "year10": [ + { + "x": 1, + "y": 1, + "value": 0 + }, + { + "x": 1, + "y": 2, + "value": 0 + }, + { + "x": 1, + "y": 3, + "value": 0 + }, + { + "x": 1, + "y": 4, + "value": 0 + }, + { + "x": 2, + "y": 1, + "value": 0 + }, + { + "x": 2, + "y": 2, + "value": 0 + }, + { + "x": 2, + "y": 3, + "value": 0 + }, + { + "x": 2, + "y": 4, + "value": 0 + }, + { + "x": 3, + "y": 1, + "value": 0 + }, + { + "x": 3, + "y": 2, + "value": 0 + }, + { + "x": 3, + "y": 3, + "value": 0 + }, + { + "x": 3, + "y": 4, + "value": 0 + }, + { + "x": 4, + "y": 1, + "value": 0 + }, + { + "x": 4, + "y": 2, + "value": 0 + }, + { + "x": 4, + "y": 3, + "value": 0 + }, + { + "x": 4, + "y": 4, + "value": 0 + } + ] + } +} +``` + + + +### Integration Transformation Operation + + Code Snippet + +```javascript dark +function getCorrelationMatrixData(xRayData) { + const correlationMatrix={}; + const timePeriodMapping = { + "M12": "year1", + "M36": "year3", + "M60": "year5", + "M120": "year10", + } + xRayData.correlationMatrix.forEach((timePeriod) => { + const chartData=[]; + timePeriod.correlationMatrixDetail.forEach((correlation, index) => { + correlation.correlationDetail.forEach((details) => { + const obj = {}; + obj.x = index + 1; + obj.y = parseInt(details.id) + 1; + obj.value = parseFloat(details.correlation) || 0 + chartData.push(obj); + }); + correlationMatrix[timePeriodMapping[timePeriod.timePeriod]] = chartData; + }); + }); + return { + securities: xRayData.holdings.map(s => s.name), + correlationMatrix + }; +} +``` + + + +### Component Transformation Operation + + Code Snippet + +```javascript dark + function getCorrelationMatrixData(xRayData) { + const correlationMatrix={}; + xRayData.correlationMatrix.forEach((timePeriod) => { + const chartData=[]; + timePeriod.Correlations.forEach((correlation, index) => { + correlation.CorrelatedItemKey.forEach((details) => { + const obj = {}; + obj.SecurityId = correlation.SecurityId, + obj.x = index + 1; + obj.y = details.CorrelatedItemKeyId; + obj.value = parseFloat(details.Value) || 0 + chartData.push(obj); + }); + correlationMatrix[timePeriod.TrailingTimePeriod] = chartData; + }); + }); + return { + securities: xRayData.securities, + correlationMatrix + }; + } +``` + + diff --git a/src/components/esg-risk/EsgRisk.vue b/src/components/esg-risk/EsgRisk.vue new file mode 100644 index 0000000..0a1fc2a --- /dev/null +++ b/src/components/esg-risk/EsgRisk.vue @@ -0,0 +1,512 @@ + + + + + Sustainability + + + + + + {{ type.label }} + + + + + + + + + {{ + `${type.portfolioName} + (Based on + ${type.portfolioAum}% of AUM)` + }} + + + + + + + + {{ `${type.benchmarkName}` }} + + + + + + {{ range[0] }} + + + + + {{ + type.type === 'corporate' + ? type.benchmarkCorporateSustainabilityScore + : type.benchmarkSovereignSustainabilityScore + }} + + + + + + {{ + type.type === 'corporate' + ? type.portfolioCorporateSustainabilityScore + : type.portfolioSovereignSustainabilityScore + }} + + + + + Low ESG Risk + Severe ESG Risk + {{ range[1] }} + + + {{ message }} + + + + + Corporate ESG Pillars (lower scores = lower risk) + + + + + + {{ pillar.score }} + + + {{ pillar.scoreType }} + + + + + + + + + + No Data Available + + + + + + diff --git a/src/components/esg-risk/assets/images/esg-environmental.svg b/src/components/esg-risk/assets/images/esg-environmental.svg new file mode 100644 index 0000000..0ce5814 --- /dev/null +++ b/src/components/esg-risk/assets/images/esg-environmental.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/src/components/esg-risk/assets/images/esg-governance.svg b/src/components/esg-risk/assets/images/esg-governance.svg new file mode 100644 index 0000000..dc5aa89 --- /dev/null +++ b/src/components/esg-risk/assets/images/esg-governance.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/components/esg-risk/assets/images/esg-social.svg b/src/components/esg-risk/assets/images/esg-social.svg new file mode 100644 index 0000000..f16c550 --- /dev/null +++ b/src/components/esg-risk/assets/images/esg-social.svg @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/src/components/esg-risk/assets/images/esg-unallocated.svg b/src/components/esg-risk/assets/images/esg-unallocated.svg new file mode 100644 index 0000000..0b832cc --- /dev/null +++ b/src/components/esg-risk/assets/images/esg-unallocated.svg @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/src/components/esg-risk/config/mapping.json b/src/components/esg-risk/config/mapping.json new file mode 100644 index 0000000..d539801 --- /dev/null +++ b/src/components/esg-risk/config/mapping.json @@ -0,0 +1,10 @@ +{ + "dataPoints":{ + "corporate": "Corporate Sustainability Score", + "sovereign": "Sovereign Sustainability Score", + "environmentalScore": "Environmental", + "socialScore": "Social", + "governanceScore": "Governance", + "unallocatedScore": "Unallocated" + } +} diff --git a/src/components/esg-risk/config/sampleEsgData.json b/src/components/esg-risk/config/sampleEsgData.json new file mode 100644 index 0000000..59982b0 --- /dev/null +++ b/src/components/esg-risk/config/sampleEsgData.json @@ -0,0 +1,89 @@ +{ + "portfolio": { + "name": "Test Portfolio1", + "esgRisk": { + "date": "2023-01-31", + "portfolioCorporateSustainabilityScore": 22.882900752377076, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 90.36670967188532, + "portfolioEnvironmentalRiskScore": 4.733127439526373, + "portfolioSocialRiskScore": 9.563974421283557, + "portfolioGovernanceRiskScore": 8.587951649022873, + "portfolioCorporateEsgRiskExposureScore": 50.1214520290877, + "portfolioCorporateEsgManagedRiskScore": 27.238389261384, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 6.780458836312889, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 33.4939336812511, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 51.74384139964076, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 1.3707688969243552, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 6.610997185870893, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 62, + "exposurePercentEligible": 100, + "exposurePercentNotEligible": 0, + "historicalCorporateSustainabilityScore": 22.882900752377076, + "historicalSovereignSustainabilityScore": 13.426964473172335, + "numberOfSecuritiesNotScoredControversy": 43, + "numberOfSecuritiesScoredControversy": 62, + "percentOfAumCoveredControversy": 90.36670967188532, + "percentOfAumWithHighAndSevereControversies": 7.998929002610373, + "percentOfAumWithHighControversies": 5.582265131235619, + "percentOfAumWithLowControversies": 9.32486111431431, + "percentOfAumWithModerateControversies": 27.476771810881036, + "percentOfAumWithNoControversies": 0, + "percentOfAumWithSevereControversies": 2.4166638713747535, + "percentOfAumWithSignificantControversies": 55.19943807219428, + "portfolioDateSustainabilityRating": "2023-01-31", + "portfolioSovereignSustainabilityScore": 13.426964473172335, + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 92.18753020669142, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 7.812469793308578, + "percentOfCorporateSustainabilityScoreContributionEScore": 20.68412344547138, + "percentOfCorporateSustainabilityScoreContributionGScore": 37.52999561531008, + "percentOfCorporateSustainabilityScoreContributionSScore": 41.795288651461945, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 0, + "portfolioUnallocatedEsgRiskScore": 0, + "sovereignPercentOfPortfolioCoveredWithHighEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithLowEsgRiskScores": 100, + "sovereignPercentOfPortfolioCoveredWithMediumEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithSevereEsgRiskScores": 0, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 2, + "sovereignSustainabilityRatingPercentOfEligiblePortfolioCovered": 100, + "sustainabilityRatingCorporateContributionPercent": 92.18753020669142, + "sustainabilityRatingNumberOfSecuritiesScored": 64, + "sustainabilityRatingSovereignContributionPercent": 7.812469793308578 + } + }, + "benchmark": { + "name": "Morningstar US Market TR USD", + "identifier": "XIUSA0010V", + "identifierType": "SecurityId", + "securityType": "XI", + "esgRisk": { + "portfolioCorporateSustainabilityScore": 21.9, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 99.67083, + "portfolioEnvironmentalRiskScore": 4.32, + "portfolioSocialRiskScore": 9.3, + "portfolioGovernanceRiskScore": 7.21, + "portfolioCorporateEsgRiskExposureScore": 40.4303, + "portfolioCorporateEsgManagedRiskScore": 18.53295, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 12.525, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 41.85472, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 42.76231, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 1.75063, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 1.10734, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 1461, + "historicalCorporateSustainabilityScore": 21.85748, + "portfolioDateSustainabilityRating": "2022-12-30", + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 100, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 0, + "percentOfCorporateSustainabilityScoreContributionEScore": 19.72974, + "percentOfCorporateSustainabilityScoreContributionGScore": 32.90745, + "percentOfCorporateSustainabilityScoreContributionSScore": 42.47712, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 4.88994, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 0, + "portfolioUnallocatedEsgScore": 1.07 + } + } +} \ No newline at end of file diff --git a/src/components/esg-risk/doc-global-async.mdx b/src/components/esg-risk/doc-global-async.mdx new file mode 100644 index 0000000..493255d --- /dev/null +++ b/src/components/esg-risk/doc-global-async.mdx @@ -0,0 +1,1029 @@ +import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; +import Sustainability from "@/components/esg-risk/EsgRisk.vue"; +import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external-links"; + + + + + +# ESG Risk Rating + +- [Description](#description) +- [Properties](#properties) +- [Fetching Data](#fetching-data) +- [Data Transformation](#data-transformation) +- [Data Models](#data-models) + + +## Description + +The Morningstar Portfolio Corporate and Sovereign Sustainability Scores are the asset-weighted averages of Sustainalytics' company-level and country ESG Risk Scores. + +The Portfolio Corporate and Sovereign Sustainability Scores are rendered on a 0-100 scale, where lower scores are better, using an asset-weighted average of all covered securities. Morningstar determines whether each eligible portfolio holding can be classified under the corporate or sovereign framework. Each holding can only contribute an ESG Risk Score or a Country Risk score, not both. + +To receive a Corporate Sustainability Score, at least 67% of a portfolio's corporate assets under management (long positions only) must have a company ESG Risk Rating. + +To receive a Sovereign Sustainability Score, at least 67% of a portfolio's sovereign assets under management (long positions only) must have a country ESG Risk Rating. + + + + + +## Properties + + + +## Fetching Data + +The component is populated with data returned by calls to the +Portfolio Analysis Global API. + +### API Data Access Library + +The API Data Access Library is used to fetch data from the API. +Request header 'prefer: 'respond-async' allows to fetch the response asynchronously, which makes sure the response is +available without timeout issues + +``` javascript dark +window.mstarApisSdk.xray.getEsgRiskData({ portfolios: samplePortfolio, languageId: 'en-US', prefer: 'respond-async' }); +``` + + + + Example + +``` javascript dark +const samplePortfolio = [ + { + Name: 'Test Portfolio1', + TotalValue: 10000, + Holdings: [ + { + SecurityId: 'F00000VPDY', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPE0', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3S', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3Q', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3R', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76W', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76Y', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76Z', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76X', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T770', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T772', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T773', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T771', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDQ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDR', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDS', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3Z', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK42', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK47', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4B', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4F', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4J', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4N', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4R', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3V', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T777', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T775', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T776', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T774', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000011DGV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000011DGU', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35Y', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35X', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35W', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000J8SX', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PQ2U', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA007RP', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00ABD', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05GYK', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00DEK', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA08N2L', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00KJW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00COA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00CTW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05HX7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW6', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW5', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIC', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000QSIZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000QSIX', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N79H', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N75J', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UDFO', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N1IS', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000XKG7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000XKG8', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUC', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKDA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKD9', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKKG', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6OZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6P0', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6P1', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIU', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZF1O', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010IS3', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05KKV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000YSY7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000YSY8', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WQUJ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010GIB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010GIA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000U3B0', + Type: 'FO', + Value: 100, + }, + ], + Benchmark: { + Type: 'Standard', + Holdings: [ + { + SecurityId: 'XIUSA0010V', + Type: 'XI', + Weight: 100, + }, + ], + }, + }, +]; + +window.mstarApisSdk.portfolioAnalysis.getEsgRiskData({ + portfolios: samplePortfolio, + languageId: 'en-US', + headers: { + prefer: 'respond-async', + }, +}); + +``` + + + +### Request Example +Asynchronous API Requests has below 3 steps to get the Sustainability data Response: +1. **Initiating Request**: Sustainability API will send back the jobId as shown in the below example. To make the request asynchronous + we need to pass the ‘prefer’ header in the request as shown in the example below. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/esg-risk?langcult={{languageId}} + ``` + + #### Request Payload Example + | Query Parameter | Description | Example | + | :-------------- | :---------- | :------ | + | `languageId` | ISO culture codes. If not provided, defaults to the language defined in settings. | `languageId=en-US` | + + | Request Header | Description | Example | + | :------------- | :---------- | :------ | + | `prefer` | Get the response in asynchronous format | `prefer=respond-async` | + + #### Sample JobId API Response Data Format + + ```javascript dark + { + "jobId": "efb3a071-cd29-41c6-86ce-fb1b3569b5e4", + "_links": [ + { + "href": "www.us-api.morningstar.com/dynamic-services-apis/jobs/efb3a071-cd29-41c6-86ce-fb1b3569b5e4", + "rel": "self", + "method": "GET" + } + ] + } + ``` +2. **Pooling Status**: Once JobId is received, use below API to get the status from the S3 server in the below format. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/dynamic-services-apis/jobs/:jobId + ``` + When the *Automatically follow redirects* setting is on(it’s true by default in postman as well as in all native browsers) + then it automatically redirects to step 3 and returns the response with the status code 200 when the response is available. + Otherwise, we need to keep polling the API until we get a final response. + + #### Sample response for the pending status. + + ```javascript dark + { + "id": "8d616381-9be9-4a2e-85ec-3f5bf244e7c8", + "created": "2023-05-11T10:12:08.3246921Z", + "status": "pending", + "isComplete": false, + "_links": [ + { + "href": "https://www.us-api.morningstar.com/jobs/8d616381-9be9-4a2e-85ec-3f5bf244e7c8", + "rel": "self", + "method": "GET" + } + ] + } + ``` + When the *Automatically follow redirects* setting is off then it returns the status code '302 Found' and the URL + provided will be returned in the response header. Follow Step 3 to get final response. + +3. **Getting Final Response**: Make the Get request to fetch final response from S3 server. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/:requestId + ``` + *Note: RequestId in below URl is received in the step 2 APIs 'location' response header* + + #### Sample final API Response Data Format + + + Code Snippet + + ```json dark + { + "sustainability": [ + { + "portfolio": { + "name": "Test Portfolio1", + "esgRisk": { + "date": "2023-01-31", + "portfolioCorporateSustainabilityScore": 22.882900752377076, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 90.36670967188532, + "portfolioEnvironmentalRiskScore": 4.733127439526373, + "portfolioSocialRiskScore": 9.563974421283557, + "portfolioGovernanceRiskScore": 8.587951649022873, + "portfolioCorporateEsgRiskExposureScore": 50.1214520290877, + "portfolioCorporateEsgManagedRiskScore": 27.238389261384, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 6.780458836312889, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 33.4939336812511, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 51.74384139964076, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 1.3707688969243552, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 6.610997185870893, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 62, + "exposurePercentEligible": 100, + "exposurePercentNotEligible": 0, + "historicalCorporateSustainabilityScore": 22.882900752377076, + "historicalSovereignSustainabilityScore": 13.426964473172335, + "numberOfSecuritiesNotScoredControversy": 43, + "numberOfSecuritiesScoredControversy": 62, + "percentOfAumCoveredControversy": 90.36670967188532, + "percentOfAumWithHighAndSevereControversies": 7.998929002610373, + "percentOfAumWithHighControversies": 5.582265131235619, + "percentOfAumWithLowControversies": 9.32486111431431, + "percentOfAumWithModerateControversies": 27.476771810881036, + "percentOfAumWithNoControversies": 0, + "percentOfAumWithSevereControversies": 2.4166638713747535, + "percentOfAumWithSignificantControversies": 55.19943807219428, + "portfolioDateSustainabilityRating": "2023-01-31", + "portfolioSovereignSustainabilityScore": 13.426964473172335, + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 92.18753020669142, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 7.812469793308578, + "percentOfCorporateSustainabilityScoreContributionEScore": 20.68412344547138, + "percentOfCorporateSustainabilityScoreContributionGScore": 37.52999561531008, + "percentOfCorporateSustainabilityScoreContributionSScore": 41.795288651461945, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 0, + "portfolioUnallocatedEsgRiskScore": 0, + "sovereignPercentOfPortfolioCoveredWithHighEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithLowEsgRiskScores": 100, + "sovereignPercentOfPortfolioCoveredWithMediumEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithSevereEsgRiskScores": 0, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 2, + "sovereignSustainabilityRatingPercentOfEligiblePortfolioCovered": 100, + "sustainabilityRatingCorporateContributionPercent": 92.18753020669142, + "sustainabilityRatingNumberOfSecuritiesScored": 64, + "sustainabilityRatingSovereignContributionPercent": 7.812469793308578 + } + }, + "benchmark": { + "name": "Morningstar US Market TR USD", + "identifier": "XIUSA0010V", + "identifierType": "SecurityId", + "securityType": "XI", + "esgRisk": { + "portfolioCorporateSustainabilityScore": 21.9, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 99.67083, + "portfolioEnvironmentalRiskScore": 4.32, + "portfolioSocialRiskScore": 9.3, + "portfolioGovernanceRiskScore": 7.21, + "portfolioCorporateEsgRiskExposureScore": 40.4303, + "portfolioCorporateEsgManagedRiskScore": 18.53295, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 12.525, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 41.85472, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 42.76231, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 1.75063, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 1.10734, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 1461, + "historicalCorporateSustainabilityScore": 21.85748, + "portfolioDateSustainabilityRating": "2022-12-30", + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 100, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 0, + "percentOfCorporateSustainabilityScoreContributionEScore": 19.72974, + "percentOfCorporateSustainabilityScoreContributionGScore": 32.90745, + "percentOfCorporateSustainabilityScoreContributionSScore": 42.47712, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 4.88994, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 0, + "portfolioUnallocatedEsgScore": 1.07 + } + }, + "securityBreakdown": [ + { + "name": "London & Capital Glbl Bal Fxd Inc I £Inc", + "identifier": "0P00013NQG", + "identifierType": "PerformanceId", + "securityType": "FO", + "esgRisk": { + "portfolioCorporateSustainabilityScore": 22.75, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 95.43613, + "portfolioEnvironmentalRiskScore": 4.62, + "portfolioSocialRiskScore": 9.6, + "portfolioGovernanceRiskScore": 8.53, + "portfolioCorporateEsgRiskExposureScore": 49.85916, + "portfolioCorporateEsgManagedRiskScore": 27.11155, + "morningstarSustainabilityRating": "Below Average", + "corporateSustainabilityPercentRankInGlobalCategory": 68, + "historicalCorporateSustainabilityScoreGlobalCategoryAverage": 21.61421, + "historicalCorporateSustainabilityPercentRankInGlobalCategory": 73, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 6.81752, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 31.96378, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 51.96355, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 2.72161, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 6.53354, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 64, + "historicalCorporateSustainabilityScore": 23.34877, + "historicalSovereignSustainabilityScore": 13.08997, + "portfolioDateSustainabilityRating": "2022-12-31", + "portfolioSovereignSustainabilityScore": 13.45, + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 90.45343, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 9.54657, + "percentOfCorporateSustainabilityScoreContributionEScore": 20.32348, + "percentOfCorporateSustainabilityScoreContributionGScore": 37.49788, + "percentOfCorporateSustainabilityScoreContributionSScore": 42.18933, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 0, + "sovereignPercentOfPortfolioCoveredWithHighEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithLowEsgRiskScores": 100, + "sovereignPercentOfPortfolioCoveredWithMediumEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithSevereEsgRiskScores": 0, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 3, + "sovereignSustainabilityRatingPercentOfEligiblePortfolioCovered": 100, + "portfolioSustainabilityRatingCorporateContributionPercent": 90.45343, + "portfolioSustainabilityRatingSovereignContributionPercent": 9.54657, + "portfolioCorporateSustainabilityRating": "Below Average", + "portfolioSovereignSustainabilityRating": "Above Average", + "sovereignSustainabilityPercentRankInGlobalCategory": 17, + "sovereignSustainabilityAbsoluteRankInGlobalCategory": 391, + "historicalSovereignSustainabilityPercentRankInGlobalCategory": 13, + "historicalSovereignSustainabilityAbsoluteRankInGlobalCategory": 311, + "sovereignSustainabilityGlobalCategoryAverage": 15.92096, + "historicalSovereignSustainabilityScoreGlobalCategoryAverage": 15.90791, + "numberOfFundsInGlobalCategoryCorporateSustainability": 1766, + "numberOfFundsInGlobalCategorySovereignSustainability": 2369, + "sovereignSustainabilityBreakpoint12": 21.91, + "sovereignSustainabilityBreakpoint23": 16.08, + "sovereignSustainabilityBreakpoint34": 13.82, + "sovereignSustainabilityBreakpoint45": 12.86, + "portfolioUnallocatedEsgScore": 0, + "corporateSustainabilityAbsoluteRankInGlobalCategory": 1199, + "historicalCorporateSustainabilityAbsoluteRankInGlobalCategory": 1286, + "corporateSustainabilityGlobalCategoryAverage": 21.43134 + } + } + ], + "metadata": { + "messages": [ + { + "type": "Warning", + "message": "Invalid or unentitled holdings", + "invalidHoldings": [ + { + "securityId": "F0GBR052QA", + "status": "Unentitled" + }, + { + "securityId": "F000000EY1", + "status": "Unentitled" + }, + { + "securityId": "F00000OXG7", + "status": "Unentitled" + } + ] + } + ] + } + } + ], + "metadata": { + "requestId": "03956dbc-bc59-449b-a0e8-94c9d2c6f0b0" + } + } + ``` + + +## Data Transformation + +Data returned by the API must be transformed to a format the component understands. + + +### Component Transformed Data Format + + + Code Snippet + +```javascript dark +{ + "portfolio": { + "name": "Test Portfolio1", + "esgRisk": { + "date": "2023-01-31", + "portfolioCorporateSustainabilityScore": 22.882900752377076, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 90.36670967188532, + "portfolioEnvironmentalRiskScore": 4.733127439526373, + "portfolioSocialRiskScore": 9.563974421283557, + "portfolioGovernanceRiskScore": 8.587951649022873, + "portfolioCorporateEsgRiskExposureScore": 50.1214520290877, + "portfolioCorporateEsgManagedRiskScore": 27.238389261384, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 6.780458836312889, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 33.4939336812511, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 51.74384139964076, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 1.3707688969243552, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 6.610997185870893, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 62, + "exposurePercentEligible": 100, + "exposurePercentNotEligible": 0, + "historicalCorporateSustainabilityScore": 22.882900752377076, + "historicalSovereignSustainabilityScore": 13.426964473172335, + "numberOfSecuritiesNotScoredControversy": 43, + "numberOfSecuritiesScoredControversy": 62, + "percentOfAumCoveredControversy": 90.36670967188532, + "percentOfAumWithHighAndSevereControversies": 7.998929002610373, + "percentOfAumWithHighControversies": 5.582265131235619, + "percentOfAumWithLowControversies": 9.32486111431431, + "percentOfAumWithModerateControversies": 27.476771810881036, + "percentOfAumWithNoControversies": 0, + "percentOfAumWithSevereControversies": 2.4166638713747535, + "percentOfAumWithSignificantControversies": 55.19943807219428, + "portfolioDateSustainabilityRating": "2023-01-31", + "portfolioSovereignSustainabilityScore": 13.426964473172335, + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 92.18753020669142, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 7.812469793308578, + "percentOfCorporateSustainabilityScoreContributionEScore": 20.68412344547138, + "percentOfCorporateSustainabilityScoreContributionGScore": 37.52999561531008, + "percentOfCorporateSustainabilityScoreContributionSScore": 41.795288651461945, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 0, + "portfolioUnallocatedEsgRiskScore": 0, + "sovereignPercentOfPortfolioCoveredWithHighEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithLowEsgRiskScores": 100, + "sovereignPercentOfPortfolioCoveredWithMediumEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 0, + "sovereignPercentOfPortfolioCoveredWithSevereEsgRiskScores": 0, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 2, + "sovereignSustainabilityRatingPercentOfEligiblePortfolioCovered": 100, + "sustainabilityRatingCorporateContributionPercent": 92.18753020669142, + "sustainabilityRatingNumberOfSecuritiesScored": 64, + "sustainabilityRatingSovereignContributionPercent": 7.812469793308578 + } + }, + "benchmark": { + "name": "Morningstar US Market TR USD", + "identifier": "XIUSA0010V", + "identifierType": "SecurityId", + "securityType": "XI", + "esgRisk": { + "portfolioCorporateSustainabilityScore": 21.9, + "corporateSustainabilityRatingPercentOfEligiblePortfolioCovered": 99.67083, + "portfolioEnvironmentalRiskScore": 4.32, + "portfolioSocialRiskScore": 9.3, + "portfolioGovernanceRiskScore": 7.21, + "portfolioCorporateEsgRiskExposureScore": 40.4303, + "portfolioCorporateEsgManagedRiskScore": 18.53295, + "corporatePercentOfPortfolioCoveredWithHighEsgRiskScores": 12.525, + "corporatePercentOfPortfolioCoveredWithLowEsgRiskScores": 41.85472, + "corporatePercentOfPortfolioCoveredWithMediumEsgRiskScores": 42.76231, + "corporatePercentOfPortfolioCoveredWithNegligibleEsgRiskScores": 1.75063, + "corporatePercentOfPortfolioCoveredWithSevereEsgRiskScores": 1.10734, + "corporateSustainabilityRatingNumberOfSecuritiesScored": 1461, + "historicalCorporateSustainabilityScore": 21.85748, + "portfolioDateSustainabilityRating": "2022-12-30", + "portfolioSustainabilityRatingEligibleHoldingType": "corporate, sovereign", + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsCorporate": 100, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsOther": 0, + "portfolioSustainabilityRatingPercentageOfQualifiedHoldingsSovereign": 0, + "percentOfCorporateSustainabilityScoreContributionEScore": 19.72974, + "percentOfCorporateSustainabilityScoreContributionGScore": 32.90745, + "percentOfCorporateSustainabilityScoreContributionSScore": 42.47712, + "percentOfCorporateSustainabilityScoreContributionUnallocatedScore": 4.88994, + "sovereignSustainabilityRatingNumberOfSecuritiesScored": 0, + "portfolioUnallocatedEsgScore": 1.07 + } + } +} +``` + + + +### Component Transformation Operation + + + Code Snippet + +```javascript dark +generateSustainabilityData(data = {}) { + const esgBreakdownData = {}; + const portfolio = get(data, 'portfolio', {}); + const benchmark = get(data, 'benchmark', {}); + const portfolioCorporateSustainabilityScore = this.formatNumber( + get(portfolio, 'esgRisk.portfolioCorporateSustainabilityScore'), + 2, + ); + const portfolioSovereignSustainabilityScore = this.formatNumber( + get(portfolio, 'esgRisk.portfolioSovereignSustainabilityScore'), + 2, + ); + const benchmarkCorporateSustainabilityScore = this.formatNumber( + get(benchmark, 'esgRisk.historicalCorporateSustainabilityScore'), + 2, + ); + const benchmarkSovereignSustainabilityScore = this.formatNumber( + get(benchmark, 'esgRisk.historicalSovereignSustainabilityScore'), + 2, + ); + if (portfolioCorporateSustainabilityScore) { + this.corporate = { + type: 'corporate', + label: mappings.dataPoints.corporate, + portfolioName: portfolio.name, + benchmarkName: benchmark.name, + portfolioAum: this.formatNumber( + get(portfolio, 'esgRisk.corporateSustainabilityRatingPercentOfEligiblePortfolioCovered'), + 2, + ), + portfolioCorporateSustainabilityScore, + benchmarkCorporateSustainabilityScore, + }; + } + + if (portfolioSovereignSustainabilityScore) { + this.sovereign = { + type: 'sovereign', + label: mappings.dataPoints.sovereign, + portfolioName: portfolio.name, + benchmarkName: benchmark.name, + portfolioAum: this.formatNumber( + get(portfolio, 'esgRisk.sovereignSustainabilityRatingPercentOfEligiblePortfolioCovered'), + 2, + ), + portfolioSovereignSustainabilityScore, + benchmarkSovereignSustainabilityScore, + }; + } + + esgBreakdownData.environmentalScore = this.formatNumber( + get(portfolio, 'esgRisk.portfolioEnvironmentalRiskScore'), + 2, + ); + esgBreakdownData.socialScore = this.formatNumber( + get(portfolio, 'esgRisk.portfolioSocialRiskScore'), + 2, + ); + esgBreakdownData.governanceScore = this.formatNumber( + get(portfolio, 'esgRisk.portfolioGovernanceRiskScore'), + 2, + ); + esgBreakdownData.unallocatedScore = this.formatNumber( + get(portfolio, 'esgRisk.portfolioUnallocatedESGRiskScore'), + 2, + ); + + this.pillarData = []; + + Object.entries(esgBreakdownData).forEach((pillar) => { + const obj = { + scoreType: mappings.dataPoints[pillar[0]], + score: this.formatNumber(pillar[1], 2), + }; + this.pillarData.push(obj); + }); +}, +``` + + + + +## Data Models +The component uses the following data models: + + Corporate Data + +```json dark +{ + "type": "corporate", + "label": "Corporate Sustainability Score", + "portfolioName": "TestPortfolio1", + "benchmarkName": "S&P 500 TR USD", + "portfolioAum": "91.08", + "portfolioCorporateSustainabilityScore": "21.98", + "benchmarkCorporateSustainabilityScore": "21.39" +} +``` + + + + + Sovereign Data + +```json dark +{ + "type": "sovereign", + "label": "Sovereign Sustainability Score", + "portfolioName": "TestPortfolio1", + "benchmarkName": "S&P 500 TR USD", + "portfolioAum": "100.00", + "portfolioSovereignSustainabilityScore": "15.52", + "benchmarkSovereignSustainabilityScore": "20.63" +} +``` + + + + + Corporate Pillars Data + +```json dark +[ + { + "scoreType": "Environmental", + "score": "3.39" + }, + { + "scoreType": "Social", + "score": "8.04" + }, + { + "scoreType": "Governance", + "score": "6.95" + }, + { + "scoreType": "Unallocated", + "score": "3.59" + } +] +``` + diff --git a/src/components/fees-expenses/doc-americas.mdx b/src/components/fees-expenses/doc-americas.mdx index 15eebe1..a61be3e 100644 --- a/src/components/fees-expenses/doc-americas.mdx +++ b/src/components/fees-expenses/doc-americas.mdx @@ -105,7 +105,7 @@ window.mstarApisSdk.xray.getFeesExpensesUsData({ portfolios: helper.sampleUsPort ### Request Example ```javascript dark -"https://www.us-api.morningstar.com/portfolioanalysis/v1/esg?langcult={{languageId}}" +"https://www.us-api.morningstar.com/portfolioanalysis/v1/xray?langcult={{languageId}}" ``` ### Request Payload Example diff --git a/src/components/fixed-income-country/doc.mdx b/src/components/fixed-income-country/doc.mdx index 526b16c..f78e42c 100644 --- a/src/components/fixed-income-country/doc.mdx +++ b/src/components/fixed-income-country/doc.mdx @@ -37,7 +37,7 @@ import { PORTFOLIO_ANALYSIS_EMEA_URL, DATA_ACCESS_LIBRARY } from "@/external-lin ## Description -Fixed Income country represents the percent of fixed income invest country wise. +The Fixed Income - Country component illustrates a portfolio's fixed income exposure by country. @@ -111,7 +111,7 @@ window.mstarApisSdk.getFixedIncomeCountryData({ portfolios: samplePortfolio }); ### Request Example ```javascript dark -https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} +https://www.emea-api.morningstar.com/ecint/v2/xray?outputtype=json&languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} ``` @@ -130,9 +130,9 @@ https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId} Data returned by the API must be transformed to the format the component understands. ### API Response Data Format diff --git a/src/components/fixed-income-sectors/doc-americas.mdx b/src/components/fixed-income-sectors/doc-americas.mdx index 9ac6e6f..951084c 100644 --- a/src/components/fixed-income-sectors/doc-americas.mdx +++ b/src/components/fixed-income-sectors/doc-americas.mdx @@ -36,7 +36,7 @@ import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external ## Description -Fixed Income sector represents the different kind of sector which total make your fixed income. +The Fixed Income - Sectors component illustrates a portfolio's fixed income exposure by sector. @@ -105,7 +105,7 @@ window.mstarApisSdk.xray.getFixedIncomeSectorsUsData({ portfolios: helper.sample ### Request Example ```javascript dark -"https://www.us-api.morningstar.com/portfolioanalysis/v1/esg?langcult={{languageId}}" +"https://www.us-api.morningstar.com/portfolioanalysis/v1/xray?langcult={{languageId}}" ``` ### Request Payload Example diff --git a/src/components/fixed-income-sectors/doc-emea.mdx b/src/components/fixed-income-sectors/doc-emea.mdx index 78d5dad..1ef7951 100644 --- a/src/components/fixed-income-sectors/doc-emea.mdx +++ b/src/components/fixed-income-sectors/doc-emea.mdx @@ -37,7 +37,7 @@ import { PORTFOLIO_ANALYSIS_EMEA_URL, DATA_ACCESS_LIBRARY } from "@/external-lin ## Description -Fixed Income sector represents the different kind of sector which total make your fixed income +The Fixed Income - Sectors component illustrates a portfolio's fixed income exposure by sector. @@ -110,7 +110,7 @@ window.mstarApisSdk.getFixedIncomeSectorsData{{ portfolios: samplePortfolio }}; ### Request Example ```javascript dark -https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} +https://www.emea-api.morningstar.com/ecint/v2/xray?outputtype=json&languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} ``` @@ -128,9 +128,9 @@ https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId} Data returned by the API must be transformed to the format the component understands. ### API Response Data Format diff --git a/src/components/performance-graph/PerformanceGraph.vue b/src/components/performance-graph/PerformanceGraph.vue index 5337462..ba98901 100644 --- a/src/components/performance-graph/PerformanceGraph.vue +++ b/src/components/performance-graph/PerformanceGraph.vue @@ -266,7 +266,7 @@ export default { const { graphBaseValue } = this; newValue = ((newValue - graphBaseValue) / graphBaseValue) * 100.0; - return `${name} : ${newValue.toFixed(2)}`; + return `${name} : ${newValue.toFixed(2)}%`; }, tabChanged(event) { this.chartData = this.parseChartData(event.key); diff --git a/src/components/performance-graph/docs/doc-growth-chart-americas.mdx b/src/components/performance-graph/docs/doc-growth-chart-americas.mdx index fea3895..980b003 100644 --- a/src/components/performance-graph/docs/doc-growth-chart-americas.mdx +++ b/src/components/performance-graph/docs/doc-growth-chart-americas.mdx @@ -36,7 +36,7 @@ import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external - [Subcomponent Configuration](#subcomponent-configuration) ## Description -The Growth of 10K performance graph is illustrates the change in value of an initial $10,000 investment in a financial asset during a given period of time. +The Growth of 10K performance graph illustrates the change in value of an initial $10,000 investment in a financial asset over a given period of time. @@ -104,7 +104,7 @@ window.mstarApisSdk.xray.getPerformanceGraphUsData({ portfolios: samplePortfolio ### Request Example ```javascript dark -"https://www.us-api.morningstar.com/portfolioanalysis/v1/esg?langcult={{languageId}}" +"https://www.us-api.morningstar.com/portfolioanalysis/v1/xray?langcult={{languageId}}" ``` ### Request Payload Example diff --git a/src/components/performance-graph/docs/doc-growth-chart-emea.mdx b/src/components/performance-graph/docs/doc-growth-chart-emea.mdx index ca6cc11..1a93ede 100644 --- a/src/components/performance-graph/docs/doc-growth-chart-emea.mdx +++ b/src/components/performance-graph/docs/doc-growth-chart-emea.mdx @@ -24,7 +24,7 @@ import { PORTFOLIO_ANALYSIS_EMEA_URL, DATA_ACCESS_LIBRARY } from "@/external-lin min-height: 100% } `} - + # Performance Graph - Growth of 10k (APAC/EMEA) @@ -36,7 +36,7 @@ import { PORTFOLIO_ANALYSIS_EMEA_URL, DATA_ACCESS_LIBRARY } from "@/external-lin - [Subcomponent Configuration](#subcomponent-configuration) ## Description -The Growth of 10K performance graph is illustrates the change in value of an initial $10,000 investment in a financial asset during a given period of time. +The Growth of 10K performance graph illustrates the change in value of an initial $10,000 investment in a financial asset over a given period of time. @@ -110,15 +110,15 @@ window.mstarApisSdk.xray.getPerformanceGraphData({ portfolios: samplePortfolio } ### Request Example ```javascript dark -https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} +https://www.emea-api.morningstar.com/ecint/v2/xray?outputtype=json&languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} ``` ### Request Payload Example | Query Parameter | Description|Example | -| :----------- | :--------| :----------- | +| :----------- | :--------| :----------- | | `languageId` | ISO culture codes. If not provided, defaults to language defined in settings. | `languageId=en-GB` | -| `portfolioDataPoints` | Comma-separated list of portfolio data points.| `portfolioDataPoints=BenchmarkName,HistoricalPerformanceSeries` | +| `portfolioDataPoints` | Comma-separated list of portfolio data points.| `portfolioDataPoints=BenchmarkName,HistoricalPerformanceSeries` | | `holdingDataPoints` | Comma-separated list of holding data points.| `HoldingDataPoints=ShowBreakdown` | | `benchmarkDataPoints` | Comma-separated list of benchmark data points.| `benchmarkDataPoints=ShowBreakdown,HistoricalPerformanceSeries` | @@ -127,9 +127,9 @@ https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId} Data returned by the API must be transformed to a format the component understands. ### API Response Data Format @@ -177,7 +177,7 @@ Data returned by the API must be transformed to a format the component understan [ "2012-09-30", 5.00531 - ], + ], ] }, ], @@ -201,7 +201,7 @@ Data returned by the API must be transformed to a format the component understan [ "1972-03-31", 0.66122 - ], + ], ] }, ] diff --git a/src/components/portfolio-holdings/PortfolioHoldings.vue b/src/components/portfolio-holdings/PortfolioHoldings.vue index d7bb436..07aa903 100644 --- a/src/components/portfolio-holdings/PortfolioHoldings.vue +++ b/src/components/portfolio-holdings/PortfolioHoldings.vue @@ -5,8 +5,23 @@ Portfolio Holdings + + + + Portion of Portfolio Aligned + + + + {{modelData.preferenceAlignedPercentage}}% + + + + - + - - - - - - - - - - - {{ child[fieldDefinitions.stockOverlap[index - 1] - .value] }} - - - - - - + + + + + + + + + {{ value }} + + + + + + + + + + + {{ child[fieldDefinitions.stockOverlap[index - 1] + .value] }} + + + + + + + + Investments aligned with my selected preferences. + + + + + @@ -106,6 +142,9 @@ export default { }; }, computed: { + hasPreferenceAlignedPercentage() { + return Object.keys(this.modelData) && this.modelData.preferenceAlignedPercentage; + }, parsedModelData() { if (this.modelData) { const selectedTab = this.tabs[this.selectedTab]; @@ -119,7 +158,7 @@ export default { return this.getStockOverlapModelData(); } } - return []; + return {}; }, selectedFieldDefinitions() { const selectedTab = this.tabs[this.selectedTab]; @@ -200,9 +239,32 @@ export default { .portfolio-holdings { @include mixin.wal-component-title; + @include mixin.wal-component-subtitle(false, true, true); @include mixin.wal-table; + + // constants + $badge-size: 75px; + + .user-preference-badge { + height: $badge-size; + width: $badge-size; + background-image: url("@/assets/badge.svg"); + + &__text { + font-size: map.get(mixin.$wal, 'font-size', 'xs'); + align-self: center; + color: mixin.$wal-color-white; + } + } table { - td ul { + .user-preference { + margin: map.get(mixin.$wal, "space", "1-and-a-quarter-x"); + + &__logo { + @include mixin.applyIcon("@/assets/badge.svg"); + } + } + td ul { list-style: none; padding-left: 0; li { @@ -213,5 +275,8 @@ export default { text-align: end; } } + .preferences * { + vertical-align: middle; + } } diff --git a/src/components/portfolio-holdings/doc-americas.mdx b/src/components/portfolio-holdings/doc-americas.mdx index 9f878d0..49e1eb6 100644 --- a/src/components/portfolio-holdings/doc-americas.mdx +++ b/src/components/portfolio-holdings/doc-americas.mdx @@ -113,7 +113,7 @@ window.mstarApisSdk.xray.getPortfolioHoldingsUsData({ portfolios: samplePortfoli Requests to the API have the following format: ```javascript dark -"https://www.us-api.morningstar.com/portfolioanalysis/v1/esg?langcult={{languageId}}" +"https://www.us-api.morningstar.com/portfolioanalysis/v1/xray?langcult={{languageId}}" ``` ### Request Payload Example diff --git a/src/components/portfolio-holdings/doc-emea.mdx b/src/components/portfolio-holdings/doc-emea.mdx index 9928ce2..ce1641a 100644 --- a/src/components/portfolio-holdings/doc-emea.mdx +++ b/src/components/portfolio-holdings/doc-emea.mdx @@ -118,7 +118,7 @@ window.mstarApisSdk.xray.getPortfolioHoldingsData({ portfolios: samplePortfolio Requests to the API have the following format: ```javascript dark -https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} +https://www.emea-api.morningstar.com/ecint/v2/xray?outputtype=json&languageId={{languageId}}&portfolioDataPoints={{portfolioDataPoints}}&holdingDataPoints={{holdingDataPoints}}&benchmarkDataPoints={{benchmarkDataPoints}} ``` @@ -136,9 +136,9 @@ https://www.emea-api.morningstar.com/ecint/v1/xray/json?languageId={{languageId} Data returned by the API must be transformed to a format the component understands. @@ -223,7 +223,7 @@ Data returned by the API must be transformed to a format the component understan } ], "topUnderlyingHoldings": [ - { + { "holdingId": "G4527HHD6", "name": "United Kingdom of Great Britain and Northern Ireland 1.25%", "securityId": "B000367UR0", diff --git a/src/components/portfolio-srri/doc.mdx b/src/components/portfolio-srri/doc.mdx index eaa4e4d..74b5e80 100644 --- a/src/components/portfolio-srri/doc.mdx +++ b/src/components/portfolio-srri/doc.mdx @@ -2,7 +2,7 @@ import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; import PortfolioSrri from "@/components/portfolio-srri/PortfolioSrri.vue"; import { PORTFOLIO_ANALYSIS_EMEA_URL, DATA_ACCESS_LIBRARY } from "@/external-links"; - + + +# Product Involvement + +- [Description US](#description) +- [Properties](#properties) +- [Fetching Data](#fetching-data) +- [Data Transformation](#data-transformation) + + +## Description + +The Product Involvement component displays metrics that illustrate a portfolio’s exposure to various products, services, and business activities on a percentage involvement basis. + + + + + +## Properties + + + +## Fetching Data + +The component is populated with data returned by calls to the Portfolio Analysis API (Americas). + +### API Data Access Library + +The API Data Access Library is used to fetch data from the API. +Request header 'prefer: 'respond-async' allows to fetch the response asynchronously, which makes sure the response is +available without timeout issues + +``` javascript dark +window.mstarApisSdk.portfolioAnalysis.getProductInvolvementData({ + portfolios: samplePortfolio, + languageId: 'en-US', + prefer: 'respond-async' +}); +``` + + Example + +``` javascript dark +const samplePortfolio = [ + { + Name: 'Test Portfolio1', + TotalValue: 10000, + Holdings: [ + { + SecurityId: 'F00000VPDY', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPE0', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3S', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3Q', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3R', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76W', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76Y', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76Z', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T76X', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T770', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T772', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T773', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T771', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDQ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDR', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000VPDS', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3Z', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK42', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK47', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4B', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4F', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4J', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4N', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK4R', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WK3V', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T777', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T775', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T776', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T774', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000011DGV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000011DGU', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35Y', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35X', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000H35W', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000J8SX', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PQ2U', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA007RP', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00ABD', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05GYK', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00DEK', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA08N2L', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00KJW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00COA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA00CTW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05HX7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW6', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW5', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WRW7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UEIC', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000QSIZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000QSIX', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N79H', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N75J', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000UDFO', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000N1IS', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000XKG7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000XKG8', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUC', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000OEUA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKDA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKD9', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZKKG', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6OZ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6P0', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000T6P1', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIU', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000PEIW', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000ZF1O', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010IS3', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'FOUSA05KKV', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000YSY7', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000YSY8', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000WQUJ', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010GIB', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F000010GIA', + Type: 'FO', + Value: 100, + }, + { + SecurityId: 'F00000U3B0', + Type: 'FO', + Value: 100, + }, + ], + Benchmark: { + Type: 'Standard', + Holdings: [ + { + SecurityId: 'XIUSA0010V', + Type: 'XI', + Weight: 100, + }, + ], + }, + }, +]; + +window.mstarApisSdk.portfolioAnalysis.getProductInvolvementData({ + portfolios: samplePortfolio, + languageId: 'en-US', + headers: { + prefer: 'respond-async', + }, +}); + +``` + + + +### Request Example + +```javascript dark +"https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/product-involvement?langcult={{languageId}}" + +``` +### Request Payload Example + +Asynchronous API Requests has below 3 steps to get the ESG data Response: +1. **Initiating Request**: Product Involvement Sustainability API will send back the jobId as shown in the below example. To make the request asynchronous + we need to pass the ‘prefer’ header in the request as shown in the example below. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/product-involvement?langcult={{languageId}} + ``` + + #### Request Payload Example + | Query Parameter | Description | Example | + | :-------------- | :---------- | :------ | + | `languageId` | ISO culture codes. If not provided, defaults to the language defined in settings. | `languageId=en-US` | + + | Request Header | Description | Example | + | :------------- | :---------- | :------ | + | `prefer` | Get the response in asynchronous format | `prefer=respond-async` | + + #### Sample JobId API Response Data Format + + ```javascript dark + { + "jobId": "efb3a071-cd29-41c6-86ce-fb1b3569b5e4", + "_links": [ + { + "href": "www.us-api.morningstar.com/dynamic-services-apis/jobs/efb3a071-cd29-41c6-86ce-fb1b3569b5e4", + "rel": "self", + "method": "GET" + } + ] + } + ``` +2. **Pooling Status**: Once JobId is received, use below API to get the status from the S3 server in the below format. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/dynamic-services-apis/jobs/:jobId + ``` + When the *Automatically follow redirects* setting is on(it’s true by default in postman as well as in all native browsers) + then it automatically redirects to step 3 and returns the response with the status code 200 when the response is available. + Otherwise, we need to keep polling the API until we get a final response. + + #### Sample response for the pending status. + + ```javascript dark + { + "id": "8d616381-9be9-4a2e-85ec-3f5bf244e7c8", + "created": "2023-05-11T10:12:08.3246921Z", + "status": "pending", + "isComplete": false, + "_links": [ + { + "href": "https://www.us-api.morningstar.com/jobs/8d616381-9be9-4a2e-85ec-3f5bf244e7c8", + "rel": "self", + "method": "GET" + } + ] + } + ``` + When the *Automatically follow redirects* setting is off then it returns the status code '302 Found' and the URL + provided will be returned in the response header. Follow Step 3 to get final response. + +3. **Getting Final Response**: Make the Get request to fetch final response from S3 server. + + ```javascript dark + https://www.us-api.morningstar.com/portfolio-analysis/v1/sustainability/:requestId + ``` + *Note: RequestId in below URl is received in the step 2 APIs 'location' response header* + + +## Data Transformation + +Data returned by the API must be transformed to a format the component understands. + + +### API Response Data Format + + Code Snippet + +```json dark +{ + "sustainability": [ + { + "portfolio": { + "name": "Test Portfolio1", + "productInvolvement": { + "date": "2023-01-31", + "abortiveContraceptivesStemCell": 8.625899, + "adultEntertainment": 0, + "alcohol": 0, + "animalTesting": 12.112276, + "controversialWeapons": 0, + "furAndSpecialtyLeather": 0, + "gambling": 0, + "gmo": 0, + "militaryContracting": 3.7213857, + "nuclear": 4.837718, + "palmOil": 0, + "pesticides": 0, + "smallArms": 0, + "thermalCoal": 3.3160741, + "tobacco": 0 + } + }, + "benchmark": { + "name": "Morningstar US Market TR USD", + "identifier": "XIUSA0010V", + "identifierType": "SecurityId", + "securityType": "XI", + "productInvolvement": { + "abortiveContraceptivesStemCell": 10.45828, + "adultEntertainment": 0, + "alcohol": 0.18794, + "animalTesting": 21.60459, + "controversialWeapons": 2.07183, + "furAndSpecialtyLeather": 0, + "gambling": 0.3169, + "gmo": 0.11377, + "militaryContracting": 3.48873, + "nuclear": 2.127, + "palmOil": 0, + "pesticides": 0.17732, + "smallArms": 1.06037, + "thermalCoal": 1.44929, + "tobacco": 0.6942 + } + }, + "securityBreakdown": [ + { + "name": "London & Capital Glbl Bal Fxd Inc I £Inc", + "identifier": "0P00013NQG", + "identifierType": "PerformanceId", + "securityType": "FO", + "productInvolvement": { + "abortiveContraceptivesStemCell": 8.40239, + "adultEntertainment": 0, + "alcohol": 0, + "animalTesting": 11.60398, + "controversialWeapons": 0, + "furAndSpecialtyLeather": 0, + "gambling": 0, + "gmo": 0, + "militaryContracting": 3.59007, + "nuclear": 4.54035, + "palmOil": 0, + "pesticides": 0, + "smallArms": 0, + "thermalCoal": 3.12427, + "tobacco": 0 + } + } + ], + "metadata": { + "messages": [ + { + "type": "Warning", + "message": "Invalid or unentitled holdings", + "invalidHoldings": [ + { + "securityId": "F0GBR052QA", + "status": "Unentitled" + }, + { + "securityId": "F000000EY1", + "status": "Unentitled" + }, + { + "securityId": "F00000OXG7", + "status": "Unentitled" + } + ] + } + ] + } + } + ], + "metadata": { + "requestId": "9eeb7465-e774-45d8-905c-358ec272f804" + } +} +``` + + + +### Integration Data Format + + Code Snippet + +```json dark +{ + "portfolio": { + "abortiveContraceptivesStemcell": 6.6914544, + "animalTesting": 12.180668, + "controversialWeapons": 1.2591741, + "adultEntertainment": 0, + "alcohol": 1.1270572, + "furAndSpecialtyLeather": 0, + "gambling": 0.28550306, + "militaryContracting": 2.0566392, + "nuclear": 0.43815938, + "palmOil": 0.008738188, + "pesticides": 0.06944976, + "smallArms": 1.3401275, + "thermalCoal": 0.12252558, + "tobacco": 0.16017261, + "gmo": 0.017991528 + }, + "benchmark": { + "abortiveContraceptivesStemcell": 9.76653, + "animalTesting": 20.19085, + "controversialWeapons": 1.88323, + "adultEntertainment": 0, + "alcohol": 0.15723, + "furAndSpecialtyLeather": 0, + "gambling": 0.15979, + "militaryContracting": 3.08397, + "nuclear": 1.94728, + "palmOil": 0, + "pesticides": 0.15281, + "smallArms": 0.98947, + "thermalCoal": 1.36642, + "tobacco": 0.62949, + "gmo": 0.10922 + } +} +``` + + + +### Integration Transformation Operation + + Code Snippet + +```javascript dark +function getProductInvolvementData(esgData) { + return getComponentData( + esgData, + 'portfolio.productInvolvement', + 'benchmark.productInvolvement', + ); +} +``` + + + +### Component Transformed Data Format + + Code Snippet + +```json dark + [ + { + "name": "businessPractices" + }, + { + "name": "animalTesting", + "portfolio": "11.99", + "benchmark": "20.19" + }, + { + "name": "furAndSpecialtyLeather", + "portfolio": "0.00", + "benchmark": "0.00" + }, + { + "name": "defenseAndMilitary" + }, + { + "name": "controversialWeapons", + "portfolio": "0.86", + "benchmark": "1.88" + }, + { + "name": "militaryContracting", + "portfolio": "1.55", + "benchmark": "3.08" + }, + { + "name": "smallArms", + "portfolio": "0.95", + "benchmark": "0.99" + }, + { + "name": "energy" + }, + { + "name": "nuclear", + "portfolio": "0.43", + "benchmark": "1.95" + }, + { + "name": "thermalCoal", + "portfolio": "0.10", + "benchmark": "1.37" + }, + { + "name": "environment" + }, + { + "name": "gmo", + "portfolio": "0.01", + "benchmark": "0.11" + }, + { + "name": "palmOil", + "portfolio": "0.01", + "benchmark": "0.00" + }, + { + "name": "pesticides", + "portfolio": "0.04", + "benchmark": "0.15" + }, + { + "name": "healthAndLife" + }, + { + "name": "alcohol", + "portfolio": "0.95", + "benchmark": "0.16" + }, + { + "name": "lifeEthics" + }, + { + "name": "tobacco", + "portfolio": "0.14", + "benchmark": "0.63" + }, + { + "name": "valuesBased" + }, + { + "name": "adultEntertainment", + "portfolio": "0.00", + "benchmark": "0.00" + }, + { + "name": "gambling", + "portfolio": "0.25", + "benchmark": "0.16" + } + ] +``` + + + +### Component Transformation Operation + + Code Snippet + +```javascript dark + parsedModelData() { + if (this.modelData) { + const parseProductInvolvementData = []; + const { valueMapping } = productInvolvementMapping; + const productInvolvementData = this.modelData; + + if (productInvolvementData.portfolio || productInvolvementData.benchmark) { + valueMapping.dataPoints.forEach((key) => { + parseProductInvolvementData.push({ + name: key, + }); + valueMapping.dataPointsObject[key].forEach((item) => { + if (item) { + parseProductInvolvementData.push({ + name: item, + portfolio: productInvolvementData?.portfolio[item]?.toFixed(2) ?? '-', + benchmark: productInvolvementData?.benchmark[item]?.toFixed(2) ?? '-', + }); + } + }); + }); + return parseProductInvolvementData; + } + } + return []; + } +``` + diff --git a/src/components/questionnaire/Questionnaire.vue b/src/components/questionnaire/Questionnaire.vue new file mode 100644 index 0000000..fa69909 --- /dev/null +++ b/src/components/questionnaire/Questionnaire.vue @@ -0,0 +1,265 @@ + + + + + Questionnaire + + + + {{ questionairre.description }} + + + + + + + {{ question.text }} + + + {{ question.text }} + + + + + + + + + + + + + + + + + + {{ button.text }} + + + + + + + diff --git a/src/components/questionnaire/doc.mdx b/src/components/questionnaire/doc.mdx new file mode 100644 index 0000000..7fffbb6 --- /dev/null +++ b/src/components/questionnaire/doc.mdx @@ -0,0 +1,143 @@ +import { Canvas, Meta, Story, ArgsTable } from "@storybook/addon-docs"; +import { DATA_ACCESS_LIBRARY } from "@/external-links"; +import Questionnaire from "@/components/questionnaire/Questionnaire.vue"; + + + + + +# Questionnaire + +- [Description](#description) +- [Properties](#properties) +- [Fetching Data](#fetching-data) +- [Data Transformation](#data-transformation) +- [Data Models](#data-models) + + +## Description +The Questionnaire Component is part of Investment Preferences Workflow which helps to create a set of filters based on an investor's preferences that you use to search Morningstar's database for matching investments to assess an investor's sustainable investing preferences using a questionnaire. + + + + + +## Properties + + + +## Fetching Data + +The component is populated with data returned by calls to the [Portfolio X-Ray API](https://developer.morningstar.com/documentation/dynamic-services-apis/portfolio-analysis-apacemea/overview). + +### API Data Access Library + +The API Data Access Library is used to fetch data from the API. + +``` javascript dark +window.mstarApisSdk.xray.getAssetAllocationBreakdown({ portfolios: samplePortfolio }); +``` + + Example + +``` javascript dark +const samplePortfolio = {} +window.mstarApisSdk.{/* code to fetch api data */}; +``` + + + +### Request Example + +```javascript dark +https://{base URL}.morningstar.com/ecint/v1/{API name}/json?languageId={languageId} + +``` + +### Request Payload Example + +| Query Parameter | Description|Example | +| :----------- | :--------| :----------- | +| `languageId` | ISO culture codes. If not provided, defaults to language defined in settings. |`languageId=en-GB` | + + +## Data Transformation + +Data returned by the API must be transformed to the format the component understands. + +### API Response Data Format + + Code Snippet + +```json dark + // data goes here +``` + + + +### Component Data Format + + Code Snippet + +```json dark + // data goes here +``` + + + +### Transformation Operation + + Code Snippet + +```javascript dark + // Transformation code goes here +``` + + + +## Data Models +The component uses the following data models: + + Component 1 + +```json dark + // sub components data models go here +``` + + + + Component 2 + +```json dark + // sub components data models go here +``` + diff --git a/src/components/questionnaire/questionairre.json b/src/components/questionnaire/questionairre.json new file mode 100644 index 0000000..649d346 --- /dev/null +++ b/src/components/questionnaire/questionairre.json @@ -0,0 +1,237 @@ +{ + "description": "How much of your portfolio should include financial products that meet the EU's definition of sustainable ?", + "buttons": [ + { + "text": "See Preferences in Screener", + "enabled": false, + "value": "screener" + }, + { + "text": "See Current Portfolio matches your Preferences", + "enabled": false, + "value": "xray" + } + ], + "questions": [ + { + "id": 1, + "text": "EU Taxonomy Alignment", + "infoText": "", + "componentType": "dropdown", + "options": ["Yes Art 8", "Yes Art 9", "No"], + "classes": "", + "defaultValue": "Yes Art 8", + "values": [ + { + "key": "Yes Art 8", + "name": "EET_SustInvEUTaxonomy_A8", + "op": "in", + "value": "Y|I" + }, + { + "key": "Yes Art 9", + "name": "EET_SustInvEUTaxonomy_A9", + "op": "in", + "value": "Y|I" + }, + { + "key": "No", + "value": {} + } + ] + }, + { + "id": 2, + "text": "Minimum Portion", + "componentType": "slider", + "parentId": 1, + "options": { + "val": 0, + "color": "primary" + }, + "value": { + "name": "EET_PlannedInvtsSustInvEUTaxonomy", + "op": "gt", + "value": "0" + }, + "classes": "" + }, + { + "id": 3, + "text": "Optional or Exclusive", + "defaultValue": "Optional", + "parentId": 1, + "options": ["Optional", "Exclusive"], + "componentType": "dropdown", + "classes": "" + }, + { + "id": 4, + "text": "SFDR Classification", + "infoText": "", + "componentType": "dropdown", + "options": ["Yes", "No"], + "classes": "", + "defaultValue": "Yes" + }, + { + "id": 5, + "text": "Type", + "options": ["Art 6", "Art 8", "Art 9"], + "defaultValue": ["Art 8"], + "componentType": "dropdown-multi", + "classes": "", + "parentId": 4 + }, + { + "id": 6, + "text": "Optional or Exclusive", + "defaultValue": "Optional", + "options": ["Optional", "Exclusive"], + "componentType": "dropdown", + "classes": "", + "parentId": 4 + }, + { + "id": 7, + "text": "Principal Adverse Indicators", + "infoText": "", + "componentType": "dropdown", + "options": ["Yes", "No"], + "classes": { + "header": "", + "textHeader": "ml-md-0" + }, + "defaultValue": "Yes" + }, + { + "id": 8, + "text": "Optional or Exclusive", + "defaultValue": "Optional", + "options": ["Optional", "Exclusive"], + "componentType": "dropdown", + "classes": "", + "parentId": 7 + }, + { + "id": 9, + "text": "Environmental", + "options": ["Yes", "No"], + "componentType": "dropdown", + "classes": "", + "defaultValue": "Yes", + "parentId": 7 + }, + { + "id": 10, + "text": "Energy", + "options": ["Yes", "No"], + "componentType": "dropdown", + "defaultValue": "Yes", + "value": "EET_PAI_EnergyInefficientExposureConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + }, + "parentId": 9 + }, + { + "id": 11, + "text": "Biodiversity", + "options": ["Yes", "No"], + "componentType": "dropdown", + "defaultValue": "Yes", + "value": "EET_PAI_NegativeAffectConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + }, + "parentId": 9 + }, + { + "id": 12, + "text": "Water", + "options": ["Yes", "No"], + "componentType": "dropdown", + "defaultValue": "Yes", + "value": "EET_PAI_EmissionsToWaterConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + }, + "parentId": 9 + }, + { + "id": 13, + "text": "Waste", + "options": ["Yes", "No"], + "componentType": "dropdown", + "defaultValue": "Yes", + "parentId": 9, + "value": "EET_PAI_HazardousWasteConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + } + }, + { + "id": 14, + "text": "Corporate Social", + "options": ["Yes", "No"], + "value": "EET_PAI_UNGCViolationsConsidered", + "componentType": "dropdown", + "defaultValue": "Yes", + "classes": "", + "parentId": 7 + }, + { + "id": 15, + "text": "Human Rights", + "options": ["Yes", "No"], + "componentType": "dropdown", + "classes": "", + "defaultValue": "Yes", + "showSubQuestions": true, + "parentId": 7 + }, + { + "id": 16, + "text": "Sovereign & Supernational", + "options": ["Yes", "No"], + "defaultValue": "Yes", + "componentType": "dropdown", + "value": "EET_PAI_SocialViolationsNumberConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + }, + "parentId": 15 + }, + { + "id": 17, + "text": "Environmental", + "options": ["Yes", "No"], + "defaultValue": "Yes", + "componentType": "dropdown", + "value": "EET_PAI_CarbonIntensityConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + }, + "parentId": 15 + }, + { + "id": 18, + "text": "Social", + "options": ["Yes", "No"], + "defaultValue": "Yes", + "componentType": "dropdown", + "value": "EET_PAI_SocialViolationsPercentageConsidered", + "classes": { + "header": "ml-3", + "component": "ml-n3" + }, + "parentId": 15 + } + ] +} diff --git a/src/components/risk-score/RiskScore.vue b/src/components/risk-score/RiskScore.vue index 553fc67..979a2d9 100644 --- a/src/components/risk-score/RiskScore.vue +++ b/src/components/risk-score/RiskScore.vue @@ -1,81 +1,200 @@ - + - - Risk Score + + Portfolio Risk Score - - No Data Available - - + - - - - - - ! - - - - This Portfolio Risk Score is above the average of - 100%-equity portfolios benchmarked by Morningstar. - - + + + + + + + + + + Conservative + + + Moderate + + + Aggressive + + + Very Aggressive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ + riskScore + }} + + {{ getExtremeRisk }} + + + + + + 0 + 100 + + + - - - Profile Benchmarks - - - - ⓘ - - - - The Profile Benchmarks are aligned to - Morningstar's Target Allocation Indexes, - and their scores reflect the equity exposure of each index. - The indexes represent the holdings and asset mixes of all - fixedallocation funds, from conservative to aggressive, - available in your local market. - - - - - - - {{ item.value }} - - - + + + + No Data Available + diff --git a/src/components/risk-score/RiskScoreTable.vue b/src/components/risk-score/RiskScoreTable.vue new file mode 100644 index 0000000..aade7ed --- /dev/null +++ b/src/components/risk-score/RiskScoreTable.vue @@ -0,0 +1,302 @@ + + + + + + + Risk Score + + + {{ riskScore }} + + + + + + Risk Level + + + + mdi-information-outline + + + + About Risk Levels + + The Morningstar Portfolio Risk Score (MPRS) measures the overall + risk of portfolios including client portfolios, model portfolios, + and fund portfolios. MPRS uses Morningstar Risk Model's + holdings-based analysis to derive a risk estimate and + score for each portfolio, and Morningstar's multi-asset Target + Allocation Indexes to define the following risk ranges: + + + + + + Range + Risk Level + + + + + + + + 0 + Conservative + + + + + + + + 25 + Moderate + + + + + + + + 50 + Aggressive + + + + + + + + 82 + Very Aggressive + + + + + + + + 100+ + Extreme Risk + + + + You can use MPRS to immediately see how much risk a portfolio is + taking, and use Morningstar's Risk Profiler to generate a + personalized Risk Comfort Range for each of your clients. + + + + + {{ riskScoreLevel }} + + + + + + + + + diff --git a/src/components/risk-score/config/sampleRiskScore.json b/src/components/risk-score/config/sampleRiskScore.json index 6938f2f..3d56d34 100644 --- a/src/components/risk-score/config/sampleRiskScore.json +++ b/src/components/risk-score/config/sampleRiskScore.json @@ -1,11 +1,15 @@ -{ - "riskScore": [ - { - "portfolioName": "US demo portfolio - weight", - "portfolioRiskScore": 122.52514387989147, - "portfolioAlignmentScore": 24.535489481591917, - "portfolioRsquared": 0.840970300308755, - "isProxyUsedInRiskScore": false - } - ] -} +{ + "riskScores": [ + { + "portfolio": { + "name": "US demo portfolio - weight", + "riskScore": 97.14201416530976, + "alignmentScore": 11.765856202588854, + "rSquared": 0.9747255143703797, + "retainedWeightProxied": 0, + "scoringMethodUsed": "RBSA", + "effectiveDate": "2023-01-31" + } + } + ] +} \ No newline at end of file diff --git a/src/components/risk-score/doc.mdx b/src/components/risk-score/doc.mdx index df19f02..df81ac4 100644 --- a/src/components/risk-score/doc.mdx +++ b/src/components/risk-score/doc.mdx @@ -115,7 +115,7 @@ window.mstarApisSdk.portfolioAnalysis.getRiskScore({ portfolios: samplePortfolio Requests to the API have the following format: ```javascript dark -https://www.us-api.morningstar.com/portfolioanalysis/v1/riskScore?langcult={{languageId}} +https://www.us-api.morningstar.com/portfolioanalysis/v1/risk-score?langcult={{languageId}} ``` @@ -142,16 +142,20 @@ Data returned by the API must be transformed to a format the component understan ```json dark { - "riskScore": [ - { - "portfolioName": "US demo portfolio - weight", - "portfolioRiskScore": 122.52514387989147, - "portfolioAlignmentScore": 24.535489481591917, - "portfolioRsquared": 0.840970300308755, - "isProxyUsedInRiskScore": false + "riskScores": [ + { + "portfolio": { + "name": "US demo portfolio - weight", + "riskScore": 97.14201416530976, + "alignmentScore": 11.765856202588854, + "rSquared": 0.9747255143703797, + "retainedWeightProxied": 0, + "scoringMethodUsed": "RBSA", + "effectiveDate": "2023-01-31" } + } ] -} + } ``` @@ -171,10 +175,13 @@ Data returned by the API must be transformed to a format the component understan Code Snippet ```javascript dark - parsedModelData() { - const portfolioRiskScore = this.modelData?.riskScore[0]?.portfolioRiskScore; - return (portfolioRiskScore === null || portfolioRiskScore === undefined) - ? null : Math.round(portfolioRiskScore); + riskScore() { + const portfolioRiskScore = this.modelData && Object.prototype.hasOwnProperty.call(this.modelData, 'riskScores') + ? this.modelData?.riskScores[0]?.portfolio?.riskScore + : null; + return portfolioRiskScore === null || portfolioRiskScore === undefined + ? null + : Math.round(portfolioRiskScore); }, ``` diff --git a/src/components/risk-score/styles/risk-score.scss b/src/components/risk-score/styles/risk-score.scss new file mode 100644 index 0000000..a3afa65 --- /dev/null +++ b/src/components/risk-score/styles/risk-score.scss @@ -0,0 +1,321 @@ +@use "sass:math"; +@use "sass:map"; +@use '~@/components/shared/scss/mixin.scss' as mixin; + +.risk-score { + text-align: center; + display: flex; + position: relative; + justify-content: center; + align-items: center; + width: var(--dial-width); + height: var(--dial-height); + + @include mixin.wal-component-title; + + /* ================ for disk dial pointer animation ==================*/ + @for $risk-score from 0 through 100 { + .risk-score-#{$risk-score} { + transform: rotate((($dial-per-unit-position-change-in-degrees * $risk-score) - ($dial-max-position-in-degrees * 0.5)) * 1deg); + } + + .risk-score-#{$risk-score}-animated { + animation-name: risk-score-#{$risk-score}-animation; + animation-duration: 1s; + animation-iteration-count: 1; + animation-fill-mode: forwards; + animation-timing-function: cubic-bezier(0, 1.44, 1, 0.8); + } + + @keyframes risk-score-#{$risk-score}-animation { + 0% { + transform: rotate(-135deg); + } + 100% { + transform: rotate((($dial-per-unit-position-change-in-degrees * $risk-score) - ($dial-max-position-in-degrees * 0.5)) * 1deg); + } + } + } + + .risk-score-extreme { + transform: rotate(180deg); + } + + @keyframes risk-score-extreme-animation { + 0% { + transform: rotate(-135deg); + } + 100% { + transform: rotate(150deg); + } + } + + .risk-score-extreme-animated { + animation-name: risk-score-extreme-animation; + animation-duration: 1s; + animation-iteration-count: 1; + animation-fill-mode: forwards; + animation-timing-function: cubic-bezier(0, 1.44, 1, 0.8); + } + + .risk-score-title { + h2 { + margin-top: 100px; + } + } + + .dial-container { + display: flex; + justify-content: center; + align-items: center; + + .risk-text-container { + .risk-text { + font-style: normal; + font-weight: 400; + font-size: map.get(mixin.$wal, 'font-size', 's'); + line-height: map.get(mixin.$wal, 'font-size', 'l'); + letter-spacing: 0.25px; + /* identical to box height, or 129% */ + text-align: center; + + /* Generic Neutrals/Neutral 37 */ + fill: $color-dial-grey-background; + } + } + .dial-background { + position: absolute; + display: flex; + width: $dial-outer-background-size; + height: $dial-outer-background-size; + background: #E5E5E5; + border-radius: 50%; + + .fade-area { + position: absolute; + display: flex; + width: $dial-outer-background-size; + height: $dial-outer-background-size; + border-radius: 50%; + background: conic-gradient(from 180deg at 50% 50%, mixin.$wal-color-white -17.38deg, mixin.$wal-color-white 17.01deg, rgba(255, 255, 255, 0) 90deg, rgba(255, 255, 255, 0) 268.13deg, mixin.$wal-color-white 342.62deg, mixin.$wal-color-white 377.01deg); + } + } + + /* ====================== Risk Score only version of dial (medium) =================== */ + + .score-dial-container { + position: absolute; + display: flex; + width: $dial-outer-ring-diameter + 2; + height: $dial-outer-ring-diameter; + justify-content: center; + align-items: center; + z-index: 0; + + .dial-circle { + position: absolute; + display: flex; + width: $dial-outer-ring-diameter + 1; + height: $dial-outer-ring-diameter; + border-radius: 50%; + justify-content: center; + align-items: center; + background: conic-gradient(from 180deg at 50% 50%, #B2204C -39.68deg, #3C5B9A 45.14deg, #8A4089 180deg, #B2204C 320.32deg, #3C5B9A 405.14deg); + clip-path: url(#outline); + } + + .dial-circle-error-state { + position: absolute; + display: flex; + width: $dial-outer-ring-diameter + 1; + height: $dial-outer-ring-diameter; + border-radius: 50%; + justify-content: center; + align-items: center; + background: conic-gradient(from 180deg at 50% 50%, mixin.$wal-color-white -39.68deg, mixin.$wal-color-white 45.14deg, mixin.$wal-color-white 180deg, mixin.$wal-color-white 320.32deg, mixin.$wal-color-white 405.14deg); + clip-path: url(#outline); + } + + .dial-marker-container { + position: absolute; + height: $dial-outer-background-size; + display: flex; + flex-direction: column; + + .marker { + width: 3px; + height: $dial-annulus-radius-difference + 32; + background: mixin.$wal-color-white; + } + } + + .dial-circle-inner { + position: absolute; + display: flex; + height: $dial-circle-text-diameter; + width: $dial-circle-text-diameter; + border-radius: 100%; + border-style: solid; + border-width: 1px; + border-color: mixin.$wal-color-black; + justify-content: center; + align-items: center; + background: mixin.$wal-color-white; + clip-path: circle(50% at 50% 50%); + } + + .dial-circle-error-inner { + position: absolute; + display: flex; + width: $dial-inner-ring-diameter; + height: $dial-inner-ring-diameter; + border-radius: 100%; + border-style: solid; + border-width: 1px; + border-color: #999999; + justify-content: center; + align-items: center; + background: mixin.$wal-color-white; + } + + .dial-pointer-container { + z-index: 1; + position: absolute; + display: flex; + height: $dial-circle-text-diameter + 28px; + width: map.get(mixin.$wal, 'space', '3-and-a-half-x'); + justify-content: center; + align-items: flex-start; + transform: rotate(-135deg); + + .dial-needle { + display: flex; + flex-direction: column; + height: 15px; + width: map.get(mixin.$wal, 'space', '3-and-a-half-x'); + background: $color-dial-background; + clip-path: polygon(0 100%, 50% 0, 100% 100%); + } + } + + .dial-circle-pointer-text { + position: absolute; + display: flex; + height: 146; + width: 146; + border-radius: 50%; + justify-content: center; + align-items: center; + background: mixin.$wal-color-white; + + span { + display: flex; + justify-content: center; + align-items: center; + font-style: normal; + font-weight: 400; + font-size: 64px; + line-height: 59px; + + .extreme-plus { + padding-bottom: 18px; + font-size: 36px; + color: #ED4A04; + } + } + } + + .dial-range-container { + position: absolute; + display: flex; + height: $dial-outer-ring-diameter; + width: $dial-inner-ring-diameter; + justify-content: center; + align-items: center; + background: transparent; + font-style: normal; + font-weight: 700; + font-size: map.get(mixin.$wal, 'font-size', 'xs'); + line-height: 12px; + + .minimum-score { + position: absolute; + display: flex; + height: $dial-outer-ring-diameter - 21px; + width: 88px; + justify-content: flex-start; + align-items: end; + color: $color-dial-grey-background; + } + + .maximum-score { + position: absolute; + display: flex; + height: $dial-outer-ring-diameter - 21px; + width: 88px; + justify-content: flex-end; + align-items: end; + color: $color-dial-grey-background; + } + + .dial-circle-error-icon { + position: absolute; + height: 14px; + width: 14px; + left: 65px; + right: 118px; + top: 225px; + bottom: 13px; + background-color: #ff0000; + border-radius: 50%; + } + } + + .extreme-risk-container { + position: absolute; + width: $dial-outer-ring-diameter + 24; + height: $dial-outer-ring-diameter + 24; + display: flex; + border-radius: 50%; + transform: rotate(-5deg); + justify-content: center; + align-items: center; + clip-path: url(#medium-extreme); + + + .extreme-risk { + position: absolute; + width: map.get(mixin.$wal, 'space', '2-and-a-half-x'); + height: $dial-outer-ring-diameter + 22; + background: blue; + background: linear-gradient(270deg, rgba(237, 74, 4, 0.7) 0%, rgba(237, 74, 4, 0) 100%); + transform: rotate(-27deg); + } + + .extreme-risk-marker-container { + position: absolute; + height: $dial-outer-background-size; + display: flex; + flex-direction: column; + transform: rotate(154deg); + + .extreme-risk-marker { + position: absolute; + width: 3px; + height: $dial-annulus-radius-difference + 32; + background: mixin.$wal-color-white; + background: #F17945; + } + } + } + } + } +} + +.risk-score__table { + width: 200px; + display: flex; + align-items: center; + justify-content: flex-start; +} + diff --git a/src/components/risk-score/styles/variables.scss b/src/components/risk-score/styles/variables.scss new file mode 100644 index 0000000..24e710d --- /dev/null +++ b/src/components/risk-score/styles/variables.scss @@ -0,0 +1,31 @@ +@use "sass:math"; + +$dial-container-size: 300px; +$dial-outer-background-size: 252px; +$dial-outer-ring-diameter: 232px; +$dial-inner-ring-diameter: 146px; +$dial-annulus-radius-difference: 20px; +$dial-circle-text-diameter: 146px; +$dial-circle-text-size: $dial-circle-text-diameter * 0.5; +$dial-range-numbers-width: 66px; +$dial-inner-ring-diameter: 97px; + +$color-dial-background: #000000; +$color-dial-grey-background: #808080; + +$dial-range-start: 0; +$dial-range-end: 100; + +$dial-min-position-in-degrees: 0; +$dial-max-position-in-degrees: 295; + +$dial-per-unit-position-change-in-degrees: $dial-max-position-in-degrees / $dial-range-end; + +$number-of-sectors: 3; // each sector being 90deg + +$max-score-per-sector: $dial-range-end / $number-of-sectors; + +$units-per-sector: 100; // x-axis or y-axis position ranges from 0-100 + +$increment-per-unit-per-sector: $units-per-sector / $max-score-per-sector; + diff --git a/src/components/risk-statistics/doc.mdx b/src/components/risk-statistics/doc.mdx index 8f2edb7..a428d24 100644 --- a/src/components/risk-statistics/doc.mdx +++ b/src/components/risk-statistics/doc.mdx @@ -37,7 +37,7 @@ import { PORTFOLIO_ANALYSIS_AMERICAS_URL, DATA_ACCESS_LIBRARY } from "@/external ## Description -The Risk Statistics component illustrates variations in a portfolio's returns for 1, 3, and 5 years based on a number of different ratios including Sharep Ration, Information Ration, Upside and Downside Capture Ratios. +The Risk Statistics component illustrates variations in a portfolio's returns for 1, 3, and 5 years based on a number of different ratios including Sharpe Ratio, Information Ratio, Upside and Downside Capture Ratios. diff --git a/src/components/screener/Screener.vue b/src/components/screener/Screener.vue index 3a1d06c..0fea221 100644 --- a/src/components/screener/Screener.vue +++ b/src/components/screener/Screener.vue @@ -8,8 +8,8 @@ @@ -78,6 +78,15 @@ export default { type: Object, default: () => ({}), }, + + /** Except params and sdk method name from parent component */ + requestDetails: { + type: Object, + default: () => ({ + params: {}, + methodName: '', + }), + }, }, watch: { selectedFiltersValues: { @@ -108,7 +117,16 @@ export default { }, created() { this.fieldDefs = this.fieldDefinitions; - this.setSelectedFiltersValues(); + // scroll to top in case of scroll position is changed in workflow + this.$vuetify.goTo(0); + }, + computed: { + getFilters() { + return (this.fieldDefs.filters && Object.keys(this.fieldDefs.filters).length > 0) ? this.fieldDefs.filters : null; + }, + getQuickFilters() { + return (this.fieldDefs.quickFilters && Object.keys(this.fieldDefs.quickFilters).length > 0) ? this.fieldDefs.quickFilters : null; + }, }, methods: { setFilterParams(values) { @@ -222,17 +240,34 @@ export default { const defaultParams = { page: params.page || 1, pageSize: params.pageSize || 10, - sortField: params.sortField || 'name', - sortOrder: params.sortOrder || 'asc', + sortOrder: `${params.sortField ?? 'name'} ${params.sortOrder ?? 'asc'}`, universeIds: 'FOGBR$$ALL|E0EXG$XLON', securityDataPoints: 'secId,tenforeId,name,closePrice,yield_M12,ongoingCharge,initialPurchase,maxFrontEndLoad,starRatingM255,analystRatingScale,lowCarbonDesignation,sustainabilityRank,average12MonthCarbonRiskScore,gbrReturnD1,gbrReturnW1,gbrReturnM1,gbrReturnM3,gbrReturnM6,investmentType,holdingTypeId,universe', filterValues: params.filterValues || '', term: '', }; + + const methodName = this.requestDetails.methodName ? this.requestDetails.methodName : 'getIntlScreenerData'; + const reqParams = Object.keys(this.requestDetails.params).length ? this.requestDetails.params : defaultParams; + if (Object.keys(this.requestDetails.params).length) { + reqParams.page = params.page ?? reqParams.page; + reqParams.pageSize = params.pageSize ?? reqParams.pageSize; + reqParams.sortOrder = `${params.sortField ? params.sortField : reqParams.sortField} ${params.sortOrder ? params.sortOrder : reqParams.sortOrder}`; + } + this.securityListData = await window .mstarApisSdk - .screener - .getIntlScreenerData(JSON.stringify(defaultParams, null, 2)); + .screener[methodName](reqParams) + .then((data) => { + // TODO: Need to remove below code when API integration is done. + data.rows.map((item) => { + if (item.UserPref1) { + item.preferenceAligned = true; + } + }); + this.$emit('onUpdatedTable', data); + return data; + }); this.loading = false; }, }, diff --git a/src/components/screener/components/Filter.vue b/src/components/screener/components/Filter.vue index 48a7dc3..abdda4f 100644 --- a/src/components/screener/components/Filter.vue +++ b/src/components/screener/components/Filter.vue @@ -5,7 +5,7 @@ - + Quick Filters @@ -27,7 +27,7 @@ - + Custom Filters @@ -73,7 +73,7 @@ - + { diff --git a/src/components/screener/components/SecurityList.vue b/src/components/screener/components/SecurityList.vue index 09cc0cc..88d7e31 100644 --- a/src/components/screener/components/SecurityList.vue +++ b/src/components/screener/components/SecurityList.vue @@ -24,6 +24,12 @@ @update:options="updateOptions" @item-expanded="getSecurityReportData" > + + + + + {{ value }} + + + + + Investments aligned with my selected preferences. + +
The Profile Benchmarks are aligned to - Morningstar's Target Allocation Indexes, - and their scores reflect the equity exposure of each index.
The indexes represent the holdings and asset mixes of all - fixedallocation funds, from conservative to aggressive, - available in your local market.