« Modèle:Graph:PageViews » : différence entre les versions

Contenu supprimé Contenu ajouté
Yurik (discussion | contributions)
Aucun résumé des modifications
Yurik (discussion | contributions)
Aucun résumé des modifications
Ligne 15 :
},
"transform": [
{{ #if: {{{max|}}}
| { "type": "formula", "field": "views", "expr": "min(datum.views, {{{max}}})" },
}}
{ "type": "formula", "field": "year", "expr": "parseInt(substring(datum.timestamp,0,4))" },
{ "type": "formula", "field": "month", "expr": "parseInt(substring(datum.timestamp,4,6))" },
Ligne 34 ⟶ 31 :
{
"name": "y",
"type": "{{{scale|linear}}}",
"range": "height",
"nice": true,
{{ #if: {{{max|}}}
| "domain": [0, {{{max}}}], "clamp": true,
| "domain": {"data": "pageviews","field": "views"}
}}
Ligne 114 ⟶ 111 :
"default": "#00f",
"example": "#f00",
"type": "string"
},
"scale": {
"label": "Graph scale",
"description": "Scaling could be one of these: linear, log, pow, sqrt, quantile, quantize, and threshold",
"default": "linear",
"example": "log",
"type": "string"
},
Ligne 129 ⟶ 133 :
"3",
"color",
"scale",
"max"
],