Comments (6)
Hey, great point, @robinharris! There's a lot of work that needs to be done on the heatmap. Currently, the heatmap colours are defined here in a Javascript object literal. This works great, but I need to look up the official colours and translate them into this system to improve the fidelity of the display.
Do you have a link to the official air quality scale though? I've seen several competing colour schemes.
from air-quality-web.
So the scale is 0 to 1 in the code.
"PM25": { // 0 to 35 low (green), 36 to 53 moderate (amber) 54 to 70 high (red) and above 71 (purple) max: 75, gradient: { "0": "hsla(111, 76%, 42%, 0.00)", "0.233": "hsl(111, 76%, 42%)", // green "0.593": "orange", "0.827": "red", "1": "purple" }
https://uk-air.defra.gov.uk/air-pollution/daqi?view=more-info&pollutant=pm25#pollutant
I'm not a web site never made webpages really, but going into the source and then the guess at the css sheet, a quick search and I think this is what you need?
bg_low1{background-color:#9cff9c;color:#000}.bg_low2{background-color:#31ff00;color:#000}.bg_low3{background-color:#31cf00;color:#000}.bg_moderate4{background-color:#ff0;color:#000}.bg_moderate5{background-color:#ffcf00;color:#000}.bg_moderate6{background-color:#ff9a00;color:#222}.bg_high7{background-color:#ff6464;color:#000}.bg_high8{background-color:red;color:#fff}.bg_high9{background-color:#900;color:#fff}.bg_very_high10{background-color:#ce30ff;color:#fff}
from air-quality-web.
Yeah, @bsimmo. It's actually used as a gradient that I pass to the library - hence between 0 and 1 with the maximum value.
Unfortunately, while that CSS is helpful, I have to define it in the place indicated. Any CSS is automatically generated through the build process you see. If you're interested in picking through the code, I can recommend cloning this repository and looking through it.
Thanks for the link though - it's very helpful! I'll use that as a reference.
from air-quality-web.
CSS was more for the hex colours used.
bg_low1 = 0-11
bg_high8 = 59-64
on the official defra scale website
If we add devices, you could have the same 10 point colour scale and then just call as needed for PM2.5 PM10 or in future O3, NO2 etc, just the µg/m³ changes for each measure.
from air-quality-web.
Ah, I see. I've taken the hex colours from the official website and am substituting them in now.
I have a system that allows me to have a different colour scheme for each reading type - but I think I broke the bit where you switch reading types a bit ago and didn't notice. Something else to look into!
The heatmap is my current area of focus, after recently focusing on the device graphs for a while. It will take a while, but I've got some great ideas on how I want to improve it :D
from air-quality-web.
Fixed. It should be deployed in the next 1/2 hour. If not, let me know :-)
from air-quality-web.
Related Issues (20)
- Display the currently selected reading type on the heatmap when loading the device graph HOT 1
- Migration: Slow HTTP API calls HOT 9
- When clicking sensors on the AQ Map (sometimes) the map just zooms HOT 5
- Sensor filter HOT 12
- Mosquitto stuck Address in use (1883) HOT 3
- FTW says 6 hours ago but last reading was 12:00 (now 16:00) HOT 13
- Issue with web site on some devices HOT 22
- Repeated measurement types above chart HOT 5
- Can the charts be made to open with data rather than just say error: no data recorded HOT 1
- Slow charts HOT 5
- POST request : Error 500 Internal Server Error HOT 7
- API action list-devices-near is not quite working - it returns only the same sensor HOT 8
- device.visible has no effect on the map HOT 7
- API and documents not working HOT 3
- Circles, on Opening the Map, don't disappear HOT 2
- Sensor not showing up correctly on current (0.14-dev) beta site HOT 5
- Last seen on chart is wrong HOT 6
- Wrong base URL in the API docs HOT 1
- graph not showing data for device bonus-a-abp HOT 5
- Integration with custom sensors and visual optimizations ? HOT 8
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 air-quality-web.