How to use @jupyterlab/csvviewer - 10 common examples

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 / model.spec.ts View on Github external
it('handles delayed parsing of rows past the initial rows', async () => {
      const d = new DSVModel({
        data: `a,b,c\nc,d,e\nf,g,h\ni,j,k`,
        delimiter: ',',
        initialRows: 2
      });
      expect(d.rowCount('column-header')).to.equal(1);
      expect(d.rowCount('body')).to.equal(1);
      expect(d.columnCount('row-header')).to.equal(1);
      expect(d.columnCount('body')).to.equal(3);
      expect([0, 1, 2].map(i => d.data('column-header', 0, i))).to.deep.equal([
        'a',
        'b',
        'c'
      ]);

      // Expected behavior is that all unparsed data is lumped into the final field.
      expect([0, 1, 2].map(i => d.data('body', 0, i))).to.deep.equal([
github jupyterlab / jupyterlab-data-explorer / packages / csvviewer-extension / src / index.ts View on Github external
function activateCsv(
  app: JupyterFrontEnd,
  restorer: ILayoutRestorer,
  themeManager: IThemeManager,
  mainMenu: IMainMenu,
  searchregistry: ISearchProviderRegistry = null
): void {
  const factory = new CSVViewerFactory({
    name: FACTORY_CSV,
    fileTypes: ['csv'],
    defaultFor: ['csv'],
    readOnly: true
  });
  const tracker = new InstanceTracker>({
    namespace: 'csvviewer'
  });

  // The current styles for the data grids.
  let style: DataGrid.IStyle = Private.LIGHT_STYLE;
  let rendererConfig: TextRenderConfig = Private.LIGHT_TEXT_CONFIG;

  // Handle state restoration.
  restorer.restore(tracker, {
    command: 'docmanager:open',
github jupyterlab / jupyterlab / packages / csvviewer-extension / src / index.ts View on Github external
function activateCsv(
  app: JupyterFrontEnd,
  restorer: ILayoutRestorer,
  themeManager: IThemeManager,
  mainMenu: IMainMenu,
  searchregistry: ISearchProviderRegistry = null
): void {
  const factory = new CSVViewerFactory({
    name: FACTORY_CSV,
    fileTypes: ['csv'],
    defaultFor: ['csv'],
    readOnly: true
  });
  const tracker = new WidgetTracker>({
    namespace: 'csvviewer'
  });

  // The current styles for the data grids.
  let style: DataGrid.IStyle = Private.LIGHT_STYLE;
  let rendererConfig: TextRenderConfig = Private.LIGHT_TEXT_CONFIG;

  // Handle state restoration.
  void restorer.restore(tracker, {
    command: 'docmanager:open',
github jupyterlab / jupyterlab-data-explorer / packages / csvviewer-extension / src / index.ts View on Github external
function activateTsv(
  app: JupyterFrontEnd,
  restorer: ILayoutRestorer,
  themeManager: IThemeManager,
  mainMenu: IMainMenu,
  searchregistry: ISearchProviderRegistry = null
): void {
  const factory = new TSVViewerFactory({
    name: FACTORY_TSV,
    fileTypes: ['tsv'],
    defaultFor: ['tsv'],
    readOnly: true
  });
  const tracker = new InstanceTracker>({
    namespace: 'tsvviewer'
  });

  // The current styles for the data grids.
  let style: DataGrid.IStyle = Private.LIGHT_STYLE;
  let rendererConfig: TextRenderConfig = Private.LIGHT_TEXT_CONFIG;

  // Handle state restoration.
  restorer.restore(tracker, {
    command: 'docmanager:open',
github jupyterlab / jupyterlab / packages / csvviewer-extension / src / index.ts View on Github external
function activateTsv(
  app: JupyterFrontEnd,
  restorer: ILayoutRestorer,
  themeManager: IThemeManager,
  mainMenu: IMainMenu,
  searchregistry: ISearchProviderRegistry = null
): void {
  const factory = new TSVViewerFactory({
    name: FACTORY_TSV,
    fileTypes: ['tsv'],
    defaultFor: ['tsv'],
    readOnly: true
  });
  const tracker = new WidgetTracker>({
    namespace: 'tsvviewer'
  });

  // The current styles for the data grids.
  let style: DataGrid.IStyle = Private.LIGHT_STYLE;
  let rendererConfig: TextRenderConfig = Private.LIGHT_TEXT_CONFIG;

  // Handle state restoration.
  void restorer.restore(tracker, {
    command: 'docmanager:open',
github jupyterlab / jupyterlab / test / src / csvviewer / table.spec.ts View on Github external
it('should be the number of columns in the region', () => {
        let model = new CSVModel({ content: CSV_DATA });
        expect(model.columnCount('row-header')).to.be(1);
        expect(model.columnCount('body')).to.be(4);
      });
github jupyterlab / jupyterlab / test / src / csvviewer / table.spec.ts View on Github external
it('should instantiate a `CSVModel`', () => {
        let model = new CSVModel();
        expect(model).to.be.a(CSVModel);
      });
github jupyterlab / jupyterlab / test / src / csvviewer / table.spec.ts View on Github external
it('should be the number of rows in the region', () => {
        let model = new CSVModel({ content: CSV_DATA });
        expect(model.rowCount('column-header')).to.be(1);
        expect(model.rowCount('body')).to.be(1002);
      });
github jupyterlab / jupyterlab / test / src / csvviewer / table.spec.ts View on Github external
it('should accept content and delimiter values', () => {
        let content = 'foo';
        let delimiter = '\t';
        let model = new CSVModel({ content, delimiter });
        expect(model).to.be.a(CSVModel);
        expect(model.content).to.be(content);
        expect(model.delimiter).to.be(delimiter);
      });
github jupyterlab / jupyterlab / test / src / csvviewer / table.spec.ts View on Github external
it('should be settable', () => {
        let model = new CSVModel({ content: CSV_DATA });
        expect(model.content).to.be(CSV_DATA);
        model.content = 'foo';
        expect(model.content).to.be('foo');
      });