User:Dragfyre/Maptest

<graph>{"version":2,"marks":[{"properties":{"enter":{"path":{"field":"layout_path"}},"update":{"fill":{"field":"zipped.v"}},"hover":{"fill":{"value":"lightsteelblue"}}},"type":"path","name":"map","from":{"data":"collection"}}],"height":1,"signals":[{"streams":[{"expr":"{x: 0, y: 0, datum: false }","type":"@map:mouseout, @map:touchstart"},{"expr":"{x: eventX(), y: eventY(), datum: eventItem().datum}","type":"@map:mouseover, @map:touchstart"}],"name":"tooltip","init":{"expr":"{x: 0, y: 0, datum: false }"}}],"data":[{"name":"highlights","values":[{"id":"FRENCH-EQUATORIAL-AFRICA","v":"steelblue"},{"id":"FRENCH-WEST-AFRICA","v":"orangered"}]},{"transform":[{"type":"geopath","translate":[0,0],"value":"data","projection":"equirectangular","scale":120},{"expr":"datum.properties.code","type":"formula","field":"my_id"},{"expr":"datum.properties.name","type":"formula","field":"my_name"},{"expr":"length(datum.properties.name)*7+10","type":"formula","field":"my_width"},{"onKey":"id","type":"lookup","values":["v"],"keys":["properties.id"],"default":{"v":"silver"},"on":"highlights","as":["zipped"]}],"url":"wikiraw:///Template%3AGraph%3AMap%2FInner%2F1953-json","name":"collection","format":{"feature":"collection","type":"topojson"}},{"name":"dummyValue","values":[[]]}],"width":1,"1":{"type":"group","name":"tooltip","from":{"data":"dummyValue","transform":[{"expr":5,"type":"formula","field":"offsetX"},{"expr":15,"type":"formula","field":"offsetY"},{"expr":"tooltip.datum.properties.code","type":"formula","field":"lookupCountry"},{"onKey":"my_id","type":"lookup","keys":["lookupCountry"],"on":"world","as":["mapDataVal"]},{"expr":"datum.mapDataVal ? datum.mapDataVal.my_width : '90'","type":"formula","field":"tipWidth"},{"expr":20,"type":"formula","field":"tipHeight"},{"expr":"tooltip.x > width - datum.offsetX - datum.tipWidth","type":"formula","field":"alignLeft"},{"expr":"tooltip.y > height - datum.offsetY - datum.tipHeight","type":"formula","field":"alignTop"},{"expr":"max(0, tooltip.x + (datum.alignLeft ? -datum.offsetX-datum.tipWidth : datum.offsetX ))","type":"formula","field":"x"},{"expr":"tooltip.y + (datum.alignTop ? -1 : 1) * datum.offsetY","type":"formula","field":"y"},{"expr":"datum.mapDataVal ? datum.mapDataVal.my_name : '?xyz?'","type":"formula","field":"name"}]},"properties":{"update":{"y":{"field":"y"},"x":{"field":"x"},"strokeWidth":{"value":0.5},"stroke":{"value":"#aaa"},"height":{"field":"tipHeight"},"fillOpacity":{"value":0.9},"fill":{"value":"#fff"},"width":{"field":"tipWidth"}}},"marks":[{"properties":{"update":{"y":{"value":14},"x":{"value":6},"limit":{"value":60},"fill":{"value":"#666"},"text":{"template":"{{((}}parent.name{{))}}"},"font":{"value":"Lucida Console, Monaco, monospace"},"width":{"field":"tipWidth"}}},"type":"text"}]}}</graph>