readyplayer2 / food-traffic-light-calculator Goto Github PK
View Code? Open in Web Editor NEWA tool to find out the traffic light labelling for food products in the UK.
License: MIT License
A tool to find out the traffic light labelling for food products in the UK.
License: MIT License
Use an Optical Character Recognition (OCR) API to parse the text in a photo as use for input.
Include string diff comparisions for partial matches of words like saturates
and sugars
.
Good to show preview of what app looks like.
routes for calculating each of the parts and returning green, orange, red (maybe with data) and encompossing routes for all in one.
Values should be numeric positive values e.g:
1
1.2
12.21344
The UI should clearly show what is wrong.
See reference in readme
Use of ml
not grams
.
It would be better if both labels (like Total Fat
) and the corresponding text fields were aligned centrally or in some other configuaration.
The current layout looks quite messy.
Fields to include:
Currently it is a single li
element that is rendered and so it is all on one line. It would look better (more like examples) if the percentage was a different element that is displayed beneath. This may require some sort of wrapper containers to hold the two values (raw + percentage).
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://apod.nasa.gov/apod/image/1803/AstroSoM/hudf.html with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
crunchSugars() {
if (this.state.lastResult.normalsugars <= 5.0) {
return <li className='green'>{this.state.lastResult.normalsugars}</li>
} else if (this.state.lastResult.normalsugars <= 22.5) {
return <li className='orange'>{this.state.lastResult.normalsugars}</li>
} else {
return <li className='red'>{this.state.lastResult.normalsugars}</li>
}
}
This type of code is duplicated and very common, it should be a generic function and pass in value to tests, range 1, range 2.
label
element.Add simple unit tests for sample values and expected output values + percentages.
Decide on unit testing framework.
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.