Skip to content

Commit

Permalink
Dataset explorer: Propagate number of bins to SDK backend API (#1940)
Browse files Browse the repository at this point in the history
* Dataset explorer: Propagate number of bins to SDK backend API

Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>

* Update libs/dataset-explorer/src/lib/ChartView/LargeDataView/getBarOrBoxChartConfig.ts

Co-authored-by: Roman Lutz <romanlutz13@gmail.com>

* Revert "Update libs/dataset-explorer/src/lib/ChartView/LargeDataView/getBarOrBoxChartConfig.ts"

This reverts commit a8b2e42.

---------

Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
Co-authored-by: Roman Lutz <romanlutz13@gmail.com>
gaugup and romanlutz authored Feb 6, 2023
1 parent 7ef0054 commit beed87f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -46,6 +46,11 @@ export async function getBarOrBoxChartConfig(
jointDataset.metaDict[yAxisProperty].isCategorical ||
jointDataset.metaDict[yAxisProperty]?.treatAsCategorical;

let numberOfBins = 5;
if (jointDataset?.binDict?.Index) {
numberOfBins = jointDataset.binDict.Index.length;
}

if (treatYAsCategorical) {
const treatXAsCategorical =
(jointDataset.metaDict[xAxisProperty].isCategorical ||
@@ -59,7 +64,7 @@ export async function getBarOrBoxChartConfig(
treatXAsCategorical,
jointDataset.metaDict[yAxisProperty].label,
treatYAsCategorical,
5,
numberOfBins,
new AbortController().signal
);
const datasetBarConfigOverride = {
@@ -78,7 +83,7 @@ export async function getBarOrBoxChartConfig(
compositeFiltersRelabeled,
jointDataset.metaDict[xAxisProperty].label,
jointDataset.metaDict[yAxisProperty].label,
5,
numberOfBins,
new AbortController().signal
);

0 comments on commit beed87f

Please sign in to comment.