How to use the @lumino/datagrid.DataGrid.defaultStyle function in @lumino/datagrid

To help you get started, we’ve selected a few @lumino/datagrid 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 / lumino / examples / example-datagrid / src / index.ts View on Github external
function main(): void {

  let model1 = new LargeDataModel();
  let model2 = new StreamingDataModel();
  let model3 = new RandomDataModel(15, 10);
  let model4 = new RandomDataModel(80, 80);
  let model5 = new JSONModel(Data.cars);

  let blueStripeStyle: DataGrid.Style = {
    ...DataGrid.defaultStyle,
    rowBackgroundColor: i => i % 2 === 0 ? 'rgba(138, 172, 200, 0.3)' : '',
    columnBackgroundColor: i => i % 2 === 0 ? 'rgba(100, 100, 100, 0.1)' : ''
  };

  let brownStripeStyle: DataGrid.Style = {
    ...DataGrid.defaultStyle,
    columnBackgroundColor: i => i % 2 === 0 ? 'rgba(165, 143, 53, 0.2)' : ''
  };

  let greenStripeStyle: DataGrid.Style = {
    ...DataGrid.defaultStyle,
    rowBackgroundColor: i => i % 2 === 0 ? 'rgba(64, 115, 53, 0.2)' : ''
  };

  let lightSelectionStyle: DataGrid.Style = {
    ...DataGrid.defaultStyle,