<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AClimate_chart</id>
	<title>Module:Climate chart - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AClimate_chart"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Climate_chart&amp;action=history"/>
	<updated>2026-08-08T16:08:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Climate_chart&amp;diff=135683&amp;oldid=prev</id>
		<title>imported&gt;Izno: put print-color-adjust back in here</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Climate_chart&amp;diff=135683&amp;oldid=prev"/>
		<updated>2022-08-25T04:43:17Z</updated>

		<summary type="html">&lt;p&gt;put print-color-adjust back in here&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- from https://lua-users.org/wiki/SimpleRound&lt;br /&gt;
local function round(num, decimal_places)&lt;br /&gt;
	local mult = 10^(decimal_places or 0)&lt;br /&gt;
	return math.floor(num * mult + 0.5) / mult&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function c_to_f(temp_in_c)&lt;br /&gt;
	return temp_in_c * 1.8 + 32&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- this implements the fahrenheit subtemplate, will need to look into what the&lt;br /&gt;
-- celsius template is doing&lt;br /&gt;
-- unit_system currently unused accordingly&lt;br /&gt;
local function month_column(low_temp, high_temp, precipitation, max_precipitation, unit_system)&lt;br /&gt;
	&lt;br /&gt;
	local precipitation = precipitation or 80&lt;br /&gt;
	local base_precipitation = max_precipitation or 500&lt;br /&gt;
	local precipitation_scale = math.max(1, base_precipitation / 750) -- 750 mm is the maximum for height&lt;br /&gt;
	local precipitation_bar_height = precipitation / 50 / precipitation_scale -- 50 is a magic constant&lt;br /&gt;
	local precipitation_in_inches = precipitation / 25.4&lt;br /&gt;
	local decimal_places = 0&lt;br /&gt;
	if precipitation_in_inches &amp;lt; 10 then decimal_places = 1 end&lt;br /&gt;
	local rounded_precipitation_inches = round(precipitation_in_inches, decimal_places)&lt;br /&gt;
	&lt;br /&gt;
	local low_temp = low_temp or 10&lt;br /&gt;
	local high_temp = high_temp or 20&lt;br /&gt;
	local low_temp_shift_for_bar = low_temp / 5 + 8 -- magic numbers&lt;br /&gt;
	local temp_bar_height = (high_temp - low_temp) / 5 -- magic numbers&lt;br /&gt;
	local high_temp_shift = high_temp / 5 + 8&lt;br /&gt;
	local low_temp_shift = low_temp / 5 + 6.5&lt;br /&gt;
	&lt;br /&gt;
	local high_temp_f = c_to_f(high_temp)&lt;br /&gt;
	local rounded_high_temp_f = round(high_temp_f, 0)&lt;br /&gt;
	local high_temp_sign = &amp;#039;&amp;#039;&lt;br /&gt;
	if rounded_high_temp_f &amp;lt; 0 then high_temp_sign = &amp;#039;&amp;amp;minus;&amp;#039; end&lt;br /&gt;
	local abs_high_temp = math.abs(rounded_high_temp_f)&lt;br /&gt;
	&lt;br /&gt;
	local low_temp_f = c_to_f(low_temp)&lt;br /&gt;
	local rounded_low_temp_f = round(low_temp_f, 0)&lt;br /&gt;
	local low_temp_sign = &amp;#039;&amp;#039;&lt;br /&gt;
	if rounded_low_temp_f &amp;lt; 0 then low_temp_sign = &amp;#039;&amp;amp;minus;&amp;#039; end&lt;br /&gt;
	local abs_low_temp = math.abs(rounded_low_temp_f)&lt;br /&gt;
	&lt;br /&gt;
	local column = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	column:addClass(&amp;#039;climate-chart-column&amp;#039;)&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climate-chart-column-spacer&amp;#039;)&lt;br /&gt;
		:wikitext(&amp;#039;&amp;amp;nbsp;&amp;#039;)&lt;br /&gt;
		:done()&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climate-chart-column-precip-bar&amp;#039;)&lt;br /&gt;
		:wikitext(&amp;#039;&amp;amp;nbsp;&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;height&amp;#039;, precipitation_bar_height .. &amp;#039;em&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;print-color-adjust&amp;#039;, &amp;#039;exact&amp;#039;) -- css sanitizer doesn&amp;#039;t accept yet&lt;br /&gt;
		:done()&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climiate-chart-column-precip&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:wikitext(rounded_precipitation_inches)&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climate-chart-column-spacer2&amp;#039;)&lt;br /&gt;
		:wikitext(&amp;#039;&amp;amp;nbsp;&amp;#039;)&lt;br /&gt;
		:done()&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climate-chart-column-temp-bar&amp;#039;)&lt;br /&gt;
		:wikitext(&amp;#039;&amp;amp;nbsp;&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;bottom&amp;#039;, low_temp_shift_for_bar .. &amp;#039;em&amp;#039; )&lt;br /&gt;
		:css(&amp;#039;height&amp;#039;, temp_bar_height .. &amp;#039;em&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;print-color-adjust&amp;#039;, &amp;#039;exact&amp;#039;) -- css sanitizer doesn&amp;#039;t accept yet&lt;br /&gt;
		:done()&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climate-chart-column-high-temp&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;bottom&amp;#039;, high_temp_shift .. &amp;#039;em&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:wikitext(high_temp_sign .. abs_high_temp)&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
	:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;climate-chart-column-low-temp&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;bottom&amp;#039;, low_temp_shift .. &amp;#039;em&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:wikitext(low_temp_sign .. abs_low_temp)&lt;br /&gt;
			:done()&lt;br /&gt;
		:done()&lt;br /&gt;
	:done()&lt;br /&gt;
	return column&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>imported&gt;Izno</name></author>
	</entry>
</feed>