<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://jotunnheim.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASeats_diagram</id>
	<title>Module:Seats diagram - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://jotunnheim.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASeats_diagram"/>
	<link rel="alternate" type="text/html" href="https://jotunnheim.org/w/index.php?title=Module:Seats_diagram&amp;action=history"/>
	<updated>2026-07-30T03:49:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://jotunnheim.org/w/index.php?title=Module:Seats_diagram&amp;diff=6777&amp;oldid=prev</id>
		<title>Marie: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://jotunnheim.org/w/index.php?title=Module:Seats_diagram&amp;diff=6777&amp;oldid=prev"/>
		<updated>2024-11-07T01:59:39Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:59, 6 November 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Marie</name></author>
	</entry>
	<entry>
		<id>https://jotunnheim.org/w/index.php?title=Module:Seats_diagram&amp;diff=6776&amp;oldid=prev</id>
		<title>wikipedia&gt;MusikBot II: Protected &quot;Module:Seats diagram&quot;: High-risk template or module: 271 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://jotunnheim.org/w/index.php?title=Module:Seats_diagram&amp;diff=6776&amp;oldid=prev"/>
		<updated>2024-10-03T18:00:23Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/Module:Seats_diagram&quot; title=&quot;Module:Seats diagram&quot;&gt;Module:Seats diagram&lt;/a&gt;&amp;quot;: &lt;a href=&quot;https://en.wikipedia.org/wiki/High-risk_templates&quot; class=&quot;extiw&quot; title=&quot;wikipedia:High-risk templates&quot;&gt;High-risk template or module&lt;/a&gt;: 271 transclusions (&lt;a href=&quot;/w/index.php?title=User:MusikBot_II/TemplateProtector&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:MusikBot II/TemplateProtector (page does not exist)&quot;&gt;more info&lt;/a&gt;) ([Edit=Require autoconfirmed or confirmed access] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
local p = {}&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local errorCategory = &amp;#039;[[Category:Compilation error of the Seats diagram template]]&amp;#039;&lt;br /&gt;
local getPartyData = require(&amp;#039;Module:Political party&amp;#039;).fetch&lt;br /&gt;
&lt;br /&gt;
-- get the party color from Module:Party color&lt;br /&gt;
-- a = party; b = optional color&lt;br /&gt;
-- (copied from Module:Parliament_diagram)&lt;br /&gt;
local function color(a,b)&lt;br /&gt;
	local c = &amp;#039;#CCC&amp;#039;&lt;br /&gt;
	if (b) then&lt;br /&gt;
		c = b&lt;br /&gt;
	else&lt;br /&gt;
		c = getPartyData({a, &amp;quot;color&amp;quot;})&lt;br /&gt;
	end&lt;br /&gt;
	if string.sub(c,1,5) == &amp;#039;&amp;amp;#35;&amp;#039; then c = &amp;quot;#&amp;quot; .. string.sub(c, 6, 11) end&lt;br /&gt;
	return c&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function partyShortLink(p)&lt;br /&gt;
	if getPartyData({p, &amp;#039;abbrev&amp;#039;, error=&amp;#039; &amp;#039;}) == &amp;#039; &amp;#039; then&lt;br /&gt;
		return p&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local shortname = getPartyData({p, &amp;#039;abbrev&amp;#039;}) or getPartyData({p, &amp;#039;shortname&amp;#039;}) or &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	if shortname then&lt;br /&gt;
		return &amp;#039;[[&amp;#039;..p..&amp;#039;|&amp;#039;..shortname..&amp;#039;]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[[&amp;#039;..p..&amp;#039;]]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function getData(args)&lt;br /&gt;
	local totalSeats = 0&lt;br /&gt;
	local data = {}&lt;br /&gt;
	local num = 1&lt;br /&gt;
	&lt;br /&gt;
	while (args[&amp;#039;n&amp;#039;..num]) do&lt;br /&gt;
		if (tonumber(args[&amp;#039;n&amp;#039;..num])) then&lt;br /&gt;
			data[num] = {&lt;br /&gt;
				n = args[&amp;#039;n&amp;#039;..num] and tonumber(args[&amp;#039;n&amp;#039;..num]),&lt;br /&gt;
				c = color(args[&amp;#039;p&amp;#039;..num] or &amp;#039;&amp;#039;, args[&amp;#039;c&amp;#039;..num]),&lt;br /&gt;
				b = args[&amp;#039;b&amp;#039;..num] or &amp;#039;-&amp;#039;,&lt;br /&gt;
				p = args[&amp;#039;p&amp;#039;..num] or &amp;#039;Serie &amp;#039;..num&lt;br /&gt;
			}&lt;br /&gt;
			totalSeats = totalSeats + data[num].n&lt;br /&gt;
			num = num+1&lt;br /&gt;
		else&lt;br /&gt;
			error(string.format(&amp;#039;Invalid value for n%d&amp;#039;, num),2)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	data[&amp;#039;totalSeats&amp;#039;] = totalSeats&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function generateDiagram(root, args, data)&lt;br /&gt;
	local totalSeats = 0&lt;br /&gt;
	local width = args.width or 240&lt;br /&gt;
	local range = root&lt;br /&gt;
	&lt;br /&gt;
	local lastRotation = 0&lt;br /&gt;
	&lt;br /&gt;
	for i, v in ipairs(data) do&lt;br /&gt;
		&lt;br /&gt;
		if v.n &amp;gt; 0 then&lt;br /&gt;
			range = range:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;transform&amp;#039;, &amp;#039;rotate(&amp;#039;..tostring(180 * lastRotation)..&amp;#039;deg)&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;width&amp;#039;, tostring(width)..&amp;#039;px&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;height&amp;#039;, tostring(width/2)..&amp;#039;px&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;position&amp;#039;, &amp;#039;relative&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;transform-origin&amp;#039;, &amp;#039;bottom center&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;border-top-left-radius&amp;#039;, tostring(width/2)..&amp;#039;px&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;border-top-right-radius&amp;#039;, tostring(width/2)..&amp;#039;px&amp;#039;)&lt;br /&gt;
			range:css(&amp;#039;background&amp;#039;, v.c)&lt;br /&gt;
			&lt;br /&gt;
			range:tag(&amp;#039;div&amp;#039;) -- seats number&lt;br /&gt;
			     :css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;width&amp;#039;, tostring(width)..&amp;#039;px&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;height&amp;#039;, tostring(width/2)..&amp;#039;px&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;position&amp;#039;, &amp;#039;absolute&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;transform&amp;#039;, &amp;#039;rotate(&amp;#039;..tostring(-90 + 180 * (v.n/data.totalSeats/2))..&amp;#039;deg)&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;transform-origin&amp;#039;, &amp;#039;bottom center&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;top&amp;#039;, &amp;#039;-15px&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;line-height&amp;#039;, &amp;#039;15px&amp;#039;)&lt;br /&gt;
			     :css(&amp;#039;padding-bottom&amp;#039;, &amp;#039;15px&amp;#039;)&lt;br /&gt;
			     :wikitext(tostring(v.n))&lt;br /&gt;
			     :done()&lt;br /&gt;
			&lt;br /&gt;
			lastRotation = v.n/data.totalSeats&lt;br /&gt;
		&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	root:tag(&amp;#039;div&amp;#039;) --inner circle&lt;br /&gt;
	    :css(&amp;#039;width&amp;#039;, tostring(width*3/8)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;height&amp;#039;, tostring(width*3/8)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;margin&amp;#039;, tostring(-width*3/16)..&amp;#039;px auto&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;border-radius&amp;#039;, tostring(width*3/16)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;transform&amp;#039;, &amp;#039;translate(0,0)&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;background&amp;#039;, args.background)&lt;br /&gt;
	    :done()&lt;br /&gt;
	    :tag(&amp;#039;div&amp;#039;) --cover below&lt;br /&gt;
	    :css(&amp;#039;width&amp;#039;, tostring(width+1)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;height&amp;#039;, tostring(width*3/8)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;transform&amp;#039;, &amp;#039;translate(0,0)&amp;#039;)&lt;br /&gt;
	    :css(&amp;#039;background&amp;#039;, args.background)&lt;br /&gt;
	    :done()&lt;br /&gt;
	&lt;br /&gt;
	return root&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function generateCaption(root, args, data)&lt;br /&gt;
	&lt;br /&gt;
	local list = root:tag(&amp;#039;ul&amp;#039;)&lt;br /&gt;
	list:css(&amp;#039;column-count&amp;#039;, &amp;#039;2&amp;#039;)&lt;br /&gt;
	list:css(&amp;#039;margin-left&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	for i, v in ipairs(data) do&lt;br /&gt;
		list:tag(&amp;#039;li&amp;#039;) --li&lt;br /&gt;
			:css(&amp;#039;list-style-type&amp;#039;, &amp;#039;none&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;list-style-image&amp;#039;, &amp;#039;none&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;margin&amp;#039;, &amp;#039;0&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;span&amp;#039;) --span&lt;br /&gt;
				:css(&amp;#039;border&amp;#039;, &amp;#039;none&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;width&amp;#039;, &amp;#039;1.2em&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;height&amp;#039;, &amp;#039;1.2em&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;background-color&amp;#039;, v.c)&lt;br /&gt;
				:css(&amp;#039;margin-right&amp;#039;, &amp;#039;0.3em&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;middle&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;display&amp;#039;, &amp;#039;inline-block&amp;#039;)&lt;br /&gt;
				:done()&lt;br /&gt;
			:wikitext(partyShortLink(v.p) .. &amp;#039;: &amp;#039; .. v.n)&lt;br /&gt;
			:done()&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return list&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function parliamentFloat(root, args, data)&lt;br /&gt;
	local width = args.width or 240&lt;br /&gt;
	local mainDiv = root:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	mainDiv:addClass(&amp;#039;thumb&amp;#039;)&lt;br /&gt;
	mainDiv:addClass(&amp;#039;t&amp;#039;..args[&amp;#039;float&amp;#039;])&lt;br /&gt;
	&lt;br /&gt;
	local divThumbinner = mainDiv:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	divThumbinner:addClass(&amp;#039;thumbinner&amp;#039;)&lt;br /&gt;
	divThumbinner:css(&amp;#039;width&amp;#039;, tostring(width*1.125)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divThumbinner:css(&amp;#039;padding-right&amp;#039;, &amp;#039;6.5px !important&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	if args[&amp;#039;title&amp;#039;] then&lt;br /&gt;
		local divTitle = divThumbinner:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		divTitle:addClass(&amp;#039;thumbdescription&amp;#039;)&lt;br /&gt;
		divTitle:css(&amp;#039;font-weight&amp;#039;, &amp;#039;bold&amp;#039;)&lt;br /&gt;
		divTitle:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
		divTitle:css(&amp;#039;font-size&amp;#039;, &amp;#039;100%&amp;#039;)&lt;br /&gt;
		divTitle:wikitext(args[&amp;#039;title&amp;#039;])&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local divThumbimage = divThumbinner:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	divThumbimage:addClass(&amp;#039;thumbimage&amp;#039;)&lt;br /&gt;
	divThumbimage:addClass(&amp;#039;diagram&amp;#039;)&lt;br /&gt;
	divThumbimage:addClass(&amp;#039;noprint&amp;#039;)&lt;br /&gt;
	divThumbimage:css(&amp;#039;width&amp;#039;, tostring(width)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divThumbimage:css(&amp;#039;height&amp;#039;, tostring(width/2)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divThumbimage:css(&amp;#039;padding&amp;#039;, tostring(width/15)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divThumbimage:css(&amp;#039;overflow&amp;#039;, &amp;#039;hidden&amp;#039;)&lt;br /&gt;
	divThumbimage:css(&amp;#039;background&amp;#039;, args.background)&lt;br /&gt;
	&lt;br /&gt;
	generateDiagram(divThumbimage, args, data)&lt;br /&gt;
	&lt;br /&gt;
	local divThumbcaption = divThumbinner:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	divThumbcaption:addClass(&amp;#039;thumbcaption&amp;#039;)&lt;br /&gt;
	divThumbcaption:wikitext(&amp;#039;Total &amp;#039;..tostring(data.totalSeats)..&amp;#039; seats&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	generateCaption(divThumbcaption, args, data)&lt;br /&gt;
	&lt;br /&gt;
	return root&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function parliamentNonFloat(root, args, data)&lt;br /&gt;
	local width = args.width or 240&lt;br /&gt;
	local mainDiv = root:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	local divCentered = mainDiv:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	divCentered:addClass(&amp;#039;centered&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;margin-left&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;margin-right&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
	divCentered:addClass(&amp;#039;diagram&amp;#039;)&lt;br /&gt;
	divCentered:addClass(&amp;#039;noprint&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;width&amp;#039;, tostring(width)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;height&amp;#039;, tostring(width/2)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;padding&amp;#039;, tostring(width/15)..&amp;#039;px&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;padding-top&amp;#039;, &amp;#039;15px&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;padding-bottom&amp;#039;, &amp;#039;5px&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;overflow&amp;#039;, &amp;#039;hidden&amp;#039;)&lt;br /&gt;
	divCentered:css(&amp;#039;background&amp;#039;, args.background)&lt;br /&gt;
	&lt;br /&gt;
	divCentered:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	generateDiagram(divCentered, args, data)&lt;br /&gt;
	&lt;br /&gt;
	return root&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._parliament(args)&lt;br /&gt;
	local root = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	local data = getData(args)&lt;br /&gt;
	&lt;br /&gt;
	if not args.background then args.background = &amp;#039;white&amp;#039; end&lt;br /&gt;
	&lt;br /&gt;
	if args[&amp;#039;float&amp;#039;] then&lt;br /&gt;
		return parliamentFloat(root, args, data)&lt;br /&gt;
	else&lt;br /&gt;
		return parliamentNonFloat(root, args, data)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.parliament(frame)&lt;br /&gt;
	return p._parliament(getArgs(frame))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;MusikBot II</name></author>
	</entry>
</feed>