Skip to content

Commit 8f5bf16

Browse files
imatiach-msftms-kashyap
authored andcommitted
fix dataset explorer plot with count not displaying (#1454)
1 parent d45e245 commit 8f5bf16

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libs/dataset-explorer/src/lib/getDatasetBar.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ export function getDatasetBar(
2424
chartProps?.xAxis.property &&
2525
jointData.metaDict[chartProps.xAxis.property].sortedCategoricalValues
2626
?.length;
27+
const noneGroup = "none";
2728

2829
if (customData && xData) {
2930
for (const [i, customDatum] of customData.entries()) {
30-
const yValue = (customDatum as any).Y;
31+
const yValue = (customDatum as any).Y ?? noneGroup;
3132
if (!groupedData[yValue]) {
3233
groupedData[yValue] = new Array(xDataTypeCount).fill(0);
3334
}
@@ -36,9 +37,9 @@ export function getDatasetBar(
3637
}
3738

3839
if (chartProps?.yAxis.property) {
39-
jointData.metaDict[
40-
chartProps.yAxis.property
41-
].sortedCategoricalValues?.forEach((value) => {
40+
const groups = jointData.metaDict[chartProps.yAxis.property]
41+
.sortedCategoricalValues ?? [noneGroup];
42+
groups.forEach((value) => {
4243
result.push({
4344
data: groupedData[value],
4445
name: value

0 commit comments

Comments
 (0)