How to use the @jupyterlab/csvviewer.CSVDelimiter 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 / toolbar.spec.ts View on Github external
it('should allow pre-selecting the delimiter', () => {
        const wanted = DELIMITERS[DELIMITERS.length - 1];
        const widget = new CSVDelimiter({ selected: wanted });
        expect(widget.selectNode.value).to.equal(wanted);
        widget.dispose();
      });
    });
github jupyterlab / jupyterlab / tests / test-csvviewer / src / toolbar.spec.ts View on Github external
it('should instantiate a `CSVDelimiter` toolbar widget', () => {
        const widget = new CSVDelimiter({ selected: ',' });
        expect(widget).to.be.an.instanceof(CSVDelimiter);
        expect(Array.from(widget.node.classList)).to.contain('jp-CSVDelimiter');
        widget.dispose();
      });
github jupyterlab / jupyterlab / tests / test-csvviewer / src / toolbar.spec.ts View on Github external
it('should be safe to call multiple times', () => {
        const widget = new CSVDelimiter({ selected: ',' });
        expect(widget.isDisposed).to.equal(false);
        widget.dispose();
        widget.dispose();
        expect(widget.isDisposed).to.equal(true);
      });
    });
github jupyterlab / jupyterlab / tests / test-csvviewer / src / toolbar.spec.ts View on Github external
it('should emit a value when the dropdown value changes', () => {
        const widget = new CSVDelimiter({ selected: ',' });
        let delimiter = '';
        const index = DELIMITERS.length - 1;
        const wanted = DELIMITERS[index];
        widget.delimiterChanged.connect((s, value) => {
          delimiter = value;
        });
        Widget.attach(widget, document.body);
        widget.selectNode.selectedIndex = index;
        simulate(widget.selectNode, 'change');
        expect(delimiter).to.equal(wanted);
        widget.dispose();
      });
    });