Skip to content

Commit

Permalink
merge from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
craigrbarnes committed Dec 6, 2024
2 parents 4668889 + 573df06 commit 89f5645
Show file tree
Hide file tree
Showing 8 changed files with 1,149 additions and 456 deletions.
1,024 changes: 583 additions & 441 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@mantine/modals": "^7.13.3",
"@mantine/dates": "^7.13.3",
"@mantine/notifications": "^7.13.3",
"jsonpath-plus": "^10.2.0",
"classnames": "^2.3.1",
"colorette": "^2.0.20",
"dom-to-svg": "^0.12.2",
Expand All @@ -53,7 +54,7 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.0",
"@swc/cli": "^0.4.0",
"@swc/cli": "^0.5.0",
"@swc/core": "^1.7.28",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.1.2",
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@types/fastestsmallesttextencoderdecoder": "^1.0.2",
"@types/flat": "^5.0.3",
"@types/isomorphic-fetch": "^0.0.36",
"@types/jsonpath-plus": "5.0.5",
"@types/lodash": "^4.14.191",
"@types/papaparse": "^5.3.14",
"@types/uuid": "^9.0.0"
Expand Down
19 changes: 13 additions & 6 deletions packages/core/src/features/guppy/guppySlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ const statusEndpoint = '/_status';
const processHistogramResponse = (
data: Record<string, any>,
): AggregationsData => {
const pathData = JSONPath({
const valueData = JSONPath({
json: data,
path: '$..histogram',
resultType: 'all',
resultType: 'value',
});
const results = pathData.reduce(
(acc: AggregationsData, element: Record<string, any>) => {
const key = element.pointer

const pointerData = JSONPath({
json: data,
path: '$..histogram',
resultType: 'pointer',
});

const results = pointerData.reduce(
(acc: AggregationsData, element: Record<string, any>, idx: number) => {
const key = element
.slice(1)
.replace(/\/histogram/g, '')
.replace(/\//g, '.');
return {
...acc,
[key]: element.value,
[key]: valueData[idx],
};
},
{} as AggregationsData,
Expand Down
Loading

0 comments on commit 89f5645

Please sign in to comment.