Comments (2)
The above commit gets rid of my populate_ott_name_map
bodge that started this issue, and setting detail_fetched
instead, but the rest of the points here still stand. ott_name_map
is pretty likely useless.
from oztree.
This was an interesting thread to pull. There were 2 cases where ott_name_map
came into play:
- On leaping to search results, we didn't wait to fetch details first. The search results were stuffed into
ott_name_map
so at least the node names were available - On tree startup, node metadata could be fetched, but
details_fetched
wasn't set. We refuse to return the metadata in this case, butott_name_map
doesn't have similar qualms. I haven't discovered entirely why this would be the case, but checking if the metadata is available (array lookup) isn't dramatically more expensive than checkingdetails_fetched
.
id_ott_map
has become redundant in exactly the same way, so gotten rid of that as well.
Generally, I suspect everywhere details_fetched
touches could do with a rethink.
- Cache a reference to
data_repo.metadata.leaf_meta[this.metacode]
rather than caching metadata in the midnode object. Things likeget sponsor_name()
just become an alias toget_metadata
. - Push any modification of cached values (e.g.
capitalizeFirstLetter
) further upstream, at least to the metadata-parsing.
I wouldn't be surprised if it evaporates. But this is probably enough wild refactoring for today.
from oztree.
Related Issues (20)
- Add a few events to the hard-coded list in endorsements.html
- Tour ideas HOT 1
- Additional Wikidata tab on leaves's description HOT 19
- Additional iNaturalist tab on leave's description HOT 4
- Tidy up tabs and add links HOT 13
- `otts2vns` API endpoint considers 0 to be true. HOT 4
- `getOTT` API endpoint does not default to a JSON representation HOT 4
- Place some links to the recently created roz package for R
- permit external links in tour content HOT 1
- Settings are reset upon clicking "Popular places" links HOT 2
- QR code tools for museums, zoos and botanic gardens
- `header` return value from `popularity/list` API endpoint does not include a name for raw popularity data. HOT 4
- Search bar doesn't bring up keyboard on first tap on iOS HOT 2
- Fiddly to add the current node to common ancestors HOT 7
- Search results can include nodes that aren't in the OZ tree HOT 6
- Trivial: need to add some expiry strings to appconfig.ini.example
- Add a toggle to disable tour auto-advance HOT 3
- Links within tours should open in a new tab HOT 1
- Compass menu does not display reliably on iOS Safari HOT 2
- Set the 4 `name` fields to utf8mb4 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oztree.