Zurück zum Ranking

TonyGermaneri/canvas-datagrid

JavaScript

Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.

datagriddatatablecomponentweb-component
Sterne-Wachstum
Sterne
1.6k
Forks
205
Wochenwachstum
Issues
142
5001k1.5k
Nov. 2016Jan. 2020Apr. 2023Juli 2026
Artefaktenpmnpm install canvas-datagrid
README

canvas-datagrid

Demo

canvas-datagrid

NPM License Published on webcomponents.org

  • Works with Firefox, Edge, Safari and Chrome.
  • Native support for touch devices (phones and tablets).
  • Rich documentation, tutorials, and slack support.
  • Single canvas element, drawn in immediate mode, data size does not impact performance.
  • Support for unlimited rows and columns without paging or loading.
  • Rich API of events, methods and properties using the familiar W3C DOM interface.
  • Extensible styling, filtering, formatting, resizing, selecting, and ordering.
  • Support for hierarchal drill in style row level inner grids as well grids in cells.
  • Customizable hierarchal context menu.
  • Built in and custom styles.
  • W3C Web Component. Works in all frameworks.
  • Per-user styles, column sizes, row sizes, view preferences and settings using localStorage.
  • Small file size

Documentation

Tutorials

Slack Support (message author for invite)

Style Builder

Download latest version (minified)

Tests

Source Code

Latest Test Coverage

Installation

With npm

npm install canvas-datagrid

Place the single source file ./dist/canvas-datagrid.js in your web page using a script tag that points to the source or use webpack.

<script src="dist/canvas-datagrid.js"></script>

Alternatively, instead of downloading and installing, you can link directly to an NPM CDN like unpkg.com.

<script src="https://unpkg.com/canvas-datagrid"></script>

A function will be added to the global scope of the web page called canvasDatagrid as well as module loader definitions.

Getting started

Works with webpack, without webpack or as a web component. No matter how you load it, canvasDatagrid is declared in the global scope.

Canvas-datagrid is a Web Component when in a compatible browser, otherwise it is a <canvas> tag.

Using pure JavaScript

var grid = canvasDatagrid();
document.body.appendChild(grid);
grid.data = [
  { col1: 'row 1 column 1', col2: 'row 1 column 2', col3: 'row 1 column 3' },
  { col1: 'row 2 column 1', col2: 'row 2 column 2', col3: 'row 2 column 3' },
];

Using Web Component

<canvas-datagrid class="myGridStyle" data="data can go here too"
  >[ {"col1": "row 1 column 1", "col2": "row 1 column 2", "col3": "row 1 column
  3"}, {"col1": "row 2 column 1", "col2": "row 2 column 2", "col3": "row 2
  column 3"} ]</canvas-datagrid
>

or

var grid = document.createElement('canvas-datagrid');
grid.data = [
  { col1: 'row 1 column 1', col2: 'row 1 column 2', col3: 'row 1 column 3' },
  { col1: 'row 2 column 1', col2: 'row 2 column 2', col3: 'row 2 column 3' },
];

Using Vue

<canvas-datagrid :data.prop="[{"col1": "row 1 column 1"}]"></canvas-datagrid>

More Demos

Note about XHR paging demo: Thanks to jservice for the use of the free paging API. You must "load unsafe scripts" or relevant command to allow HTTPS (github) to make XHR requests to HTTP (Jeopardy Questions API). There is nothing unsafe about this.

Building & Testing

To install development dependencies. Required to build or test.

npm install

To build production and debug versions:

npm run build

To build documentation:

npm run build:docs

To build types:

npm run build:types

To run tests. Note: Headless tests will mostly fail due to lack of headless canvas pixel detection support. Use VM testing or your browser.

npm test

Windows 10 WSL Testing

This is info for wsl version 1. v2 seems to be different.

  • CHROME_BIN needs to be set to the location of your Google Chrome exe in Windows. (e.g. /mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe) in WSL, export CHROME_BIN='path/to/chrome'
  • Chrome needs access to karma's temp folder.
    • Create a tmp folder on the same Windows drive as your repo.
    • set TEMP to a folder that exists on the same Windows drive as your repo. (matching capitalization probably matters) in WSL, export TEMP='/Temp/karma', if your repo is on drive C, then create folder C:\Temp\karma
  • karma.conf.js needs to be edited
    • Change the browser from ChromeHeadless to Chrome
    • Modify to run ChromeHeadless without sandboxing. This is not ideal, but it seems to be necessary in WSL and Linux containers (see also)
      • Add a custom launcher
        customLaunchers: {
          ChromeHeadlessNoSandbox: {
              base: 'ChromeHeadless',
              flags: ['--no-sandbox']
          }
        }
        
      • Change the browser from ChromeHeadless to ChromeHeadlessNoSandbox
Ähnliche Repositories
TanStack/table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

TypeScriptnpmMIT Licensereacttable
tanstack.com/table
28.2k3.6k
handsontable/handsontable

JavaScript Data Grid / Data Table with a Spreadsheet Look & Feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

JavaScriptnpmOtherexcelcrud-operations
handsontable.com/docs
22k3.2k
ag-grid/ag-grid

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

TypeScriptnpmOtherreactangular
ag-grid.com
15.5k2.1k
primefaces/primeng

The Most Complete Angular UI Component Library

TypeScriptnpmOtherangularui
primeng.org
12.5k5.1k
jspreadsheet/ce

Jspreadsheet is a lightweight JavaScript data grid component for creating interactive data grids with advanced spreadsheet controls.

JavaScriptnpmMIT Licensejavascriptspreadsheet
bossanova.uk/jspreadsheet/
7.2k891
glideapps/glide-data-grid

🚀 Glide Data Grid is a no compromise, outrageously fast react data grid with rich rendering, first class accessibility, and full TypeScript support.

TypeScriptnpmMIT Licensereactdata
grid.glideapps.com
5.3k414
swimlane/ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular

TypeScriptnpmMIT Licenseangulardatatable
swimlane.github.io/ngx-datatable/
4.7k1.7k
radzenhq/radzen-blazor

Radzen Blazor is the most sophisticated free UI component library for Blazor, featuring 145+ native components including DataGrid, Scheduler, Charts, and advanced theming with full support for Material Design and Fluent UI. If Radzen Blazor is useful to you, a ⭐ on GitHub helps other Blazor developers find it.

C#MIT Licenseblazorasp-net-core
blazor.radzen.com
4.3k953
xceedsoftware/wpftoolkit

All the controls missing in WPF. Over 1 million downloads.

C#Otherwpfcontrols
4.2k915
ruilisi/fortune-sheet

A drop-in javascript spreadsheet library that provides rich features like Excel and Google Sheets

TypeScriptnpmMIT Licenseexceljavascript
ruilisi.github.io/fortune-sheet-docs/
3.7k313
VisActor/VTable

VTable is not just a high-performance multidimensional data analysis table, but also a grid artist that creates art between rows and columns.

TypeScriptnpmMIT Licensedatagridgrid
visactor.io/vtable
3.6k482
Megabit/Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.

C#Otherblazoriseblazor
blazorise.com
3.5k535