Modelo:Graph:Street map with marks: Diferenzas entre revisións

Contido eliminado Contido engadido
Yurik (conversa | contribucións)
cloned from mediawiki.org
Yurik (conversa | contribucións)
Sen resumo de edición
Liña 5:
// 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:Street_map_with_marks
//
// Template translation is in https://commons.wikimedia.org/wiki/Data:Original/Template:Graphs.tab
//
"version": 2, "width":{{{width|400}}}, "height": {{{height|{{{width|300}}}}}}, "padding": {{{padding|0}}},
Liña 39 ⟶ 41:
|{{#if:{{{table|}}}|
// Use tabular data source
"url": "tabular:///{{urlencode:{{{table}}}|PATH}}",
"format": {"type": "json", "property": "data"},
| // Otherwise use the first unnamed argument for source values
Liña 50 ⟶ 52:
{"lat":20, "lon":-120, "color":"#0f0"},
{"lat":40, "lon":-120, "shape":"diamond", "color":"#0f0", "size": 80, "text": "Some cool text", "textColor": "#0ff", "textFontSize": 20, "textBaseline": "middle"},
{"lat":-10, "lon":20, "img":"Volcano red 32x32.svg", "offsetY":-10},
// BUG! raw SVG image will NOT render properly on the server. Make sure to specify image pixel size, e.g. "{{!}}32"
{"lat":-100, "lon":200, "img":"wikirawupload:{{filepath:Volcano red 32x32.svg|32}}", "width":25, "height": 25, "offsetY":-10, "text": "Big volcano", "textFontWeight": "bold", "textFontSize": 20, "textColor": "#fff"},
{"lat":0, "lon":0, "img":"wikirawupload:{{filepath:Volcano red 32x32.svg|32}}", "width":25, "height": 25, "offsetY":-10, "text": "Big volcano", "textFontWeight": "bold", "textFontSize": 20, "textColor": "#fff"},
{"lat":37.774755, "lon":-122.454688, "color":"#f00", "size": 10},
}}}
Liña 137 ⟶ 138:
{ "type": "filter", "test": "datum.img" },
{ "type": "formula", "field":"iconWidth", "expr": "datum.width {{!}}{{!}} 0" },
{ "type": "formula", "field":"iconHeight", "expr": "datum.height {{!}}{{!}} 0" },
{ "type": "formula", "field":"img",
"expr": "if(!test(/^[a-z]+:\\/\\//, datum.img), 'wikifile:///'+datum.img, datum.img)" },
// Ensure that either width or height parameter is passed to wikifile:// request
{ "type": "formula", "field":"img",
"expr": "if((datum.iconWidth {{!}}{{!}} datum.iconHeight) && !test(/[?&](width{{!}}height)=\\d/, datum.img),if(datum.iconWidth,datum.img+'?width='+datum.iconWidth,datum.img+'?height='+datum.iconHeight), datum.img)" },
]},
"properties": {
Liña 266 ⟶ 272:
]
}
<includeonly>}}
<includeonly>}}</includeonly><noinclude>|lang=javascript}}<syntaxhighlight lang=html></graph></syntaxhighlight></noinclude>
{{#if:{{{wdqs|}}}|
<small>{{#invoke:TNT|msg|Original/Template:Graphs.tab|source-wdqs|https://query.wikidata.org/#{{urlencode:{{{table}}}|PATH}}}}.</small>
|{{#if:{{{table|}}}|
<small>{{#invoke:TNT|msg|Original/Template:Graphs.tab|source-table|{{#invoke:TNT|link|{{{table}}}}}}}.</small>
<includeonly>}}}}</includeonly><noinclude>|lang=javascript}}<syntaxhighlight lang=html></graph></syntaxhighlight></noinclude>