How to use the vega-loader.inferTypes function in vega-loader

To help you get started, we’ve selected a few vega-loader 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 Kitware / candela / python / girder_plugin / girder_candela / web_client / views / CandelaWidget.js View on Github external
this.loader.load(this.item.downloadUrl()).then((data) => {
            data = read(data, options);
            let columns = Object.keys(data[0]);
            const types = inferTypes(data, columns);
            data.__types__ = types;

            // Vega has issues with empty-string fields and fields with dots, so rename those.
            let rename = [];
            _.each(data.__types__, (value, key) => {
                if (key === '') {
                    rename.push({from: '', to: 'id'});
                } else if (key.indexOf('.') >= 0) {
                    rename.push({from: key, to: key.replace(/\./g, '_')});
                }
            });

            _.each(rename, (d) => {
                data.__types__[d.to] = data.__types__[d.from];
                delete data.__types__[d.from];
                _.each(data, (row) => {

vega-loader

Network request and file loading utilities.

BSD-3-Clause
Latest version published 5 months ago

Package Health Score

94 / 100
Full package analysis