How to use the @hpcc-js/map.ChoroplethCountries function in @hpcc-js/map

To help you get started, we’ve selected a few @hpcc-js/map examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hpcc-systems / Visualization / tests / test-map / src / map.spec.ts View on Github external
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:
github hpcc-systems / Visualization / demos / gallery / samples / geospatial / Choropleth / Countries.js View on Github external
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()
    ;