How to use the paraview-glance/src/io/ReaderFactory.downloadDataset function in paraview-glance

To help you get started, we’ve selected a few paraview-glance 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 / paraview-glance / src / store / index.js View on Github external
datasetHandler(ds) {
              if (ds.vtkClass) {
                return vtk(ds);
              }
              return ReaderFactory.downloadDataset(ds.name, ds.url)
                .then((file) => ReaderFactory.loadFiles([file]))
                .then((readers) => readers[0])
                .then(({ dataset, reader }) => {
                  if (reader && reader.getOutputData) {
                    const newDS = reader.getOutputData();
                    newDS.set(ds, true); // Attach remote data origin
                    return newDS;
                  }
                  if (dataset && dataset.isA) {
                    dataset.set(ds, true); // Attach remote data origin
                    return dataset;
                  }
                  if (reader && reader.setProxyManager) {
                    reader.setProxyManager(state.proxyManager);
                    return null;
                  }
github Kitware / paraview-glance / src / store / fileLoader.js View on Github external
FETCH_REMOTE({ commit }, remotes) {
      commit(Mutations.FILE_LOAD);

      const progressCb = (index) => (progress) =>
        commit(Mutations.FILE_UPDATE_PROGRESS, {
          index,
          progress: (100 * progress.loaded) / progress.total / remotes.length,
        });

      const promises = [];
      for (let i = 0; i < remotes.length; ++i) {
        promises.push(
          ReaderFactory.downloadDataset(
            remotes[i].name,
            remotes[i].url,
            progressCb(i)
          )
        );
      }

      return allWithErrors(promises);
    },
    LOAD_STATE({ dispatch }, stateFile) {