How to use the vega-loader.read 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];
github girder / girder / plugins / table_view / girder_table_view / web_client / views / TableWidget.js View on Github external
loader.loader().load(this.file.downloadUrl()).then((data) => {
            data = loader.read(data, {type: parser, parse: 'auto'});
            this.data = data;
            this.columns = _.keys(data[0]);
            this.state = this.states.DATA_READY;
            this.render();
            return data;
        }, (error) => {
            console.error(error);
github vega / vega-dataflow / src / dataflow / load.js View on Github external
function(data) {
        return read(data, format);
      },
      function(error) {
github altair-viz / jupyterlab_voyager / src / voyagerpanel.ts View on Github external
docManager.services.contents.get(wholePath).then(src => {
                let local_filetype = PathExt.extname(DATA["url"]).substring(1);
                let local_values = read(src.content, { type: local_filetype });
                this.voyager_cur = CreateVoyager(
                  this.voyager_widget.node,
                  VoyagerPanel.config,
                  { values: local_values }
                );
              });
                this.voyager_cur.setSpec(spec);
github vega / vega-dataflow / src / dataflow / load.js View on Github external
export function ingest(target, data, format) {
  return this.pulse(target, this.changeset().insert(read(data, format)));
}
github altair-viz / jupyterlab_voyager / src / voyagerpanel.ts View on Github external
this._context.ready.then(_ => {
      this._ready.resolve(undefined);
      const data = context.model.toString();
      var values: any;
      //read in the data
      if (this.fileType === "txt") {
        values = read(data, { type: "json" });
      } else {
        values = read(data, { type: this.fileType });
      }
      const spec: Object = {
        "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
        "data": values['data'],
        "mark": values['mark'],
        "encoding": values['encoding'],
        "height":values['height'],
        "width":values['width'],
        "description":values['description'],
        "name":values['name'],
        "selection":values['selection'],
        "title":values['title'],
        "transform":values['transform']
      };
      if(this.fileType==='json'||this.fileType==='txt'){
        if(values['data']){

vega-loader

Network request and file loading utilities.

BSD-3-Clause
Latest version published 1 year ago

Package Health Score

80 / 100
Full package analysis