function drawMap (data, {
features,
borders,
projection,
domain,
range,
radius,
coordinatesLabel,
category
} = {}) {
let value = null
const colorScale = d3.scaleOrdinal()
.domain(domain)
.range(range)
const path = d3.geoPath(projection)
const svg = d3.create('svg')
.attr('viewBox', `0, 0, ${width}, ${height}`)
svg.append('g')
.attr('fill', '#ddd')
.selectAll('path')
.data(features.features)
.enter().append('path')
.attr('d', path)
svg.append('path')
.datum(borders)
.attr('fill', 'none')
.attr('stroke', 'white')
.attr('stroke-linejoin', 'round')
.attr('pointer-events', 'none')
.attr('d', path)
let circle = svg.append('g')
.selectAll('circle')
.attr('fill-opacity', 0.5)
.attr('stroke', 'black')
.attr('stroke-width', 0.5)
circle
.data(data)
.join(
enter => enter.append('circle')
.call(circle => circle.append('title'))
)
.attr('cx', d => projection([d[coordinatesLabel[0]], d[coordinatesLabel[1]]])[0])
.attr('cy', d => projection([d[coordinatesLabel[0]], d[coordinatesLabel[1]]])[1])
.attr('r', radius)
.attr('fill', d => colorScale(d[category]))
.call(circle => circle.select('title').text(d => `${names.get(d.id)}\ntecnología:${d.technology}`))
return svg.node()
}