How to use tsx-create-element - 4 common examples

To help you get started, we’ve selected a few tsx-create-element 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 microsoft / SandDance / packages / vega-deck.gl / src / presenter.ts View on Github external
if (stage.backgroundColor) {
                deckProps.style = { 'background-color': colorToString(stage.backgroundColor) };
            }
            this.deckgl = new classes.DeckGL_Class(deckProps);
        }
        let cubeCount = Math.max(this._last.cubeCount, stage.cubeData.length);
        if (options.ordinalsSpecified) {
            cubeCount = Math.max(cubeCount, options.maxOrdinal + 1);
            const empty: Partial = {
                isEmpty: true,
                color: [0, 0, 0, 0] // possibly a bug in Deck.gl? set color to invisible.
            };
            stage.cubeData = patchCubeArray(cubeCount, empty, stage.cubeData as Cube[]);
        }
        this.setDeckProps(stage, height, width, cubeCount, config);
        mount(LegendView({ legend: stage.legend, onClick: config && config.onLegendClick }), this.getElement(PresenterElement.legend));
        if (config && config.onPresent) {
            config.onPresent();
        }
    }
github microsoft / SandDance / packages / sanddance / src / details.tsx View on Github external
render() {
        const hasRefinedData = this.dataScope.hasFilteredData();
        const renderProps: RenderProps = {
            language: this.language,
            actionHandler: action => this.handleAction(action),
            selectionHandler: (columnName, value) => this.selectByNameValue(columnName, value),
            count: this.state.userSelection && this.state.userSelection.included.length,
            hasRefinedData,
            item: this.state.userSelection && this.state.userSelection.included[this.state.index],
            remapColorHandler: remap => this.remapChanged(remap),
            hasColorMaps: this.hasColorMaps() && hasRefinedData,
            remapColor: this.state.remapColor
        };
        mount(renderDetails(renderProps), this.element);
    }
}
github microsoft / SandDance / packages / sanddance / src / viewer.ts View on Github external
private applyLegendColorContext(colorContext: ColorContext) {
        mount(colorContext.legendElement, this.presenter.getElement(VegaDeckGl.PresenterElement.legend));
        this.presenter.stage.legend = colorContext.legend;
    }
github microsoft / SandDance / packages / vega-deck.gl / src / panel.tsx View on Github external
export function initializePanel(presenter: IPresenter) {
    const rootDiv = (
        <div>
            <div style="{{"></div>
            <div>
                <div></div>
                <div></div>
            </div>
        </div>
    );
    mount(rootDiv, presenter.el);
}

tsx-create-element

Use TypeScript TSX without React

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular tsx-create-element functions