Skip to content

Commit

Permalink
Merge pull request #387 from visdesignlab/386-deviation-scale-fix
Browse files Browse the repository at this point in the history
Fix deviation scale being shifted by 1/2 attribute bar width
  • Loading branch information
JakeWags committed Aug 29, 2024
2 parents 624db5c + 90d632c commit 256bf35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/upset/src/components/Columns/DeviationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const DeviationBar: FC<Props> = ({ deviation }) => {
const dimensions = useRecoilValue(dimensionsSelector);

const deviationScale = useRecoilValue(deviationScaleAtom);
deviationScale.range([0, dimensions.attribute.width / 2]);
deviationScale.range([0, dimensions.attribute.width]);

return (
<g
Expand All @@ -30,11 +30,11 @@ export const DeviationBar: FC<Props> = ({ deviation }) => {
<rect
fill={(deviation > 0) ? positiveDeviation : negativeDeviation}
transform={translate(
deviation > 0 ? 0 : -deviationScale(Math.abs(deviation)),
deviation > 0 ? 0 : -deviationScale(Math.abs(deviation)) + dimensions.attribute.width / 2,
0,
)}
height={dimensions.attribute.plotHeight}
width={deviationScale(Math.abs(deviation))}
width={deviationScale(Math.abs(deviation)) - dimensions.attribute.width / 2}
/>
</g>
);
Expand Down

0 comments on commit 256bf35

Please sign in to comment.