Module:inc-ash-dial-map

Hello, you have come here looking for the meaning of the word Module:inc-ash-dial-map. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:inc-ash-dial-map, but we will also tell you about its etymology, its characteristics and you will know how to say Module:inc-ash-dial-map in singular and plural. Everything you need to know about the word Module:inc-ash-dial-map you have here. The definition of the word Module:inc-ash-dial-map will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:inc-ash-dial-map, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Test

Map of dialectal forms of ๐‘€“๐‘€ญ๐‘„๐‘€ข๐‘€บ (โ€œdoโ€)

local export = {}
local m_links = require("Module:links")
local lang = require("Module:languages").getByCode("inc-ash")
local variety_data = require("Module:inc-ash/dial/data")

local dots = {
	"d2502e", "6941c7", "9fdd42", "c74dc9", "6ccb6e", 
	"d34280", "77d6ba", "4f286c", "d1b94e", "777ad0", 
	"557433", "cf8ebf", "342a29", "c7c3a2", "7f3241", 
	"8ab8d7", "8d6234", "5b6080", "da8573", "4e7a6e"
}

function export.make_map(frame)
	local width = tonumber(frame.args) or 1200
	local word = frame.args or mw.title.getCurrentTitle().text
	local syn_data = require("Module:inc-ash/dial/data/" .. word).list
	local map = [=[
		<div style="margin-left: auto; margin-right:auto; width:]=] .. width .. =] .. width .. [=[px;">
		<div><div style="height:]=] .. width * (1615/1500) .. =] .. width .. [=[px;overflow:auto;">
		<div style="position:relative;top:0;left:0">
		<div style="position:relative;top:0;left:0;line-height:0">=] .. width .. ]</div>
		]=]
	local prelim_data, data, points, legend = {}, {}, {}, {}
	local num = 1
	for location, synonym_set in pairs(syn_data) do
		-- check if location is in alias list and use the proper one if so
		local actual_location = location
		if variety_data ~= nil then actual_location = variety_data end
		if location ~= "note" and location ~= "meaning" and variety_data.lat and synonym_set ~= "" then
			for _, term in ipairs(synonym_set) do
				term = mw.text.split(term, ":")
				if prelim_data then
					prelim_data.count = prelim_data.count + 1
					table.insert(prelim_data.locations, location)
				else
					prelim_data = { count = 1, locations = { location } }
				end
			end
		end
	end
	for term, term_data in pairs(prelim_data) do
		table.insert(data, { term = term, count = term_data.count, locations = term_data.locations })
	end
	table.sort(data, function(first, second) return first.count > second.count end)
	
	local prev_count = data.count
	local greyed, greyed_count = false, 0
	for _, d in ipairs(data) do
		greyed = greyed or (num > 10 and d.count ~= prev_count) or num > 20
		local colour = greyed and "CCCCBF" or dots
		for _, location in ipairs(d.locations) do
			-- check if location is in alias list and use the proper one if so
			local actual_location = location
			if variety_data ~= nil then actual_location = variety_data end
			
			local loc_info = variety_data
			local top_offset, left_offset = 0, 0
			if table.getn(syn_data) > 1 then
				top_offset = math.random(-300, 300) / 100
				left_offset = math.random(-300, 300) / 100
			end
			local top = ((37.5 - loc_info.lat) * (width*(1615/1500))/(37.5-5)) + top_offset
			local left = ((loc_info.long - 67) * width/(99-67)) + left_offset
			local loc_name = mw.ustring.gsub(loc_info.english or actual_location, "%((.*)%)$", "- %1")
			table.insert(points,
				tostring( mw.html.create( "div" )
					:css( "position", "absolute" )
					:css( "top", top .. "px" )
					:css( "left", left .. "px" )
					:css( "margin", "auto" )
					:css( "transform", "translate(-50%,-50%)" ) -- http://stackoverflow.com/questions/33683602/transform-origin-equivalent-for-position-absolute
					:css( "padding", "5px" )
					:css( "border-radius", "100%" )
					:css( "background-color", "#" .. colour )
					:css( "cursor", "help" )
					:css( "opacity", "0.8" )
					:attr( "title", loc_name .. " (" .. loc_info.group .. ")" )))
		end
		if greyed then
			greyed_count = greyed_count + d.count
		else
			table.insert(legend, 
				tostring( mw.html.create( "div" )
					:css( "display", "inline-block" )
					:css( "width", "10px" )
					:css( "height", "10px" )
					:css( "border-radius", "100%" )
					:css( "background-color", "#" .. colour )) .. 
				
				m_links.full_link({lang = lang,
					term = mw.ustring.gsub(d.term, "(.+)_", "%1"),
					alt = mw.ustring.gsub(d.term, "(.+)_()", "%1<sub>%2</sub>")}) .. " (" .. d.count .. ")")
		end
		
		prev_count = d.count
		num = num + 1
	end
	
	if greyed_count > 0 then
		table.insert(legend, 
			tostring( mw.html.create( "div" )
				:css( "display", "inline-block" )
				:css( "width", "10px" )
				:css( "height", "10px" )
				:css( "border-radius", "100%" )
				:css( "background-color", "#CCCCBF" )) .. 
			
			"other terms (" .. greyed_count .. ")")
	end

	map = [=[
	{| class="wikitable mw-collapsible mw-collapsed" style="margin:0; text-align:center;"
	|-
	! style="background:#FCFFFC; width:40em" colspan=3 | Map of dialectal forms of <b><span class="Brah" lang="inc-ash">]=] ..
		word .. '</span></b> (โ€œ' .. syn_data .. 'โ€) ' .. "\n|-\n|\n" .. map .. table.concat(points) .. '</div></div></div>' ..
		'<div style="column-count:' .. math.ceil(width/240) .. ';-moz-column-count:' .. math.ceil(width/240) .. ';-webkit-column-count:' .. math.ceil(width/240) .. ';font-size:smaller;line-height:1.7">' ..
		table.concat(legend, "<br>") .. "</div></div>" .. [=[
		
	|}]=]
		
	return map
end

return export