jariarkko / psgeo

Activity location library
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

psgeo.js filter window needs to be made data-driven #128

Closed jariarkko closed 4 years ago

jariarkko commented 4 years ago

This window should be entirely data-driven. Now there's too much code here, and it is error-prone. We are making mistakes as we change the code, because of this complexity.

ralfstrandell commented 4 years ago

Good idea.

Our data contains prefixed tags, such as Rock-Sandstone, Rock-Limestone, ... (IF we change activityJSON and our DB a bit, then those might become Environment-Rock-Sandstone, Environment-Rock-Limestone, Environment-Ice, ...; note the two/three level structure).

The Simple Cave Types, however, are generated/reinterpreted in psgeo. Instead they could be in the data itself: Type-Boulders, Type-Karst...

Having a prefix (environment, type, others), a category, and a member would make this a generic system that could be data driven and automated. There may be better and more clever ways to do it, this is but a quick draft.

jariarkko commented 4 years ago

The code is now largely data-driven. Swimming, skiing, and sauna subtypes are all automatically handled by the new general code and the table at the beginning of the psgeo.js file. Tomorrow I will put the rock type and morphology under the new system as well. This should not change the behaviour.

jariarkko commented 4 years ago

I believe this is now done.