Color palette based on weather temperatures
Hello.
I'm very new to this (only 48 hours playing with Nodebox). I'm trying to create some Christmas garlands based on three Spanish locations' monthly maximum and minimum temperatures. (Previous creators inspire the design, so if I spread something, I will credit the sources.)
I cannot associate a range of colors with the series of minimum temperatures (10ºC down) or maximum temperatures (10ºC down). However, I could also use a complete range if I could go from blue-green-yellow-orange-red.
Any help is welcome.
Thank you.
- weather-nodebox.png 567 KB
- Enero.zip 5.18 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by john on 28 Nov, 2023 04:32 AM
Deduce,
Welcome to the NodeBox community.
First of all, I am very impressed by how far you got in only 48 hours. You seem to have a knack with Nodebox.
I have attached an updated version of your Enero 2023 project with the following changes:
There was a bug in all three of your CSVs with the first header (fecha). This was not your fault; it's a common thing that happens with Excel. For some reason, Excel sometimes puts hidden characters before the first letter of the first header in CSV files. This makes the first column of CSVs impossible to filter on in Nodebox. Very annoying and took me awhile to find the first time I encountered it.
To avoid this Excel problem I generally try to create and export my CSVs in Nodebox. I can then fill them out in Excel if I want; as long as the CSV was originally created in Nodebox, Excel will not corrupt it.
If, as in this case, you already have corrupted CSVs, you need to repair them by changing the name of the first header to what it should be. I have some nodes that make this easier.
You can see how I did it by looking inside my master_table subnetwork. This subnetwork fixes the first header then merges the three city CSVs, adding a new "city" column to the front. You only need to do that once and then export the master table, which I did. Going forward you can just access Data Enero/Cities-01.csv.
If you have more CSVs for more cities and more months, you can modify my master_table node to create a single data file for all your future projects.
Merging the three separate CSVs into a single file allows you also merge your repeated subtrees into a single subnetwork. In addition to saving you a lot of work, this also ensures that your visualization in consistent across all cities.
In the process of updating your network I discovered a bug in your second and third cities: for the upper warm hemispheres you had the target start and end reversed in your convert range node. This made 20 degree temperatures appear redder than 40 degree temperatures for those two cities. Having a single subnetwork to handle all cities ensures that this kind of inconsistency cannot happen.
The other problem you had in your original file was that your attempt to add the date to each bubble failed because the fecha lookup returned a null value (because of the Excel bug mentioned above). Once that was fixed in the new master table, the lookup started working. I added some nodes to turn each date into a textpath and fit it inside the appropriate bubble.
I also added a temperature scale and city names atop each line of bubbles. Just for fun I made the temp_bubbles adjustable. You can change the overall height of each column of bubbles and the relative size of each bubble. Once you get the height where you want it, you can adjust the bubble size until the two biggest adjacent bubbles almost touch.
Fixing the problem with the CSVs may solve at least part of the problems you were having creating your Christmas garlands. So try using the new master CSV and see if that helps.
Beyond that I didn't understand the issue you were having with your garlands. Are you trying to replace the single color spectrum in the garlands with your bipolar spectrum? What exactly is the problem you want me to help you with?
If you do still need help with the garlands, I will be happy to try. I actually enjoy overcoming issues like this. But you will need to attach a zipped version of your garland ndbx file so I can see where the problem is.
Hope this helps! I look forward to hearing more from you.
John
2 Posted by Debora Domingo-... on 28 Nov, 2023 07:24 PM
Dear John
Wow... thank you very much!
Incredible feedback and so many things to learn. I sincerely appreciate all the explanations. I have opened the new file, and I think I will need some time to assimilate all the changes (during the week, I don't have as much availability for these 'funs').
I will come back to you if I need to, but even without being able to analyze everything, I wanted to thank you for your time.
Débora
Support Staff 3 Posted by john on 28 Nov, 2023 10:03 PM
Débora,
You are most welcome.
I meant to tell you how impressed I was with your code to create the two-hemisphere temperature bubbles. Using a convert range node to adjust the range of a color node is an ingenious way to create a temperature spectrum with minimal fuss.
I also appreciated that you included your code as a zipped file and went to the trouble of adding cutouts for two subnetworks to your screenshot.
I really do think you have a knack for NodeBox and I look forward to hearing from you again whenever you're ready.
John
4 Posted by Debora Domingo-... on 03 Dec, 2023 09:47 AM
Hello again, John.
Back to the fun with Nodebox, I found all your suggestions very useful, and I learned a lot from 'tracking' the file you returned to me.
I decided to introduce a range of colors depending on temperatures, and I learned to use the 'Color' Node with hex codes thanks to another conversation of yours on the Forum.
I also wanted the garlands to have different lengths depending on the number of days in the month, so I distributed them according to a line that I shortened or stretched depending on the month's days. I'm sure there is a way to order all the bubbles with the same distance according to their center without predetermining the final line length, but I couldn't find the solution.
Anyway, I am attaching to all my files a draft of the advance of my greeting card with some credits that include Nodebox and its support.
Thank you for all of your help!!
Débora
Support Staff 5 Posted by john on 04 Dec, 2023 10:14 PM
Débora,
I'm glad it has all worked out and you're making such good progress.
I think your greeting card is quite lovely. And I really appreciate you including Nodebox and me in the credits. Thank you.
I am also a great admirer of Nick Rougeux. He often uses NodeBox in his projects.
Glad to hear you got some use out of my Color node. I am currently working on some new color nodes that I think you would find useful for future visualization projects. I hope to publish them soon here on the forum.
Best wishes and Happy Holidays! I hope to see more of your work here.
John