Skip to content

Commit

Permalink
fix(#8338): make boxplot work with single value per group
Browse files Browse the repository at this point in the history
  • Loading branch information
kanitw committed Aug 4, 2022
1 parent a8d7a15 commit 17d84cd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/compositemark/boxplot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,17 @@ export function normalizeBoxPlot(

const makeBoxPlotExtent = makeBoxPlotPart(encodingWithoutSizeColorAndContinuousAxis);
const makeBoxPlotBox = makeBoxPlotPart(encodingWithoutContinuousAxis);
const makeBoxPlotMidTick = makeBoxPlotPart({...encodingWithoutSizeColorAndContinuousAxis, ...(size ? {size} : {})});
const defaultBoxColor = isObject(config.boxplot.box) ? config.boxplot.box.color : config.mark.color || '#4c78a8';
const makeBoxPlotMidTick = makeBoxPlotPart({
...encodingWithoutSizeColorAndContinuousAxis,
...(size ? {size} : {}),
color: {
condition: {
test: `datum['lower_box_${continuousAxisChannelDef.field}'] >= datum['upper_box_${continuousAxisChannelDef.field}']`,
...(color || {value: defaultBoxColor})
}
}
});

const fiveSummaryTooltipEncoding: Encoding<string> = getCompositeMarkTooltip(
[
Expand Down

0 comments on commit 17d84cd

Please sign in to comment.