How to use the @hpcc-js/other.HeatMap function in @hpcc-js/other

To help you get started, we’ve selected a few @hpcc-js/other 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-other / src / other.spec.ts View on Github external
describe(`${item.prototype.constructor.name}`, () => {
                    if (item.prototype instanceof Class) {
                        classDef("other", item);
                    }
                    if (item.prototype instanceof HTMLWidget || item.prototype instanceof SVGWidget || item.prototype instanceof CanvasWidget) {
                        switch (item.prototype.constructor) {
                            case HeatMap:
                                render(new HeatMap()
                                    .columns(data.HeatMap.simple.columns)
                                    .data(data.HeatMap.simple.data)
                                );
                                break;
                            case Table:
                                const table = new Table()
                                    .columns(["Subject", "Year 1", "Year 2", "Year 3", "Year 4"])
                                    .data([
                                        ["Width 2 undefined", , 83, , 72],
                                        ["English II", 17, 43, 83, 93],
                                        ["English III", 6, 43, 64, 93],
                                        ["Width Blank", 7, "", 52, 83],
                                        ["Geography II", 16, 73, 52, 83],
                                        ["Width 2 undefined", , 83, , 72],
                                        ["Science", 66, 60, 85, 6],
                                        ["Science II", 46, 20, 53, 7],
github hpcc-systems / Visualization / packages / map / src / Heat.ts View on Github external
layerEnter(base, svgElement, domElement) {
        Layer.prototype.layerEnter.apply(this, arguments);
        this._parentOverlay.style("pointer-events", "none");
        this._heatTransform = domElement
            .style("pointer-events", "none")
            .append("div")
            .attr("class", this.classID())
            .style("width", base.width() + "px")
            .style("height", base.height() + "px")
            ;
        this.heat = new HeatMap()
            .target(this._heatTransform.node())
            ;
    }
github hpcc-systems / Visualization / packages / map / src / GMapHeat.ts View on Github external
enter() {
        super.enter.apply(this, arguments);
        const heat = new HeatMap();

        const origRender = heat.render;
        const context = this;
        heat.render = function (callback?): HeatMap {
            this.data(context.data().map(function (row) {
                const pos = context._viewportSurface.project(row[0], row[1]);
                return [pos.x, pos.y, row[4]];
            }));
            origRender.apply(this, arguments);
            return this;
        };

        this._viewportSurface.widget(heat);
    }
}