S🌴
Size: a a a
S🌴
S🌴
S🌴

S🌴
SV
N
SV
SV
ИП
AA

ИА
M
HR
AR
createMap() {
this.projection = d3.geoMercator()
.center([-60, 60])
.rotate([-180, 0])
.scale(600);
this.svg = d3.select('#map').append('svg')
.attr("viewBox", [0, 0, this.width, this.height])
.attr('width', this.width)
.attr('height', this.height);
this.path = d3.geoPath()
.projection(this.projection);
this.g = this.svg.append('g');
this.states = d3.select('g')
.selectAll("path")
.data(geoData.features)
.join("path")
.on("click", this.clicked)
.attr("d", this.path)
.append("text")
.attr('x', (d, i, nodes) => getBoundingBoxCenter(nodes[i].parentNode)[0])
.attr('y', (d, i, nodes) => getBoundingBoxCenter(nodes[i].parentNode)[1])
.text('Я ТЕКСТ');
const zoom = d3.zoom()
.scaleExtent([0.1, 10]) //zoom limit
.on('zoom', (e) => {
const {x, y, k} = e.transform;
this.g.attr('transform', e.transform);
});
this.svg.call(zoom);
},VI