Wikipedia
avwiki
https://av.wikipedia.org/wiki/%D0%91%D0%B5%D1%82%D3%80%D0%B5%D1%80%D0%B0%D0%B1_%D0%B3%D1%8C%D1%83%D0%BC%D0%B5%D1%80
MediaWiki 1.48.0-wmf.4
first-letter
Медиа
Хъулухъалъулаб
БахӀс
ГӀахьалчи
ГӀахьалчиясул бахӀс
Википедия
Википедиялъул бахӀс
Файл
Файлалъул бахӀс
MediaWiki
MediaWiki-ялъул бахӀс
Халип
Халипалъул бахӀс
Кумек
Кумекалъул бахӀс
Категория
Категориялъул бахӀс
TimedText
TimedText talk
Модуль
Обсуждение модуля
Event
Event talk
Дохъузпара мухъ
0
7213
102511
99661
2026-11-11T14:03:00Z
M. Omarius
10562
102511
wikitext
text/x-wiki
{{Infobox Dagestanian district
| av_name = Дохъузпара мухъ
| ru_name =
| loc_name1 = ''Докъузпара район''
| loc_lang1 = Курал
| loc_name2 =
| loc_lang2 =
| image_view =
| image_caption =
| image_flag = Flag_of_Dokuzparinsky_district.png
| image_coa = Герб Докузпаринского района 04.12.2018.jpg
| image_map = {{Russia district OSM map}}
| map_caption = Дохъузпара мухъ Дагъистаналъул картаялда
| pushpin_map =
| coordinates = {{coord|42|04|N|47|13|E|type:adm2nd_region:RU|display=inline,title}}
| district =
| type =
| city =
| city_ref =
| established_date =
| established_date_ref =
| adm_ctr_name = [[Ушугъ]]
| adm_ctr_ref = <ref name="RDagestan_admlaw" />
<!-- government -->
| mun_formation1_leader_name =
| mun_formation1_representative_body =
| mun_formation1_representative_body_ref =
| mun_formation1_leader_title =
| mun_formation1_leader_title_ref =
| mun_formation1_leader_name_ref =
<!-- area -->
| area_km2 = {{Infobox Dagestanian district/area|Дохъузпара район}}
| area_km2_ref = <ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title=Республика Дагестан. Общая площадь земель муниципального образования |trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-07-14 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref>
| area_rank = 39
<!-- population -->
| pop_latest = {{ЧагӀазул рикӀкӀен|Дохъузпара мухъ|р}}
| pop_latest_date = {{ЧагӀазул рикӀкӀен|Дохъузпара мухъ|с}}
| pop_latest_ref = {{ЧагӀазул рикӀкӀен|Дохъузпара мухъ|л}}
| population_rank =
| population_density =
| urban_pop = 0
| rural_pop = 100
| ethnicity = [[Куралал]], [[агъулал]], [[рутулал]]
<!-- administrative status -->
| no_of_towns_of_district_significance =
| no_of_urban-type_settlements_of_district_significance =
| no_of_selsoviets_type1 = 2
| no_of_selsoviets_type2 = 7
| no_of_rural_localities = 16
| selsoviet_type1 = росдал совет
| selsoviet_type2 = ''росу''
| counts_ref = <ref name="OKATO2" />
<!-- administrative status -->
| mun_formation1 = Дохъузпара муниципалаб мухъ
| mun_formation2 =
| mun_formation1_ref = <ref name="RDagestan_mun" />
| mun_formation1_no_of_urban_settlements =
| mun_formation1_no_of_rural_settlements = 9
| mun_formation1_counts_ref = <ref name="RDagestan_mun" />
| website =
}}
'''Дохъузпара мухъ''' ({{langx|lez|Дохъузпара район}}) буго [[Дагъистаналъул административияб рикьи|административиябгун территориалаб цвелги]]<ref name="RDagestan_admlaw">{{Cite web |url=http://docs.cntd.ru/document/802038531 |title=Закон Республики Дагестан от 10 апреля 2002 года N 16 «Об административно-территориальном устройстве Республики Дагестан» |trans-title= Дагъистаналъул Республикаялъул акт 2002 сонил 10 апрелалдаса N 16 «Дагъистаналъул Республикалъул административиябгун территориалаб гӀуцӀи́ялъул» |access-date=2016-09-23 |archive-date=2018-04-02 |archive-url=https://web.archive.org/web/20180402175449/http://docs.cntd.ru/document/802038531 }}</ref> [[Муниципалаб гӀуцӀел|муниципалаб гӀуцӀелги]]<ref name="RDagestan_mun">{{cite web |url = https://docs.cntd.ru/document/802037479 |title = Закон Республики Дагестан от 13 января 2005 года № 6 «О статусе муниципальных образований Республики Дагестан» |trans-title=Дагъистаналъул Республикаялъул акт 2005 сонил 13 январалдаса N 6 «Дагъистаналъул Республикаялъул муниципалал гӀуцӀалабазул статусалъул»|archive-url = https://web.archive.org/web/20220407093518/https://docs.cntd.ru/document/802037479 |archive-date = 2022-04-07 |access-date = 2022-06-20 }}</ref> ([[Муницпалаб район (Россия)|муниципалаб район]]), жиб Россиялъул [[Дагъистан|Дагъистаналда]] гъорлӀ бугеб. Элъул территориялъул гӀатӀилъи буго {{Infobox Dagestanian district/area|Дохъузпара район}} кв. км.<ref name='82_8006001' />
Мухъалъул административияб центер ккола [[Ушугъ]].
== География ==
Дохъузпара мухъ буго Дагъистаналъул жанубалда. Элъул гӏурхъи цураб буго бакътӏерхьуда [[Ахти мухъ|Ахти]], шималияб рахъалда [[Мухӏарамхур мухъ|Мухӏарамхур]] районазулгун. Гьеб гуребги, районалъул ккола лъаргӏилаб анклавги, Дербенд мухъалъул территориялда бугеб. Гьединго районалъул гӏурхъи буго Азарбижаналъул [[Кӏуцӏар район|Кӏуцӏарги]] (бакъбаккудехун) [[Къвепеле район|Къвепелеги]] (жанубалда) мухъазулгун.
Территориялъул гӀатӀилъи буго {{Infobox Dagestanian district/area|Дохъузпара район}} км<sup>2</sup>, элъул рахъалъ, Дагъистаналъул цогидал мухъазда гьоркьоб, Дохъузпара мухъ буго 39-абилеб бакӀалда (республикалъул тӀолаб гӀатӀилъудаса {{#expr: {{Infobox Dagestanian district/area|Дохъузпара район}} * 100 / {{Infobox Dagestanian district/area|Дагъистан}} round 2|R}} %).
== Демография ==
{{ЧагӀазул рикӀкӀен| Дохъузпара мухъ }}
{{ЧагӀазул рикӀкӀен| Дохъузпара мухъ |д}}
=== Националаб гӀуцӀи ===
Дохъузпара мухъ, [[Авадан (росу)|Авадан]] росу хутӏизегӏан, буго куралазул ккала моноэтникияб район. Авадан росулӏ, эксклавлъун Дербенд районалъул территориялда бугеб, куралал гурелги, руго гьединго [[рутулал]]ги [[агъулал]]ги.
Тӏолго Россиялъул 2010 сонил цензалда рекъон:<ref name="Даг2010">{{Cite web |url=http://dagstat.gks.ru/wps/wcm/connect/rosstat_ts/dagstat/resources/cafa4e00421f0cb8805fcc2d59c15b71/%D0%92%D0%9F%D0%9D+%D1%82%D0%BE%D0%BC3.rar |title=Перепись 2010 года. Дагстат. Том 3 |access-date=2013-12-14 |archive-url=https://web.archive.org/web/20171011191513/http://dagstat.gks.ru/wps/wcm/connect/rosstat_ts/dagstat/resources/cafa4e00421f0cb8805fcc2d59c15b71/%D0%92%D0%9F%D0%9D+%D1%82%D0%BE%D0%BC3.rar |archive-date=2017-10-11 |url-status=dead }}</ref>
{|class="wikitable"
|-
! Этникияб<br>къокъа !! Рикӏкӏен,<br>чи !! Бутӏа<br>, %
|-
| [[куралал]] || align="right" | 14,367 || align="right" | 93.96 %
|-
| [[рутулал]] || align="right" | 461 || align="right" | 3.01 %
|-
| [[агъулал]] || align="right" | 351 || align="right" | 2.29 %
|-
| [[табасаранал]] || align="right" | 50 || align="right" | 0.33 %
|-
| [[къажарал]] || align="right" | 23 || align="right" | 0.15 %
|-
| [[гӏурусал]] || align="right" | 21 || align="right" | 0.14 %
|-
| цогидал || align="right" | 19 || align="right" | 0.12 %
|-
| бихьизабичӏел || align="right" | 66 || align="right" | 0.43 %
|-
| киналниги || align="right" | 15,357 || align="right" | 100.00 %
|}
ТӀолго россиялъулаб 2020–2021 соназул цензалда рекъон:<ref>{{Cite web |url=https://05.rosstat.gov.ru/itogi |title=Территориальный орган Федеральной службы государственной системы по Республики Дагестан — итоги Всероссийской переписи населения 2020 года |access-date=2023-07-08 |archive-date=2023-07-08 |archive-url=https://web.archive.org/web/20230708124610/https://05.rosstat.gov.ru/itogi }}</ref>
{|class="wikitable"
|-
! Этникияб<br>къокъа !! РикӀкӀен,<br>чи !! БутӀа,<br>%
|-
| [[куралал]] || align="right" | 14,230 {{борти}} || align="right" | 94.63 % {{гӏей}}
|-
| [[рутулал]] || align="right" | 345 {{борти}} || align="right" | 2.29 % {{борти}}
|-
| [[агъулал]] || align="right" | 257 {{борти}} || align="right" | 1.71 % {{борти}}
|-
| цогидал || align="right" | 206 {{гӏей}} || align="right" | 1.37 % {{гӏей}}
|-
| '''киналниги''' || align="right" | '''15,038''' || align="right" | '''100.00 %'''
|}
==Административиябги муниципалабги статус==
Административияб рикьуда жаниб, Дохъузпара район буго республикалъул [[Дагъистаналъул административияб рикьи|41 районалъул]] цояб.<ref name="RDagestan_admlaw" /> Эб бикьула 2 [[Дагъистаналъул росдал советал|росдал советалдеги]], 7 росдадеги.<ref name="OKATO2">{{OKATO reference|82 221}}</ref>
Муниципалаб гӀуцӀел гӀадин, район гъорлӀе бачун буго Дохъузпара муниципалаб район кинигин.<ref name="RDagestan_mun" /> Элъул кӀиго росдал советги анкьго росуги гъорлӀе бачун буго муниципалаб районалде ичӏго муницпалаб гӀуцӀеллъун, жиндир [[росдал поселение]] абун статус бугеб.<ref name="RDagestan_mun" /> [[Ушугъ]] ''[[росу#Россия|росу]]'' буго административиябги<ref name="RDagestan_admlaw" /> муниципалабги<ref name="OKTMO">{{OKTMO reference|82 621}}</ref> районалъул центер.
== Росаби ==
Дохъузпара мухъалда буго 16 росдалаб чӀел-бакӀ.<ref name="реестрАТЕ">{{Cite web |url=http://minyustrd.ru/otkrytye-dannye/item/id/148 |title=Единый реестр административно-территориальных единиц Республики Дагестан от 27.07.2018 N 00 |trans-title=Дагъистаналъул Республикалъул административ-территориалал цвелазул цохӀояб реестер N 00, 2018, 07 июлалдаса |access-date=2020-06-19 |archive-date=2020-06-22 |archive-url=https://web.archive.org/web/20200622030725/http://minyustrd.ru/otkrytye-dannye/item/id/148 |url-status=dead }}</ref><ref name="RDagestan_admlaw" />
== Референсал ==
{{Reflist}}
{{Дохъузпара мухъ}}
{{Дагъистан}}
[[Категория:Дагъистаналъул мухъал]]
edgj1hhy18d9p9p07hd2mne56ghqlvp
Халип:Дохъузпара мухъ
10
7214
102500
102474
2026-11-11T12:03:42Z
M. Omarius
10562
102500
wikitext
text/x-wiki
{{Navbox with collapsible groups
| name = Дохъузпара мухъ
| title = [[Дохъузпара мухъ]]
| listclass = hlist
| state = {{{state|}}}
| above =
| image1 = [[file:Герб Докузпаринского района 04.12.2018.jpg|60px]]
|group1 = Росу-ракь
| abbr1 = rosu
| list1 =
;Мухъалъул центер
:'''[[Ушугъ]]'''
* [[Авадан (росу)|Авадан]]
* [[Гандурар]]
* [[Демирар]]
* [[Кавалар]]
* [[Карар]]
* [[Керимханар]]
* [[Килер]]
* [[Къуруш]]
* [[Кӏележугъ (Дохъузпара мухъ)|Кӏележугъ]]
* [[Миграгъар (Дохъузпара мухъ)|Миграгъар]]
* [[Мискискар]]
* [[Техъияр]]
* [[ЦIияб Карар]]
* [[Чувалар ]]
* [[Эсетар]]
|group2 = Муниципалаб гӀуцӀи́
|abbr2 = municipal
|list2 =
;Росаби:
:[[Авадан (росу)|Авадан]] росу
:[[Карар]] росу
:[[Къуруш]] росу
:[[Кӏележугъ (Дохъузпара мухъ)|Кӏележугъ]]
:[[Мискискар]] росу
:[[Цӏияб Карар]]
:[[Ушугъ]] росу
;Росдал советал:
:[[Килер росдал совет|Килер р/совет]]
:[[Миграгъар р/совет|Миграгъар росдал совет]]
|selected = {{{1|}}}
| below =
}}<noinclude>{{doc}}</noinclude>
radfl75dr36gj1kgjcwmvid19m1u125
102505
102500
2026-11-11T12:37:35Z
M. Omarius
10562
102505
wikitext
text/x-wiki
{{Navbox with collapsible groups
| name = Дохъузпара мухъ
| title = [[Дохъузпара мухъ]]
| listclass = hlist
| state = {{{state|}}}
| above =
| image1 = [[file:Герб Докузпаринского района 04.12.2018.jpg|60px]]
|group1 = Росу-ракь
| abbr1 = rosu
| list1 =
;Мухъалъул центер
:'''[[Ушугъ]]'''
* [[Авадан (росу)|Авадан]]
* [[Гандурар]]
* [[Демирар]]
* [[Кавалар]]
* [[Карар]]
* [[Керимханар]]
* [[Килер]]
* [[Къуруш]]
* [[Кӏележугъ (Дохъузпара мухъ)|Кӏележугъ]]
* [[Миграгъар (Дохъузпара мухъ)|Миграгъар]]
* [[Мискискар]]
* [[Техъияр]]
* [[Цӏияб Карар]]
* [[Чувалар ]]
* [[Эсетар]]
|group2 = Муниципалаб гӀуцӀи́
|abbr2 = municipal
|list2 =
;Росаби:
:[[Авадан (росу)|Авадан]] росу
:[[Карар]] росу
:[[Къуруш]] росу
:[[Кӏележугъ (Дохъузпара мухъ)|Кӏележугъ]] росу
:[[Мискискар]] росу
:[[Цӏияб Карар]] росу
:[[Ушугъ]] росу
;Росдал советал:
:[[Килер росдал совет|Килер р/совет]]
:[[Миграгъар р/совет|Миграгъар росдал совет]]
|selected = {{{1|}}}
| below =
}}<noinclude>{{doc}}</noinclude>
fj1tmv3e5u84yis09hoo0vsoqrx2t8w
Къуруш
0
7229
102508
101463
2026-11-11T13:05:07Z
M. Omarius
10562
102508
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Къуруш
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Dokuzpara District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Къуруш росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Къуруш|р}}
| pop_latest_date = {{ЧР|Къуруш|с}}
| pop_latest_ref = {{ЧР|Къуруш|л}}
| population_demonym =
| ethnicity = [[Куралал]]
| adm_ctr_of1 = Къуруш росдал поселениялъул
| rural_settlement_jur = ''«Къуруш росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Къуруш'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 33}}</ref> ({{langx|lez|Къуруш}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Къуруш росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== География ==
Расу буго [[Шалбуздагъ]] магӏарул жанубияб бакъбаккул рахъалда, [[Ушугъ (гӀор)|Ушугъ]] гӏорухъ, мухъалъул центр [[Ушугъ]]алдасан 17 км-лъ жанубияб бакътӏерхьул рахъалда.
Къуруш буго [[Кавказ]]алдаги, [[Россия|Россиялдаги]], [[Европа|Европаялдаги]] бищунго борхатаб тӀанкӀ (Кавказалъул щобдасан Европаялъулги Азиялъулги гӏурхъи бачани).<ref>[http://www.bibliotekar.ru/divo/31-75.htm Библиотекарь.ру]</ref><ref>{{Cite web |title=Официальный сайт Президента Республики Дагестан |url=http://president.e-dag.ru/map/42/ |access-date=2014-08-26 |archive-date=2012-04-24 |archive-url=https://web.archive.org/web/20120424064654/http://president.e-dag.ru/map/42/ |url-status=dead }}</ref><ref>[http://www.outdoors.ru/news/2006/11/26_2.php Outdoors.ru — Мир путешествий и развлечений]</ref><ref>{{Cite web |title=Турометр: социальная сеть туристов |url=http://turometr.ru/geo/europe/russia/dagestan/kurush/ |access-date=2014-08-26 |archive-date=2011-11-06 |archive-url=https://web.archive.org/web/20111106093919/http://turometr.ru/geo/europe/russia/dagestan/kurush/ |url-status=dead }}</ref> Ралъдал гьурмадаса росу буго 2560 метралъ эххедегӏан.<ref>[http://www.odnoselchane.ru/?sect=1758 Односельчане.ru — города и села Дагестана]</ref> Гьединго гьеб буго бищунго Россиялъул къилабияб росу.<ref>{{Карта|K-38-108}}</ref> Къуруш росулӏа байбихьула [[алпинист]]аз [[Базардузу]] (4466 м), [[Шалбуздагъ]] (4150 м) ва [[Еридагъ]] (3925 м) мугӀрузде рахине.
Росу бикьула хадусел роххабазе: ''Пагъвай къилер'', ''Вене къилер'', ''Хъиртар'', ''Камавайбур''.
== Демография==
{{ЧР|Къуруш}}
{{ЧР|Къуруш|д}}
Тарихалдаго Къуруш росдал чӏагӏи тухумазда рикьулаан, гьезда гъоркьор: ''Хайитакъар'', ''Гьилевар'',''Тетацар'', ''Фалакъар'', ''Хъизирар'', ''Хъартар'', ''Мисрияр''.
== Муниципалаб статус ==
Карар росдаца гӀуцӀула гьебго цӀар бугеб муниципалитат.
Муницпалаб гӀуцӀалил гӀатӀилъи буго 151.85 км<sup>2</sup><ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title= Республика Дагестан. Общая площадь земель муниципального образования|trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-05-11 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref> (мухъалъул территориялъул {{#expr: 151.85 * 100 / {{Infobox Dagestanian district/area|Дохъузпара район}} round 2|R}} %).
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
2x8dfijap0g7i11fshlc6v0wcvw1p0g
Модуль:Chart
828
8524
102518
95442
2026-11-11T16:40:12Z
M. Omarius
10562
102518
Scribunto
text/plain
--[[
keywords are used for languages: they are the names of the actual
parameters of the template
]]
local keywords = {
barChart = 'bar chart',
pieChart = 'pie chart',
width = 'width',
height = 'height',
stack = 'stack',
colors = 'colors',
group = 'group',
xlegend = 'x legends',
yticks = 'y tick marks',
tooltip = 'tooltip',
accumulateTooltip = 'tooltip value accumulation',
links = 'links',
defcolor = 'default color',
scalePerGroup = 'scale per group',
unitsPrefix = 'units prefix',
unitsSuffix = 'units suffix',
groupNames = 'group names',
hideGroupLegends = 'hide group legends',
slices = 'slices',
slice = 'slice',
radius = 'radius',
percent = 'percent',
} -- here is what you want to translate
local defColors = mw.loadData("Module:Chart/Default colors")
local hideGroupLegends
local function nulOrWhitespace( s )
return not s or mw.text.trim( s ) == ''
end
local function createGroupList( tab, legends, cols )
if #legends > 1 and not hideGroupLegends then
table.insert( tab, mw.text.tag( 'div' ) )
local list = {}
local spanStyle = "padding:0 1em;color:inherit;background-color:%s;border:1px solid %s;margin-right:1em;-webkit-print-color-adjust:exact;"
for gi = 1, #legends do
local span = mw.text.tag( 'span', { style = string.format( spanStyle, cols[gi], cols[gi] ) }, ' ' ) .. ' '.. legends[gi]
table.insert( list, mw.text.tag( 'li', {}, span ) )
end
table.insert( tab,
mw.text.tag( 'ul',
{style="list-style:none;column-width:12em;"},
table.concat( list, '\n' )
)
)
table.insert( tab, '</div>' )
end
end
local function pieChart( frame )
local res, imslices, args = {}, {}, frame.args
local radius
local values, colors, names, legends, links = {}, {}, {}, {}, {}
local delimiter = args.delimiter or ':'
local lang = mw.getContentLanguage()
local function getArg( s, def, subst, with )
local result = args[keywords[s]] or def or ''
if subst and with then result = string.gsub( result, subst, with ) end
return result
end
local function analyzeParams()
local function addSlice( i, slice )
local value, name, color, link = unpack( mw.text.split( slice, '%s*' .. delimiter .. '%s*' ) )
values[i] = tonumber( lang:parseFormattedNumber( value ) )
or error( string.format( 'Slice %d: "%s", first item("%s") could not be parsed as a number', i, value or '', slice ) )
colors[i] = not nulOrWhitespace( color ) and color or defColors[i * 2]
names[i] = name or ''
links[i] = link
end
radius = getArg( 'radius', 150 )
hideGroupLegends = not nulOrWhitespace( args[keywords.hideGroupLegends] )
local slicesStr = getArg( 'slices' )
local prefix = getArg( 'unitsPrefix', '', '_', ' ' )
local suffix = getArg( 'unitsSuffix', '', '_', ' ' )
local percent = args[keywords.percent]
local sum = 0
local i = 0
for slice in string.gmatch( slicesStr or '', "%b()" ) do
i = i + 1
addSlice( i, string.match( slice, '^%(%s*(.-)%s*%)$' ) )
end
for k, v in pairs(args) do
local ind = string.match( k, '^' .. keywords.slice .. '%s+(%d+)$' )
if ind then addSlice( tonumber( ind ), v ) end
end
for _, val in ipairs( values ) do sum = sum + val end
for i, value in ipairs( values ) do
local addprec = percent and string.format( ' (%0.1f%%)', value / sum * 100 ) or ''
legends[i] = string.format( '%s: %s%s%s%s', names[i], prefix, lang:formatNum( value ), suffix, addprec )
links[i] = mw.text.trim( links[i] or string.format( '[[#noSuchAnchor|%s]]', legends[i] ) )
end
end
local function addRes( ... )
for _, v in pairs( { ... } ) do
table.insert( res, v )
end
end
local function createImageMap()
addRes( '{{#tag:imagemap|', 'File:Circle frame.svg{{!}}' .. ( radius * 2 ) .. 'px' )
addRes( unpack( imslices ) )
addRes( 'desc none', '}}' )
end
local function drawSlice( i, q, start )
local color = colors[i]
local angle = start * 2 * math.pi
local sin, cos = math.abs( math.sin( angle ) ), math.abs( math.cos( angle ) )
local wsin, wcos = sin * radius, cos * radius
local s1, s2, w1, w2, w3, w4, border
if q == 1 then
border = 'left'
w1, w2, w3, w4 = 0, 0, wsin, wcos
s1, s2 = 'bottom', 'left'
elseif q == 2 then
border = 'bottom'
w1, w2, w3, w4 = 0, wcos, wsin, 0
s1, s2 = 'bottom', 'right'
elseif q == 3 then
border = 'right'
w1, w2, w3, w4 = wsin, wcos, 0, 0
s1, s2 = 'top', 'right'
else
border = 'top'
w1, w2, w3, w4 = wsin, 0, 0, wcos
s1, s2 = 'top', 'left'
end
local style = string.format( 'border:solid transparent;position:absolute;%s:%spx;%s:%spx;width:%spx;height:%spx', s1, radius, s2, radius, radius, radius )
if start <= ( q - 1 ) * 0.25 then
style = string.format( '%s;border:0;background-color:%s', style, color )
else
style = string.format( '%s;border-width:%spx %spx %spx %spx;border-%s-color:%s', style, w1, w2, w3, w4, border, color )
end
addRes( mw.text.tag( 'div', { style = style }, '' ) )
end
local function createSlices()
local function coordsOfAngle( angle )
return ( 100 + math.floor( 100 * math.cos( angle ) ) ) .. ' ' .. ( 100 - math.floor( 100 * math.sin( angle ) ) )
end
local sum, start = 0, 0
for _, value in ipairs( values ) do sum = sum + value end
for i, value in ipairs(values) do
local poly = { 'poly 100 100' }
local startC, endC = start / sum, ( start + value ) / sum
local startQ, endQ = math.floor( startC * 4 + 1 ), math.floor( endC * 4 + 1 )
for q = startQ, math.min( endQ, 4 ) do drawSlice( i, q, startC ) end
for angle = startC * 2 * math.pi, endC * 2 * math.pi, 0.02 do
table.insert( poly, coordsOfAngle( angle ) )
end
table.insert( poly, coordsOfAngle( endC * 2 * math.pi ) .. ' 100 100 ' .. links[i] )
table.insert( imslices, table.concat( poly, ' ' ) )
start = start + values[i]
end
end
analyzeParams()
if #values == 0 then error( "no slices found - can't draw pie chart" ) end
addRes( mw.text.tag( 'div', { class = 'chart noresize', style = string.format( 'margin-top:0.5em;max-width:%spx;', radius * 2 ) } ) )
addRes( mw.text.tag( 'div', { style = string.format( 'position:relative;min-width:%spx;min-height:%spx;max-width:%spx;overflow:hidden;', radius * 2, radius * 2, radius * 2 ) } ) )
createSlices()
addRes( mw.text.tag( 'div', { style = string.format( 'position:absolute;min-width:%spx;min-height:%spx;overflow:hidden;', radius * 2, radius * 2 ) } ) )
createImageMap()
addRes( '</div>' ) -- close "position:relative" div that contains slices and imagemap.
addRes( '</div>' ) -- close "position:relative" div that contains slices and imagemap.
createGroupList( res, legends, colors ) -- legends
addRes( '</div>' ) -- close containing div
return frame:preprocess( table.concat( res, '\n' ) )
end
local function barChart( frame )
local res = {}
local args = frame.args -- can be changed to frame:getParent().args
local values, xlegends, colors, tooltips, yscales = {}, {}, {}, {}, {}
local groupNames, unitsSuffix, unitsPrefix, links = {}, {}, {}, {}
local width, height, yticks, stack, delimiter = 500, 350, -1, false, args.delimiter or ':'
local chartWidth, chartHeight, defcolor, scalePerGroup, accumulateTooltip
local numGroups, numValues
local scaleWidth
local function validate()
local function asGroups( name, tab, toDuplicate, emptyOK )
if #tab == 0 and not emptyOK then
error( "must supply values for " .. keywords[name] )
end
if #tab == 1 and toDuplicate then
for i = 2, numGroups do tab[i] = tab[1] end
end
if #tab > 0 and #tab ~= numGroups then
error ( keywords[name] .. ' must contain the same number of items as the number of groups, but it contains ' .. #tab .. ' items and there are ' .. numGroups .. ' groups')
end
end
-- do all sorts of validation here, so we can assume all params are good from now on.
-- among other things, replace numerical values with mw.language:parseFormattedNumber() result
chartHeight = height - 80
numGroups = #values
numValues = #values[1]
defcolor = defcolor or 'blue'
colors[1] = colors[1] or defcolor
scaleWidth = scalePerGroup and 80 * numGroups or 100
chartWidth = width - scaleWidth
asGroups( 'unitsPrefix', unitsPrefix, true, true )
asGroups( 'unitsSuffix', unitsSuffix, true, true )
asGroups( 'colors', colors, true, true )
asGroups( 'groupNames', groupNames, false, false )
if stack and scalePerGroup then
error( string.format( 'Illegal settings: %s and %s are incompatible.', keywords.stack, keywords.scalePerGroup ) )
end
for gi = 2, numGroups do
if #values[gi] ~= numValues then error( keywords.group .. " " .. gi .. " does not have same number of values as " .. keywords.group .. " 1" ) end
end
if #xlegends ~= numValues then error( 'Illegal number of ' .. keywords.xlegend .. '. Should be exactly ' .. numValues .. ' not ' .. #xlegends) end
end
local function extractParams()
local function testone( keyword, key, val, tab )
local i = keyword == key and 0 or key:match( keyword .. "%s+(%d+)" )
if not i then return end
i = tonumber( i ) or error("Expect numerical index for key " .. keyword .. " instead of '" .. key .. "'")
if i > 0 then tab[i] = {} end
for s in mw.text.gsplit( val, '%s*' .. delimiter .. '%s*' ) do
table.insert( i == 0 and tab or tab[i], s )
end
return true
end
for k, v in pairs( args ) do
if k == keywords.width then
width = tonumber( v )
if not width or width < 200 then
error( 'Illegal width value (must be a number, and at least 200): ' .. v )
end
elseif k == keywords.height then
height = tonumber( v )
if not height or height < 200 then
error( 'Illegal height value (must be a number, and at least 200): ' .. v )
end
elseif k == keywords.stack then stack = true
elseif k == keywords.yticks then yticks = tonumber(v) or -1
elseif k == keywords.scalePerGroup then scalePerGroup = true
elseif k == keywords.defcolor then defcolor = v
elseif k == keywords.accumulateTooltip then accumulateTooltip = not nulOrWhitespace( v )
elseif k == keywords.hideGroupLegends then hideGroupLegends = not nulOrWhitespace( v )
else
for keyword, tab in pairs( {
group = values,
xlegend = xlegends,
colors = colors,
tooltip = tooltips,
unitsPrefix = unitsPrefix,
unitsSuffix = unitsSuffix,
groupNames = groupNames,
links = links,
} ) do
if testone( keywords[keyword], k, v, tab )
then break
end
end
end
end
end
local function roundup( x ) -- returns the next round number: eg., for 30 to 39.999 will return 40, for 3000 to 3999.99 wil return 4000. for 10 - 14.999 will return 15.
local ordermag = 10 ^ math.floor( math.log10( x ) )
local normalized = x / ordermag
local top = normalized >= 1.5 and ( math.floor( normalized + 1 ) ) or 1.5
return ordermag * top, top, ordermag
end
local function calcHeightLimits() -- if limits were passed by user, use them, otherwise calculate. for "stack" there's only one limet.
if stack then
local sums = {}
for _, group in pairs( values ) do
for i, val in ipairs( group ) do sums[i] = ( sums[i] or 0 ) + val end
end
local sum = math.max( unpack( sums ) )
for i = 1, #values do yscales[i] = sum end
else
for i, group in ipairs( values ) do yscales[i] = math.max( unpack( group ) ) end
end
for i, scale in ipairs( yscales ) do yscales[i] = roundup( scale * 0.9999 ) end
if not scalePerGroup then for i = 1, #values do yscales[i] = math.max( unpack( yscales ) ) end end
end
local function tooltip( gi, i, val )
if tooltips and tooltips[gi] and not nulOrWhitespace( tooltips[gi][i] ) then return tooltips[gi][i], true end
local groupName = mw.text.killMarkers(not nulOrWhitespace( groupNames[gi] ) and groupNames[gi] .. ': ' or '')
local prefix = unitsPrefix[gi] or unitsPrefix[1] or ''
local suffix = unitsSuffix[gi] or unitsSuffix[1] or ''
return string.gsub(groupName .. prefix .. mw.getContentLanguage():formatNum( tonumber( val ) or 0 ) .. suffix, '_', ' '), false
end
local function calcHeights( gi, i, val )
local barHeight = math.max( 2, math.floor( val / yscales[gi] * chartHeight + 0.5 ) ) -- add half to make it "round" instead of "trunc", min height to 2 to avoid negative bar sizes
local top, base = chartHeight - barHeight, 0
if stack then
for j = 1, gi - 1 do
if tonumber(values[j][i]) > 0 then
base = base + math.max( 2, math.floor( values[j][i] / yscales[gi] * chartHeight + 0.5 ) ) -- sum the "i" value of all the groups below our group, gi, and keep the same calculation for each bar
end
end
end
return barHeight, top - base
end
local function groupBounds( i )
local setWidth = math.floor( chartWidth / numValues )
local setOffset = ( i - 1 ) * setWidth
return setOffset, setWidth
end
local function calcx( gi, i )
local setOffset, setWidth = groupBounds( i )
if stack or numGroups == 1 then
local barWidth = math.min( 38, math.floor( 0.8 * setWidth ) )
return setOffset + (setWidth - barWidth) / 2, barWidth
end
setWidth = 0.85 * setWidth
local barWidth = math.floor( 0.75 * setWidth / numGroups )
local left = setOffset + math.floor( ( gi - 1 ) / numGroups * setWidth )
return left, barWidth
end
local function drawbar( gi, i, val, ttval )
if val == '0' then return end -- do not show single line (borders....) if value is 0, or rather, '0'. see talkpage
local color, tooltip, custom = colors[gi] or defcolor or 'blue', tooltip( gi, i, ttval or val )
local left, barWidth = calcx( gi, i )
local barHeight, top = calcHeights( gi, i, val )
-- borders so it shows up when printing
local style = string.format("position:absolute;left:%spx;top:%spx;height:%spx;min-width:%spx;max-width:%spx;color:inherit;background-color:%s;-webkit-print-color-adjust:exact;border:1px solid %s;border-bottom:none;overflow:hidden;",
left, top, barHeight-1, barWidth-2, barWidth-2, color, color)
local link = links[gi] and links[gi][i] or ''
local img = not nulOrWhitespace( link ) and string.format( '[[File:Transparent.png|1000px|link=%s|%s]]', link, custom and tooltip or '' ) or ''
table.insert( res, mw.text.tag( 'div', { style = style, title = tooltip, }, img ) )
end
local function drawYScale()
local function drawSingle( gi, color, width, yticks, single )
local yscale = yscales[gi]
local _, top, ordermag = roundup( yscale * 0.999 )
local numnotches = yticks >= 0 and yticks or
(top <= 1.5 and top * 4
or top < 4 and top * 2
or top)
local valStyleStr =
single and 'position:absolute;height=20px;text-align:right;vertical-align:middle;width:%spx;top:%spx;padding:0 2px'
or 'position:absolute;height=20px;text-align:right;vertical-align:middle;width:%spx;top:%spx;left:3px;background-color:%s;color:white;font-weight:bold;text-shadow:-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000;padding:0 2px'
local notchStyleStr = 'position:absolute;height=1px;min-width:5px;top:%spx;left:%spx;border:1px solid %s;'
for i = 1, numnotches do
local val = i / numnotches * yscale
local y = chartHeight - calcHeights( gi, 1, val )
local div = mw.text.tag( 'div', { style = string.format( valStyleStr, width - 10, y - 10, color ) }, mw.getContentLanguage():formatNum( tonumber( val ) or 0 ) )
table.insert( res, div )
div = mw.text.tag( 'div', { style = string.format( notchStyleStr, y, width - 4, color ) }, '' )
table.insert( res, div )
end
end
if scalePerGroup then
local colWidth = 80
local colStyle = "position:absolute;height:%spx;min-width:%spx;left:%spx;border-right:1px solid %s;color:%s"
for gi = 1, numGroups do
local left = ( gi - 1 ) * colWidth
local color = colors[gi] or defcolor
table.insert( res, mw.text.tag( 'div', { style = string.format( colStyle, chartHeight, colWidth, left, color, color ) } ) )
drawSingle( gi, color, colWidth, yticks )
table.insert( res, '</div>' )
end
else
drawSingle( 1, 'black', scaleWidth, yticks, true )
end
end
local function drawXlegends()
local setOffset, setWidth
local legendDivStyleFormat = "position:absolute;left:%spx;top:10px;min-width:%spx;max-width:%spx;text-align:center;vertical-align:top;"
local tickDivstyleFormat = "position:absolute;left:%spx;height:10px;width:1px;border-left:1px solid black;"
for i = 1, numValues do
if not nulOrWhitespace( xlegends[i] ) then
setOffset, setWidth = groupBounds( i )
-- setWidth = 0.85 * setWidth
table.insert( res, mw.text.tag( 'div', { style = string.format( legendDivStyleFormat, setOffset + 1, setWidth - 2, setWidth - 2 ) }, xlegends[i] or '' ) )
table.insert( res, mw.text.tag( 'div', { style = string.format( tickDivstyleFormat, setOffset + setWidth / 2 ) }, '' ) )
end
end
end
local function drawChart()
table.insert( res, mw.text.tag( 'div', { class = 'chart noresize', style = string.format( 'padding-top:10px;margin-top:1em;max-width:%spx;', width ) } ) )
table.insert( res, mw.text.tag( 'div', { style = string.format("position:relative;min-height:%spx;min-width:%spx;max-width:%spx;", height, width, width ) } ) )
table.insert( res, mw.text.tag( 'div', { style = string.format("float:right;position:relative;min-height:%spx;min-width:%spx;max-width:%spx;border-left:1px black solid;border-bottom:1px black solid;", chartHeight, chartWidth, chartWidth ) } ) )
local acum = stack and accumulateTooltip and {}
for gi, group in pairs( values ) do
for i, val in ipairs( group ) do
if acum then acum[i] = ( acum[i] or 0 ) + val end
drawbar( gi, i, val, acum and acum[i] )
end
end
table.insert( res, '</div>' )
table.insert( res, mw.text.tag( 'div', { style = string.format("position:absolute;height:%spx;min-width:%spx;max-width:%spx;", chartHeight, scaleWidth, scaleWidth, scaleWidth ) } ) )
drawYScale()
table.insert( res, '</div>' )
table.insert( res, mw.text.tag( 'div', { style = string.format( "position:absolute;top:%spx;left:%spx;width:%spx;", chartHeight, scaleWidth, chartWidth ) } ) )
drawXlegends()
table.insert( res, '</div>' )
table.insert( res, '</div>' )
createGroupList( res, groupNames, colors )
table.insert( res, '</div>' )
end
extractParams()
validate()
calcHeightLimits()
drawChart()
return table.concat( res, "\n" )
end
return {
['bar-chart'] = barChart,
[keywords.barChart] = barChart,
[keywords.pieChart] = pieChart,
}
3gr0l75trmt4l1qpr2bpsqph1i340gf
Халип:Wikidata/Population
10
12402
102519
69765
2026-11-11T16:53:51Z
M. Omarius
10562
102519
wikitext
text/x-wiki
<includeonly>{{center|{{WikidataChart|P1082|pageIds={{{from|}}}|chart=Wikidata population (with dynamic data)}}}}
{{Wikidata/Population/Table|from={{{from|}}}|references={{{references|}}}}}</includeonly><noinclude>
{{doc}}
</noinclude>
pikvdnnc35643lfud3bvozmxrnyvn02
Модуль:Wikidata/Population
828
12403
102520
69766
2026-11-11T16:56:49Z
M. Omarius
10562
102520
Scribunto
text/plain
local p = {};
local COLLAPSE_IF_MORE_THAN = 30;
local TABLE_COLLAPSIBLE_HEADER = "Чагӏазул рикӏкӏадул статистика, %s–%s";
local TABLE_COLUMN_HEADER_YEAR = "Сон";
local TABLE_COLUMN_HEADER_POPULATION = "Рикӏкӏен";
local function deepcopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
local function formatPopulationPropertyImpl( context, options )
if ( not context ) then error( 'context not specified' ); end;
if ( not options ) then error( 'options not specified' ); end;
if ( not options.entity ) then error( 'options.entity missing' ); end;
local claims = context.selectClaims( options, options.property );
if (claims == nil) then
return nil -- TODO error?
end
local validClaims = {}
for _, claim in ipairs( claims ) do
-- проверка на наличие корректного момента времени
if claim.qualifiers.P585[1] and claim.qualifiers.P585[1].snaktype == 'value' then
table.insert( validClaims, claim )
end
end
if #validClaims == 0 then
return nil -- TODO error?
end
local comparator = function( o1, o2 )
local t1 = context.parseTimeFromSnak( o1.qualifiers.P585[1] )
local t2 = context.parseTimeFromSnak( o2.qualifiers.P585[1] )
return t1 < t2
end
table.sort( validClaims, comparator )
return validClaims
end
function p.formatPopulationPropertyForTable( context, options )
local claims = formatPopulationPropertyImpl( context, options );
-- Обход всех заявлений утверждения и с накоплением оформленых предпочтительных
-- заявлений в таблице
local formattedClaims = {}
local years = {}
local firstTime = false;
local lastTime = '';
local count = 0;
if ( not claims ) then
return '';
end
if options.nolinks == nil then
options.nolinks = true
end
for i, claim in ipairs( claims ) do
-- обрезаем выводимую дату до года
local timeQualifier = claim.qualifiers.P585[1];
if ( timeQualifier.datavalue.value.precision > 9 ) then
timeQualifier = deepcopy( timeQualifier );
timeQualifier.datavalue.value.precision = 9;
end
local year = string.sub( timeQualifier.datavalue.value.time, 2, 5 );
if claim.mainsnak.datavalue and not years[ year ] then
years[ year ] = true
local time = context.formatSnak( options, timeQualifier )
local value = context.formatSnak( options, claim.mainsnak )
if not firstTime then
firstTime = time
end
lastTime = time
-- link to topic (census)
if claim.qualifiers.P805 and
claim.qualifiers.P805[1] and
claim.qualifiers.P805[1].snaktype == 'value'
then
local link = mw.wikibase.sitelink( claim.qualifiers.P805[1].datavalue.value.id )
if link then
time = '[[' .. link .. '|' .. time .. ']]'
end
end
local line = '\n|- role="row"'
line = line .. '\n! role="rowheader" scope="row" | ' .. time
line = line .. '\n| role="cell" | ' .. ( value or "" )
if options.references then
line = line .. context.formatRefs( options, claim )
end
table.insert( formattedClaims, line )
count = count + 1
end
end
if ( count == 0 ) then
return '';
end
local out = '<div class="ts-wikidata-population-table'
if count < 20 then
out = out .. ' cols-' .. ( math.floor( count / 5 ) + 1 )
end
out = out .. '">\n'
local caption = mw.ustring.format( TABLE_COLLAPSIBLE_HEADER, firstTime, lastTime );
out = out .. '{| role="table" class="wikitable mw-collapsible'
if count > COLLAPSE_IF_MORE_THAN then
out = out .. ' mw-collapsed'
end
out = out .. '"\n|+ ' .. caption
out = out .. '\n|- role="row"'
out = out .. '\n! role="columnheader" aria-sort="ascending" scope="col" | ' .. TABLE_COLUMN_HEADER_YEAR
out = out .. '\n! role="columnheader" aria-sort="none" scope="col" | ' .. TABLE_COLUMN_HEADER_POPULATION
out = out .. '\n|-'
out = out .. table.concat( formattedClaims, '\n' )
out = out .. '\n|}';
out = out .. '\n</div>';
return out
end
return p;
tvp659aibytagaexmy1mn5llb1w6rka
Модуль:Statistical/салулгъамас
828
20422
102513
93590
2026-11-11T15:17:40Z
M. Omarius
10562
102513
Scribunto
text/plain
local p = {}
local templateIncrease = 'Увеличение'
local templateDecrease = 'Уменьшение'
local templateNoChange = 'Без изменения'
local Regions = mw.loadData("Модуль:Statistical/Regions")
bit32 = require( 'bit32' )
local function LimitDouble(Val)
local MaxNumber = 2147483648
return Val - (math.floor(Val / MaxNumber) * MaxNumber)
end
local function shl(Val, Shift)
if Shift > 0 then
return LimitDouble(Val * (2 ^ Shift))
else
return Value
end
end
local function shr(Val, Shift)
if Shift > 0 then
return math.floor(Val / (2 ^ Shift))
else
return Val
end
end
-- Код основан на алгоритме SuperFastHash:
-- http://www.azillionmonkeys.com/qed/hash.html
local function MakeHash(PlaceName)
local dataLength = mw.ustring.len(PlaceName)
if dataLength == 0 then return 0 end
local hash = dataLength
local remainingBytes = math.fmod(dataLength, 2)
local numberOfLoops = math.floor(dataLength / 2)
local currentIndex = 0
local tmp = 0
while (numberOfLoops > 0) do
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
tmp = bit32.bxor(shl(mw.ustring.codepoint(PlaceName, currentIndex + 2), 11), hash)
hash = bit32.bxor(shl(hash, 16), tmp)
hash = LimitDouble(hash + shr(hash, 11))
currentIndex = currentIndex + 2
numberOfLoops = numberOfLoops - 1
end
if remainingBytes == 1 then
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
hash = bit32.bxor(hash, shl(hash, 10))
hash = LimitDouble(hash + shr(hash, 1))
end
hash = bit32.bxor(hash, shl(hash, 3))
hash = LimitDouble(hash + shr(hash, 5))
hash = bit32.bxor(hash, shl(hash, 4))
hash = LimitDouble(hash + shr(hash, 17))
hash = bit32.bxor(hash, shl(hash, 25))
hash = LimitDouble(hash + shr(hash, 6))
return hash
end
local function First_less_Second(a, b)
local LenA = mw.ustring.len(a)
local LenB = mw.ustring.len(b)
for i = 1, (LenA < LenB) and LenA or LenB do
if mw.ustring.codepoint(a, i, i) ~= mw.ustring.codepoint(b, i, i) then
return mw.ustring.codepoint(a, i, i) < mw.ustring.codepoint(b, i, i)
end
end
return LenA < LenB
end
function GetHashData(PlaceHash)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Чагӏазул рикӏкӏен/STA-00"..NumPage else templatename = "Чагӏазул рикӏкӏен/STA-0"..NumPage end
local page = mw.title.new(templatename, 10)
local RawData = page:getContent()
HashData = RawData:match("|" .. PlaceHash .. "=([^\n<]+)")
if (HashData=="") then HashData=nil
elseif (tonumber(HashData)~=nil) then HashData=tonumber(HashData) end
return HashData
end
function p.GenerateAndReturnHash(frame)
local args = frame:getParent().args
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if PlaceName == nil then return "АТР абйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
local PlaceHash = MakeHash(PlaceName)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Чагӏазул рикӏкӏен/STA-00"..NumPage else templatename = "Чӏагӏазул рикӏкӏен/STA-0"..NumPage end
return PlaceHash..' → '..'[[Template:'..templatename..']]'
end
function p.GetStat(frame)
local args
if frame == mw.getCurrentFrame() then
args = frame:getParent().args
else
args = frame
end
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if args[3] ~= nil and tonumber(args[3]) then args.year = args[3] end
local Format = mw.text.trim ( (args[2] or "Табло"))
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
if Format == 'Хеш' or Format == 'х' then do return MakeHash(PlaceName) end end
local Region = args['Регион'] or ''
local check = args['check'] or ''
if check == '' or check == '0' or check == 'false' then
check = false;
else
check = true;
end
local PlaceData = nil
local RegionData = nil
local CheckRedirect = false
local NeedhandleRedirect = false
local function GetPlaceData()
local PlaceHash = MakeHash(PlaceName)
PlaceData = nil
RegionData = nil
local test = PlaceName:match("%((%P+)%)")
if Region=='' and test~='' then
-- Если в имени населенного пункта есть уточнение с именем региона, то можно не пользоваться индексной таблицей, то есть не вызывать GetHashData
local value = Regions[test]
if(value) then
RegionData = mw.loadData("Модуль:Statistical/"..value)
PlaceData = RegionData[PlaceHash]
end
elseif Region ~= "" then
-- магия, позволяющая указывать не только индекс, но и значение напрямую
Region = Regions[Region] or Region
RegionData = mw.loadData("Модуль:Statistical/"..Region)
PlaceData = RegionData[PlaceHash]
end
if PlaceData == nil then
local RegionPage = GetHashData(PlaceHash)
if RegionPage == 0 then return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Совпадение хешей. Пожалуйста, укажите регион вручную, например <code><nowiki>{{ Халип | " .. PlaceName .. " | " .. Format .." | Регион = Приморский край }}</nowiki></code>" .. ((args.nocat and "") or "[[Категория:Википедия:Статьи с неправильными параметрами шаблона Население]]")}} end
if RegionPage ~= nil then
if type(tonumber(RegionPage)) == "number" then
-- очень плохая вещь, ибо GetHashData очень дорогая по памяти функция
PlaceHash=tonumber(RegionPage)
RegionPage = GetHashData(PlaceHash)
end
if type(RegionPage) == "table" then RegionPage = RegionPage[PlaceName] end
if RegionPage ~= nil then
RegionData = mw.loadData("Модуль:Statistical/"..RegionPage)
if RegionData ~= nil then PlaceData = RegionData[PlaceHash] end
end
end
end
end
GetPlaceData()
-- Проверка на редирект, если данные не найдены
if PlaceData == nil then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
GetPlaceData()
end
end
local IsWikidata
-- Если данные перемещены из шаблона Население в Wikidata, то работаем с ними
if PlaceData ~= nil then
IsWikidata = PlaceData == "Wikidata"
else
if check then
return 0;
else
--return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные не обнаружены. Возможно, страница переименовывалась. Проверьте справочник".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
-- Вместо прекращения работы при неудаче поиска данных в шаблоне Население попытка поиска в Wikdata
IsWikidata = true
end
end
if check then
return 1;
end
local LastRecord = 0
local Qcode
if IsWikidata then
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
if Qcode == "" then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
end
end
if Qcode == "" then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
if next(mw.wikibase.getBestStatements(Qcode, 'P1082')) == nil then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
else
for k in pairs(PlaceData) do
LastRecord = LastRecord + 1
if args[3] ~= nil and PlaceData[LastRecord][1] == tonumber(args[3]) then
break
end
end
end
local NumRecord = LastRecord
local function FormatY()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatY",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][1]
end
end
local function FormatN()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatN",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][2]
end
end
local function FormatS(SourceType)
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatS",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if ( PlaceData[NumRecord][3] == nil or PlaceData[NumRecord][3] == '' ) then
return ""
else
local Source1
local Source2
if string.find(PlaceData[NumRecord][3],"%d+[A-Z]+")==1 then
if RegionData['Иццал'][PlaceData[NumRecord][3]] ~= nil then
Source1 = RegionData['Иццал'][PlaceData[NumRecord][3]][1]
Source2 = PlaceData[NumRecord][3]
else
Source1 = PlaceData[NumRecord][3] .. '[[Категория:Википедия:Statistical модулалда мекъе иццалгун макъалаби]]'
Source2 = ""
end
else
Source1 = PlaceData[NumRecord][3]
Source2 = ""
end
if string.find(Source1, "https?://")==1 then
Source1 = '['..Source1..']'
end
if SourceType == "и" then
return Source1
end
if Source2 == "" then
return frame:callParserFunction{name = '#tag:ref', args = {Source1}}
else
return frame:callParserFunction{name = '#tag:ref', args = {Source1, name = Source2}}
end
end
end
end
local function FormatF()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatF",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local lang = mw.language.getContentLanguage()
return lang:formatNum( PlaceData[NumRecord][2] )
end
end
local function FormatT()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatT",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if NumRecord > 1 then
if PlaceData[NumRecord][2] > PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateIncrease
}
elseif PlaceData[NumRecord][2] < PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
end
local function FormatD()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatD",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local tempHeight = 320
local tempWidth = 800
mw.logObject(LastRecord)
local tickCount = 5
if LastRecord > 100 then
tickCount = 10
end
local tempMod = math.fmod (LastRecord, tickCount)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k in pairs(PlaceData) do
NumRecord = k
tempGroup = tempGroup .. FormatN() .. ":"
tempTooltip = tempTooltip .. FormatF() .. " (" .. FormatY() .. "):"
if LastRecord < tickCount or math.fmod (k, tickCount) == tempMod then tempLegend = tempLegend .. FormatY() end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Численность населения',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = frame:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
end
local function FormatG()
local xValues = "|arg:x="
local yValues = "|arg:y1="
if IsWikidata then
xValues, yValues = frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatG",property="p1082[p585][rank:preferred, rank:normal]"} }:match("^(.-);(.*)$")
else
for k in pairs(PlaceData) do
NumRecord = k
xValues = xValues .. FormatY() .. ","
yValues = yValues .. FormatN() .. ","
end
end
local chartParams = "|arg:y1Title=" .. PlaceName .. xValues:gsub(',$', '') .. yValues:gsub(',$', '')
local graph = string.format("{{#chart:Wikidata population (with dynamic data).chart%s}}", chartParams)
local _, count = string.gsub(xValues, ',', '')
local cat = ""
if count <= 3 then
cat = "[[Категория:Википедия:Графикалъе дагьал тӏанкӏал]]"
end
return mw.getCurrentFrame():preprocess( graph .. cat )
end
local function FormatTable()
-- Формирование HTML-таблицы
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode, column = args['Хӏубал'], decor = args['Гӏуцӏи'], titul = args['Бетӏер'], ['property-module']="Statistical/Wikidata",['property-function']="FormatTable",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local HTML = mw.html.create('table')
local MaxData
if args['Хӏубал'] then
Column = tonumber(args['Хӏубал'])
else
Column = 7
end
if Column > LastRecord then Column = LastRecord end
if args['Гӏуцӏи'] ~= nil then
HTML:attr('class', args['Гӏуцӏи'])
else
HTML:attr('class', 'standard')
end
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(args['Бетӏер'] or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('color', 'inherit')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(FormatY()..FormatS("с"))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(FormatT()..FormatF())
end
end
end
return tostring(HTML)
end
end
-- грязный хак для графиков (если вставлять <templatestyles> напрямую, то это ломает версию без форматирования)
-- стили стоит или перенести в Common.css, если графики будут активнее использоваться, или разобрать шаблон на несколько
local styles = frame:extensionTag('templatestyles', '', { src = 'Халип:WikidataChart/styles.css' })
if Format == 'Сон' or Format == 'г' then
mw.logObject(Format)
return FormatY()
elseif Format == 'Безформат' or Format == 'Рикӏкӏен' or Format == 'р' then
return FormatN()
elseif Format == 'Линк' or Format == 'л' then
return FormatS("с")
elseif Format == 'Ицц' or Format == 'и' then
return FormatS("и")
elseif Format == 'Формат' or Format == 'ф' then
return FormatF()
elseif Format == 'ФорматСон' or Format == 'фс' then
return FormatF().." ("..FormatY()..")"
elseif Format == 'ФорматЛинк' or Format == 'фл' then
return FormatF()..FormatS()
elseif Format == 'ФорматЛинкСон' or Format == 'флс' then
return FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Тренд' or Format == 'т' then
return FormatT()..FormatF()
elseif Format == 'Кӏвар' or Format == 'ТрендЛинк' or Format == 'тл' then
return FormatT()..FormatF()..FormatS()
elseif Format == 'ТрендЛинкСон' or Format == 'тлс' then
return FormatT()..FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Диаграмма' or Format == 'д' then
mw.logObject(FormatD())
return FormatD()
elseif Format == 'График' or Format == 'график' then
return styles..FormatG()
else
return FormatTable()
end
return 1, Format
end
return p
ts8msdeocate62uizvnff8ie673yk7e
102514
102513
2026-11-11T15:53:25Z
M. Omarius
10562
102514
Scribunto
text/plain
local p = {}
local templateIncrease = 'Цӏикӏкӏин'
local templateDecrease = 'Дагьлъи'
local templateNoChange = 'Хисичӏого'
local Regions = mw.loadData("Модуль:Statistical/Regions")
bit32 = require( 'bit32' )
local function LimitDouble(Val)
local MaxNumber = 2147483648
return Val - (math.floor(Val / MaxNumber) * MaxNumber)
end
local function shl(Val, Shift)
if Shift > 0 then
return LimitDouble(Val * (2 ^ Shift))
else
return Value
end
end
local function shr(Val, Shift)
if Shift > 0 then
return math.floor(Val / (2 ^ Shift))
else
return Val
end
end
-- Код основан на алгоритме SuperFastHash:
-- http://www.azillionmonkeys.com/qed/hash.html
local function MakeHash(PlaceName)
local dataLength = mw.ustring.len(PlaceName)
if dataLength == 0 then return 0 end
local hash = dataLength
local remainingBytes = math.fmod(dataLength, 2)
local numberOfLoops = math.floor(dataLength / 2)
local currentIndex = 0
local tmp = 0
while (numberOfLoops > 0) do
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
tmp = bit32.bxor(shl(mw.ustring.codepoint(PlaceName, currentIndex + 2), 11), hash)
hash = bit32.bxor(shl(hash, 16), tmp)
hash = LimitDouble(hash + shr(hash, 11))
currentIndex = currentIndex + 2
numberOfLoops = numberOfLoops - 1
end
if remainingBytes == 1 then
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
hash = bit32.bxor(hash, shl(hash, 10))
hash = LimitDouble(hash + shr(hash, 1))
end
hash = bit32.bxor(hash, shl(hash, 3))
hash = LimitDouble(hash + shr(hash, 5))
hash = bit32.bxor(hash, shl(hash, 4))
hash = LimitDouble(hash + shr(hash, 17))
hash = bit32.bxor(hash, shl(hash, 25))
hash = LimitDouble(hash + shr(hash, 6))
return hash
end
local function First_less_Second(a, b)
local LenA = mw.ustring.len(a)
local LenB = mw.ustring.len(b)
for i = 1, (LenA < LenB) and LenA or LenB do
if mw.ustring.codepoint(a, i, i) ~= mw.ustring.codepoint(b, i, i) then
return mw.ustring.codepoint(a, i, i) < mw.ustring.codepoint(b, i, i)
end
end
return LenA < LenB
end
function GetHashData(PlaceHash)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Чагӏазул рикӏкӏен/STA-00"..NumPage else templatename = "Чагӏазул рикӏкӏен/STA-0"..NumPage end
local page = mw.title.new(templatename, 10)
local RawData = page:getContent()
HashData = RawData:match("|" .. PlaceHash .. "=([^\n<]+)")
if (HashData=="") then HashData=nil
elseif (tonumber(HashData)~=nil) then HashData=tonumber(HashData) end
return HashData
end
function p.GenerateAndReturnHash(frame)
local args = frame:getParent().args
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
local PlaceHash = MakeHash(PlaceName)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Чагӏазул рикӏкӏен/STA-00"..NumPage else templatename = "Чӏагӏазул рикӏкӏен/STA-0"..NumPage end
return PlaceHash..' → '..'[[Template:'..templatename..']]'
end
function p.GetStat(frame)
local args
if frame == mw.getCurrentFrame() then
args = frame:getParent().args
else
args = frame
end
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if args[3] ~= nil and tonumber(args[3]) then args.year = args[3] end
local Format = mw.text.trim ( (args[2] or "Табло"))
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
if Format == 'Хеш' or Format == 'х' then do return MakeHash(PlaceName) end end
local Region = args['Регион'] or ''
local check = args['check'] or ''
if check == '' or check == '0' or check == 'false' then
check = false;
else
check = true;
end
local PlaceData = nil
local RegionData = nil
local CheckRedirect = false
local NeedhandleRedirect = false
local function GetPlaceData()
local PlaceHash = MakeHash(PlaceName)
PlaceData = nil
RegionData = nil
local test = PlaceName:match("%((%P+)%)")
if Region=='' and test~='' then
-- Если в имени населенного пункта есть уточнение с именем региона, то можно не пользоваться индексной таблицей, то есть не вызывать GetHashData
local value = Regions[test]
if(value) then
RegionData = mw.loadData("Модуль:Statistical/"..value)
PlaceData = RegionData[PlaceHash]
end
elseif Region ~= "" then
-- магия, позволяющая указывать не только индекс, но и значение напрямую
Region = Regions[Region] or Region
RegionData = mw.loadData("Модуль:Statistical/"..Region)
PlaceData = RegionData[PlaceHash]
end
if PlaceData == nil then
local RegionPage = GetHashData(PlaceHash)
if RegionPage == 0 then return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Совпадение хешей. Пожалуйста, укажите регион вручную, например <code><nowiki>{{ Халип | " .. PlaceName .. " | " .. Format .." | Регион = Приморский край }}</nowiki></code>" .. ((args.nocat and "") or "[[Категория:Википедия:Статьи с неправильными параметрами шаблона Население]]")}} end
if RegionPage ~= nil then
if type(tonumber(RegionPage)) == "number" then
-- очень плохая вещь, ибо GetHashData очень дорогая по памяти функция
PlaceHash=tonumber(RegionPage)
RegionPage = GetHashData(PlaceHash)
end
if type(RegionPage) == "table" then RegionPage = RegionPage[PlaceName] end
if RegionPage ~= nil then
RegionData = mw.loadData("Модуль:Statistical/"..RegionPage)
if RegionData ~= nil then PlaceData = RegionData[PlaceHash] end
end
end
end
end
GetPlaceData()
-- Проверка на редирект, если данные не найдены
if PlaceData == nil then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
GetPlaceData()
end
end
local IsWikidata
-- Если данные перемещены из шаблона Население в Wikidata, то работаем с ними
if PlaceData ~= nil then
IsWikidata = PlaceData == "Wikidata"
else
if check then
return 0;
else
--return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные не обнаружены. Возможно, страница переименовывалась. Проверьте справочник".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
-- Вместо прекращения работы при неудаче поиска данных в шаблоне Население попытка поиска в Wikdata
IsWikidata = true
end
end
if check then
return 1;
end
local LastRecord = 0
local Qcode
if IsWikidata then
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
if Qcode == "" then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
end
end
if Qcode == "" then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
if next(mw.wikibase.getBestStatements(Qcode, 'P1082')) == nil then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
else
for k in pairs(PlaceData) do
LastRecord = LastRecord + 1
if args[3] ~= nil and PlaceData[LastRecord][1] == tonumber(args[3]) then
break
end
end
end
local NumRecord = LastRecord
local function FormatY()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatY",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][1]
end
end
local function FormatN()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatN",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][2]
end
end
local function FormatS(SourceType)
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatS",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if ( PlaceData[NumRecord][3] == nil or PlaceData[NumRecord][3] == '' ) then
return ""
else
local Source1
local Source2
if string.find(PlaceData[NumRecord][3],"%d+[A-Z]+")==1 then
if RegionData['Иццал'][PlaceData[NumRecord][3]] ~= nil then
Source1 = RegionData['Иццал'][PlaceData[NumRecord][3]][1]
Source2 = PlaceData[NumRecord][3]
else
Source1 = PlaceData[NumRecord][3] .. '[[Категория:Википедия:Statistical модулалда мекъе иццалгун макъалаби]]'
Source2 = ""
end
else
Source1 = PlaceData[NumRecord][3]
Source2 = ""
end
if string.find(Source1, "https?://")==1 then
Source1 = '['..Source1..']'
end
if SourceType == "и" then
return Source1
end
if Source2 == "" then
return frame:callParserFunction{name = '#tag:ref', args = {Source1}}
else
return frame:callParserFunction{name = '#tag:ref', args = {Source1, name = Source2}}
end
end
end
end
local function FormatF()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatF",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local lang = mw.language.getContentLanguage()
return lang:formatNum( PlaceData[NumRecord][2] )
end
end
local function FormatT()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatT",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if NumRecord > 1 then
if PlaceData[NumRecord][2] > PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateIncrease
}
elseif PlaceData[NumRecord][2] < PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
end
local function FormatD()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatD",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local tempHeight = 320
local tempWidth = 800
mw.logObject(LastRecord)
local tickCount = 5
if LastRecord > 100 then
tickCount = 10
end
local tempMod = math.fmod (LastRecord, tickCount)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k in pairs(PlaceData) do
NumRecord = k
tempGroup = tempGroup .. FormatN() .. ":"
tempTooltip = tempTooltip .. FormatF() .. " (" .. FormatY() .. "):"
if LastRecord < tickCount or math.fmod (k, tickCount) == tempMod then tempLegend = tempLegend .. FormatY() end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Численность населения',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = frame:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
end
local function FormatG()
local xValues = "|arg:x="
local yValues = "|arg:y1="
if IsWikidata then
xValues, yValues = frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatG",property="p1082[p585][rank:preferred, rank:normal]"} }:match("^(.-);(.*)$")
else
for k in pairs(PlaceData) do
NumRecord = k
xValues = xValues .. FormatY() .. ","
yValues = yValues .. FormatN() .. ","
end
end
local chartParams = "|arg:y1Title=" .. PlaceName .. xValues:gsub(',$', '') .. yValues:gsub(',$', '')
local graph = string.format("{{#chart:Wikidata population (with dynamic data).chart%s}}", chartParams)
local _, count = string.gsub(xValues, ',', '')
local cat = ""
if count <= 3 then
cat = "[[Категория:Википедия:Графикалъе дагьал тӏанкӏал]]"
end
return mw.getCurrentFrame():preprocess( graph .. cat )
end
local function FormatTable()
-- Формирование HTML-таблицы
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode, column = args['Хӏубал'], decor = args['Гӏуцӏи'], titul = args['Бетӏер'], ['property-module']="Statistical/Wikidata",['property-function']="FormatTable",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local HTML = mw.html.create('table')
local MaxData
if args['Хӏубал'] then
Column = tonumber(args['Хӏубал'])
else
Column = 7
end
if Column > LastRecord then Column = LastRecord end
if args['Гӏуцӏи'] ~= nil then
HTML:attr('class', args['Гӏуцӏи'])
else
HTML:attr('class', 'standard')
end
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(args['Бетӏер'] or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('color', 'inherit')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(FormatY()..FormatS("с"))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(FormatT()..FormatF())
end
end
end
return tostring(HTML)
end
end
-- грязный хак для графиков (если вставлять <templatestyles> напрямую, то это ломает версию без форматирования)
-- стили стоит или перенести в Common.css, если графики будут активнее использоваться, или разобрать шаблон на несколько
local styles = frame:extensionTag('templatestyles', '', { src = 'Халип:WikidataChart/styles.css' })
if Format == 'Сон' or Format == 'г' then
mw.logObject(Format)
return FormatY()
elseif Format == 'Безформат' or Format == 'Рикӏкӏен' or Format == 'р' then
return FormatN()
elseif Format == 'Линк' or Format == 'л' then
return FormatS("с")
elseif Format == 'Ицц' or Format == 'и' then
return FormatS("и")
elseif Format == 'Формат' or Format == 'ф' then
return FormatF()
elseif Format == 'ФорматСон' or Format == 'фс' then
return FormatF().." ("..FormatY()..")"
elseif Format == 'ФорматЛинк' or Format == 'фл' then
return FormatF()..FormatS()
elseif Format == 'ФорматЛинкСон' or Format == 'флс' then
return FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Тренд' or Format == 'т' then
return FormatT()..FormatF()
elseif Format == 'Кӏвар' or Format == 'ТрендЛинк' or Format == 'тл' then
return FormatT()..FormatF()..FormatS()
elseif Format == 'ТрендЛинкСон' or Format == 'тлс' then
return FormatT()..FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Диаграмма' or Format == 'д' then
mw.logObject(FormatD())
return FormatD()
elseif Format == 'График' or Format == 'график' then
return styles..FormatG()
else
return FormatTable()
end
return 1, Format
end
return p
2y8gxdrdpsx1rq5f49zglncp7y568on
102516
102514
2026-11-11T16:05:14Z
M. Omarius
10562
102516
Scribunto
text/plain
local p = {}
local templateIncrease = 'Цӏикӏкӏин'
local templateDecrease = 'Дагьлъи'
local templateNoChange = 'Хисичӏого'
local Regions = mw.loadData("Модуль:Statistical/Regions")
bit32 = require( 'bit32' )
local function LimitDouble(Val)
local MaxNumber = 2147483648
return Val - (math.floor(Val / MaxNumber) * MaxNumber)
end
local function shl(Val, Shift)
if Shift > 0 then
return LimitDouble(Val * (2 ^ Shift))
else
return Value
end
end
local function shr(Val, Shift)
if Shift > 0 then
return math.floor(Val / (2 ^ Shift))
else
return Val
end
end
-- Код основан на алгоритме SuperFastHash:
-- http://www.azillionmonkeys.com/qed/hash.html
local function MakeHash(PlaceName)
local dataLength = mw.ustring.len(PlaceName)
if dataLength == 0 then return 0 end
local hash = dataLength
local remainingBytes = math.fmod(dataLength, 2)
local numberOfLoops = math.floor(dataLength / 2)
local currentIndex = 0
local tmp = 0
while (numberOfLoops > 0) do
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
tmp = bit32.bxor(shl(mw.ustring.codepoint(PlaceName, currentIndex + 2), 11), hash)
hash = bit32.bxor(shl(hash, 16), tmp)
hash = LimitDouble(hash + shr(hash, 11))
currentIndex = currentIndex + 2
numberOfLoops = numberOfLoops - 1
end
if remainingBytes == 1 then
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
hash = bit32.bxor(hash, shl(hash, 10))
hash = LimitDouble(hash + shr(hash, 1))
end
hash = bit32.bxor(hash, shl(hash, 3))
hash = LimitDouble(hash + shr(hash, 5))
hash = bit32.bxor(hash, shl(hash, 4))
hash = LimitDouble(hash + shr(hash, 17))
hash = bit32.bxor(hash, shl(hash, 25))
hash = LimitDouble(hash + shr(hash, 6))
return hash
end
local function First_less_Second(a, b)
local LenA = mw.ustring.len(a)
local LenB = mw.ustring.len(b)
for i = 1, (LenA < LenB) and LenA or LenB do
if mw.ustring.codepoint(a, i, i) ~= mw.ustring.codepoint(b, i, i) then
return mw.ustring.codepoint(a, i, i) < mw.ustring.codepoint(b, i, i)
end
end
return LenA < LenB
end
function GetHashData(PlaceHash)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Население/STA-00"..NumPage else templatename = "Население/STA-0"..NumPage end
local page = mw.title.new(templatename, 10)
local RawData = page:getContent()
HashData = RawData:match("|" .. PlaceHash .. "=([^\n<]+)")
if (HashData=="") then HashData=nil
elseif (tonumber(HashData)~=nil) then HashData=tonumber(HashData) end
return HashData
end
function p.GenerateAndReturnHash(frame)
local args = frame:getParent().args
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
local PlaceHash = MakeHash(PlaceName)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Население/STA-00"..NumPage else templatename = "Чӏагӏазул рикӏкӏен/STA-0"..NumPage end
return PlaceHash..' → '..'[[Template:'..templatename..']]'
end
function p.GetStat(frame)
local args
if frame == mw.getCurrentFrame() then
args = frame:getParent().args
else
args = frame
end
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if args[3] ~= nil and tonumber(args[3]) then args.year = args[3] end
local Format = mw.text.trim ( (args[2] or "Табло"))
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
if Format == 'Хеш' or Format == 'х' then do return MakeHash(PlaceName) end end
local Region = args['Регион'] or ''
local check = args['check'] or ''
if check == '' or check == '0' or check == 'false' then
check = false;
else
check = true;
end
local PlaceData = nil
local RegionData = nil
local CheckRedirect = false
local NeedhandleRedirect = false
local function GetPlaceData()
local PlaceHash = MakeHash(PlaceName)
PlaceData = nil
RegionData = nil
local test = PlaceName:match("%((%P+)%)")
if Region=='' and test~='' then
-- Если в имени населенного пункта есть уточнение с именем региона, то можно не пользоваться индексной таблицей, то есть не вызывать GetHashData
local value = Regions[test]
if(value) then
RegionData = mw.loadData("Модуль:Statistical/"..value)
PlaceData = RegionData[PlaceHash]
end
elseif Region ~= "" then
-- магия, позволяющая указывать не только индекс, но и значение напрямую
Region = Regions[Region] or Region
RegionData = mw.loadData("Модуль:Statistical/"..Region)
PlaceData = RegionData[PlaceHash]
end
if PlaceData == nil then
local RegionPage = GetHashData(PlaceHash)
if RegionPage == 0 then return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Совпадение хешей. Пожалуйста, укажите регион вручную, например <code><nowiki>{{ Халип | " .. PlaceName .. " | " .. Format .." | Регион = Приморский край }}</nowiki></code>" .. ((args.nocat and "") or "[[Категория:Википедия:Статьи с неправильными параметрами шаблона Население]]")}} end
if RegionPage ~= nil then
if type(tonumber(RegionPage)) == "number" then
-- очень плохая вещь, ибо GetHashData очень дорогая по памяти функция
PlaceHash=tonumber(RegionPage)
RegionPage = GetHashData(PlaceHash)
end
if type(RegionPage) == "table" then RegionPage = RegionPage[PlaceName] end
if RegionPage ~= nil then
RegionData = mw.loadData("Модуль:Statistical/"..RegionPage)
if RegionData ~= nil then PlaceData = RegionData[PlaceHash] end
end
end
end
end
GetPlaceData()
-- Проверка на редирект, если данные не найдены
if PlaceData == nil then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
GetPlaceData()
end
end
local IsWikidata
-- Если данные перемещены из шаблона Население в Wikidata, то работаем с ними
if PlaceData ~= nil then
IsWikidata = PlaceData == "Wikidata"
else
if check then
return 0;
else
--return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные не обнаружены. Возможно, страница переименовывалась. Проверьте справочник".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
-- Вместо прекращения работы при неудаче поиска данных в шаблоне Население попытка поиска в Wikdata
IsWikidata = true
end
end
if check then
return 1;
end
local LastRecord = 0
local Qcode
if IsWikidata then
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
if Qcode == "" then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
end
end
if Qcode == "" then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
if next(mw.wikibase.getBestStatements(Qcode, 'P1082')) == nil then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
else
for k in pairs(PlaceData) do
LastRecord = LastRecord + 1
if args[3] ~= nil and PlaceData[LastRecord][1] == tonumber(args[3]) then
break
end
end
end
local NumRecord = LastRecord
local function FormatY()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatY",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][1]
end
end
local function FormatN()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatN",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][2]
end
end
local function FormatS(SourceType)
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatS",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if ( PlaceData[NumRecord][3] == nil or PlaceData[NumRecord][3] == '' ) then
return ""
else
local Source1
local Source2
if string.find(PlaceData[NumRecord][3],"%d+[A-Z]+")==1 then
if RegionData['Иццал'][PlaceData[NumRecord][3]] ~= nil then
Source1 = RegionData['Иццал'][PlaceData[NumRecord][3]][1]
Source2 = PlaceData[NumRecord][3]
else
Source1 = PlaceData[NumRecord][3] .. '[[Категория:Википедия:Statistical модулалда мекъе иццалгун макъалаби]]'
Source2 = ""
end
else
Source1 = PlaceData[NumRecord][3]
Source2 = ""
end
if string.find(Source1, "https?://")==1 then
Source1 = '['..Source1..']'
end
if SourceType == "и" then
return Source1
end
if Source2 == "" then
return frame:callParserFunction{name = '#tag:ref', args = {Source1}}
else
return frame:callParserFunction{name = '#tag:ref', args = {Source1, name = Source2}}
end
end
end
end
local function FormatF()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatF",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local lang = mw.language.getContentLanguage()
return lang:formatNum( PlaceData[NumRecord][2] )
end
end
local function FormatT()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatT",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if NumRecord > 1 then
if PlaceData[NumRecord][2] > PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateIncrease
}
elseif PlaceData[NumRecord][2] < PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
end
local function FormatD()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatD",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local tempHeight = 320
local tempWidth = 800
mw.logObject(LastRecord)
local tickCount = 5
if LastRecord > 100 then
tickCount = 10
end
local tempMod = math.fmod (LastRecord, tickCount)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k in pairs(PlaceData) do
NumRecord = k
tempGroup = tempGroup .. FormatN() .. ":"
tempTooltip = tempTooltip .. FormatF() .. " (" .. FormatY() .. "):"
if LastRecord < tickCount or math.fmod (k, tickCount) == tempMod then tempLegend = tempLegend .. FormatY() end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Численность населения',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = frame:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
end
local function FormatG()
local xValues = "|arg:x="
local yValues = "|arg:y1="
if IsWikidata then
xValues, yValues = frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatG",property="p1082[p585][rank:preferred, rank:normal]"} }:match("^(.-);(.*)$")
else
for k in pairs(PlaceData) do
NumRecord = k
xValues = xValues .. FormatY() .. ","
yValues = yValues .. FormatN() .. ","
end
end
local chartParams = "|arg:y1Title=" .. PlaceName .. xValues:gsub(',$', '') .. yValues:gsub(',$', '')
local graph = string.format("{{#chart:Wikidata population (with dynamic data).chart%s}}", chartParams)
local _, count = string.gsub(xValues, ',', '')
local cat = ""
if count <= 3 then
cat = "[[Категория:Википедия:Графикалъе дагьал тӏанкӏал]]"
end
return mw.getCurrentFrame():preprocess( graph .. cat )
end
local function FormatTable()
-- Формирование HTML-таблицы
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode, column = args['Хӏубал'], decor = args['Гӏуцӏи'], titul = args['Бетӏер'], ['property-module']="Statistical/Wikidata",['property-function']="FormatTable",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local HTML = mw.html.create('table')
local MaxData
if args['Хӏубал'] then
Column = tonumber(args['Хӏубал'])
else
Column = 7
end
if Column > LastRecord then Column = LastRecord end
if args['Гӏуцӏи'] ~= nil then
HTML:attr('class', args['Гӏуцӏи'])
else
HTML:attr('class', 'standard')
end
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(args['Бетӏер'] or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('color', 'inherit')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(FormatY()..FormatS("с"))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(FormatT()..FormatF())
end
end
end
return tostring(HTML)
end
end
-- грязный хак для графиков (если вставлять <templatestyles> напрямую, то это ломает версию без форматирования)
-- стили стоит или перенести в Common.css, если графики будут активнее использоваться, или разобрать шаблон на несколько
local styles = frame:extensionTag('templatestyles', '', { src = 'Халип:WikidataChart/styles.css' })
if Format == 'Сон' or Format == 'г' then
mw.logObject(Format)
return FormatY()
elseif Format == 'Безформат' or Format == 'Рикӏкӏен' or Format == 'р' then
return FormatN()
elseif Format == 'Линк' or Format == 'л' then
return FormatS("с")
elseif Format == 'Ицц' or Format == 'и' then
return FormatS("и")
elseif Format == 'Формат' or Format == 'ф' then
return FormatF()
elseif Format == 'ФорматСон' or Format == 'фс' then
return FormatF().." ("..FormatY()..")"
elseif Format == 'ФорматЛинк' or Format == 'фл' then
return FormatF()..FormatS()
elseif Format == 'ФорматЛинкСон' or Format == 'флс' then
return FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Тренд' or Format == 'т' then
return FormatT()..FormatF()
elseif Format == 'Кӏвар' or Format == 'ТрендЛинк' or Format == 'тл' then
return FormatT()..FormatF()..FormatS()
elseif Format == 'ТрендЛинкСон' or Format == 'тлс' then
return FormatT()..FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Диаграмма' or Format == 'д' then
mw.logObject(FormatD())
return FormatD()
elseif Format == 'График' or Format == 'график' then
return styles..FormatG()
else
return FormatTable()
end
return 1, Format
end
return p
n9evjqxhfiuqwyzt0x7y3pymwk4tc3y
102517
102516
2026-11-11T16:37:27Z
M. Omarius
10562
102517
Scribunto
text/plain
local p = {}
local templateIncrease = 'Цӏикӏкӏин'
local templateDecrease = 'Дагьлъи'
local templateNoChange = 'Хисичӏого'
local Regions = mw.loadData("Модуль:Statistical/Regions")
bit32 = require( 'bit32' )
local function LimitDouble(Val)
local MaxNumber = 2147483648
return Val - (math.floor(Val / MaxNumber) * MaxNumber)
end
local function shl(Val, Shift)
if Shift > 0 then
return LimitDouble(Val * (2 ^ Shift))
else
return Value
end
end
local function shr(Val, Shift)
if Shift > 0 then
return math.floor(Val / (2 ^ Shift))
else
return Val
end
end
-- Код основан на алгоритме SuperFastHash:
-- http://www.azillionmonkeys.com/qed/hash.html
local function MakeHash(PlaceName)
local dataLength = mw.ustring.len(PlaceName)
if dataLength == 0 then return 0 end
local hash = dataLength
local remainingBytes = math.fmod(dataLength, 2)
local numberOfLoops = math.floor(dataLength / 2)
local currentIndex = 0
local tmp = 0
while (numberOfLoops > 0) do
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
tmp = bit32.bxor(shl(mw.ustring.codepoint(PlaceName, currentIndex + 2), 11), hash)
hash = bit32.bxor(shl(hash, 16), tmp)
hash = LimitDouble(hash + shr(hash, 11))
currentIndex = currentIndex + 2
numberOfLoops = numberOfLoops - 1
end
if remainingBytes == 1 then
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
hash = bit32.bxor(hash, shl(hash, 10))
hash = LimitDouble(hash + shr(hash, 1))
end
hash = bit32.bxor(hash, shl(hash, 3))
hash = LimitDouble(hash + shr(hash, 5))
hash = bit32.bxor(hash, shl(hash, 4))
hash = LimitDouble(hash + shr(hash, 17))
hash = bit32.bxor(hash, shl(hash, 25))
hash = LimitDouble(hash + shr(hash, 6))
return hash
end
local function First_less_Second(a, b)
local LenA = mw.ustring.len(a)
local LenB = mw.ustring.len(b)
for i = 1, (LenA < LenB) and LenA or LenB do
if mw.ustring.codepoint(a, i, i) ~= mw.ustring.codepoint(b, i, i) then
return mw.ustring.codepoint(a, i, i) < mw.ustring.codepoint(b, i, i)
end
end
return LenA < LenB
end
function GetHashData(PlaceHash)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Население/STA-00"..NumPage else templatename = "Население/STA-0"..NumPage end
local page = mw.title.new(templatename, 10)
local RawData = page:getContent()
HashData = RawData:match("|" .. PlaceHash .. "=([^\n<]+)")
if (HashData=="") then HashData=nil
elseif (tonumber(HashData)~=nil) then HashData=tonumber(HashData) end
return HashData
end
function p.GenerateAndReturnHash(frame)
local args = frame:getParent().args
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
local PlaceHash = MakeHash(PlaceName)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Население/STA-00"..NumPage else templatename = "Население/STA-0"..NumPage end
return PlaceHash..' → '..'[[Template:'..templatename..']]'
end
function p.GetStat(frame)
local args
if frame == mw.getCurrentFrame() then
args = frame:getParent().args
else
args = frame
end
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if args[3] ~= nil and tonumber(args[3]) then args.year = args[3] end
local Format = mw.text.trim ( (args[2] or "Табло"))
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
if Format == 'Хеш' or Format == 'х' then do return MakeHash(PlaceName) end end
local Region = args['Регион'] or ''
local check = args['check'] or ''
if check == '' or check == '0' or check == 'false' then
check = false;
else
check = true;
end
local PlaceData = nil
local RegionData = nil
local CheckRedirect = false
local NeedhandleRedirect = false
local function GetPlaceData()
local PlaceHash = MakeHash(PlaceName)
PlaceData = nil
RegionData = nil
local test = PlaceName:match("%((%P+)%)")
if Region=='' and test~='' then
-- Если в имени населенного пункта есть уточнение с именем региона, то можно не пользоваться индексной таблицей, то есть не вызывать GetHashData
local value = Regions[test]
if(value) then
RegionData = mw.loadData("Модуль:Statistical/"..value)
PlaceData = RegionData[PlaceHash]
end
elseif Region ~= "" then
-- магия, позволяющая указывать не только индекс, но и значение напрямую
Region = Regions[Region] or Region
RegionData = mw.loadData("Модуль:Statistical/"..Region)
PlaceData = RegionData[PlaceHash]
end
if PlaceData == nil then
local RegionPage = GetHashData(PlaceHash)
if RegionPage == 0 then return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Совпадение хешей. Пожалуйста, укажите регион вручную, например <code><nowiki>{{ Халип | " .. PlaceName .. " | " .. Format .." | Регион = Приморский край }}</nowiki></code>" .. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}} end
if RegionPage ~= nil then
if type(tonumber(RegionPage)) == "number" then
-- очень плохая вещь, ибо GetHashData очень дорогая по памяти функция
PlaceHash=tonumber(RegionPage)
RegionPage = GetHashData(PlaceHash)
end
if type(RegionPage) == "table" then RegionPage = RegionPage[PlaceName] end
if RegionPage ~= nil then
RegionData = mw.loadData("Модуль:Statistical/"..RegionPage)
if RegionData ~= nil then PlaceData = RegionData[PlaceHash] end
end
end
end
end
GetPlaceData()
-- Проверка на редирект, если данные не найдены
if PlaceData == nil then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
GetPlaceData()
end
end
local IsWikidata
-- Если данные перемещены из шаблона Население в Wikidata, то работаем с ними
if PlaceData ~= nil then
IsWikidata = PlaceData == "Wikidata"
else
if check then
return 0;
else
--return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные не обнаружены. Возможно, страница переименовывалась. Проверьте справочник".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
-- Вместо прекращения работы при неудаче поиска данных в шаблоне Население попытка поиска в Wikdata
IsWikidata = true
end
end
if check then
return 1;
end
local LastRecord = 0
local Qcode
if IsWikidata then
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
if Qcode == "" then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
end
end
if Qcode == "" then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
if next(mw.wikibase.getBestStatements(Qcode, 'P1082')) == nil then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
else
for k in pairs(PlaceData) do
LastRecord = LastRecord + 1
if args[3] ~= nil and PlaceData[LastRecord][1] == tonumber(args[3]) then
break
end
end
end
local NumRecord = LastRecord
local function FormatY()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatY",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][1]
end
end
local function FormatN()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatN",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][2]
end
end
local function FormatS(SourceType)
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatS",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if ( PlaceData[NumRecord][3] == nil or PlaceData[NumRecord][3] == '' ) then
return ""
else
local Source1
local Source2
if string.find(PlaceData[NumRecord][3],"%d+[A-Z]+")==1 then
if RegionData['Иццал'][PlaceData[NumRecord][3]] ~= nil then
Source1 = RegionData['Иццал'][PlaceData[NumRecord][3]][1]
Source2 = PlaceData[NumRecord][3]
else
Source1 = PlaceData[NumRecord][3] .. '[[Категория:Википедия:Statistical модулалда мекъе иццалгун макъалаби]]'
Source2 = ""
end
else
Source1 = PlaceData[NumRecord][3]
Source2 = ""
end
if string.find(Source1, "https?://")==1 then
Source1 = '['..Source1..']'
end
if SourceType == "и" then
return Source1
end
if Source2 == "" then
return frame:callParserFunction{name = '#tag:ref', args = {Source1}}
else
return frame:callParserFunction{name = '#tag:ref', args = {Source1, name = Source2}}
end
end
end
end
local function FormatF()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatF",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local lang = mw.language.getContentLanguage()
return lang:formatNum( PlaceData[NumRecord][2] )
end
end
local function FormatT()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatT",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if NumRecord > 1 then
if PlaceData[NumRecord][2] > PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateIncrease
}
elseif PlaceData[NumRecord][2] < PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
end
local function FormatD()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatD",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local tempHeight = 320
local tempWidth = 800
mw.logObject(LastRecord)
local tickCount = 5
if LastRecord > 100 then
tickCount = 10
end
local tempMod = math.fmod (LastRecord, tickCount)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k in pairs(PlaceData) do
NumRecord = k
tempGroup = tempGroup .. FormatN() .. ":"
tempTooltip = tempTooltip .. FormatF() .. " (" .. FormatY() .. "):"
if LastRecord < tickCount or math.fmod (k, tickCount) == tempMod then tempLegend = tempLegend .. FormatY() end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Чагӏазул рикӏкӏен',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = frame:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
end
local function FormatG()
local xValues = "|arg:x="
local yValues = "|arg:y1="
if IsWikidata then
xValues, yValues = frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatG",property="p1082[p585][rank:preferred, rank:normal]"} }:match("^(.-);(.*)$")
else
for k in pairs(PlaceData) do
NumRecord = k
xValues = xValues .. FormatY() .. ","
yValues = yValues .. FormatN() .. ","
end
end
local chartParams = "|arg:y1Title=" .. PlaceName .. xValues:gsub(',$', '') .. yValues:gsub(',$', '')
local graph = string.format("{{#chart:Wikidata population (with dynamic data).chart%s}}", chartParams)
local _, count = string.gsub(xValues, ',', '')
local cat = ""
if count <= 3 then
cat = "[[Категория:Википедия:Графикалъе дагьал тӏанкӏал]]"
end
return mw.getCurrentFrame():preprocess( graph .. cat )
end
local function FormatTable()
-- Формирование HTML-таблицы
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode, column = args['Хӏубал'], decor = args['Гӏуцӏи'], titul = args['Бетӏер'], ['property-module']="Statistical/Wikidata",['property-function']="FormatTable",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local HTML = mw.html.create('table')
local MaxData
if args['Хӏубал'] then
Column = tonumber(args['Хӏубал'])
else
Column = 7
end
if Column > LastRecord then Column = LastRecord end
if args['Гӏуцӏи'] ~= nil then
HTML:attr('class', args['Гӏуцӏи'])
else
HTML:attr('class', 'standard')
end
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(args['Бетӏер'] or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('color', 'inherit')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(FormatY()..FormatS("с"))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(FormatT()..FormatF())
end
end
end
return tostring(HTML)
end
end
-- грязный хак для графиков (если вставлять <templatestyles> напрямую, то это ломает версию без форматирования)
-- стили стоит или перенести в Common.css, если графики будут активнее использоваться, или разобрать шаблон на несколько
local styles = frame:extensionTag('templatestyles', '', { src = 'Халип:WikidataChart/styles.css' })
if Format == 'Сон' or Format == 'г' then
mw.logObject(Format)
return FormatY()
elseif Format == 'Безформат' or Format == 'Рикӏкӏен' or Format == 'р' then
return FormatN()
elseif Format == 'Линк' or Format == 'л' then
return FormatS("с")
elseif Format == 'Ицц' or Format == 'и' then
return FormatS("и")
elseif Format == 'Формат' or Format == 'ф' then
return FormatF()
elseif Format == 'ФорматСон' or Format == 'фс' then
return FormatF().." ("..FormatY()..")"
elseif Format == 'ФорматЛинк' or Format == 'фл' then
return FormatF()..FormatS()
elseif Format == 'ФорматЛинкСон' or Format == 'флс' then
return FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Тренд' or Format == 'т' then
return FormatT()..FormatF()
elseif Format == 'Кӏвар' or Format == 'ТрендЛинк' or Format == 'тл' then
return FormatT()..FormatF()..FormatS()
elseif Format == 'ТрендЛинкСон' or Format == 'тлс' then
return FormatT()..FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Диаграмма' or Format == 'д' then
mw.logObject(FormatD())
return FormatD()
elseif Format == 'График' or Format == 'график' then
return styles..FormatG()
else
return FormatTable()
end
return 1, Format
end
return p
lho5mlxpgn1mqc9d3b5t604dawseeib
102528
102517
2026-11-11T17:53:05Z
M. Omarius
10562
102528
Scribunto
text/plain
local p = {}
local templateIncrease = 'Цӏикӏкӏин'
local templateDecrease = 'Дагьлъи'
local templateNoChange = 'Хисичӏого'
local Regions = mw.loadData("Модуль:Statistical/Regions")
bit32 = require( 'bit32' )
local function LimitDouble(Val)
local MaxNumber = 2147483648
return Val - (math.floor(Val / MaxNumber) * MaxNumber)
end
local function shl(Val, Shift)
if Shift > 0 then
return LimitDouble(Val * (2 ^ Shift))
else
return Value
end
end
local function shr(Val, Shift)
if Shift > 0 then
return math.floor(Val / (2 ^ Shift))
else
return Val
end
end
-- Код основан на алгоритме SuperFastHash:
-- http://www.azillionmonkeys.com/qed/hash.html
local function MakeHash(PlaceName)
local dataLength = mw.ustring.len(PlaceName)
if dataLength == 0 then return 0 end
local hash = dataLength
local remainingBytes = math.fmod(dataLength, 2)
local numberOfLoops = math.floor(dataLength / 2)
local currentIndex = 0
local tmp = 0
while (numberOfLoops > 0) do
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
tmp = bit32.bxor(shl(mw.ustring.codepoint(PlaceName, currentIndex + 2), 11), hash)
hash = bit32.bxor(shl(hash, 16), tmp)
hash = LimitDouble(hash + shr(hash, 11))
currentIndex = currentIndex + 2
numberOfLoops = numberOfLoops - 1
end
if remainingBytes == 1 then
hash = LimitDouble(hash + mw.ustring.codepoint(PlaceName, currentIndex + 1))
hash = bit32.bxor(hash, shl(hash, 10))
hash = LimitDouble(hash + shr(hash, 1))
end
hash = bit32.bxor(hash, shl(hash, 3))
hash = LimitDouble(hash + shr(hash, 5))
hash = bit32.bxor(hash, shl(hash, 4))
hash = LimitDouble(hash + shr(hash, 17))
hash = bit32.bxor(hash, shl(hash, 25))
hash = LimitDouble(hash + shr(hash, 6))
return hash
end
local function First_less_Second(a, b)
local LenA = mw.ustring.len(a)
local LenB = mw.ustring.len(b)
for i = 1, (LenA < LenB) and LenA or LenB do
if mw.ustring.codepoint(a, i, i) ~= mw.ustring.codepoint(b, i, i) then
return mw.ustring.codepoint(a, i, i) < mw.ustring.codepoint(b, i, i)
end
end
return LenA < LenB
end
function GetHashData(PlaceHash)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Население/STA-00"..NumPage else templatename = "Население/STA-0"..NumPage end
local page = mw.title.new(templatename, 10)
local RawData = page:getContent()
HashData = RawData:match("|" .. PlaceHash .. "=([^\n<]+)")
if (HashData=="") then HashData=nil
elseif (tonumber(HashData)~=nil) then HashData=tonumber(HashData) end
return HashData
end
function p.GenerateAndReturnHash(frame)
local args = frame:getParent().args
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
local PlaceHash = MakeHash(PlaceName)
local NumPage = math.floor((PlaceHash - 1) / 33554432 + 2)
if NumPage == 2 and (PlaceHash - 1) < 16777216 then NumPage = 1 end
local templatename
if NumPage < 10 then templatename = "Население/STA-00"..NumPage else templatename = "Население/STA-0"..NumPage end
return PlaceHash..' → '..'[[Template:'..templatename..']]'
end
function p.GetStat(frame)
local args
if frame == mw.getCurrentFrame() then
args = frame:getParent().args
else
args = frame
end
if args == nil then return "АТР обйекталъул цӏар хъвай" end
local PlaceName = args[1]
if args[3] ~= nil and tonumber(args[3]) then args.year = args[3] end
local Format = mw.text.trim ( (args[2] or "Табло"))
if PlaceName == nil then return "АТР обйекталъул цӏар хъвай" end
PlaceName = mw.text.trim(PlaceName)
if Format == 'Хеш' or Format == 'х' then do return MakeHash(PlaceName) end end
local Region = args['Регион'] or ''
local check = args['check'] or ''
if check == '' or check == '0' or check == 'false' then
check = false;
else
check = true;
end
local PlaceData = nil
local RegionData = nil
local CheckRedirect = false
local NeedhandleRedirect = false
local function GetPlaceData()
local PlaceHash = MakeHash(PlaceName)
PlaceData = nil
RegionData = nil
local test = PlaceName:match("%((%P+)%)")
if Region=='' and test~='' then
-- Если в имени населенного пункта есть уточнение с именем региона, то можно не пользоваться индексной таблицей, то есть не вызывать GetHashData
local value = Regions[test]
if(value) then
RegionData = mw.loadData("Модуль:Statistical/"..value)
PlaceData = RegionData[PlaceHash]
end
elseif Region ~= "" then
-- магия, позволяющая указывать не только индекс, но и значение напрямую
Region = Regions[Region] or Region
RegionData = mw.loadData("Модуль:Statistical/"..Region)
PlaceData = RegionData[PlaceHash]
end
if PlaceData == nil then
local RegionPage = GetHashData(PlaceHash)
if RegionPage == 0 then return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Совпадение хешей. Пожалуйста, укажите регион вручную, например <code><nowiki>{{ Халип | " .. PlaceName .. " | " .. Format .." | Регион = Приморский край }}</nowiki></code>" .. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}} end
if RegionPage ~= nil then
if type(tonumber(RegionPage)) == "number" then
-- очень плохая вещь, ибо GetHashData очень дорогая по памяти функция
PlaceHash=tonumber(RegionPage)
RegionPage = GetHashData(PlaceHash)
end
if type(RegionPage) == "table" then RegionPage = RegionPage[PlaceName] end
if RegionPage ~= nil then
RegionData = mw.loadData("Модуль:Statistical/"..RegionPage)
if RegionData ~= nil then PlaceData = RegionData[PlaceHash] end
end
end
end
end
GetPlaceData()
-- Проверка на редирект, если данные не найдены
if PlaceData == nil then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
GetPlaceData()
end
end
local IsWikidata
-- Если данные перемещены из шаблона Население в Wikidata, то работаем с ними
if PlaceData ~= nil then
IsWikidata = PlaceData == "Wikidata"
else
if check then
return 0;
else
--return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные не обнаружены. Возможно, страница переименовывалась. Проверьте справочник".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
-- Вместо прекращения работы при неудаче поиска данных в шаблоне Население попытка поиска в Wikdata
IsWikidata = true
end
end
if check then
return 1;
end
local LastRecord = 0
local Qcode
if IsWikidata then
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
if Qcode == "" then
local page = mw.title.makeTitle('', PlaceName)
if page.redirectTarget then
PlaceName = page.redirectTarget.text
Qcode = args.from or mw.wikibase.getEntityIdForTitle(PlaceName) or ""
end
end
if Qcode == "" then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
if next(mw.wikibase.getBestStatements(Qcode, 'P1082')) == nil then
return "#Н/Д"..frame:callParserFunction{name = '#tag:ref', args = {PlaceName .." > Данные в Викиданных не обнаружены. Чтобы устранить ошибку, убедитесь, что на Викиданных заполнен параметр численности населения (P1082) для соответствующего населённого пункта, или проверьте, совпадает ли название населённого пункта в шаблоне с названием соответствующей статьи в Википедии.".. ((args.nocat and "") or "[[Категория:Википедия:Чагӏазул рикӏкӏен халипалъул мекъе параметрабигун макъалаби]]")}}
end
else
for k in pairs(PlaceData) do
LastRecord = LastRecord + 1
if args[3] ~= nil and PlaceData[LastRecord][1] == tonumber(args[3]) then
break
end
end
end
local NumRecord = LastRecord
local function FormatY()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatY",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][1]
end
end
local function FormatN()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatN",property="p1082[p585][rank:preferred, rank:normal]"} }
else
return PlaceData[NumRecord][2]
end
end
local function FormatS(SourceType)
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatS",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if ( PlaceData[NumRecord][3] == nil or PlaceData[NumRecord][3] == '' ) then
return ""
else
local Source1
local Source2
if string.find(PlaceData[NumRecord][3],"%d+[A-Z]+")==1 then
if RegionData['Иццал'][PlaceData[NumRecord][3]] ~= nil then
Source1 = RegionData['Иццал'][PlaceData[NumRecord][3]][1]
Source2 = PlaceData[NumRecord][3]
else
Source1 = PlaceData[NumRecord][3] .. '[[Категория:Википедия:Statistical модулалда мекъе иццалгун макъалаби]]'
Source2 = ""
end
else
Source1 = PlaceData[NumRecord][3]
Source2 = ""
end
if string.find(Source1, "https?://")==1 then
Source1 = '['..Source1..']'
end
if SourceType == "и" then
return Source1
end
if Source2 == "" then
return frame:callParserFunction{name = '#tag:ref', args = {Source1}}
else
return frame:callParserFunction{name = '#tag:ref', args = {Source1, name = Source2}}
end
end
end
end
local function FormatF()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatF",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local lang = mw.language.getContentLanguage()
return lang:formatNum( PlaceData[NumRecord][2] )
end
end
local function FormatT()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatT",property="p1082[p585][rank:preferred, rank:normal]"} }
else
if NumRecord > 1 then
if PlaceData[NumRecord][2] > PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateIncrease
}
elseif PlaceData[NumRecord][2] < PlaceData[NumRecord - 1][2] then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
end
local function FormatD()
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatD",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local tempHeight = 320
local tempWidth = 800
mw.logObject(LastRecord)
local tickCount = 5
if LastRecord > 100 then
tickCount = 10
end
local tempMod = math.fmod (LastRecord, tickCount)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k in pairs(PlaceData) do
NumRecord = k
tempGroup = tempGroup .. FormatN() .. ":"
tempTooltip = tempTooltip .. FormatF() .. " (" .. FormatY() .. "):"
if LastRecord < tickCount or math.fmod (k, tickCount) == tempMod then tempLegend = tempLegend .. FormatY() end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Чагӏазул рикӏкӏен',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = frame:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
end
local function FormatG()
local xValues = "|arg:x="
local yValues = "|arg:y1="
if IsWikidata then
xValues, yValues = frame:expandTemplate{ title = "Wikidata", args={from=Qcode,year=args.year,['property-module']="Statistical/Wikidata",['property-function']="FormatG",property="p1082[p585][rank:preferred, rank:normal]"} }:match("^(.-);(.*)$")
else
for k in pairs(PlaceData) do
NumRecord = k
xValues = xValues .. FormatY() .. ","
yValues = yValues .. FormatN() .. ","
end
end
local chartParams = "|arg:y1Title=" .. PlaceName .. xValues:gsub(',$', '') .. yValues:gsub(',$', '')
local graph = string.format("{{#chart:Wikidata population (with dynamic data).chart%s}}", chartParams)
local _, count = string.gsub(xValues, ',', '')
local cat = ""
if count <= 3 then
cat = "[[Категория:Википедия:Графикалъе дагьал тӏанкӏал]]"
end
return mw.getCurrentFrame():preprocess( graph .. cat )
end
local function FormatTable()
-- Формирование HTML-таблицы
if IsWikidata then
return frame:expandTemplate{ title = "Wikidata", args={from=Qcode, column = args['Хӏубал'], decor = args['Гӏуцӏи'], titul = args['Бетӏер'], ['property-module']="Statistical/Wikidata",['property-function']="FormatTable",property="p1082[p585][rank:preferred, rank:normal]"} }
else
local HTML = mw.html.create('table')
local MaxData
if args['Хӏубал'] then
Column = tonumber(args['Хӏубал'])
else
Column = 7
end
if Column > LastRecord then Column = LastRecord end
if args['Гӏуцӏи'] ~= nil then
HTML:attr('class', args['Гӏуцӏи'])
else
HTML:attr('class', 'wikitable')
end
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(args['Бетӏер'] or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('color', 'inherit')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(FormatY()..FormatS("с"))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if PlaceData[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(FormatT()..FormatF())
end
end
end
return tostring(HTML)
end
end
-- грязный хак для графиков (если вставлять <templatestyles> напрямую, то это ломает версию без форматирования)
-- стили стоит или перенести в Common.css, если графики будут активнее использоваться, или разобрать шаблон на несколько
local styles = frame:extensionTag('templatestyles', '', { src = 'Халип:WikidataChart/styles.css' })
if Format == 'Сон' or Format == 'г' then
mw.logObject(Format)
return FormatY()
elseif Format == 'Безформат' or Format == 'Рикӏкӏен' or Format == 'р' then
return FormatN()
elseif Format == 'Линк' or Format == 'л' then
return FormatS("с")
elseif Format == 'Ицц' or Format == 'и' then
return FormatS("и")
elseif Format == 'Формат' or Format == 'ф' then
return FormatF()
elseif Format == 'ФорматСон' or Format == 'фс' then
return FormatF().." ("..FormatY()..")"
elseif Format == 'ФорматЛинк' or Format == 'фл' then
return FormatF()..FormatS()
elseif Format == 'ФорматЛинкСон' or Format == 'флс' then
return FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Тренд' or Format == 'т' then
return FormatT()..FormatF()
elseif Format == 'Кӏвар' or Format == 'ТрендЛинк' or Format == 'тл' then
return FormatT()..FormatF()..FormatS()
elseif Format == 'ТрендЛинкСон' or Format == 'тлс' then
return FormatT()..FormatF()..FormatS().." ("..FormatY()..")"
elseif Format == 'Диаграмма' or Format == 'д' then
mw.logObject(FormatD())
return FormatD()
elseif Format == 'График' or Format == 'график' then
return styles..FormatG()
else
return FormatTable()
end
return 1, Format
end
return p
lquwmlqefehwxcvo4c1dcw8jmiu0eit
Модуль:Statistical/Wikidata
828
20437
102523
95066
2026-11-11T17:14:50Z
M. Omarius
10562
102523
Scribunto
text/plain
local p={}
local templateIncrease = 'Цӏикӏкӏин'
local templateDecrease = 'Дагьлъи'
local templateNoChange = 'Хисичӏого'
local function deepcopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
local function formatPopulationPropertyImpl( context, options )
if ( not context ) then error( 'context not specified' ); end;
if ( not options ) then error( 'options not specified' ); end;
if ( not options.entity ) then error( 'options.entity missing' ); end;
local claims = context.selectClaims( options, options.property );
if (claims == nil) then
return nil -- TODO error?
end
local validClaims = {}
for _, claim in ipairs( claims ) do
if
claim.mainsnak.snaktype == 'value' and
-- проверка на наличие корректного момента времени
claim.qualifiers.P585[1] and claim.qualifiers.P585[1].snaktype == 'value'
then
table.insert( validClaims, claim )
end
end
if #validClaims == 0 then
return nil -- TODO error?
end
local comparator = function( o1, o2 )
local t1 = context.parseTimeFromSnak( o1.qualifiers.P585[1] )
local t2 = context.parseTimeFromSnak( o2.qualifiers.P585[1] )
return t1 < t2
end
table.sort( validClaims, comparator )
return validClaims
end
local function GetFormatY(claim)
local timeQualifier = claim.qualifiers.P585[1];
if ( timeQualifier.datavalue.value.precision > 9 ) then
timeQualifier = deepcopy( timeQualifier );
timeQualifier.datavalue.value.precision = 9;
end
local datetime = timeQualifier.datavalue.value.time
local sign = string.sub(datetime, 1, 1)
local year = tostring(tonumber(string.sub(datetime, 2, 5)))
if sign == "-" then
return year .. " до н.э."
else
return year
end
end
function p.FormatY(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatY(claims[#claims])
end
local function GetFormatN(claim)
local out = string.gsub(claim.mainsnak.datavalue.value.amount, '+', '')
return out
end
function p.FormatN(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatN(claims[#claims])
end
local function GetFormatS(context, options, claim)
local out = context.formatRefs(options, claim)
return out
end
function p.FormatS(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local out = GetFormatS(context, options, claims[#claims])
return out
end
local function GetFormatF(context, options, claim)
local out = context.formatSnak( options, claim.mainsnak )
out = string.gsub(out, '<[^>]*>', '')
out = string.gsub(out, '%s*±.+', '')
return out
end
function p.FormatF(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatF(context, options, claims[#claims])
end
local function GetFormatT(claims, index)
if index > 1 then
local FirstClaim = tonumber(claims[index].mainsnak.datavalue.value.amount)
local SecondClaim = tonumber(claims[index-1].mainsnak.datavalue.value.amount)
local frame = mw.getCurrentFrame()
if FirstClaim > SecondClaim then
return frame:expandTemplate{
title = templateIncrease
}
elseif FirstClaim < SecondClaim then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
function p.FormatT(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatT(claims, #claims)
end
function p.FormatD(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local LastRecord = #claims
local tempHeight = 320
local tempWidth = 800
local tempMod = math.fmod (LastRecord, 5)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k, claim in ipairs( claims ) do
tempGroup = tempGroup .. GetFormatN(claim) .. ":"
tempTooltip = tempTooltip .. GetFormatF(context, options, claim) .. " (" .. GetFormatY(claim) .. "):"
if LastRecord < 5 or math.fmod (k, 5) == tempMod then tempLegend = tempLegend .. GetFormatY(claim) end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Чагӏазул рикӏкӏен',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = cframe:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
function p.FormatG(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local xValues = '|arg:x='
local yValues = '|arg:y1='
for _, claim in ipairs( claims ) do
xValues = xValues .. GetFormatY(claim) .. ','
yValues = yValues .. GetFormatN(claim) .. ','
end
return xValues .. ';' .. yValues
end
function p.FormatTable(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local HTML = mw.html.create('table')
local LastRecord = #claims
local NumRecord
local MaxData
local Column = tonumber(options.column or 7)
if Column > LastRecord then Column = LastRecord end
HTML:attr('class', options.decor or 'standard')
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(options.titul or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
:css('color', 'inherit')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if claims[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(GetFormatY(claims[NumRecord])..GetFormatS(context, options, claims[NumRecord]))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if claims[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(GetFormatT(claims, NumRecord)..GetFormatF(context, options, claims[NumRecord]))
end
end
end
return tostring(HTML)
end
return p
3d04mmj4p0cnb14wv4yxhbqjzlr5vz7
102529
102523
2026-11-11T18:32:17Z
M. Omarius
10562
102529
Scribunto
text/plain
local p={}
local templateIncrease = 'Цӏикӏкӏин'
local templateDecrease = 'Дагьлъи'
local templateNoChange = 'Хисичӏого'
local function deepcopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
local function formatPopulationPropertyImpl( context, options )
if ( not context ) then error( 'context not specified' ); end;
if ( not options ) then error( 'options not specified' ); end;
if ( not options.entity ) then error( 'options.entity missing' ); end;
local claims = context.selectClaims( options, options.property );
if (claims == nil) then
return nil -- TODO error?
end
local validClaims = {}
for _, claim in ipairs( claims ) do
if
claim.mainsnak.snaktype == 'value' and
-- проверка на наличие корректного момента времени
claim.qualifiers.P585[1] and claim.qualifiers.P585[1].snaktype == 'value'
then
table.insert( validClaims, claim )
end
end
if #validClaims == 0 then
return nil -- TODO error?
end
local comparator = function( o1, o2 )
local t1 = context.parseTimeFromSnak( o1.qualifiers.P585[1] )
local t2 = context.parseTimeFromSnak( o2.qualifiers.P585[1] )
return t1 < t2
end
table.sort( validClaims, comparator )
return validClaims
end
local function GetFormatY(claim)
local timeQualifier = claim.qualifiers.P585[1];
if ( timeQualifier.datavalue.value.precision > 9 ) then
timeQualifier = deepcopy( timeQualifier );
timeQualifier.datavalue.value.precision = 9;
end
local datetime = timeQualifier.datavalue.value.time
local sign = string.sub(datetime, 1, 1)
local year = tostring(tonumber(string.sub(datetime, 2, 5)))
if sign == "-" then
return year .. " НЩ"
else
return year
end
end
function p.FormatY(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatY(claims[#claims])
end
local function GetFormatN(claim)
local out = string.gsub(claim.mainsnak.datavalue.value.amount, '+', '')
return out
end
function p.FormatN(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatN(claims[#claims])
end
local function GetFormatS(context, options, claim)
local out = context.formatRefs(options, claim)
return out
end
function p.FormatS(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local out = GetFormatS(context, options, claims[#claims])
return out
end
local function GetFormatF(context, options, claim)
local out = context.formatSnak( options, claim.mainsnak )
out = string.gsub(out, '<[^>]*>', '')
out = string.gsub(out, '%s*±.+', '')
return out
end
function p.FormatF(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatF(context, options, claims[#claims])
end
local function GetFormatT(claims, index)
if index > 1 then
local FirstClaim = tonumber(claims[index].mainsnak.datavalue.value.amount)
local SecondClaim = tonumber(claims[index-1].mainsnak.datavalue.value.amount)
local frame = mw.getCurrentFrame()
if FirstClaim > SecondClaim then
return frame:expandTemplate{
title = templateIncrease
}
elseif FirstClaim < SecondClaim then
return frame:expandTemplate{
title = templateDecrease
}
else
return frame:expandTemplate{
title = templateNoChange
}
end
else
return ""
end
end
function p.FormatT(context, options)
local claims = formatPopulationPropertyImpl( context, options );
return GetFormatT(claims, #claims)
end
function p.FormatD(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local LastRecord = #claims
local tempHeight = 320
local tempWidth = 800
local tempMod = math.fmod (LastRecord, 5)
if LastRecord < 40 then
tempHeight = 200 + 170 * (LastRecord - 1) / 40
tempWidth = 200 + 600 * (LastRecord - 1) / 40
end
local tempGroup = ""
local tempTooltip = ""
local tempLegend = ""
for k, claim in ipairs( claims ) do
tempGroup = tempGroup .. GetFormatN(claim) .. ":"
tempTooltip = tempTooltip .. GetFormatF(context, options, claim) .. " (" .. GetFormatY(claim) .. "):"
if LastRecord < 5 or math.fmod (k, 5) == tempMod then tempLegend = tempLegend .. GetFormatY(claim) end
tempLegend = tempLegend .. ":"
end
tempGroup = string.sub (tempGroup, 1, string.len (tempGroup)-1)
tempTooltip = string.sub (tempTooltip, 1, string.len (tempTooltip)-1)
tempLegend = string.sub (tempLegend, 1, string.len (tempLegend)-1)
local barChartFunc = require('Модуль:Chart')['bar chart'];
local Diagram = {
['height'] = tempHeight,
['width'] = tempWidth,
['group 1'] = tempGroup,
['tooltip 1'] = tempTooltip,
['colors'] = "#B0C4DE",
['x legends'] = tempLegend,
['group names'] = 'Чагӏазул рикӏкӏен',
['default color'] = '#1E90FF'
}
local cframe = mw.getCurrentFrame();
local barChart = barChartFunc(cframe:newChild{ title=cframe.title, args = Diagram})
local ts = cframe:extensionTag{ name = 'templatestyles', content = '', args = { src = 'Module:Statistical/styles.css' } }
return ts .. mw.text.tag( 'div', { class = 'ts-statistical' }, barChart )
end
function p.FormatG(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local xValues = '|arg:x='
local yValues = '|arg:y1='
for _, claim in ipairs( claims ) do
xValues = xValues .. GetFormatY(claim) .. ','
yValues = yValues .. GetFormatN(claim) .. ','
end
return xValues .. ';' .. yValues
end
function p.FormatTable(context, options)
local claims = formatPopulationPropertyImpl( context, options );
local HTML = mw.html.create('table')
local LastRecord = #claims
local NumRecord
local MaxData
local Column = tonumber(options.column or 7)
if Column > LastRecord then Column = LastRecord end
HTML:attr('class', options.decor or 'wikitable')
local TempRow
local NumRow = 0
HTML:tag('caption')
:wikitext(options.titul or 'Чагӏазул рикӏкӏен')
:css('background-color', 'var(--ruwiki-background-color-blue200, #cfe3ff)')
:css('border', '1px solid var(--border-color-base, #a2a9b1)')
:css('border-bottom', '0')
:css('color', 'inherit')
for i = 1, math.ceil(LastRecord / Column) do
TempRow = HTML:tag('tr')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if claims[NumRecord] == nil then
TempRow:tag('th'):attr('scope', 'col'):wikitext("")
else
TempRow:tag('th'):attr('scope', 'col'):wikitext(GetFormatY(claims[NumRecord])..GetFormatS(context, options, claims[NumRecord]))
end
end
TempRow = HTML:tag('tr'):css('text-align', 'center')
for j = 1, Column do
NumRecord = (i - 1) * Column + j
if claims[NumRecord] == nil then
TempRow:tag('td'):wikitext("")
else
TempRow:tag('td'):wikitext(GetFormatT(claims, NumRecord)..GetFormatF(context, options, claims[NumRecord]))
end
end
end
return tostring(HTML)
end
return p
52pzkkbxdie6i580dflnxpqqnlszgjr
Кӏележугъ (Дохъузпара мухъ)
0
22399
102501
2026-11-11T12:11:12Z
M. Omarius
10562
Новая страница: «{{Infobox Dagestan inhabited locality | av_name = Кӏележугъ | loc_name1 = | loc_lang1 = | image_skyline = | image_caption = Росдал сурат | district_map = Russia Dagestan Dokuzpara District | coordinates = | elevation_m = | adm_district_jur = [[Дохъузпара мухъ]] | adm_selsoviet_jur = Кӏележуг...»
102501
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Кӏележугъ
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Dokuzpara District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Кӏележугъ росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Кӏележугъ (Дохъузпара мухъ)|р}}
| pop_latest_date = {{ЧР|Кӏележугъ (Дохъузпара мухъ)|с}}
| pop_latest_ref = {{ЧР|Кӏележугъ (Дохъузпара мухъ)|л}}
| population_demonym =
| ethnicity = [[Куралал]]
| adm_ctr_of1 = Кӏележугъ росдал поселениялъул
| rural_settlement_jur = ''«Кӏележугъ росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Кӏележугъ''' яги '''Къалажухъ'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 33}}</ref> ({{langx|lez|Кӏележугъ}}, яги {{lang|lez|Кӏелет}}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Кӏележугъ росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== Этимология ==
Курал мацӏалда росдал цӏар бачӏараб буго {{lang|lex|кӏеле|italic=yes}} 'хъала, кӏалгӏа' абураб рагӏудаса.<ref>{{Cite web|url=https://www.alamjurnal.com/3044-osobennosti-stanovleniya-gogazskogo-selskogo-obshhestva-ahtyparinskogo-naibstva-samurskogo-okruga/|title=ОСОБЕННОСТИ СТАНОВЛЕНИЯ ГОГАЗСКОГО СЕЛЬСКОГО ОБЩЕСТВА АХТЫПАРИНСКОГО НАИБСТВА САМУРСКОГО ОКРУГА|lang=ru|last=murugvi|website=АЛАМ|date=2020-06-26|access-date=2024-03-05|archive-date=2024-03-03|archive-url=https://web.archive.org/web/20240303231443/https://www.alamjurnal.com/3044-osobennosti-stanovleniya-gogazskogo-selskogo-obshhestva-ahtyparinskogo-naibstva-samurskogo-okruga/|url-status=live}}</ref>
== География ==
Росу буго мухъалъул центер [[Ушугъ|Ушугъалдаса]] 9 км-лъ жанубалдехун.
== Демография==
{{ЧР|Кӏележугъ}}
{{ЧР|Кӏележугъ|д}}
== Муниципалаб статус ==
Кӏележугъ росдаца гӀуцӀула гьебго цӀар бугеб муниципалитат.
Муницпалаб гӀуцӀалил гӀатӀилъи буго 15.52 км<sup>2</sup><ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title= Республика Дагестан. Общая площадь земель муниципального образования|trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-05-11 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref> (мухъалъул территориялъул {{#expr: 15.52 * 100 / {{Infobox Dagestanian district/area|Дохъузпара район}} round 2|R}} %).
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
c6pahwgt2nx45nprfdi3s5kj4xmksc6
102502
102501
2026-11-11T12:11:51Z
M. Omarius
10562
102502
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Кӏележугъ
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Dokuzpara District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Кӏележугъ росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Кӏележугъ (Дохъузпара мухъ)|р}}
| pop_latest_date = {{ЧР|Кӏележугъ (Дохъузпара мухъ)|с}}
| pop_latest_ref = {{ЧР|Кӏележугъ (Дохъузпара мухъ)|л}}
| population_demonym =
| ethnicity = [[Куралал]]
| adm_ctr_of1 = Кӏележугъ росдал поселениялъул
| rural_settlement_jur = ''«Кӏележугъ росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Кӏележугъ''' яги '''Къалажухъ'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 33}}</ref> ({{langx|lez|Кӏележугъ}}, яги {{lang|lez|Кӏелет}}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Кӏележугъ росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== Этимология ==
Курал мацӏалда росдал цӏар бачӏараб буго {{lang|lex|кӏеле|italic=yes}} 'хъала, кӏалгӏа' абураб рагӏудаса.<ref>{{Cite web|url=https://www.alamjurnal.com/3044-osobennosti-stanovleniya-gogazskogo-selskogo-obshhestva-ahtyparinskogo-naibstva-samurskogo-okruga/|title=ОСОБЕННОСТИ СТАНОВЛЕНИЯ ГОГАЗСКОГО СЕЛЬСКОГО ОБЩЕСТВА АХТЫПАРИНСКОГО НАИБСТВА САМУРСКОГО ОКРУГА|lang=ru|last=murugvi|website=АЛАМ|date=2020-06-26|access-date=2024-03-05|archive-date=2024-03-03|archive-url=https://web.archive.org/web/20240303231443/https://www.alamjurnal.com/3044-osobennosti-stanovleniya-gogazskogo-selskogo-obshhestva-ahtyparinskogo-naibstva-samurskogo-okruga/|url-status=live}}</ref>
== География ==
Росу буго мухъалъул центер [[Ушугъ|Ушугъалдаса]] 9 км-лъ жанубалдехун.
== Демография==
{{ЧР|Кӏележугъ (Дохъузпара мухъ)}}
{{ЧР|Кӏележугъ (Дохъузпара мухъ)|д}}
== Муниципалаб статус ==
Кӏележугъ росдаца гӀуцӀула гьебго цӀар бугеб муниципалитат.
Муницпалаб гӀуцӀалил гӀатӀилъи буго 15.52 км<sup>2</sup><ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title= Республика Дагестан. Общая площадь земель муниципального образования|trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-05-11 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref> (мухъалъул территориялъул {{#expr: 15.52 * 100 / {{Infobox Dagestanian district/area|Дохъузпара район}} round 2|R}} %).
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
ku2r34meljeuf0lq71plm9slo47mjzh
Мискискар
0
22400
102503
2026-11-11T12:35:19Z
M. Omarius
10562
Новая страница: «{{Infobox Dagestan inhabited locality | av_name = Мискискар | loc_name1 = | loc_lang1 = | image_skyline = | image_caption = Росдал сурат | district_map = Russia Dagestan Dokuzpara District | coordinates = | elevation_m = | adm_district_jur = [[Дохъузпара мухъ]] | adm_selsoviet_jur = Мискиска...»
102503
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Мискискар
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Dokuzpara District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Мискискар росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Мискискар|р}}
| pop_latest_date = {{ЧР|Мискискар|с}}
| pop_latest_ref = {{ЧР|Мискискар|л}}
| population_demonym =
| ethnicity = [[Куралал]]
| adm_ctr_of1 = Мискискар росдал поселениялъул
| rural_settlement_jur = ''«Мискискар росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Мискискар'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 34}}</ref> ({{langx|lez|Ккрар}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Мискискар росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== География ==
Росу буго мухъалъул центер [[Ушугъ|Ушугъалдаса]] 6 км-лъ бакътӏерхьудехун.
== Демография==
{{ЧР|Мискискар}}
{{ЧР|Мискискар|д}}
== Муниципалаб статус ==
Мискискар росдаца гӀуцӀула гьебго цӀар бугеб муниципалитат.
Муницпалаб гӀуцӀалил гӀатӀилъи буго 51.38 км<sup>2</sup><ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title= Республика Дагестан. Общая площадь земель муниципального образования|trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-05-11 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref> (мухъалъул территориялъул {{#expr: 51.38 * 100 / {{Infobox Dagestanian district/area|Дохъузпара район}} round 2|R}} %).
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
3glwh1kzo84dzgcf9c2tmihzs6py8o7
102504
102503
2026-11-11T12:35:48Z
M. Omarius
10562
102504
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Мискискар
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Dokuzpara District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Мискискар росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Мискискар|р}}
| pop_latest_date = {{ЧР|Мискискар|с}}
| pop_latest_ref = {{ЧР|Мискискар|л}}
| population_demonym =
| ethnicity = [[Куралал]]
| adm_ctr_of1 = Мискискар росдал поселениялъул
| rural_settlement_jur = ''«Мискискар росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Мискискар'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 34}}</ref> ({{langx|lez|Мискискар}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Мискискар росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== География ==
Росу буго мухъалъул центер [[Ушугъ|Ушугъалдаса]] 6 км-лъ бакътӏерхьудехун.
== Демография==
{{ЧР|Мискискар}}
{{ЧР|Мискискар|д}}
== Муниципалаб статус ==
Мискискар росдаца гӀуцӀула гьебго цӀар бугеб муниципалитат.
Муницпалаб гӀуцӀалил гӀатӀилъи буго 51.38 км<sup>2</sup><ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title= Республика Дагестан. Общая площадь земель муниципального образования|trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-05-11 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref> (мухъалъул территориялъул {{#expr: 51.38 * 100 / {{Infobox Dagestanian district/area|Дохъузпара район}} round 2|R}} %).
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
f66uklrygr7lf3fmxdqy9isq1xcomvq
Цӏияб Карар
0
22401
102506
2026-11-11T12:41:38Z
M. Omarius
10562
Новая страница: «{{Infobox Dagestan inhabited locality | av_name = Цӏияб Карар | loc_name1 = | loc_lang1 = | image_skyline = | image_caption = Росдал сурат | district_map = Russia Dagestan Dokuzpara District | coordinates = | elevation_m = | adm_district_jur = [[Дохъузпара мухъ]] | adm_selsoviet_jur = Цӏияб К...»
102506
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Цӏияб Карар
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Dokuzpara District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Цӏияб Карар росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Цӏияб Карар|р}}
| pop_latest_date = {{ЧР|Цӏияб Карар|с}}
| pop_latest_ref = {{ЧР|Цӏияб Карар|л}}
| population_demonym =
| ethnicity = [[Куралал]]
| adm_ctr_of1 = Цӏияб Карар росдал поселениялъул
| rural_settlement_jur = ''«Цӏияб Карар росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Цӏияб Карар''' яги '''Цӏияб Каракура'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 34}}</ref> ({{langx|lez|Цӏийи Крар}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Цӏияб Карар росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== География ==
Росу буго мухъалъул центер [[Ушугъ|Ушугъалдаса]] 3.5 км-лъ шималияб бакъбаккудехун.
== Демография==
{{ЧР|Цӏияб Карар}}
{{ЧР|Цӏияб Карар|д}}
== Муниципалаб статус ==
Цӏияб Карар росдаца гӀуцӀула гьебго цӀар бугеб муниципалитат.
Муницпалаб гӀуцӀалил гӀатӀилъи буго 16.33 км<sup>2</sup><ref name='82_8006001'>{{Cite web |url=http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 |title= Республика Дагестан. Общая площадь земель муниципального образования|trans-title= Дагъистаналъул Республика. Муниципалаб гӀуцӀалил ракьазул тӀолаб гӀатӀилъи |access-date=2016-05-11 |archive-date=2017-08-06 |archive-url=https://web.archive.org/web/20170806223020/http://www.gks.ru/dbscripts/munst/munst82/DBInet.cgi?pl=8006001 }}</ref> (мухъалъул территориялъул {{#expr: 16.33 * 100 / {{Infobox Dagestanian district/area|Дохъузпара район}} round 2|R}} %).
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
bnnx35p55pp74alq2yjc800j9jg0x8t
Авадан (росу)
0
22402
102507
2026-11-11T12:52:22Z
M. Omarius
10562
Новая страница: «{{Infobox Dagestan inhabited locality | av_name = Авадан | loc_name1 = | loc_lang1 = | image_skyline = | image_caption = Росдал сурат | district_map = Russia Dagestan Derbent District | coordinates = | elevation_m = | adm_district_jur = [[Дохъузпара мухъ]] | adm_selsoviet_jur = Авадан росу | a...»
102507
wikitext
text/x-wiki
{{Infobox Dagestan inhabited locality
| av_name = Авадан
| loc_name1 =
| loc_lang1 =
| image_skyline =
| image_caption = Росдал сурат
| district_map = Russia Dagestan Derbent District
| coordinates =
| elevation_m =
| adm_district_jur = [[Дохъузпара мухъ]]
| adm_selsoviet_jur = Авадан росу
| adm_selsoviet_type = Росдал поселение
| inhabloc_type = Росу
| pop_latest = {{ЧР|Авадан (росу)|р}}
| pop_latest_date = {{ЧР|Авадан (росу)|с}}
| pop_latest_ref = {{ЧР|Авадан (росу)|л}}
| population_demonym =
| ethnicity = [[Куралал]], [[агъулал]], [[рутулал]]
| adm_ctr_of1 = Авадан росдал поселениялъул
| rural_settlement_jur = ''«Авадан росу»'' муниципалаб гӀуцӀел
| mun_admctr_of1 = <ref name="RDagestan_mun"/>
| website =
}}
'''Авадан'''<ref>{{cite book|title= МагӀарухъ ЖумхӀурият (Дагъистан Республика): Административияб рикьи|date= 2013|url= |publisher= [[Авар национал-културияб автономия|МагӀарул миллиябгун маданияб автономия]]|place= МахӀачхъала|page= 33}}</ref> ({{langx|lez|Авадан}}) буго [[Дагъистан|Дагъистаналъул]] [[Дохъузпара мухъ|Дохъузпара мухъалъул]] росу.
Эб уна росдал поселениялъул статус бугеб ''Авадан росу'' абураб муниципалаб гӀуцӀалида гъорлӀе цохӀо бугеб росу гӀадин.<ref name="RDagestan_mun"/>
== География ==
Росу ккола анклав, Чор мухъалъул территориялда бугеб, Дербенд шагьаралдаса 15 км-лъ жанубалдехун, Рубас гӏорухъ.
== Демография==
{{ЧР|Авадан (росу)}}
{{ЧР|Авадан (росу)|д}}
; Националаб гӏуцӏи
2021 сонил тӏолго россиялъулаб чагӏазул рикӏкӏен хъвавул баназда рекъон:<ref>{{cite web|url=http://lingvarium.org/russia/2021/%d0%94%d0%b0%d0%b3%d0%b5%d1%81%d1%82%d0%b0%d0%bd%20(82)_%d0%bd%d0%b0%d1%86.xlsx|title=Данные Всероссийской переписи населения 2021 года|archive-date=2024-08-02|access-date=2025-07-21|archive-url=https://web.archive.org/web/20240802061601/http://lingvarium.org/russia/2021/%D0%94%D0%B0%D0%B3%D0%B5%D1%81%D1%82%D0%B0%D0%BD%20(82)_%D0%BD%D0%B0%D1%86.xlsx|url-status=live}}</ref>
{|class="wikitable"
|-
!Этникияб<br>къокъа
!Рикӏкӏен,<br>чи
!Бутӏа<br> %
|-
|[[куралал]]
| align="right" | 2,192
| align="right" | 76.70 %
|-
|[[рутулал]]
| align="right" |330
| align="right" |11.54 %
|-
|[[агъулал]]
| align="right" |254
| align="right" |8.88 %
|-
|цогидал
| align="right" | 82
| align="right" | 2.88 %
|-
|'''киналниги'''
| align="right" | '''2,858'''
| align="right" | 100 %
|}
== МугъчӀваял ==
{{МугъчӀваял}}
{{Дохъузпара мухъ|rosu}}
[[Категория:Дохъузпара мухъалъул росаби]]
jqzfsn1sqpu21b6qs5wqdoh9kr8ts83
Халип:Гӏей
10
22403
102509
2026-11-11T13:54:24Z
M. Omarius
10562
Новая страница: «[[File:Increase2.svg|{{{size|11px}}}|alt={{{1|Increase}}}|link=|{{{1|Increase}}}]]<noinclude> {{documentation}} </noinclude>»
102509
wikitext
text/x-wiki
[[File:Increase2.svg|{{{size|11px}}}|alt={{{1|Increase}}}|link=|{{{1|Increase}}}]]<noinclude>
{{documentation}}
</noinclude>
pjwfj56472ptd30nio6ml3f3abtvuf1
Халип:Fluctuation formatter
10
22404
102510
2026-11-11T13:56:11Z
M. Omarius
10562
Новая страница: «{{#switch:{{{type|{{{2|maximize}}}}}}<!-- Check type and use appropriate symbols --> | maximize = {{#switch:1 | {{#expr: {{formatnum:{{{1}}}|R}} > {{{threshold|0}}}}} = {{Increase}}{{nbs}}{{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}} | {{#expr: {{formatnum:{{{1}}}|R}} < -{{{threshold|0}}}}} = {{Decrease}}{{nbs}}{{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}} | {{#expr: abs{{formatnum:{{{1}}}|R}} <= {{{threshold|...»
102510
wikitext
text/x-wiki
{{#switch:{{{type|{{{2|maximize}}}}}}<!-- Check type and use appropriate symbols -->
| maximize = {{#switch:1
| {{#expr: {{formatnum:{{{1}}}|R}} > {{{threshold|0}}}}} = {{Increase}}{{nbs}}{{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: {{formatnum:{{{1}}}|R}} < -{{{threshold|0}}}}} = {{Decrease}}{{nbs}}{{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: abs{{formatnum:{{{1}}}|R}} <= {{{threshold|0}}}}} = {{Steady}}{{nbs}}{{#switch:1<!-- Check value and display number or steady label -->
| {{#expr: {{formatnum:{{{1}}}|R}} > 0}} = {{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: {{formatnum:{{{1}}}|R}} < 0}} = {{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}}
| 1 = {{{display|{{{custom label|{{{steady label|no change}}}}}}}}}
}}
| 1 = <includeonly>{{Error|Error: Unrecognized value.}}</includeonly>
}}
| minimize = {{#switch:1
| {{#expr: {{formatnum:{{{1}}}|R}} > {{{threshold|0}}}}} = {{IncreaseNegative}}{{nbs}}{{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: {{formatnum:{{{1}}}|R}} < -{{{threshold|0}}}}} = {{DecreasePositive}}{{nbs}}{{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: abs{{formatnum:{{{1}}}|R}} <= {{{threshold|0}}}}} = {{Steady}}{{nbs}}{{#switch:1<!-- Check value and display number or steady label -->
| {{#expr: {{formatnum:{{{1}}}|R}} > 0}} = {{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: {{formatnum:{{{1}}}|R}} < 0}} = {{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}}
| 1 = {{{display|{{{custom label|{{{steady label|no change}}}}}}}}}
}}
| 1 = <includeonly>{{Error|Error: Unrecognized value.}}</includeonly>
}}
| neutral = {{#switch:1
| {{#expr: {{formatnum:{{{1}}}|R}} > {{{threshold|0}}}}} = {{IncreaseNeutral}}{{nbs}}{{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: {{formatnum:{{{1}}}|R}} < -{{{threshold|0}}}}} = {{DecreaseNeutral}}{{nbs}}{{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: abs{{formatnum:{{{1}}}|R}} <= {{{threshold|0}}}}} = {{Steady}}{{nbs}}{{#switch:1<!-- Check value and display number or steady label -->
| {{#expr: {{formatnum:{{{1}}}|R}} > 0}} = {{{display|{{{custom label|+{{#expr:{{formatnum:{{{1}}}|R}}}}}}}}}}
| {{#expr: {{formatnum:{{{1}}}|R}} < 0}} = {{{display|{{{custom label|−{{#expr:abs{{formatnum:{{{1}}}|R}}}}}}}}}}
| 1 = {{{display|{{{custom label|{{{steady label|no change}}}}}}}}}
}}
| 1 = <includeonly>{{Error|Error: Unrecognized value.}}</includeonly>
}}
| {{{type|{{{2|maximize}}}}}} = {{Error|Error: Unrecognized type. Please use "maximize", "minimize", or "neutral".}}
}}<noinclude>
{{Documentation}}
</noinclude>
bnr8dpsv7d9oua4km4w612nlcae2doy
Халип:Борти
10
22405
102512
2026-11-11T14:47:47Z
M. Omarius
10562
Новая страница: «[[File:Decrease2.svg|{{{size|11px}}}|alt={{{1|Decrease}}}|link=|{{{1|Decrease}}}]]<noinclude> {{Documentation}} </noinclude>»
102512
wikitext
text/x-wiki
[[File:Decrease2.svg|{{{size|11px}}}|alt={{{1|Decrease}}}|link=|{{{1|Decrease}}}]]<noinclude>
{{Documentation}}
</noinclude>
nm6l27i9rcol0j9wxptzdcampxcrppc
Халип:Чагӏазул рикӏкӏен
10
22406
102515
2026-11-11T15:55:28Z
M. Omarius
10562
Новая страница: «{{#invoke:Statistical/салулгъамас | GetStat }}<noinclude> {{doc}} </noinclude>»
102515
wikitext
text/x-wiki
{{#invoke:Statistical/салулгъамас | GetStat }}<noinclude>
{{doc}}
</noinclude>
8fbkhrd8gynhnzre1440movfvlmhdce
Халип:Wikidata/Population/Table
10
22407
102521
2026-11-11T16:59:13Z
M. Omarius
10562
Новая страница: «<templatestyles src="Халип:Wikidata/Population/Table/styles.css" />{{#invoke:Wikidata|formatProperty |property-module=Wikidata/Population |property-function=formatPopulationPropertyForTable |claim-module=Wikidata/Population |claim-function=formatPopulationClaimForTable |property=p1082[p585][rank:preferred, rank:normal] |unit=- |datatype=quantity |references={{{references|}}} }}<noinclude> {{doc}} </noinclude>»
102521
wikitext
text/x-wiki
<templatestyles src="Халип:Wikidata/Population/Table/styles.css" />{{#invoke:Wikidata|formatProperty
|property-module=Wikidata/Population
|property-function=formatPopulationPropertyForTable
|claim-module=Wikidata/Population
|claim-function=formatPopulationClaimForTable
|property=p1082[p585][rank:preferred, rank:normal]
|unit=-
|datatype=quantity
|references={{{references|}}}
}}<noinclude>
{{doc}}
</noinclude>
co8z55wk27es4eak1751ke7gz3zfaqj
Халип:Wikidata/Population/Table/styles.css
10
22408
102522
2026-11-11T17:00:17Z
M. Omarius
10562
Новая страница: «.ts-wikidata-population-table { margin-top: 1em; margin-bottom: 1em; max-width: 60em; } .ts-wikidata-population-table.cols-1 { max-width: 14em; } .ts-wikidata-population-table.cols-2 { max-width: 28em; } .ts-wikidata-population-table.cols-3 { max-width: 42em; } .ts-wikidata-population-table.cols-4 { max-width: 56em; } .ts-wikidata-population-table table { display: block; margin-top: 0; margin-bottom: 0; border: 0; background: tra...»
102522
sanitized-css
text/css
.ts-wikidata-population-table {
margin-top: 1em;
margin-bottom: 1em;
max-width: 60em;
}
.ts-wikidata-population-table.cols-1 {
max-width: 14em;
}
.ts-wikidata-population-table.cols-2 {
max-width: 28em;
}
.ts-wikidata-population-table.cols-3 {
max-width: 42em;
}
.ts-wikidata-population-table.cols-4 {
max-width: 56em;
}
.ts-wikidata-population-table table {
display: block;
margin-top: 0;
margin-bottom: 0;
border: 0;
background: transparent;
}
.ts-wikidata-population-table caption {
display: block;
margin-bottom: .5em;
text-align: left;
}
.ts-wikidata-population-table tbody {
column-width: 13em;
display: block;
}
.ts-wikidata-population-table tr {
display: block;
margin-bottom: -1px;
}
.ts-wikidata-population-table tr:last-child {
margin-bottom: 0;
}
.ts-wikidata-population-table tr,
.ts-wikidata-population-table th,
.ts-wikidata-population-table td {
break-inside: avoid;
}
.ts-wikidata-population-table th {
width: 3em;
}
.ts-wikidata-population-table th + th {
width: 8em;
}
.ts-wikidata-population-table td {
background: var(--background-color-neutral-subtle, #f8f9fa);
}
.ts-wikidata-population-table td:nth-child(2) {
width: 8em;
text-align: right;
}
.ts-wikidata-population-table td:nth-child(3) {
width: 2em;
text-align: left;
border-left: none;
padding-left: 0;
}
e34kuq7i260d1rdzv3q1t0rbg8dwad1
Халип:WikidataChart/styles.css
10
22409
102524
2026-11-11T17:16:04Z
M. Omarius
10562
Новая страница: «wiki-chart { border-style: solid; border-width: thin; clear: none; padding: 5px; width: 800px; margin: 10px 0; overflow: auto; }»
102524
sanitized-css
text/css
wiki-chart {
border-style: solid;
border-width: thin;
clear: none;
padding: 5px;
width: 800px;
margin: 10px 0;
overflow: auto;
}
bhn2zsc9m5lasq66rzsrser109hu2vl
Халип:WikidataChart
10
22410
102525
2026-11-11T17:26:33Z
M. Omarius
10562
Новая страница: «<includeonly><templatestyles src="Халип:WikidataChart/styles.css"/>{{#invoke:WikidataChart|plotWrapper}}</includeonly><noinclude>{{doc}}</noinclude>»
102525
wikitext
text/x-wiki
<includeonly><templatestyles src="Халип:WikidataChart/styles.css"/>{{#invoke:WikidataChart|plotWrapper}}</includeonly><noinclude>{{doc}}</noinclude>
omvad4jad7n4p879yyobxcy2qllh81t
Халип:Цӏикӏкӏин
10
22411
102526
2026-11-11T17:46:44Z
M. Omarius
10562
Новая страница: «<templatestyles src="Халип:Динамика/styles.css"/><span class=ts-up-arrow>↗</span><noinclude> {{doc}} </noinclude>»
102526
wikitext
text/x-wiki
<templatestyles src="Халип:Динамика/styles.css"/><span class=ts-up-arrow>↗</span><noinclude>
{{doc}}
</noinclude>
ridnkxyviie4ge3qb3y7756cb8zcbu3
Халип:Динамика/styles.css
10
22412
102527
2026-11-11T17:48:55Z
M. Omarius
10562
Новая страница: «.ts-profit::before, .ts-loss::before, .ts-stalledprofit::before, .ts-up::before, .ts-up-arrow::before, .ts-updown-arrow::before, .ts-downup-arrow::before, .ts-down-arrow::before, .ts-nochange-arrow::before, .ts-up::before, .ts-updown::before, .ts-downup::before, .ts-down::before, .ts-nochange::before { border: 0; clip: rect(0, 0, 0, 0); clip-path: polygon(0px 0px, 0px 0px, 0px 0px); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: a...»
102527
sanitized-css
text/css
.ts-profit::before, .ts-loss::before, .ts-stalledprofit::before, .ts-up::before, .ts-up-arrow::before, .ts-updown-arrow::before, .ts-downup-arrow::before, .ts-down-arrow::before, .ts-nochange-arrow::before, .ts-up::before, .ts-updown::before, .ts-downup::before, .ts-down::before, .ts-nochange::before {
border: 0;
clip: rect(0, 0, 0, 0);
clip-path: polygon(0px 0px, 0px 0px, 0px 0px);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap
}
.ts-up, .ts-up-arrow, .ts-updown, .ts-updown-arrow {
color: var(--color-success, #14866d);
font-size: larger;
font-weight: bold
}
.ts-profit {
color: #02a802;
font-size: larger
}
.ts-down, .ts-down-arrow, .ts-downup, .ts-downup-arrow {
color: var(--color-destructive, #d73333);
font-size: larger;
font-weight: bold
}
.ts-loss {
color: #f00;
font-size: larger
}
.ts-stalledprofit, .ts-nochange, .ts-nochange-arrow {
color: #0c99df;
font-size: larger
}
.ts-nochange, .ts-nochange-arrow {
font-weight: bold
}
.ts-profit::before {
content: "Тӏаде щвей"
}
.ts-loss::before {
content: "Тӏаса ин"
}
.ts-stalledprofit::before {
content: "Чӏараб щвей"
}
.ts-up::before {
content: "Гӏей"
}
.ts-up-arrow::before {
content: "Цӏикӏкӏин"
}
.ts-updown::before {
content: "Позитивияб борти"
}
.ts-updown-arrow::before {
content: "Позитивияб дагьлъи"
}
.ts-downup::before {
content: "Негативияб гӏей"
}
.ts-downup-arrow::before {
content: "Негативияб цӏикӏкӏин"
}
.ts-down::before {
content: "Борти"
}
.ts-down-arrow::before {
content: "Дагьлъи"
}
.ts-nochange::before {
content: "Хиси гьечӏо"
}
.ts-nochange-arrow::before {
content: "Хисичӏого"
}
948c19wotx2o6hkfg0fu2g48z9bymi4