@gen3/core 0.11.54 → 0.11.56
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/dist/cjs/index.js +14 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/features/cohort/cohortManagerSlice.d.ts +1 -0
- package/dist/dts/features/cohort/cohortManagerSlice.d.ts.map +1 -1
- package/dist/dts/features/facets/types.d.ts +1 -1
- package/dist/dts/features/facets/types.d.ts.map +1 -1
- package/dist/dts/features/guppy/guppySlice.d.ts.map +1 -1
- package/dist/dts/features/guppy/index.d.ts +2 -1
- package/dist/dts/features/guppy/index.d.ts.map +1 -1
- package/dist/dts/features/guppy/range.d.ts +4 -3
- package/dist/dts/features/guppy/range.d.ts.map +1 -1
- package/dist/dts/features/guppy/types.d.ts +1 -0
- package/dist/dts/features/guppy/types.d.ts.map +1 -1
- package/dist/esm/index.js +14 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1541,7 +1541,9 @@ const getCurrentCohortId = (state)=>state.currentCohortId;
|
|
|
1541
1541
|
customName: uniqueName
|
|
1542
1542
|
});
|
|
1543
1543
|
cohortsAdapter.addOne(state, cohort);
|
|
1544
|
-
|
|
1544
|
+
if (action.payload?.setAsCurrent) {
|
|
1545
|
+
state.currentCohortId = cohort.id;
|
|
1546
|
+
}
|
|
1545
1547
|
},
|
|
1546
1548
|
updateCohortName: (state, action)=>{
|
|
1547
1549
|
const { id, name } = action.payload;
|
|
@@ -2333,23 +2335,23 @@ const convertNumericFromToArrayToFilters = (field, range, isNested = true)=>{
|
|
|
2333
2335
|
]
|
|
2334
2336
|
};
|
|
2335
2337
|
};
|
|
2336
|
-
const rawDataQueryStrForEachField = (field)=>{
|
|
2338
|
+
const rawDataQueryStrForEachField = (field, asTextHistogram = false)=>{
|
|
2337
2339
|
const splitFieldArray = field.split('.');
|
|
2338
2340
|
const splitField = splitFieldArray.shift();
|
|
2339
2341
|
let middleQuery = '';
|
|
2340
2342
|
if (splitFieldArray.length === 0) {
|
|
2341
|
-
middleQuery = `${splitField} { histogram { count } }`;
|
|
2343
|
+
middleQuery = `${splitField} { ${asTextHistogram ? "histogram: asTextHistogram" : "histogram"} { count } }`;
|
|
2342
2344
|
} else {
|
|
2343
|
-
middleQuery = `${splitField} { ${rawDataQueryStrForEachField(splitFieldArray.join('.'))} }`;
|
|
2345
|
+
middleQuery = `${splitField} { ${rawDataQueryStrForEachField(splitFieldArray.join('.'), asTextHistogram)} }`;
|
|
2344
2346
|
}
|
|
2345
2347
|
return middleQuery;
|
|
2346
2348
|
};
|
|
2347
|
-
const buildAliasedNestedCountsQuery = ({ type, field, rangeName })=>{
|
|
2349
|
+
const buildAliasedNestedCountsQuery = ({ type, field, rangeName, asTextHistogram = false })=>{
|
|
2348
2350
|
const dataParams = [
|
|
2349
2351
|
`filter: $${rangeName}`
|
|
2350
2352
|
];
|
|
2351
2353
|
const dataTypeLine = `${rangeName} : ${type} (accessibility: $accessibility ${dataParams}) {`;
|
|
2352
|
-
const processedFields = rawDataQueryStrForEachField(field);
|
|
2354
|
+
const processedFields = rawDataQueryStrForEachField(field, asTextHistogram);
|
|
2353
2355
|
return `${dataTypeLine} ${processedFields} }`;
|
|
2354
2356
|
};
|
|
2355
2357
|
const buildRangeFilters = (field, ranges, filters, rangeBaseName, isNested = true)=>{
|
|
@@ -2364,14 +2366,15 @@ const buildRangeFilters = (field, ranges, filters, rangeBaseName, isNested = tru
|
|
|
2364
2366
|
return acc;
|
|
2365
2367
|
}, {});
|
|
2366
2368
|
};
|
|
2367
|
-
const buildRangeQuery = (field, ranges, filters, rangeBaseName = 'range', index = 'cases', indexPrefix = '', isNested = true)=>{
|
|
2369
|
+
const buildRangeQuery = (field, ranges, filters, rangeBaseName = 'range', index = 'cases', indexPrefix = '', isNested = true, asTextHistogram = false)=>{
|
|
2368
2370
|
const rangeFilters = buildRangeFilters(field, ranges, filters, rangeBaseName, isNested);
|
|
2369
2371
|
let query = `query rangeQuery ($accessibility: Accessibility, ${Object.keys(rangeFilters).map((rangeKey)=>`$${rangeKey}: JSON`).join(',')} ) { ${indexPrefix}_aggregation {`;
|
|
2370
2372
|
Object.keys(rangeFilters).forEach((rangeKey)=>{
|
|
2371
2373
|
const rangeQuery = buildAliasedNestedCountsQuery({
|
|
2372
2374
|
type: index,
|
|
2373
2375
|
field,
|
|
2374
|
-
rangeName: rangeKey
|
|
2376
|
+
rangeName: rangeKey,
|
|
2377
|
+
asTextHistogram
|
|
2375
2378
|
});
|
|
2376
2379
|
query += rangeQuery + ' \n';
|
|
2377
2380
|
});
|
|
@@ -2982,9 +2985,9 @@ const explorerTags = guppyApi.enhanceEndpoints({
|
|
|
2982
2985
|
}
|
|
2983
2986
|
}),
|
|
2984
2987
|
customRange: builder.query({
|
|
2985
|
-
query: ({ filters, field, ranges, rangeBaseName, index, indexPrefix, accessibility = Accessibility.ALL, isNested = true })=>{
|
|
2988
|
+
query: ({ filters, field, ranges, rangeBaseName, index, indexPrefix, accessibility = Accessibility.ALL, isNested = true, asTextHistogram = false })=>{
|
|
2986
2989
|
// remove field from FilterSet
|
|
2987
|
-
const queryData = buildRangeQuery(field, ranges, filters, rangeBaseName, index, indexPrefix, isNested);
|
|
2990
|
+
const queryData = buildRangeQuery(field, ranges, filters, rangeBaseName, index, indexPrefix, isNested, asTextHistogram);
|
|
2988
2991
|
const gqlFilters = Object.entries(queryData.filters).reduce((acc, [key, filter])=>{
|
|
2989
2992
|
acc[key] = isNested ? convertFilterSetToNestedGqlFilter(filter) : convertFilterSetToGqlFilter(filter);
|
|
2990
2993
|
return acc;
|
|
@@ -6295,6 +6298,7 @@ exports.buildGetStatsAggregationQuery = buildGetStatsAggregationQuery;
|
|
|
6295
6298
|
exports.buildListItemsGroupedByDataset = buildListItemsGroupedByDataset;
|
|
6296
6299
|
exports.buildNestedFilterForOperation = buildNestedFilterForOperation;
|
|
6297
6300
|
exports.buildNestedGQLFilter = buildNestedGQLFilter;
|
|
6301
|
+
exports.buildRangeQuery = buildRangeQuery;
|
|
6298
6302
|
exports.calculatePercentageAsNumber = calculatePercentageAsNumber;
|
|
6299
6303
|
exports.calculatePercentageAsString = calculatePercentageAsString;
|
|
6300
6304
|
exports.capitalize = capitalize;
|