User:Pyb/sandbox

Programme
Liste non exhaustive et indicative susceptible d'être modifiée en fonction des fromages en stock chez le fromager.

PL
{ "version": 2, "width": 500, "height": 260, "padding": 12, "background": "#edf1f7", "data": [ {     "name": "map", "url": "wikiraw:///Extension:Graph/Demo/RawData:WorldMap-json", "format": {"type": "topojson","feature": "countries"}, "transform": [ { "type": "formula", "field": "rate", "expr": "1" }, {         "type": "geopath", "value": "data", "scale": 80, "center": [-180,125], "translate": [0,0], "projection": "equirectangular" }     ]    },    {      "name": "points", "url": "wikidatasparql:///?query=PREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%20%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0APREFIX%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0A%0ASELECT%20%3FcityLabel%20%28count%28*%29%20as%20%3Fpopulation%29%20%3Fgps%0AWHERE%20{%0A%20%20%20%20%3Fpid%20wdt%3AP119%20wd%3AQ311%20.%0A%20%20%20%20%3Fpid%20wdt%3AP20%20%3Fcid%20.%0A%20%20%20%20%3Fcid%20wdt%3AP625%20%3Fgps%20.%0A%20%20%20%20OPTIONAL%20{%0A%20%20%20%20%20%20%20%20%3Fcid%20rdfs%3Alabel%20%3FcityLabel%20filter%20%28lang%28%3FcityLabel%29%20%3D%20%22en%22%29%20.%0A%20%20%20%20}%0A}%0AGROUP%20BY%20%3Fcid%20%3FcityLabel%20%3Fgps%0AORDER%20BY%20DESC%28%3Fpopulation%29%20ASC%28%3FcityLabel%29", "format": { "type": "json", "property": "results.bindings" },     "transform": [ { "type": "formula", "field": "cityLabel", "expr": "datum.cityLabel.value" }, { "type": "formula", "field": "population", "expr": "parseInt(datum.population.value)" }, { "type": "formula", "field": "lat", "expr": "parseFloat(substring(datum.gps.value, 1+indexof(datum.gps.value,'('), indexof(datum.gps.value,' ')))" },       { "type": "formula", "field": "lon", "expr": "parseFloat(substring(datum.gps.value, 1+indexof(datum.gps.value,' '), indexof(datum.gps.value,')')))" }, {"type": "sort", "by": "-population"}, {         "type": "geo", "projection": "equirectangular", "scale": 80, "center": [-180,125], "translate": [0,0], "lon": "lon", "lat": "lat" }     ]    }  ],  "signals": [ {     "name": "mouseoverSignal", "init": null, "streams": [ {           "type": "@circle:mouseover", "expr": "eventItem.datum" },       {          "type": "@circle:mouseout", "expr": null }     ]    }  ],  "scales": [ {     "name": "size", "type": "linear", "domain": {"data": "points", "field": "population"}, "range": [10, 1000] } ],  "marks": [ {     "type": "text", "properties": { "enter": { "text": {"value": "Largest cities"}, "x": {"value": 0}, "y": {"value": 25}, "fontSize": {"value": 32}, "fontWeight": {"value": "bold"}, "fill": {"value": "steelblue"} }     }    },    {      "name": "map", "type": "path", "from": {"data": "map"}, "properties": { "enter": { "fill": {"value": "grey"}, "path": {"field": "layout_path"} }     }    },    {      "name": "circle", "type": "symbol", "from": {"data": "points"}, "properties": { "enter": { "size": {"scale": "size", "field": "population"}, "fill": {"value": "steelblue"}, "fillOpacity": {"value": 0.8}, "stroke": {"value": "white"}, "strokeWidth": {"value": 1.5}, "x": {"field": "layout_x"}, "y": {"field": "layout_y"} }     }    },    {      "type": "text", "properties": { "enter": { "x": {"value": 500}, "y": {"value": 10}, "align": {"value": "right"}, "fontSize": {"value": 17}, "fill": {"value": "black"} },       "update": { "text": { "rule": [ {               "predicate": { "name": "isNotNull", "value": {"signal": "mouseoverSignal"} },               "template": "\u007b{mouseoverSignal.cityLabel}} \u007b{mouseoverSignal.population|number:'.2s'}}" },             { "value": "" } ]         }        }      }    }  ],  "predicates": [ {     "name": "isNotNull", "type": "!=", "operands": [{"value": null}, {"arg": "value"}] } ] }

Foot
{ "version": 2, "width": 500, "height": 260, "padding": 12, "background": "#edf1f7", "data": [ {     "name": "museumCounts", "url":"wikidatasparql:///?query=PREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%20%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0A%0ASELECT%20DISTINCT%20%3Fid%20%28count%28*%29%20as%20%3Fvalue%29%20WHERE%20{%0A%20%20%20%3Fplace%20wdt%3AP106%20wd%3AQ937857%20.%0A%20%20%20%3Fplace%20wdt%3AP27%20%3Fid%20.%0A}%0A%0AGROUP%20BY%20%3Fid", "format": { "type": "json", "property": "results.bindings" },     "transform": [ { "type": "formula", "field": "id", "expr": "slice(datum.id.value, lastindexof(datum.id.value,'Q'))" }, { "type": "formula", "field": "value", "expr": "parseFloat(datum.value.value)" } ]   },    {      "name": "map", "url": "wikiraw:///Extension:Graph/Demo/RawData:WorldMap-json", "format": {"type": "topojson","feature": "countries"}, "transform": [ {         "type": "geopath", "value": "data", "scale": 80, "center": [-180,125], "translate": [0,0], "projection": "equirectangular" },       {          "type": "lookup", "keys": ["id"], "on": "countryNames", "onKey": "id", "as": ["name"], "default": {"value": {"value": "???"}} },       { "type": "formula", "field": "name", "expr": "datum.name.value" }, {         "type": "lookup", "keys": ["id"], "on": "museumCounts", "onKey": "id", "as": ["museums"], "default": {"value": {"value": 0}} },       { "type": "formula", "field": "museums", "expr": "datum.museums.value" }, ]   }  ],

"scales": [ {     "name": "color", "type": "log", "domain": {"data": "map","field": "rate"}, "zero": false, "range": ["#FFEDBC", "#f83600"] } ],  "marks": [ {     "type": "text", "properties": { "enter": { "text": {"value": "football players"}, "x": {"value": 0}, "y": {"value": 25}, "fontSize": {"value": 32}, "fontWeight": {"value": "bold"}, "fill": {"value": "steelblue"} }     }    },    {      "name": "map", "type": "path", "from": {"data": "map"}, "properties": { "enter": {"path": {"field": "layout_path"}}, "update": { "fill":{ "rule": [ {               "predicate": { "name": "isNotNull", "id": {"field": "rate"} },               "scale": "color", "field": "rate" },             {"value": "grey"} ]         }        },        "hover": {"fill": {"value": "#989898"}} }   },    {      "type": "text", "properties": { "enter": { "x": {"value": 500}, "y": {"value": 10}, "align": {"value": "right"}, "fontSize": {"value": 17}, "fill": {"value": "black"} },       "update": { "text": {"template": "\u007b{tooltipSignal.datum.name}} \u007b{tooltipSignal.datum.museums}}"} }     }    }  ],  "predicates": [ {     "name": "isNotNull", "type": "!=", "operands": [{"value": null}, {"arg": "id"}] } ],  "legends": [ {     "fill": "color", "title": "Per Capita", "offset": -300, "properties": { "labels": { "text": {"value": ""} },       "gradient": { "stroke": {"value": "transparent"} },       "title": { "fontSize": {"value": 14} },       "legend": { "x": {"value": 0}, "y": {"value": 180} }     }    }  ] }