How to use the @hpcc-js/common.select function in @hpcc-js/common

To help you get started, we’ve selected a few @hpcc-js/common 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 / HPCC-Platform / esp / src / src / DataPatternsWidget.ts View on Github external
this.centerContainer.resize = function (s) {
            origResize.apply(this, arguments);
            d3Select(`#${context.id}DPReport`).style("height", `${s.h - 16}px`);  // 8 * 2 margins
            if (context.dpReport && context.dpReport.renderCount()) {
                context.dpReport
                    .resize()
                    .lazyRender()
                    ;
            }
        }
github hpcc-systems / HPCC-Platform / esp / src / src / DataPatternsWidget.ts View on Github external
const stateIconClass = this._wu ? getStateIconClass(this._wu.StateID, this._wu.isComplete(), this._wu.Archived) : "";
        this.workunitWidget.set("iconClass", stateIconClass);
        domClass.remove(this.id + "StateIdImage");
        domClass.add(this.id + "StateIdImage", stateIconClass);

        d3Select(`#${this.id}WU`).style("display", isComplete ? "none" : null);

        const msg = [];
        if (!this._wu) {
            msg.push(this.i18n.DataPatternsNotStarted);
        } else if (!this._wu.isComplete()) {
            msg.push(this.i18n.DataPatternsStarted);
        }

        const dpMessage = d3Select(`#${this.id + "DPReport"}`).selectAll(".DPMessage").data(msg);
        dpMessage.enter().insert("p", ":first-child")
            .attr("class", "DPMessage")
            .style("text-align", "center")
            .merge(dpMessage as any)
            .text(d => d)
            ;
        dpMessage.exit()
            .remove()
            ;
    }
}
github hpcc-systems / Visualization / demos / gallery / samples / common / HTMLWidget.js View on Github external
.each(function(row){
                const rowElement = d3Select(this);
                rowElement.select("span")
                    .style("float", "left")
                    .style("display", "inline-block")
                    .style("width", labelWidth+"px")
                    .text(row[0])
                    ;
                rowElement.select("div")
                    .style("float", "left")
                    .style("display", "inline-block")
                    .style("margin-left", gutter+"px")
                    .style("background-color", "red")
                    .style("width", row[1]+"px")
                    .style("height", rowHeight+"px")
                    .text(row[0])
                    ;
            })
github hpcc-systems / Visualization / website / src / hpccScrollNav.ts View on Github external
.each(function (d) {
                const li = d3Select(this);
                li.append("a")
                    .html((d: any) => d.label)
                    .attr("href", d.href)
                    .on("click", function (d: any) {
                        const navAnchorTop = this.getBoundingClientRect().top;
                        context._marker
                            .style("top", (navAnchorTop + context._yOffset + 5) + "px")
                            .style("opacity", 1)
                            ;
                    })
                    ;
            })
            ;
github hpcc-systems / Visualization / demos / gallery / src-umd / gallery.js View on Github external
setTimeout(function () {
                    common_1.select(_this)
                        .attr("src", "./galleryItem.html?" + d.path);
                }, i * 333);
            });
github hpcc-systems / Visualization / website / src / hpccIndex.ts View on Github external
.each(function (d) {
                const li = d3Select(this);
                const div = li.append("div");
                div.append("span")
                    .text(d.label)
                    ;
                if (!d.children.length) {
                    div
                        .attr("class", "hpccIndex-sub-li")
                        .on("click", (_d: any) => {
                            context.clicked(_d.path);
                        })
                        ;
                } else {
                    div
                        .attr("class", "hpccIndex-label-div")
                        .on("click", () => {
                            li.classed("hpccIndex-collapsed", !li.classed("hpccIndex-collapsed"));
github hpcc-systems / Visualization / demos / gallery / src / gallery.ts View on Github external
setTimeout(() => {
                    d3Select(this)
                        .attr("src", `./galleryItem.html?${d.path}`)
                        ;
                }, i * 333);
            })
github hpcc-systems / Visualization / packages / map / src / leaflet / FeatureLayer.ts View on Github external
style(id: string, _?: number | string | boolean): this | number | string | boolean {
        if (_ === void 0) return d3Select(this._layer.getPane()).style(id);
        d3Select(this._layer.getPane()).style(id, _);
        return this;
    }
github hpcc-systems / Visualization / packages / map / src / leaflet / FeatureLayer.ts View on Github external
layerEnter(map: Map) {
        map.addLayer(this._layer);
        const elem = d3Select(map.getContainer()).select(".leaflet-pane.leaflet-marker-pane");
        this._selection.widgetElement(elem);
    }
github hpcc-systems / HPCC-Platform / esp / src / src / DataPatternsWidget.ts View on Github external
refreshActionState() {
        const isComplete = this._wu && this._wu.isComplete();
        this.setDisabled(this.id + "Analyze", !!this._wu);
        d3Select(`#${this.id}TargetSelectLabel`).style("color", !!this._wu ? "rgb(158,158,158)" : null);
        this.setDisabled(this.id + "TargetSelect", !!this._wu);
        this.setDisabled(this.id + "Delete", !this._wu);
        this.setDisabled(this.id + "OptimizeDropDown", !isComplete);
        this.setDisabled(this.id + "_RawData", !isComplete);
        this.setDisabled(this.id + "_Workunit", !this._wu);

        if (this._wu) {
            this.targetSelectWidget.set("value", this._wu.Cluster);
        }

        const stateIconClass = this._wu ? getStateIconClass(this._wu.StateID, this._wu.isComplete(), this._wu.Archived) : "";
        this.workunitWidget.set("iconClass", stateIconClass);
        domClass.remove(this.id + "StateIdImage");
        domClass.add(this.id + "StateIdImage", stateIconClass);

        d3Select(`#${this.id}WU`).style("display", isComplete ? "none" : null);