How to use the @jupyterlab/csvviewer.parseDSVNoQuotes function in @jupyterlab/csvviewer

To help you get started, we’ve selected a few @jupyterlab/csvviewer 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 jupyterlab / jupyterlab / tests / test-csvviewer / src / parse-noquotes.spec.ts View on Github external
it('adjusts columns to match ncols with one row', () => {
      let data = `a,b,c,d`;
      let options = { data, rowDelimiter: '\n', ncols: 7 };
      let results;

      results = parser({ ...options, columnOffsets: false });
      expect(results.nrows).to.eql(1);
      expect(results.offsets).to.eql([0]);

      results = parser({ ...options, columnOffsets: true });
      expect(results.nrows).to.eql(1);
      expect(results.ncols).to.eql(7);
      expect(results.offsets).to.eql([0, 2, 4, 6, 7, 7, 7]);
    });
github jupyterlab / jupyterlab / tests / test-csvviewer / src / parse-noquotes.spec.ts View on Github external
it('handles a max row argument', () => {
      let data = `a,b,c,d\n0,1,2,3\n4,5,6,7\n`;
      let options = { data, rowDelimiter: '\n', maxRows: 2 };
      let results;

      results = parser({ ...options, columnOffsets: false });
      expect(results.nrows).to.eql(2);
      expect(results.offsets).to.eql([0, 8]);

      results = parser({ ...options, columnOffsets: true });
      expect(results.nrows).to.eql(2);
      expect(results.ncols).to.eql(4);
      expect(results.offsets).to.eql([0, 2, 4, 6, 8, 10, 12, 14]);
    });