When passing only one country in the data array, the calculation for the opacity fails.
That is because maxValue - minValue will result in 0 and we divide by zero which result in Infinity / 'NaN'. Therefore the "fillOpacity" will not get a value which results in fillOpacity: 1, which is different from the 0.2 + 0.6 * ... which can only result in max 0.8 for fillOpacity.
Don't know if the suggested change is the best way to solve this, I just want to point that out.
When passing only one country in the data array, the calculation for the opacity fails.
That is because
maxValue - minValue
will result in 0 and we divide by zero which result in Infinity / 'NaN'. Therefore the "fillOpacity" will not get a value which results in fillOpacity: 1, which is different from the0.2 + 0.6 * ...
which can only result in max 0.8 for fillOpacity.Don't know if the suggested change is the best way to solve this, I just want to point that out.