Skip to content

Commit

Permalink
Merge branch 'main' into 895-revisit-zoom-to-geohash-mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
chowington committed Apr 23, 2024
2 parents 554ed13 + c947ef6 commit 3d3564d
Show file tree
Hide file tree
Showing 76 changed files with 2,401 additions and 767 deletions.
8 changes: 5 additions & 3 deletions packages/libs/components/src/map/MapVEuMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { Map, DomEvent, LatLngBounds } from 'leaflet';
import domToImage from 'dom-to-image';
import { makeSharedPromise } from '../utils/promise-utils';
import { Undo } from '@veupathdb/coreui';
import { mouseEventHasModifierKey } from './BoundsDriftMarker';

// define Viewport type
export type Viewport = {
Expand Down Expand Up @@ -366,9 +367,10 @@ function MapVEuMapEvents(props: MapVEuMapEventsProps) {
baselayerchange: (e: { name: string }) => {
onBaseLayerChanged && onBaseLayerChanged(e.name as BaseLayerChoice);
},
// map click event: remove selected highlight markers
click: () => {
if (onMapClick != null) onMapClick();
// map click event: remove selected markers and close side panel
click: (e) => {
if (onMapClick != null && !mouseEventHasModifierKey(e.originalEvent))
onMapClick();
},
});

Expand Down
15 changes: 1 addition & 14 deletions packages/libs/components/src/map/SemanticMarkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import {
} from 'react';
import { AnimationFunction, Bounds } from './Types';
import { BoundsDriftMarkerProps } from './BoundsDriftMarker';
import { useMap, useMapEvents } from 'react-leaflet';
import { useMap } from 'react-leaflet';
import { LatLngBounds } from 'leaflet';
import { debounce, isEqual } from 'lodash';
import { mouseEventHasModifierKey } from './BoundsDriftMarker';
import AreaSelect from './AreaSelect';

export interface SemanticMarkersProps {
Expand Down Expand Up @@ -50,18 +49,6 @@ export default function SemanticMarkers({
// react-leaflet v3
const map = useMap();

// cancel marker selection with a single click on the map
useMapEvents({
click: (e) => {
// excluding a combination of special keys and mouse click
if (
setSelectedMarkers != null &&
!mouseEventHasModifierKey(e.originalEvent)
)
setSelectedMarkers(undefined);
},
});

const [prevRecenteredMarkers, setPrevRecenteredMarkers] =
useState<ReactElement<BoundsDriftMarkerProps>[]>(markers);

Expand Down
18 changes: 18 additions & 0 deletions packages/libs/components/src/plots/BipartiteNetwork.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,21 @@
font-size: 1em;
font-weight: 500;
}

.bpnet-hover-dropdown {
display: none;
}

.visx-network-node:hover .bpnet-hover-dropdown {
display: unset;
}

.visx-network-node .hover-trigger:hover {
display: unset;
fill: #00000017;
}

.NodeWithLabel_Node,
.NodeWithLabel_Label {
cursor: pointer;
}
Loading

0 comments on commit 3d3564d

Please sign in to comment.