Add charting functionality to SQL notebooks. (#9306)

This commit is contained in:
Cory Rivera
2020-02-26 10:52:19 -08:00
committed by GitHub
parent ff207859d6
commit 412214e193
6 changed files with 107 additions and 63 deletions

View File

@@ -336,6 +336,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
public id = generateUuid();
readonly element: HTMLElement = this.container;
protected tableContainer: HTMLElement;
private _state: GridTableState;
@@ -366,7 +367,6 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
this.state = state;
this.container.style.width = '100%';
this.container.style.height = '100%';
this.container.className = 'grid-panel';
this.columns = this.resultSet.columnInfo.map((c, i) => {
let isLinked = c.isXml || c.isJson;
@@ -435,11 +435,12 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
this.container.appendChild(actionBarContainer);
}
let tableContainer = document.createElement('div');
tableContainer.style.display = 'inline-block';
tableContainer.style.width = `calc(100% - ${ACTIONBAR_WIDTH}px)`;
this.tableContainer = document.createElement('div');
this.tableContainer.className = 'grid-panel';
this.tableContainer.style.display = 'inline-block';
this.tableContainer.style.width = `calc(100% - ${ACTIONBAR_WIDTH}px)`;
this.container.appendChild(tableContainer);
this.container.appendChild(this.tableContainer);
let collection = new VirtualizedCollection(
50,
@@ -463,7 +464,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
defaultColumnWidth: 120
};
this.dataProvider = new AsyncDataProvider(collection);
this.table = this._register(new Table(tableContainer, { dataProvider: this.dataProvider, columns: this.columns }, tableOptions));
this.table = this._register(new Table(this.tableContainer, { dataProvider: this.dataProvider, columns: this.columns }, tableOptions));
this.table.setTableTitle(localize('resultsGrid', "Results grid"));
this.table.setSelectionModel(this.selectionModel);
this.table.registerPlugin(new MouseWheelSupport());