Skip to content

Commit

Permalink
feat: [NGRM]: Axes2D Margins. If default or set value is to small the…
Browse files Browse the repository at this point in the history
… margin will get autocalculated #2342 (#2343)
  • Loading branch information
nilscb authored Nov 5, 2024
1 parent dfbc39c commit c097a18
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 96 deletions.
10 changes: 6 additions & 4 deletions typescript/packages/subsurface-viewer/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,13 @@ const Map: React.FC<MapProps> = ({
}) as unknown as Axes2DLayer;

const axes2DProps = axes2DLayer?.props;
const marginV = axes2DProps?.minimalMarginV ?? axes2DProps?.marginV;
const marginH = axes2DProps?.minimalMarginH ?? axes2DProps?.marginH;
return {
left: axes2DProps?.isLeftRuler ? axes2DProps.marginH : 0,
right: axes2DProps?.isRightRuler ? axes2DProps.marginH : 0,
top: axes2DProps?.isTopRuler ? axes2DProps.marginV : 0,
bottom: axes2DProps?.isBottomRuler ? axes2DProps.marginV : 0,
left: axes2DProps?.isLeftRuler ? marginH : 0,
right: axes2DProps?.isRightRuler ? marginH : 0,
top: axes2DProps?.isTopRuler ? marginV : 0,
bottom: axes2DProps?.isBottomRuler ? marginV : 0,
};
}, [layers]);

Expand Down
Loading

0 comments on commit c097a18

Please sign in to comment.