Skip to content

Commit

Permalink
Merge pull request #1567 from goat-community/main
Browse files Browse the repository at this point in the history
Patching
  • Loading branch information
EPajares authored Sep 21, 2022
2 parents 1f32dbe + 3c28637 commit d372cff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/api/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ async def swagger_ui_html():
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=["X-Total-Count"],
)


Expand All @@ -64,7 +65,7 @@ async def startup_event():
async with async_session() as db:
table_index = await crud.layer.table_index(db)
app.state.table_catalog = table_index

if not os.environ.get("DISABLE_NUMBA_STARTUP_CALL") == "True":
await run_time_method_calls.call_isochrones_startup(app=app)

Expand Down
8 changes: 6 additions & 2 deletions app/client/src/components/viewer/ol/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@
$t(
`indicators.ptRouteTypes.${transitRouteTypesByNr[routeType].name}`
)
}}: {{ tripCnt }}
}}:
{{
tripCnt && timeDelta > 0 ? Math.round(tripCnt / timeDelta) : 0
}}
</p>
</div>
</template>
Expand Down Expand Up @@ -1079,7 +1082,8 @@ export default {
...mapGetters("isochrones", {
isochroneLayer: "isochroneLayer",
options: "options",
transitRouteTypesByNr: "transitRouteTypesByNr"
transitRouteTypesByNr: "transitRouteTypesByNr",
timeDelta: "timeDelta"
}),
...mapGetters("scenarios", {
activeScenario: "activeScenario"
Expand Down
8 changes: 8 additions & 0 deletions app/client/src/store/modules/isochrones.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ const getters = {
chartDatasetType: state => state.chartDatasetType,
isochroneResultWindow: state => state.isochroneResultWindow,
// eslint-disable-next-line no-unused-vars
timeDelta: (state, getters, rootState) => {
let time =
(rootState.app.timeIndicators.endTime -
rootState.app.timeIndicators.startTime) /
3600;
return time;
},
// eslint-disable-next-line no-unused-vars
routingProfiles: (state, getters, rootState, rootGetters) => {
let routingProfiles = {};
const routing = rootState.app.appConfig.routing;
Expand Down
6 changes: 1 addition & 5 deletions app/client/src/style/OlStyleDefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,12 +989,8 @@ export function poisAoisStyle(feature) {
import Chart from "ol-ext/style/Chart";

export function ptStationCountStyle(feature) {
let time =
(appStore.state.timeIndicators.endTime -
appStore.state.timeIndicators.startTime) /
3600;
const tripCnt = feature.get("trip_cnt");

const time = store.getters["isochrones/timeDelta"]; // number of hours
const tripCntSum = Object.values(tripCnt).reduce((a, b) => a + b, 0) / time;
let radius = 3;
if (tripCntSum <= 5 && tripCntSum > 0) {
Expand Down

0 comments on commit d372cff

Please sign in to comment.