File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1035,18 +1035,23 @@ const chartData = computed<{
10351035
10361036 const dataset: VueUiXyDatasetItem [] = names .map (pkg => {
10371037 const points = pointsByPackage .get (pkg ) ?? []
1038- const map = new Map <number , number >()
1039- for (const p of points ) map .set (p .timestamp , p .value )
1038+ const valueByTimestamp = new Map <number , number >()
1039+ const anomalyTimestamps = new Set <number >()
1040+ for (const p of points ) {
1041+ valueByTimestamp .set (p .timestamp , p .value )
1042+ if (p .hasAnomaly ) anomalyTimestamps .add (p .timestamp )
1043+ }
10401044
1041- const series = dates .map (t => map .get (t ) ?? 0 )
1045+ const series = dates .map (t => valueByTimestamp .get (t ) ?? 0 )
1046+ const dashIndices = dates
1047+ .map ((t , index ) => (anomalyTimestamps .has (t ) ? index : - 1 ))
1048+ .filter (index => index !== - 1 )
10421049
10431050 const item: VueUiXyDatasetItem = {
10441051 name: pkg ,
10451052 type: ' line' ,
10461053 series ,
1047- dashIndices: points
1048- .map ((item , index ) => (item .hasAnomaly ? index : - 1 ))
1049- .filter (index => index !== - 1 ),
1054+ dashIndices ,
10501055 } as VueUiXyDatasetItem
10511056
10521057 if (isListedFramework (pkg )) {
You can’t perform that action at this time.
0 commit comments