Jump to content

"ഫലകം:Graph:PageViews" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം.
Content deleted Content added
No edit summary
(ചെ.) en:Template:Graph:PageViews എന്നതിൽ നിന്ന് 46 പതിപ്പുകൾ ഇറക്കുമതി ചെയ്തു
 
(10 ഉപയോക്താക്കൾ ചെയ്ത ഇടയ്ക്കുള്ള 43 നാൾപ്പതിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നില്ല)
വരി 1: വരി 1:
<includeonly>
{{#tag:graph|
{{#tag:graph|
{
{
//
// ATTENTION: This code is maintained at https://www.mediawiki.org/wiki/Template:Graph:PageViews
// Please do not modify it anywhere else, as it may get copied and override your changes.
// Suggestions can be made at https://www.mediawiki.org/wiki/Template_talk:Graph:PageViews
// The graph uses PageViews API https://wikitech.wikimedia.org/wiki/Analytics/PageviewAPI
//

"version": 2,
"version": 2,
"width": 400,
"width": {{{width|800}}},
"height": 200,
"height": {{{height|200}}},

// The data for this graph comes from the PageView API. The request is made for N days back up to now.
"data": [
"data": [
{
{
"name": "pageviews",
"name": "pageviews",
"url": "wikirest://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/{{trim|{{{3|en.wikipedia.org}}}}}/all-access/user/{{urlencode:{{urlencode:{{{2|{{ARTICLEPAGENAME}} }}}|WIKI}}}}/daily/{{#time: YmdH | -{{{1|30}}} days }}/{{#time: YmdH }}",
"url": "wikirest://wikimedia.org/api/rest_v1/metrics/pageviews/{{#ifeq: {{#iferror: {{#expr: {{{1|}}} + 1 }} | {{{1|}}} | {{{2|}}} }} | _ | aggregate | per-article }}/{{trim|{{#ifeq: {{#iferror: {{#expr: {{{1|}}} + 1 }} | {{#iferror: {{#expr: {{{2|}}} + 1 }} | {{{2|{{SERVERNAME}}}}} | {{{3|{{SERVERNAME}}}}} }} | {{{3|{{SERVERNAME}}}}} }} | www.mediawiki.org | mediawiki.org | {{#iferror: {{#expr: {{{1|}}} + 1 }} | {{#iferror: {{#expr: {{{2|}}} + 1 }} | {{{2|{{SERVERNAME}}}}} | {{{3|{{SERVERNAME}}}}} }} | {{{3|{{SERVERNAME}}}}} }} }}}}/{{{platform|all-access}}}/user/{{#ifeq: {{#iferror: {{#expr: {{{1|}}} + 1 }} | {{{1|}}} | {{{2|}}} }} | _
| {{{granularity | monthly}}}
| {{urlencode:{{#titleparts: {{#iferror: {{#expr: {{{1|}}} + 1 }} | {{{1|{{ARTICLEPAGENAME}}}}} | {{{2|{{ARTICLEPAGENAME}}}}} }} }}|PATH}}/daily
}}/{{formatnum:{{#time: Ymd | -{{#iferror: {{#expr: {{{1|}}} + 1 }} | {{#iferror: {{#expr: {{{2|}}} + 1 }} | {{{3|30}}} | {{{2|30}}} }} | {{{1|30}}} }} days }}|R}}00/{{formatnum:{{#time: Ymd }}|R}}00",
"format": {
"format": {
"type": "json",
"type": "json",
"property": "items"
"property": "items"
},
},

// The response is parsed here, converting date strings of form "20160223" into date 2016-02-23
"transform": [
"transform": [
{ "type": "formula", "field": "year", "expr": "parseInt(substring(datum.timestamp,0,4))" },
{ "type": "formula", "field": "year", "expr": "parseInt(substring(datum.timestamp,0,4))" },
വരി 21: വരി 34:
}
}
],
],

"scales": [
"scales": [
// The dates are scaled to the "x" axis - the width of the graph
{
{
"name": "x",
"name": "x",
വരി 28: വരി 43:
"domain": {"data": "pageviews","field": "date"}
"domain": {"data": "pageviews","field": "date"}
},
},
// The pageviews are scaled to the "y" axis - the height of the graph
// Optional scale parameter can change "linear" to other scales like log
// Optional max parameter can fix the upper bound of the graph
{
{
"name": "y",
"name": "y",
"type": "linear",
"type": "{{{scale|linear}}}",
"range": "height",
"range": "height",
"domain": {"data": "pageviews","field": "views"},
"nice": true,
"domain": {"data": "pageviews","field": "views"}
"clamp": true,
{{ #if: {{{max|}}}
| "domainMax": {{{max}}},
}}
"nice": true
}
}
],
],

// Simple axis with horizontal grid lines
"axes": [
"axes": [
{"type": "x","scale": "x","ticks": 5},
{
"type": "x",
"scale": "x",
"ticks": 5,
"properties": {
{"type": "y","scale": "y", "grid":true, "ticks": 5}
"ticks": {"stroke": {"value": "#666666"} },
"labels": {"fill": {"value": "#666666"} },
"axis": {"stroke": {"value": "#666666"}, "strokeWidth": {"value": 2} }
}
},
{
"type": "y",
"scale": "y",
"ticks": 5,
"grid": true,
"properties": {
"ticks": {"stroke": {"value": "#666666"} },
"labels": {"fill": {"value": "#666666"} },
"grid": {"stroke": {"value": "#666666"}, "strokeWidth": {"value": 2} },
"axis": {"stroke": {"value": "#666666"}, "strokeWidth": {"value": 2} }
}
}
],
],

// The graph is drawn with two elements a thick line at the top, and a semi-transparent area below
"marks": [
"marks": [
{
{
വരി 48: വരി 94:
"x": {"scale": "x","field": "date"},
"x": {"scale": "x","field": "date"},
"y": {"scale": "y","field": "views"},
"y": {"scale": "y","field": "views"},
"stroke": {"value": "#00f"},
"stroke": {"value": "{{{color|#00f}}}"},
"strokeWidth": {"value": 3},
"strokeWidth": {"value": 3},
"interpolate": {"value": "monotone"}
"interpolate": {"value": "{{{interpolate|monotone}}}"}
}
}
}
}
വരി 62: വരി 108:
"y": {"scale": "y","value": 0},
"y": {"scale": "y","value": 0},
"y2": {"scale": "y","field": "views"},
"y2": {"scale": "y","field": "views"},
"fill": {"value": "#00f"},
"fill": {"value": "{{{color|#00f}}}"},
"fillOpacity": {"value": 0.35},
"fillOpacity": {"value": 0.35},
"interpolate": {"value": "monotone"}
"interpolate": {"value": "{{{interpolate|monotone}}}"}
}
}
}
}
വരി 70: വരി 116:
]
]
}
}
}}<noinclude>{{documentation}}</noinclude>
}}
</includeonly><noinclude>
Example Usage (all parameters are optional):
<pre>
{{ Graph:PageViews | 90 | Main Page | en.wikipedia.org }}
</pre>
{{ Graph:PageViews | 90 | Main Page | en.wikipedia.org }}
<templatedata>
{
"params": {
"1": {
"type": "number",
"default": "30",
"suggested": true,
"description": "Number of days back"
},
"2": {
"label": "Page Title",
"description": "Title of the page, with namespace, including needed spaces",
"type": "wiki-page-name",
"default": "Name of the current article page (even if on talk page)",
"example": "Main Page"
},
"3": {
"description": "Domain",
"default": "en.wikipedia.org",
"type": "string"
}
},
"paramOrder": [
"1",
"2",
"3"
],
"format": "inline",
"description": "Inserts a graph with the page views statistics for the past N days of a page."
}
</templatedata>
</noinclude>

06:15, 29 ഡിസംബർ 2018-നു നിലവിലുള്ള രൂപം

[നിർമ്മിക്കുക] ഫലകത്തിന്റെ വിവരണം
"https://ml.wikipedia.org/w/index.php?title=ഫലകം:Graph:PageViews&oldid=2929262" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്