Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe(`${item.prototype.constructor.name}`, () => {
if (item.prototype instanceof Class) {
classDef("map", item);
}
if (item.prototype instanceof HTMLWidget || item.prototype instanceof SVGWidget) {
switch (item.prototype.constructor) {
case ChoroplethContinents:
render(new ChoroplethContinents());
break;
case ChoroplethCountries:
render(new ChoroplethCountries()
.columns(geo.Countries.simple.columns)
.data(geo.Countries.simple.rawData)
);
break;
case ChoroplethStates:
render(new ChoroplethStates()
.columns(geo.States.simple.columns)
.data(geo.States.simple.data));
break;
case ChoroplethCounties:
render(new ChoroplethCounties()
.columns(geo.Counties.simple.columns)
.data(geo.Counties.simple.rawData)
);
break;
case GeoHash:
import { ChoroplethCountries, topoJsonFolder } from "@hpcc-js/map";
topoJsonFolder("https://cdn.jsdelivr.net/npm/@hpcc-js/map@2.0.0/TopoJSON");
new ChoroplethCountries()
.target("target")
.columns(["Country", "Weight"])
.data([["United States", 29.946185501741], ["China", 229.946185501741], ["Ireland", 400]])
.render()
;