{
const height = 800;
const width = 1000;
const margin ={top:50,left:50,right:50,bottom:50};
const innerWidth = width - margin.left - margin.right;
const innerHeight = height - margin.top - margin.bottom;
const svg =d3.create("svg")
.attr("width",width)
.attr("height",height)
.attr('viewbox',[0,0,width,height])
.style('background',"#333333");
const wrapper = svg.append("g")
.attr("transform",`translate(${margin.left},${margin.top})`);
const projection = d3.geoMercator().fitSize([innerWidth,innerHeight],thailand);
const geoGenerator = d3.geoPath().projection(projection);
const regions = wrapper.selectAll("region").data(thailand.features);
const areas = regions.enter().append("path")
.attr("class","areas").attr("d", d=> geoGenerator(d))
.attr('opacity',0.6).attr("fill",'gray')
return svg.node();
}