Skip to content

Commit

Permalink
feat: expose pickingRadius as prop in Map.tsx in `SubsurfaceViewe…
Browse files Browse the repository at this point in the history
…r` package (#2313)
  • Loading branch information
rubenthoms authored Oct 14, 2024
1 parent 68ae569 commit 817cdeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ SubsurfaceViewer.propTypes = {
* Validate JSON datafile against schema
*/
checkDatafileSchema: PropTypes.bool,

/**
* Extra pixels around the pointer to include while picking.
*/
pickingRadius: PropTypes.number,
};

export default SubsurfaceViewer;
7 changes: 7 additions & 0 deletions typescript/packages/subsurface-viewer/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ export interface MapProps {
* an event listener.
*/
innerRef?: React.Ref<HTMLElement>;

/**
* Extra pixels around the pointer to include while picking.
*/
pickingRadius?: number;
}

function defaultTooltip(info: PickingInfo) {
Expand Down Expand Up @@ -415,6 +420,7 @@ const Map: React.FC<MapProps> = ({
triggerResetMultipleWells,
verticalScale,
innerRef,
pickingRadius,
}: MapProps) => {
// From react doc, ref should not be read nor modified during rendering.
const deckRef = React.useRef<DeckGLRef>(null);
Expand Down Expand Up @@ -825,6 +831,7 @@ const Map: React.FC<MapProps> = ({
onDragStart={onDragStart}
onDragEnd={onDragEnd}
onResize={onResize}
pickingRadius={pickingRadius}
>
{children}
</DeckGL>
Expand Down

0 comments on commit 817cdeb

Please sign in to comment.