@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.20.1 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dpr/components/_async/async-filters-form/types.d.js +1 -1
- package/dpr/components/_async/async-filters-form/types.d.js.map +1 -1
- package/dpr/components/_async/async-filters-form/types.d.ts +7 -4
- package/dpr/components/_async/async-filters-form/utils.js +1 -1
- package/dpr/components/_async/async-filters-form/utils.js.map +2 -2
- package/dpr/components/_async/async-filters-form/utils.ts +18 -17
- package/dpr/components/_catalogue/catalogue-list/utils.test.ts +1 -1
- package/dpr/components/_charts/chart/Chart.js +2 -0
- package/dpr/components/_charts/chart/Chart.js.map +7 -0
- package/dpr/components/_charts/chart/Chart.ts +89 -0
- package/dpr/components/_charts/chart/ChartColours.js +2 -0
- package/dpr/components/_charts/chart/ChartColours.js.map +7 -0
- package/dpr/components/_charts/chart/ChartColours.ts +36 -0
- package/dpr/components/_charts/chart/ChartTimeseries.js +2 -0
- package/dpr/components/_charts/chart/ChartTimeseries.js.map +7 -0
- package/dpr/components/_charts/chart/ChartTimeseries.ts +95 -0
- package/dpr/components/_charts/chart/bar/BarChart.js +2 -0
- package/dpr/components/_charts/chart/bar/BarChart.js.map +7 -0
- package/dpr/components/_charts/chart/bar/BarChart.ts +204 -0
- package/dpr/components/_charts/chart/bar/clientClass.mjs +0 -58
- package/dpr/components/_charts/chart/bar/types.js +2 -0
- package/dpr/components/_charts/chart/bar/types.js.map +7 -0
- package/dpr/components/_charts/chart/bar/types.ts +6 -0
- package/dpr/components/_charts/chart/bar/validate.js +2 -0
- package/dpr/components/_charts/chart/bar/validate.js.map +7 -0
- package/dpr/components/_charts/chart/bar/validate.ts +59 -0
- package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js +2 -0
- package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.js.map +7 -0
- package/dpr/components/_charts/chart/bar-timeseries/BarTimeseriesChart.ts +57 -0
- package/dpr/components/_charts/chart/bar-timeseries/types.js +2 -0
- package/dpr/components/_charts/chart/bar-timeseries/types.js.map +7 -0
- package/dpr/components/_charts/chart/bar-timeseries/types.ts +5 -0
- package/dpr/components/_charts/chart/bar-timeseries/validate.js +2 -0
- package/dpr/components/_charts/chart/bar-timeseries/validate.js.map +7 -0
- package/dpr/components/_charts/chart/bar-timeseries/validate.ts +30 -0
- package/dpr/components/_charts/chart/buckets/Buckets.js +2 -0
- package/dpr/components/_charts/chart/buckets/Buckets.js.map +7 -0
- package/dpr/components/_charts/chart/{Buckets.ts → buckets/Buckets.ts} +18 -14
- package/dpr/components/_charts/chart/buckets/types.js +2 -0
- package/dpr/components/_charts/chart/buckets/types.js.map +7 -0
- package/dpr/components/_charts/chart/buckets/types.ts +4 -0
- package/dpr/components/_charts/chart/buckets/validate.js +2 -0
- package/dpr/components/_charts/chart/buckets/validate.js.map +7 -0
- package/dpr/components/_charts/chart/buckets/validate.ts +15 -0
- package/dpr/components/_charts/chart/chart-config.js +2 -0
- package/dpr/components/_charts/chart/chart-config.js.map +7 -0
- package/dpr/components/_charts/chart/chart-config.ts +108 -0
- package/dpr/components/_charts/chart/clientClass.mjs +28 -106
- package/dpr/components/_charts/chart/doughnut/DoughnutChart.js +2 -0
- package/dpr/components/_charts/chart/doughnut/DoughnutChart.js.map +7 -0
- package/dpr/components/_charts/chart/doughnut/DoughnutChart.ts +77 -0
- package/dpr/components/_charts/chart/doughnut/clientClass.mjs +0 -45
- package/dpr/components/_charts/chart/doughnut/types.js +2 -0
- package/dpr/components/_charts/chart/doughnut/types.js.map +7 -0
- package/dpr/components/_charts/chart/doughnut/types.ts +5 -0
- package/dpr/components/_charts/chart/doughnut/validate.js +2 -0
- package/dpr/components/_charts/chart/doughnut/validate.js.map +7 -0
- package/dpr/components/_charts/chart/doughnut/validate.ts +30 -0
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.js +1 -1
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.js.map +3 -3
- package/dpr/components/_charts/chart/heatmap/HeatmapChart.ts +122 -44
- package/dpr/components/_charts/chart/heatmap/clientClass.mjs +7 -89
- package/dpr/components/_charts/chart/heatmap/types.js +1 -1
- package/dpr/components/_charts/chart/heatmap/types.js.map +1 -1
- package/dpr/components/_charts/chart/heatmap/types.ts +5 -0
- package/dpr/components/_charts/chart/heatmap/validate.js +2 -0
- package/dpr/components/_charts/chart/heatmap/validate.js.map +7 -0
- package/dpr/components/_charts/chart/heatmap/validate.ts +25 -0
- package/dpr/components/_charts/chart/line/LineChart.js +2 -0
- package/dpr/components/_charts/chart/line/LineChart.js.map +7 -0
- package/dpr/components/_charts/chart/line/LineChart.ts +89 -0
- package/dpr/components/_charts/chart/line/clientClass.mjs +5 -36
- package/dpr/components/_charts/chart/line/types.js +2 -0
- package/dpr/components/_charts/chart/line/types.js.map +7 -0
- package/dpr/components/_charts/chart/line/types.ts +5 -0
- package/dpr/components/_charts/chart/line/validate.js +2 -0
- package/dpr/components/_charts/chart/line/validate.js.map +7 -0
- package/dpr/components/_charts/chart/line/validate.ts +30 -0
- package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js +2 -0
- package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.js.map +7 -0
- package/dpr/components/_charts/chart/line-timeseries/LineTimeseriesChart.ts +57 -0
- package/dpr/components/_charts/chart/line-timeseries/types.js +2 -0
- package/dpr/components/_charts/chart/line-timeseries/types.js.map +7 -0
- package/dpr/components/_charts/chart/line-timeseries/types.ts +5 -0
- package/dpr/components/_charts/chart/line-timeseries/validate.js +2 -0
- package/dpr/components/_charts/chart/line-timeseries/validate.js.map +7 -0
- package/dpr/components/_charts/chart/line-timeseries/validate.ts +30 -0
- package/dpr/components/_charts/chart/view.njk +8 -1
- package/dpr/components/_charts/chart-tabs/view.njk +15 -14
- package/dpr/components/_charts/utils.js +1 -1
- package/dpr/components/_charts/utils.js.map +3 -3
- package/dpr/components/_charts/utils.test.ts +9 -3
- package/dpr/components/_charts/utils.ts +59 -193
- package/dpr/components/_dashboards/dashboard-list/types.js +2 -0
- package/dpr/components/_dashboards/dashboard-list/types.js.map +7 -0
- package/dpr/components/_dashboards/dashboard-list/types.ts +4 -0
- package/dpr/components/_dashboards/dashboard-list/validate.js +2 -0
- package/dpr/components/_dashboards/dashboard-list/validate.js.map +7 -0
- package/dpr/components/_dashboards/dashboard-list/validate.ts +28 -0
- package/dpr/components/_dashboards/dashboard-visualisation/Validate.js +2 -0
- package/dpr/components/_dashboards/dashboard-visualisation/Validate.js.map +7 -0
- package/dpr/components/_dashboards/dashboard-visualisation/Validate.ts +71 -0
- package/dpr/components/_dashboards/dashboard-visualisation/types.js +1 -1
- package/dpr/components/_dashboards/dashboard-visualisation/types.js.map +2 -2
- package/dpr/components/_dashboards/dashboard-visualisation/types.ts +32 -2
- package/dpr/components/_dashboards/scorecard/Scorecard.js +1 -1
- package/dpr/components/_dashboards/scorecard/Scorecard.js.map +3 -3
- package/dpr/components/_dashboards/scorecard/Scorecard.ts +82 -213
- package/dpr/components/_dashboards/scorecard/types.js +1 -1
- package/dpr/components/_dashboards/scorecard/types.js.map +1 -1
- package/dpr/components/_dashboards/scorecard/types.ts +11 -1
- package/dpr/components/_dashboards/scorecard/validate.js +2 -0
- package/dpr/components/_dashboards/scorecard/validate.js.map +7 -0
- package/dpr/components/_dashboards/scorecard/validate.ts +36 -0
- package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js +2 -0
- package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.js.map +7 -0
- package/dpr/components/_dashboards/scorecard-group/ScorecardGroup.ts +228 -0
- package/dpr/components/_dashboards/scorecard-group/types.js +2 -0
- package/dpr/components/_dashboards/scorecard-group/types.js.map +7 -0
- package/dpr/components/_dashboards/scorecard-group/types.ts +5 -0
- package/dpr/components/_dashboards/scorecard-group/validate.js +2 -0
- package/dpr/components/_dashboards/scorecard-group/validate.js.map +7 -0
- package/dpr/components/_dashboards/scorecard-group/validate.ts +37 -0
- package/dpr/components/_filters/filter-input/types.d.js.map +1 -1
- package/dpr/components/_filters/filter-input/types.d.ts +1 -1
- package/dpr/components/_filters/types.d.js.map +1 -1
- package/dpr/components/_filters/types.d.ts +6 -4
- package/dpr/components/_reports/report-actions/types.d.js.map +1 -1
- package/dpr/components/_reports/report-actions/types.d.ts +1 -1
- package/dpr/components/report-list/types.d.js.map +1 -1
- package/dpr/components/report-list/types.d.ts +1 -1
- package/dpr/data/types.d.js +1 -1
- package/dpr/data/types.d.js.map +1 -1
- package/dpr/data/types.d.ts +2 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +3 -3
- package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +22 -10
- package/dpr/routes/journeys/view-report/async/report/utils.js +1 -1
- package/dpr/routes/journeys/view-report/async/report/utils.js.map +2 -2
- package/dpr/routes/journeys/view-report/async/report/utils.ts +1 -1
- package/dpr/routes/journeys/view-report/controller.js +1 -1
- package/dpr/routes/journeys/view-report/controller.js.map +3 -3
- package/dpr/routes/journeys/view-report/controller.ts +3 -1
- package/dpr/types/Services.d.js +1 -1
- package/dpr/types/Services.d.js.map +1 -1
- package/dpr/types/Services.d.ts +0 -2
- package/dpr/utils/DataTableBuilder/types.d.js +1 -1
- package/dpr/utils/DataTableBuilder/types.d.js.map +1 -1
- package/dpr/utils/DataTableBuilder/types.d.ts +2 -2
- package/dpr/utils/ErrorHandler.js +1 -1
- package/dpr/utils/ErrorHandler.js.map +3 -3
- package/dpr/utils/ErrorHandler.ts +16 -0
- package/dpr/utils/ParentChildDataTableBuilder/types.d.js +1 -1
- package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +1 -1
- package/dpr/utils/ParentChildDataTableBuilder/types.d.ts +1 -0
- package/dpr/utils/Personalisation/types.d.js +1 -1
- package/dpr/utils/Personalisation/types.d.js.map +1 -1
- package/dpr/utils/Personalisation/types.d.ts +1 -0
- package/dpr/utils/UserStoreItemBuilder.js.map +2 -2
- package/dpr/utils/UserStoreItemBuilder.ts +1 -1
- package/package.json +1 -1
- package/dpr/components/_charts/chart/Buckets.js +0 -2
- package/dpr/components/_charts/chart/Buckets.js.map +0 -7
- package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.js +0 -2
- package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.js.map +0 -7
- package/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.ts +0 -40
|
@@ -78,7 +78,7 @@ class UserStoreItemBuilder {
|
|
|
78
78
|
return this
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
addSortData = (sortData
|
|
81
|
+
addSortData = (sortData?: Record<string, string>) => {
|
|
82
82
|
const sortByQueryString = new URLSearchParams(sortData).toString()
|
|
83
83
|
this.userStoreItem = {
|
|
84
84
|
...this.userStoreItem,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
|
|
3
3
|
"description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.21.0",
|
|
5
5
|
"main": "dpr/all.mjs",
|
|
6
6
|
"sass": "dpr/all.scss",
|
|
7
7
|
"engines": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var m=(u,t)=>{for(var s in t)h(u,s,{get:t[s],enumerable:!0})},f=(u,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of k(t))!b.call(u,e)&&e!==s&&h(u,e,{get:()=>t[e],enumerable:!(i=p(t,e))||i.enumerable});return u};var C=u=>f(h({},"__esModule",{value:!0}),u);var g={};m(g,{Buckets:()=>c,default:()=>d});module.exports=C(g);var l=require("with-alpha-hex");class c{constructor(t,s,i,e,o){this.baseColour="#1d70b8";this.ragColours=["#00703c","#ffdd00","#d4351c"];this.buckets=[];this.useRagColour=!1;this.bucketCount=0;this.onlyBucketColoursDefined=!1;this.autoBucketing=!1;this.hasRagScore=!1;this.options={};this.initFromOptions=t=>{this.options=t.options||{},this.baseColour=this.options?.baseColour||this.baseColour,this.useRagColour=this.options?.useRagColour||!1,this.onlyBucketColoursDefined=this.options&&this.options.buckets?this.options?.buckets?.every(s=>!s.max&&!s.min&&s.hexColour!==void 0):!1};this.initBuckets=()=>{const{buckets:t}=this.options;this.setBucketCount(),this.initBucketColours(),t?this.hasRagScore?this.onlyBucketColoursDefined&&(this.buckets=t):!this.hasRagScore&&this.onlyBucketColoursDefined&&this.autoBucketing?this.initAutomaticThresholdBucket():this.initCustomThresholdBuckets():!t&&!this.hasRagScore&&this.autoBucketing&&this.initAutomaticThresholdBucket()};this.initCustomThresholdBuckets=()=>{this.buckets=this.options.buckets?this.options.buckets.map((t,s)=>({...this.buckets[s],...t})):[]};this.initAutomaticThresholdBucket=()=>{const{min:t,max:s,bucketSize:i}=this.setAutomaticThresholdSize();let e=0;this.buckets=this.buckets.map((o,a)=>{let r=t;return a!==0&&(r=e+1),e=i*(a+1)+t,a===this.buckets.length-1&&(e=s),{hexColour:this.options?.buckets?this.options.buckets[a]?.hexColour:o.hexColour,min:r,max:e}})};this.initBucketColours=()=>{if(this.useRagColour&&this.bucketCount===3)this.buckets=Array.from(new Array(this.bucketCount)).map((t,s)=>({hexColour:this.ragColours[s]}));else{const t=1/this.bucketCount;this.buckets=Array.from(new Array(this.bucketCount)).map((s,i)=>{const e=t*(i+1);return{hexColour:(0,l.withAlphaHex)(this.baseColour,e)}})}};this.setAutomaticThresholdSize=()=>{const t=this.responseData.map(o=>Number(o[this.valueKey].raw)),s=Math.min(...t),i=Math.max(...t),e=Math.ceil((i-s)/this.bucketCount);return{min:s,max:i,bucketSize:e}};this.setBucketCount=()=>{const{buckets:t}=this.options;if(this.hasRagScore)if(this.useRagColour)this.bucketCount=3;else{const s=this.responseData.reduce((i,e)=>(e[this.valueKey].rag!==void 0&&i.push(e[this.valueKey].rag),i),[]);this.bucketCount=Math.max(...s)+1}else t?this.bucketCount=t.length:this.bucketCount=3};this.getBucketForValue=(t,s)=>{let i="",e=0;return s!==void 0?{colour:this.buckets[s].hexColour||i,score:s}:(this.buckets.forEach((o,a)=>{const{min:r,max:n}=o;!r&&n&&t<=n&&(i=o.hexColour||i,e=a),r&&t>=r&&n&&t<=n&&(i=o.hexColour||i,e=a),r&&!n&&t>=r&&(i=o.hexColour||i,e=a)}),{colour:i,score:e})};this.getBuckets=()=>this.buckets;this.responseData=t,this.initFromOptions(s),this.valueKey=i,this.hasRagScore=t[0][this.valueKey].rag!==void 0,this.autoBucketing=!!e,o&&(this.ragColours=o),this.initBuckets()}}var d=c;0&&(module.exports={Buckets});
|
|
2
|
-
//# sourceMappingURL=Buckets.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/dpr/components/_charts/chart/Buckets.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable prefer-destructuring */\nimport { withAlphaHex } from 'with-alpha-hex'\nimport { DashboardDataResponse } from '../../../types/Metrics'\nimport {\n DashboardVisualisationBucket,\n BucketDashboardVisualisationOptions,\n} from '../../_dashboards/dashboard-visualisation/types'\nimport { components } from '../../../types/api'\n\nclass Buckets {\n private baseColour = '#1d70b8'\n\n private ragColours: string[] = ['#00703c', '#ffdd00', '#d4351c']\n\n private buckets: DashboardVisualisationBucket[] = []\n\n private useRagColour = false\n\n private bucketCount = 0\n\n private onlyBucketColoursDefined = false\n\n private autoBucketing = false\n\n private hasRagScore = false\n\n private valueKey: string\n\n private options: BucketDashboardVisualisationOptions = {}\n\n responseData: DashboardDataResponse[]\n\n constructor(\n responseData: DashboardDataResponse[],\n definition: components['schemas']['DashboardVisualisationDefinition'],\n valueKey: string,\n autoBucketing?: boolean,\n ragColours?: string[],\n ) {\n this.responseData = responseData\n this.initFromOptions(definition)\n this.valueKey = valueKey\n this.hasRagScore = responseData[0][this.valueKey].rag !== undefined\n this.autoBucketing = Boolean(autoBucketing)\n if (ragColours) this.ragColours = ragColours\n this.initBuckets()\n }\n\n private initFromOptions = (definition: components['schemas']['DashboardVisualisationDefinition']) => {\n this.options = <BucketDashboardVisualisationOptions>definition.options || {}\n this.baseColour = this.options?.baseColour || this.baseColour\n this.useRagColour = this.options?.useRagColour || false\n this.onlyBucketColoursDefined =\n this.options && this.options.buckets\n ? this.options?.buckets?.every((bucket) => !bucket.max && !bucket.min && bucket.hexColour !== undefined)\n : false\n }\n\n private initBuckets = () => {\n const { buckets } = this.options\n\n this.setBucketCount()\n this.initBucketColours()\n\n if (buckets) {\n if (this.hasRagScore) {\n if (this.onlyBucketColoursDefined) {\n this.buckets = buckets\n }\n } else if (!this.hasRagScore && this.onlyBucketColoursDefined && this.autoBucketing) {\n this.initAutomaticThresholdBucket()\n } else {\n this.initCustomThresholdBuckets()\n }\n } else if (!buckets && !this.hasRagScore && this.autoBucketing) {\n this.initAutomaticThresholdBucket()\n }\n }\n\n private initCustomThresholdBuckets = () => {\n this.buckets = this.options.buckets\n ? this.options.buckets.map((bucket, i) => {\n return {\n ...this.buckets[i],\n ...bucket,\n }\n })\n : []\n }\n\n /**\n * Initialises the bucket thresholds by defining the range between the min and max\n * and dividing into 3 equal parts\n */\n private initAutomaticThresholdBucket = () => {\n const { min, max, bucketSize } = this.setAutomaticThresholdSize()\n let maxValue = 0\n this.buckets = this.buckets.map((bucket, i) => {\n let minValue = min\n if (i !== 0) minValue = maxValue + 1\n maxValue = bucketSize * (i + 1) + min\n if (i === this.buckets.length - 1) maxValue = max\n\n return {\n hexColour: this.options?.buckets ? this.options.buckets[i]?.hexColour : bucket.hexColour,\n min: minValue,\n max: maxValue,\n }\n })\n }\n\n private initBucketColours = () => {\n if (this.useRagColour && this.bucketCount === 3) {\n this.buckets = Array.from(new Array(this.bucketCount)).map((_d, i) => {\n return {\n hexColour: this.ragColours[i],\n }\n })\n } else {\n const alphaDivision = 1 / this.bucketCount\n this.buckets = Array.from(new Array(this.bucketCount)).map((_d, i) => {\n const division = alphaDivision * (i + 1)\n return {\n hexColour: withAlphaHex(this.baseColour, division),\n }\n })\n }\n }\n\n private setAutomaticThresholdSize = () => {\n const values = this.responseData.map((resData) => Number(resData[this.valueKey].raw))\n const min = Math.min(...values)\n const max = Math.max(...values)\n const bucketSize = Math.ceil((max - min) / this.bucketCount)\n\n return {\n min,\n max,\n bucketSize,\n }\n }\n\n private setBucketCount = () => {\n const { buckets } = this.options\n if (this.hasRagScore) {\n if (this.useRagColour) {\n this.bucketCount = 3\n } else {\n const allRags: number[] = this.responseData.reduce((acc: number[], resData: DashboardDataResponse) => {\n if (resData[this.valueKey].rag !== undefined) {\n acc.push(<number>resData[this.valueKey].rag)\n }\n return acc\n }, [])\n this.bucketCount = Math.max(...allRags) + 1\n }\n } else if (buckets) {\n this.bucketCount = buckets.length\n } else {\n this.bucketCount = 3\n }\n }\n\n getBucketForValue = (value: number, ragScore?: number): { colour: string; score: number } => {\n let colour = ''\n let score = 0\n\n if (ragScore !== undefined) {\n return {\n colour: this.buckets[ragScore].hexColour || colour,\n score: ragScore,\n }\n }\n\n this.buckets.forEach((bucket, index) => {\n const { min, max } = bucket\n // First bucket\n if (!min && max && value <= max) {\n colour = bucket.hexColour || colour\n score = index\n }\n // middle buckets\n if (min && value >= min && max && value <= max) {\n colour = bucket.hexColour || colour\n score = index\n }\n // last bucket\n if (min && !max && value >= min) {\n colour = bucket.hexColour || colour\n score = index\n }\n })\n\n return {\n colour,\n score,\n }\n }\n\n getBuckets = () => {\n return this.buckets\n }\n}\n\nexport { Buckets }\nexport default Buckets\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GACA,IAAAK,EAA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AeF,KAC7DA,EAAQ,KAAK,QAAQ,EAAE,MAAQ,QACjCE,EAAI,KAAaF,EAAQ,KAAK,QAAQ,EAAE,GAAG,EAEtCE,GACN,CAAC,CAAC,EACL,KAAK,YAAc,KAAK,IAAI,GAAGD,CAAO,EAAI,CAC5C,MACSZ,EACT,KAAK,YAAcA,EAAQ,OAE3B,KAAK,YAAc,CAEvB,EAEA,uBAAoB,CAACc,EAAeC,IAAyD,CAC3F,IAAIC,EAAS,GACTC,EAAQ,EAEZ,OAAIF,IAAa,OACR,CACL,OAAQ,KAAK,QAAQA,CAAQ,EAAE,WAAaC,EAC5C,MAAOD,CACT,GAGF,KAAK,QAAQ,QAAQ,CAAChB,EAAQmB,IAAU,CACtC,KAAM,CAAE,IAAAhB,EAAK,IAAAC,CAAI,EAAIJ,EAEjB,CAACG,GAAOC,GAAOW,GAASX,IAC1Ba,EAASjB,EAAO,WAAaiB,EAC7BC,EAAQC,GAGNhB,GAAOY,GAASZ,GAAOC,GAAOW,GAASX,IACzCa,EAASjB,EAAO,WAAaiB,EAC7BC,EAAQC,GAGNhB,GAAO,CAACC,GAAOW,GAASZ,IAC1Bc,EAASjB,EAAO,WAAaiB,EAC7BC,EAAQC,EAEZ,CAAC,EAEM,CACL,OAAAF,EACA,MAAAC,CACF,EACF,EAEA,gBAAa,IACJ,KAAK,QAjKZ,KAAK,aAAevB,EACpB,KAAK,gBAAgBC,CAAU,EAC/B,KAAK,SAAWC,EAChB,KAAK,YAAcF,EAAa,CAAC,EAAE,KAAK,QAAQ,EAAE,MAAQ,OAC1D,KAAK,cAAgB,EAAQG,EACzBC,IAAY,KAAK,WAAaA,GAClC,KAAK,YAAY,CACnB,CA4JF,CAGA,IAAOP,EAAQD",
|
|
6
|
-
"names": ["Buckets_exports", "__export", "Buckets", "Buckets_default", "__toCommonJS", "import_with_alpha_hex", "responseData", "definition", "valueKey", "autoBucketing", "ragColours", "bucket", "buckets", "i", "min", "max", "bucketSize", "maxValue", "minValue", "_d", "alphaDivision", "division", "values", "resData", "allRags", "acc", "value", "ragScore", "colour", "score", "index"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(i,s)=>{for(var n in s)a(i,n,{get:s[n],enumerable:!0})},r=(i,s,n,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of h(s))!u.call(i,o)&&o!==n&&a(i,o,{get:()=>s[o],enumerable:!(e=m(s,o))||e.enumerable});return i};var D=i=>r(a({},"__esModule",{value:!0}),i);var p={};c(p,{DashboardVisualisationClass:()=>t,default:()=>l});module.exports=D(p);class t{constructor(s,n){this.initUnit=()=>{this.unit=this.columns.measures[0].unit?this.columns.measures[0].unit:void 0};this.definition=n,this.columns=n.columns,this.measures=this.columns.measures,this.keys=this.columns.keys||[],this.type=this.definition.type.split("-")[0],this.initUnit(),this.responseData=s}}var l=t;0&&(module.exports={DashboardVisualisationClass});
|
|
2
|
-
//# sourceMappingURL=DashboardVisualisation.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../src/dpr/components/_dashboards/dashboard-visualisation/DashboardVisualisation.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable prefer-destructuring */\nimport { components } from '../../../types/api'\nimport { DashboardDataResponse } from '../../../types/Metrics'\n\nclass DashboardVisualisationClass {\n responseData: DashboardDataResponse[]\n\n definition: components['schemas']['DashboardVisualisationDefinition']\n\n columns: components['schemas']['DashboardVisualisationColumnsDefinition']\n\n measures: components['schemas']['DashboardVisualisationColumnDefinition'][]\n\n keys: components['schemas']['DashboardVisualisationColumnDefinition'][]\n\n unit: components['schemas']['DashboardVisualisationColumnDefinition']['unit']\n\n type: components['schemas']['DashboardVisualisationDefinition']['type']\n\n constructor(\n responseData: DashboardDataResponse[],\n definition: components['schemas']['DashboardVisualisationDefinition'],\n ) {\n this.definition = definition\n this.columns = definition.columns\n this.measures = this.columns.measures\n this.keys = this.columns.keys || []\n this.type = this.definition.type.split('-')[0] as components['schemas']['DashboardVisualisationDefinition']['type']\n this.initUnit()\n this.responseData = responseData\n }\n\n initUnit = () => {\n // todo\n this.unit = this.columns.measures[0].unit ? this.columns.measures[0].unit : undefined\n }\n}\n\nexport { DashboardVisualisationClass }\nexport default DashboardVisualisationClass\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAIA,MAAME,CAA4B,CAehC,YACEG,EACAC,EACA,CAUF,cAAW,IAAM,CAEf,KAAK,KAAO,KAAK,QAAQ,SAAS,CAAC,EAAE,KAAO,KAAK,QAAQ,SAAS,CAAC,EAAE,KAAO,MAC9E,EAZE,KAAK,WAAaA,EAClB,KAAK,QAAUA,EAAW,QAC1B,KAAK,SAAW,KAAK,QAAQ,SAC7B,KAAK,KAAO,KAAK,QAAQ,MAAQ,CAAC,EAClC,KAAK,KAAO,KAAK,WAAW,KAAK,MAAM,GAAG,EAAE,CAAC,EAC7C,KAAK,SAAS,EACd,KAAK,aAAeD,CACtB,CAMF,CAGA,IAAOF,EAAQD",
|
|
6
|
-
"names": ["DashboardVisualisation_exports", "__export", "DashboardVisualisationClass", "DashboardVisualisation_default", "__toCommonJS", "responseData", "definition"]
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* eslint-disable prefer-destructuring */
|
|
2
|
-
import { components } from '../../../types/api'
|
|
3
|
-
import { DashboardDataResponse } from '../../../types/Metrics'
|
|
4
|
-
|
|
5
|
-
class DashboardVisualisationClass {
|
|
6
|
-
responseData: DashboardDataResponse[]
|
|
7
|
-
|
|
8
|
-
definition: components['schemas']['DashboardVisualisationDefinition']
|
|
9
|
-
|
|
10
|
-
columns: components['schemas']['DashboardVisualisationColumnsDefinition']
|
|
11
|
-
|
|
12
|
-
measures: components['schemas']['DashboardVisualisationColumnDefinition'][]
|
|
13
|
-
|
|
14
|
-
keys: components['schemas']['DashboardVisualisationColumnDefinition'][]
|
|
15
|
-
|
|
16
|
-
unit: components['schemas']['DashboardVisualisationColumnDefinition']['unit']
|
|
17
|
-
|
|
18
|
-
type: components['schemas']['DashboardVisualisationDefinition']['type']
|
|
19
|
-
|
|
20
|
-
constructor(
|
|
21
|
-
responseData: DashboardDataResponse[],
|
|
22
|
-
definition: components['schemas']['DashboardVisualisationDefinition'],
|
|
23
|
-
) {
|
|
24
|
-
this.definition = definition
|
|
25
|
-
this.columns = definition.columns
|
|
26
|
-
this.measures = this.columns.measures
|
|
27
|
-
this.keys = this.columns.keys || []
|
|
28
|
-
this.type = this.definition.type.split('-')[0] as components['schemas']['DashboardVisualisationDefinition']['type']
|
|
29
|
-
this.initUnit()
|
|
30
|
-
this.responseData = responseData
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
initUnit = () => {
|
|
34
|
-
// todo
|
|
35
|
-
this.unit = this.columns.measures[0].unit ? this.columns.measures[0].unit : undefined
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { DashboardVisualisationClass }
|
|
40
|
-
export default DashboardVisualisationClass
|