danieloaks / codingtest-birdhouse-admin Goto Github PK
View Code? Open in Web Editor NEWAdmin app for an innovative new Smart Birdhouse initiative.
Home Page: https://birdhouse.danieloaks.net/
Admin app for an innovative new Smart Birdhouse initiative.
Home Page: https://birdhouse.danieloaks.net/
There are a few issues with the way the graph is displayed currently.
For reference, here is the design:
It'd hard to understand what's the birds and what's the eggs. We should probably display a legend somewhere nearby the graph to help make this easier to understand, since the blue/purple colours aren't used for these values anywhere else on the dashboard.
The design shows times from Monday through Sunday. We have a tough time replicating this sort of static scale because of the way that history entries are returned from the API (we need to grab them as pages and can't ensure that each page of states falls within a pretty range). Because pages can be grabbed and displayed arbitrarily, we also can't take that paginated info and force it into a nicer time-delimited structure unless we grab all occupancy history before the graph is displayed.
This is an issue that would be best resolved on the API side.
Currently, the ticks on the graph aren't aligned with the very left/right of the edges. This makes our graphs look less clean than they do on the design. This would also mean we don't need to try to add an extra dashed border around the outside, as the ticks will do that for us.
I'll see if we can have these align more nicely, but it may involve some filling gaps of non-existent data or starting/ending the graph before the very start and end points.
If you go to the third page of birdhouses, then click on a birdhouse, then click Back, you're sent back to page 1 of birdhouses. This doesn't feel as nice as it could.
We should push a page query param into our history, then read that when loading the page for the first time.
All the basic features that this project needs to be functional.
Design still needs to check this off, but I'd love a mode where we display all birdhouses on a map and show their location on the birdhouse pages as a map too. Consider this extra credit.
Since we intentionally don't store state to localStorage
, the API data will be refreshed whenever the user refreshes the page. However, it will continue to be stored so long as the user keeps clicking buttons on the site.
Given that registrations and occupancy info will change over time, we should periodically grab new data every e.g. 1-5 minutes. Whenever we time out existing data and grab new info we'll need to ensure that any other entries in the same page map are also scrubbed, so we don't end up in weird cases where we're mixing old paginated info and new paginated info.
Here's how to implement this for each type of data:
Paginated Registration info
Individual Registrations
getBaseRegInfo
if visiting a single page directly.getBaseRegInfo
requests, check if the grabbed time is elapsed. If it is, make a new API call to grab registration info and update the grabbed time.Paginated Occupancy info
bhid
's occupancy info.bhid
. If it's passed then dump the existing occupancy store for that bhid
and re-grab pages from the API as needed.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.