Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Refactor networks data state to support place comparisons [#699](https://github.com/azavea/echo-locator/pull/699)
- Refactor user authentication APIs [#718](https://github.com/azavea/echo-locator/pull/718)
- Implement units design changes [#776](https://github.com/azavea/echo-locator/pull/776)
- Allow un-routable neighborhoods to be recommended [#806](https://github.com/azavea/echo-locator/pull/806)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import pullAt from "lodash/pullAt";
import {
BOOST_DOWNTOWN_RESULT_PLACE,
DOWNTOWN_AREAS,
MAX_TRAVEL_TIME,
RESULTS_WITH_DOWNTOWN,
} from "../../../constants";
import { createSelector } from "@reduxjs/toolkit";
Expand Down Expand Up @@ -91,13 +90,12 @@ export default createSelector(
n
);

const isRoutable =
(useTransit && segments.length) || !useTransit;
if (isRoutable && time < MAX_TRAVEL_TIME) {
// A neighborhood is not technically "routable" if:
// (useTransit and !segments.length) OR time >= MAX_TRAVEL_TIME
// However, we don't want to exclude non-routable neighborhoods
// from recommendations entirely as they may be a valid options for someone.
// For this reason, add all neighborhoods to recommended list by default.
recommendedNeighborhoodsList.push(result);
} else {
tooFarNeighborhoodsList.push(result);
}
});
const rankedRecommendedNeighborhoods = orderBy(
recommendedNeighborhoodsList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const createNeighborhoodWeightedScore = (
// Routable neighborhoods outside the max travel time window filtered into separate list.
// Smaller travel time is better; larger timeWeight is better (reverse range).
const timeWeight =
time < MAX_TRAVEL_TIME ? scale(time, 0, MAX_TRAVEL_TIME, 1, 0) : 1;
time < MAX_TRAVEL_TIME ? scale(time, 0, MAX_TRAVEL_TIME, 1, 0) : 0;
// Weight schools either by percentile binned into quarters if given max importance,
// or otherwise weight by quintile.
let educationWeight;
Expand Down
Loading