Skip to content

Commit

Permalink
[Enhancement] add bin to filter hiitogram construct (#1673)
Browse files Browse the repository at this point in the history
* add bin to histogram
Signed-off-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
heshan0131 committed Aug 10, 2022
1 parent 41414ce commit 20d39b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/geocoder/geocoder.tsx
Expand Up @@ -208,7 +208,7 @@ const GeoCoder: React.FC<GeocoderProps & IntlProps> = ({
const newViewport = new WebMercatorViewport(viewport);
const {bbox, center} = item;

const resultViewport = bbox
const gotoViewport = bbox
? newViewport.fitBounds([
[bbox[0], bbox[1]],
[bbox[2], bbox[3]]
Expand All @@ -219,7 +219,7 @@ const GeoCoder: React.FC<GeocoderProps & IntlProps> = ({
zoom: pointZoom
};

const {longitude, latitude, zoom} = resultViewport;
const {longitude, latitude, zoom} = gotoViewport;

onSelected({...viewport, ...{longitude, latitude, zoom, transitionDuration}}, item);

Expand Down
1 change: 1 addition & 0 deletions src/utils/filter-utils.ts
Expand Up @@ -746,6 +746,7 @@ export function histogramConstruct(
.domain(domain)(mappedValue)
.map(bin => ({
count: bin.length,
bin,
x0: bin.x0,
x1: bin.x1
}));
Expand Down

0 comments on commit 20d39b8

Please sign in to comment.