circuitPath = (circuitId, width=500, height=500, margin = {top:0,left:0,bottom:0,right:0}) => {
const circuitFeatures = circuitMaps.features.filter(d => {
return d.properties.circuitId == circuitId;
})
if(circuitFeatures.length == 0){
return 0;
}
const projection = d3.geoOrthographic()
.fitExtent([[margin.left, margin.top], [width - margin.right, height - margin.right]],
{ type: 'FeatureCollection', features: circuitFeatures });
const path = d3.geoPath().projection(projection);
return path(circuitFeatures[0]);
}