Skip to content

Commit

Permalink
Add buffer space to bar charts. (#1681)
Browse files Browse the repository at this point in the history
  • Loading branch information
tealefristoe authored Dec 10, 2024
1 parent 1486581 commit be70b89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v3/src/components/graph/components/freedotplotdots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ export const FreeDotPlotDots = observer(function FreeDotPlotDots(props: PlotProp

const getBarStaticDimension = () => {
// This function determines how much space is available for each bar on the non-primary axis by dividing the
// length of the non-primary axis by the number of cases in the subplot containing the most cases. This keeps
// the bars a uniform size across subplots.
// length of the non-primary axis by one more than the number of cases in the subplot containing the most cases.
// This keeps the bars a uniform size across subplots.
const largestSubplotCount = Math.max(...Array.from(subPlotDetails.values()).map(sp => sp.cases.length))
return largestSubplotCount ? secondaryBandwidth / largestSubplotCount : 0
return largestSubplotCount ? secondaryBandwidth / (largestSubplotCount + 1) : 0
}

const getBarValueDimension = (anID: string) => {
Expand Down

0 comments on commit be70b89

Please sign in to comment.