Example
<cr-component id="component" name="risk-exposures"></cr-component>
<script>
const component = document.querySelector("#component");
component.init({
positions: [
{ id: 134230, amount: 231454.29, exposition: 231454.29, date: "20181231" },
{ id: 128520, amount: 14037.94, exposition: 14037.94, date: "20181231" },
{ id: 146057, amount: 1551576.47, exposition: 1551576.47, date: "20181231" },
{ id: 73170, amount: 2288780.71, exposition: 2288780.71, date: "20181231" },
{ id: 23772, amount: 1394051.32, exposition: 1394051.32, date: "20181231" },
{ id: 67992, amount: 485800.88, exposition: 485800.88, date: "20181231" },
{ id: 90197, amount: 165708.97, exposition: 165708.97, date: "20181231" },
{ id: 57398, amount: 441988.97, exposition: 441988.97, date: "20181231" },
{ id: 75109, amount: 641332.79, exposition: 641332.79, date: "20190108" },
{ id: 74838, amount: 167581.21, exposition: 167581.21, date: "20190108" },
{ id: 111228, amount: 166207.69, exposition: 166207.69, date: "20190108" },
{ id: 38951, amount: 446148.27, exposition: 446148.27, date: "20190108" },
{ id: 2561, amount: 396582.75, exposition: 396582.75, date: "20190108" },
{ id: 86420, amount: 26055, exposition: 26055, date: "20191029" },
{ id: 86621, amount: 71202.88, exposition: 71202.88, date: "20191029" },
{ id: 99452, amount: 24996.22, exposition: 24996.22, date: "20191029" },
{ id: 105043, amount: 34003.12, exposition: 34003.12, date: "20191029" },
{ id: 42853, amount: 33237.68, exposition: 33237.68, date: "20191029" },
{ id: 146382, amount: 70842.53, exposition: 70842.53, date: "20191029" },
],
riskfamiliescolors: {
Alternative: "#084922",
Balanced: "#00B849",
Commodities: "#008535",
Equity: "#12A54D",
"Fixed Income": "#63EE9A",
Leverage: "#E4F7D9",
"Money Market": "#C3F8D9",
},
selectedbutton: 5,
allownegative: false,
isreturns: true,
});
</script>
Schema
{
"type": "object",
"properties": {
"positions": {
"type": "array",
"minItems": 1,
"description": "Portfolio positions",
"items": {
"type": "object",
"required": [
"amount"
],
"properties": {
"symbolId": {
"type": "number"
},
"amount": {
"type": "number"
},
"date": {
"type": "string"
},
"color": {
"type": "string"
}
}
}
},
"symbolId": {
"type": "number"
},
"category": {
"type": "string",
"enum": [
"symbolType",
"currency",
"riskFamily",
"region",
"mainSector",
"industryGroup",
"industry",
"subIndustry"
],
"default": "riskFamily"
},
"subCategory": {
"type": "string",
"enum": [
"symbolType",
"currency",
"riskFamily",
"region",
"mainSector",
"industryGroup",
"industry",
"subIndustry"
],
"default": "region"
},
"riskFamiliesColors": {
"type": "object",
"patternProperties": {
"^.+$": {
"type": "string"
}
}
},
"regionsColors": {
"type": "object",
"patternProperties": {
"^.+$": {
"type": "string"
}
}
},
"allowNegative": {
"type": "boolean"
},
"period": {
"type": "string",
"default": "SI",
"description": "A period must be one of 1W,2W,1M,3M,6M,YTD,1Y,3Y,5Y,10Y,SI or a string containig two valid dates like 20211012-20220812"
},
"chartconfig": {
"type": "object"
}
},
"additionalProperties": true,
"oneOf": [
{
"required": [
"positions"
],
"prohibited": [
"symbolId"
]
},
{
"required": [
"symbolId"
],
"prohibited": [
"positions"
]
}
]
}
Complete Schema
{}
Locales
{
"all": "All",
"exposureTypes": {
"riskFamily": "Risk Family"
}
}