本文整理汇总了TypeScript中@beakerx/tableDisplay/dataGrid/store/BeakerXDataStore.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('BeakerXDataGridModel.hasIndex === true', () => {
const dataStore = createStore({
...modelStateMock,
hasIndex: true
});
const dataGrid = new BeakerXDataGrid({}, dataStore);
const beakerxDataGridModel = dataGrid.model;
it('should return proper data', () => {
expect(beakerxDataGridModel.data('corner-header', 0, 0)).to.equal('test');
expect(beakerxDataGridModel.data('column-header', 0, 0)).to.equal('column');
expect(beakerxDataGridModel.data('row-header', 0, 0)).to.equal(1);
expect(beakerxDataGridModel.data('body', 0, 0)).to.equal(2);
});
it('should return the proper row count', () => {
expect(beakerxDataGridModel.rowCount('body')).to.equal(2);
expect(beakerxDataGridModel.rowCount('column-header')).to.equal(1);
});
it('should return the proper column count', () => {
expect(beakerxDataGridModel.columnCount('body')).to.equal(1);
expect(beakerxDataGridModel.columnCount('row-header')).to.equal(1);
});
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:25,代码来源:BeakerxDataGridModel.spec.ts
示例2: before
before(() => {
dataStore = createStore(modelStateMock);
dataGrid = new BeakerXDataGrid({}, dataStore);
column = dataGrid.columnManager.bodyColumns[0];
columnMenu = column.menu;
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:7,代码来源:ColumnMenu.spec.ts
示例3: createStore
describe('ValueHighlighter', () => {
const dataStore = createStore(modelStateMock);
const dataGrid = new BeakerXDataGrid({}, dataStore);
const column = new DataGridColumn(
columnOptionsMock,
dataGrid,
dataGrid.columnManager
);
let valueHighlighter = new ValueHighlighter(
column,
{ ...highlighterStateMock, type: HIGHLIGHTER_TYPE.value }
);
it('should be an instance of highlighter', () => {
expect(valueHighlighter).to.be.an.instanceof(ValueHighlighter);
});
it('should have the getBackgroundColor method', () => {
expect(valueHighlighter).to.have.property('getBackgroundColor');
});
it('should have the midColor state property', () => {
expect(valueHighlighter.state).to.have.property('colors');
});
it('should return proper backgroud color', () => {
expect(valueHighlighter.getBackgroundColor(cellConfigMock))
.to.equal('#ff0000');
expect(valueHighlighter.getBackgroundColor({ ...cellConfigMock, row: 1 }))
.to.equal('#00ff00');
});
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:33,代码来源:ValuesHighlighter.spec.ts
示例4: createStore
describe('UniqueEntriesHighlighter', () => {
const dataStore = createStore({ ...modelStateMock, types: ['double', 'double']});
const dataGrid = new BeakerXDataGrid({}, dataStore);
const column = new DataGridColumn(
columnOptionsMock,
dataGrid,
dataGrid.columnManager
);
let uniqueEntriesHighlighter = new UniqueEntriesHighlighter(
column,
{ ...highlighterStateMock, type: HIGHLIGHTER_TYPE.uniqueEntries }
);
it('should be an instance of highlighter', () => {
expect(uniqueEntriesHighlighter).to.be.an.instanceof(UniqueEntriesHighlighter);
});
it('should have the getBackgroundColor method', () => {
expect(uniqueEntriesHighlighter).to.have.property('getBackgroundColor');
});
it('should have the midColor state property', () => {
expect(uniqueEntriesHighlighter.state).to.have.property('colors');
});
it('should return proper backgroud color', () => {
expect(uniqueEntriesHighlighter.getBackgroundColor(cellConfigMock))
.to.include('85%, 85%)');
expect(uniqueEntriesHighlighter.getBackgroundColor({ ...cellConfigMock, value: 0 }))
.to.include('85%, 85%)');
expect(uniqueEntriesHighlighter.getBackgroundColor({ ...cellConfigMock, value: 0.5 }))
.to.equal('');
});
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:35,代码来源:UniqueEntriesHighlighter.spec.ts
示例5: before
before(() => {
dataStore = createStore(modelStateMock);
dataGrid = new BeakerXDataGrid({}, dataStore);
cellManager = dataGrid.cellManager;
cellSelectionManager = dataGrid.cellSelectionManager;
cellSelectionManager.setStartCell(cellDataMock);
cellSelectionManager.setEndCell({ ...cellDataMock, column: 1 });
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:8,代码来源:CellManager.spec.ts
示例6: createStore
describe('ColumnFilter', () => {
const dataStore = createStore(modelStateMock);
const dataGrid = new BeakerXDataGrid({}, dataStore);
const columnManager = dataGrid.columnManager;
const bodyDataGridColumn = columnManager.bodyColumns[0];
const columnFilter = bodyDataGridColumn.columnFilter;
it('should be an instance of ColumnFilter', () => {
expect(columnFilter).to.be.an.instanceof(ColumnFilter);
});
it('should have HTML node properties', () => {
expect(columnFilter).to.have.property('filterNode');
expect(columnFilter.filterNode).to.be.an.instanceof(HTMLElement);
expect(columnFilter).to.have.property('filterIcon');
expect(columnFilter.filterIcon).to.be.an.instanceof(HTMLSpanElement);
expect(columnFilter).to.have.property('clearIcon');
expect(columnFilter.clearIcon).to.be.an.instanceof(HTMLSpanElement);
expect(columnFilter).to.have.property('filterInput');
expect(columnFilter.filterInput).to.be.an.instanceof(HTMLInputElement);
});
it('should show the filter input', () => {
columnFilter.showFilterInput(false);
expect(columnFilter.filterWidget.isHidden).to.be.false;
expect(columnFilter.filterIcon.classList.contains('fa-filter')).to.be.true;
expect(columnFilter.useSearch).to.be.false;
expect(columnFilter.filterInput.title).to.equal(FILTER_INPUT_TOOLTIP);
});
it('should show the search input', () => {
columnFilter.showSearchInput(false);
expect(columnFilter.filterWidget.isHidden).to.be.false;
expect(columnFilter.filterIcon.classList.contains('fa-search')).to.be.true;
expect(columnFilter.useSearch).to.be.true;
expect(columnFilter.filterInput.title).to.equal(SEARCH_INPUT_TOOLTIP);
});
it('should hide the input', () => {
columnFilter.hideInput();
expect(columnFilter.filterWidget.isHidden).to.be.true;
});
it('should filter rows', () => {
const event = new KeyboardEvent('keyup', { key: '0', code: 'Digit0' });
expect(dataGrid.model.rowCount('body')).to.equal(2);
columnFilter.useSearch = false;
columnFilter.filterInput.value = '$>0';
columnFilter['filterHandler'](event);
expect(dataGrid.model.rowCount('body')).to.equal(1);
columnManager.resetFilters();
expect(dataGrid.model.rowCount('body')).to.equal(2);
});
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:58,代码来源:ColumnFilter.spec.ts
示例7: before
before(() => {
dataStore = createStore(modelStateMock);
dataGrid = new BeakerXDataGrid({}, dataStore);
gc = new GraphicsContext(dataGrid['_canvasGC']);
gc['_context'].fillText = () => {};
cellRenderer = new DefaultCellRenderer(dataGrid);
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:9,代码来源:DefaultCellRenderer.spec.ts
示例8: before
before(() => {
dataStore = createStore({ ...modelStateMock, headersVertical: true });
dataGrid = new BeakerXDataGrid({}, dataStore);
gc = new GraphicsContext(dataGrid['_canvasGC']);
gc['_context'].fillText = () => {};
cellRenderer = new HeaderCellRenderer(dataGrid);
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:9,代码来源:HeaderCellRenderer.spec.ts
示例9: it
it('should set correct column header row size', () => {
const dataStore = createStore({
...modelStateMock,
headerFontSize: NaN,
dataFontSize: null
});
const dataGrid = new BeakerXDataGrid({}, dataStore);
expect(dataGrid.baseRowSize).to.equal(DEFAULT_ROW_HEIGHT);
expect(dataGrid.baseColumnHeaderSize).to.equal(DEFAULT_ROW_HEIGHT);
dataGrid.destroy();
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:13,代码来源:DataGridResize.spec.ts
示例10: createStore
describe('ThreeColorHeatmapHighlighter', () => {
const dataStore = createStore({ ...modelStateMock, types: ['double', 'double']});
const dataGrid = new BeakerXDataGrid({}, dataStore);
const column = new DataGridColumn(
columnOptionsMock,
dataGrid,
dataGrid.columnManager
);
let threeColorHeatmapHighlighter = new ThreeColorHeatmapHighlighter(
column,
{ ...highlighterStateMock, type: HIGHLIGHTER_TYPE.threeColorHeatmap }
);
it('should be an instance of highlighter', () => {
expect(threeColorHeatmapHighlighter).to.be.an.instanceof(HeatmapHighlighter);
});
it('should have the getBackgroundColor method', () => {
expect(threeColorHeatmapHighlighter).to.have.property('getBackgroundColor');
});
it('should have the minColor state property', () => {
expect(threeColorHeatmapHighlighter.state).to.have.property('minColor');
});
it('should have the maxColor state property', () => {
expect(threeColorHeatmapHighlighter.state).to.have.property('maxColor');
});
it('should have the midColor state property', () => {
expect(threeColorHeatmapHighlighter.state).to.have.property('midColor');
});
it('should return proper backgroud color', () => {
expect(threeColorHeatmapHighlighter.getBackgroundColor(cellConfigMock))
.to.equal('rgb(255, 0, 0)');
expect(threeColorHeatmapHighlighter.getBackgroundColor({ ...cellConfigMock, value: 0 }))
.to.equal('rgb(0, 0, 255)');
expect(threeColorHeatmapHighlighter.getBackgroundColor({ ...cellConfigMock, value: 0.5 }))
.to.equal('rgb(0, 255, 0)');
});
});
开发者ID:twosigma,项目名称:beaker-notebook,代码行数:43,代码来源:ThreeColorHeatmapHighlighter.spec.ts
注:本文中的@beakerx/tableDisplay/dataGrid/store/BeakerXDataStore.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论