I’m Afshin, the creator of Grid.js. Grid.js is an open-source table library written in TypeScript and published under MIT license. My goal is to develop a framework agnostic table library that: - Works everywhere. You don’t need a specific framework to use Grid.js - Lightweight and easy to use - Fully documented and tested - Developer friendly. Grid.js is written in TypeScript!
Supports all modern web browsers Please take a look at the examples (https://gridjs.io/docs/examples/hello-world) section and let us know if you have any suggestions. Although Grid.js is currently designed to work with web-browsers, I’m actively thinking and working on adding other integrations like React Native (see https://gridjs.io/docs/philosophy) Please let me know if you have any suggestions or comments. Happy hacking! :computer:
It looks like sorting / pagination is all down client side which forces a download of all the rows, how well does this support tables with 10s or 100s of thousands of rows?
Correct. I have a PR ready which integrates the sort, search and pagination with the server-side module. Currently, there is a Server Side module that pulls data from the server (https://gridjs.io/docs/examples/server).
Quick tip: for the client-side, large dataset case, if you want to get fancy it's possible to create a worker thread and perform the sort there, which makes it somewhat faster but more importantly stops it from freezing up the tab while it operates. We did this to great success at my last company when we needed to sort ~200,000 items client-side. The UI thread remained perfectly responsive during the operation and we were able to present the user with a loading spinner while it worked.
Great work - really clean documentation, and it looks beautiful!
We currently use `react-table`, which is good in that it can support some reasonably large datasets (for instance, here's 2 million rows on the client-side - https://datapane.com/leo/reports/table-test/ - a bit laggy with sorting, but passable). This may not be the use-case you're going after at all, but have you run any benchmarks for how big a dataset you can support?
Well, it is on our roadmap! With Grid.js you will be able to sort, search or process data in a separate thread (Web Worker) and then pass the results to the main thread to render. I'm also thinking about lazy-loading the table rows. Both the Web Worker bit and lazy-loading will be added in a week or two.
Cool! Have you checked out https://github.com/bvaughn/react-virtualized too? Might be totally useless to you, but I think they've done a lot under the hood to optimise table loading.
Oh great! I guess the columns are not properly rendered because there are a lot of columns. That looks like a bug to me. I just created two issues and will release a bug fix soon.
I took a look at it appears the observable notebook has a stylesheet defined with a table element style that sets a table's max-width to 640px. That is why it is not expanding to fill the width. (I am not associated with the project)
Good effort! I'm not sure how 'advanced' it is though. I'd even go as far as call it 'simple'?
E.g. the following features would be required to make it advanced (list not complete): - Export data (csv) - Align columns based on their content - Tree data (parent/child rows) - Total rows - Formatting applied based on data type (currency, numerical etc.) - Reordering columns - Resizing columns - Hiding columns - Optional filter field for every column - Conditional formatting - Tripple Sorting & Multiple sorting (sort by more than 1 column at a time) - ... more In the react world, I found this to be a good foundation for an 'advanced' table. Since it's rather inconsistently developed, I ended up forking it for myself and working on my own copy, removing unneeded elements and enhancing with everything else I do need. https://material-table.com/
I agree that Grid.js is not a full-featured plugin _yet_ and it's still missing essential features, like those that you mentioned but please bear in mind that: - I have only released the first version of the library. - I have been focusing on fundamental blocks of a lightweight _data processing_ library (see: https://github.com/grid-js/gridjs/tree/master/src/pipeline). That's what took most of my time. - Grid.js is framework agnostic which is a bit different compared to other libs The pipeline is very easy to extend and I'm confident that most of those features will be added soon.
I don't doubt that you can and possibly will make this a great library. It seems like a nice and clean foundation for one. I just commented on the word 'advanced' in the title. You admitted yourself that it's missing essential features, so advanced might be an adjective you'd want to use for release 2.0 ;)
How accessible is Grid.js? The main differentiator between table libraries for me these days is accessibility. Many libraries and frameworks out there do it poorly. The better ones are often tied to company-specific frameworks.
From playing around a bit, I've at least noticed that sortable headers have no focus indicator, the "sort column ascending" text gets included in the column's accessible name, and un-sortable column headers are read as clickable by screen readers. I would LOVE a framework-agnostic table library that's both lightweight and fully accessible. If there's a chance for Grid.js to take this in its philosophy, I would be all in!
I just created a ticket to work on this aspect of the library soon. I'd appreciate if you add your comments to https://github.com/grid-js/gridjs/issues/25 if you think there is any specific components that needs immediate improvement.
> The better ones are often tied to company-specific frameworks.
That is because to implement accessibility in a grid/tree widget to a meaningful level, you need a lot of underlying code. Even in modern browsers. Source: implemented accessibility in Ext JS framework. One of the most often asked questions from users of Ext JS was: hey, can we have the Grid widget without all the bloat? Sure, and ~95% of the framework exists so that the Grid can have its features and work reliably across all the browsers. You can probably do without the rest 5%, no biggie.
I have, it's amazing. The only thing it's missing is drag and drop to outside divs. Other than that, it's feature rich, very customizable and the best from all other js grids I tried.
Comments (132) 38 threads
I’m Afshin, the creator of Grid.js.
Grid.js is an open-source table library written in TypeScript and published under MIT license.
My goal is to develop a framework agnostic table library that:
- Works everywhere. You don’t need a specific framework to use Grid.js
- Lightweight and easy to use
- Fully documented and tested
- Developer friendly. Grid.js is written in TypeScript! Supports all modern web browsers
Please take a look at the examples (https://gridjs.io/docs/examples/hello-world) section and let us know if you have any suggestions.
Although Grid.js is currently designed to work with web-browsers, I’m actively thinking and working on adding other integrations like React Native (see https://gridjs.io/docs/philosophy)
Please let me know if you have any suggestions or comments. Happy hacking! :computer:
Continue this thread — 1 reply
We currently use `react-table`, which is good in that it can support some reasonably large datasets (for instance, here's 2 million rows on the client-side - https://datapane.com/leo/reports/table-test/ - a bit laggy with sorting, but passable). This may not be the use-case you're going after at all, but have you run any benchmarks for how big a dataset you can support?
Well, it is on our roadmap! With Grid.js you will be able to sort, search or process data in a separate thread (Web Worker) and then pass the results to the main thread to render.
I'm also thinking about lazy-loading the table rows. Both the Web Worker bit and lazy-loading will be added in a week or two.
Congrats again on a beautiful product.
Continue this thread — 1 reply
Any idea why the columns aren't displaying correctly for wider tables? Take a look at this example:
https://observablehq.com/@simonw/grid-js-with-datasette?url=...
Thanks!
The correct response :-)
Please take a look and let me know what you think!
Looks like it's made with Facebook's Docusaurus.
Continue this thread — 3 more replies
E.g. the following features would be required to make it advanced (list not complete):
- Export data (csv)
- Align columns based on their content
- Tree data (parent/child rows)
- Total rows
- Formatting applied based on data type (currency, numerical etc.)
- Reordering columns
- Resizing columns
- Hiding columns
- Optional filter field for every column
- Conditional formatting
- Tripple Sorting & Multiple sorting (sort by more than 1 column at a time)
- ... more
In the react world, I found this to be a good foundation for an 'advanced' table. Since it's rather inconsistently developed, I ended up forking it for myself and working on my own copy, removing unneeded elements and enhancing with everything else I do need.
https://material-table.com/
I agree that Grid.js is not a full-featured plugin _yet_ and it's still missing essential features, like those that you mentioned but please bear in mind that:
- I have only released the first version of the library.
- I have been focusing on fundamental blocks of a lightweight _data processing_ library (see: https://github.com/grid-js/gridjs/tree/master/src/pipeline). That's what took most of my time.
- Grid.js is framework agnostic which is a bit different compared to other libs
The pipeline is very easy to extend and I'm confident that most of those features will be added soon.
From playing around a bit, I've at least noticed that sortable headers have no focus indicator, the "sort column ascending" text gets included in the column's accessible name, and un-sortable column headers are read as clickable by screen readers.
I would LOVE a framework-agnostic table library that's both lightweight and fully accessible. If there's a chance for Grid.js to take this in its philosophy, I would be all in!
I just created a ticket to work on this aspect of the library soon. I'd appreciate if you add your comments to https://github.com/grid-js/gridjs/issues/25 if you think there is any specific components that needs immediate improvement.
That is because to implement accessibility in a grid/tree widget to a meaningful level, you need a lot of underlying code. Even in modern browsers. Source: implemented accessibility in Ext JS framework.
One of the most often asked questions from users of Ext JS was: hey, can we have the Grid widget without all the bloat? Sure, and ~95% of the framework exists so that the Grid can have its features and work reliably across all the browsers. You can probably do without the rest 5%, no biggie.
[1] http://www.tabulator.info/
Continue this thread — 1 reply
Continue this thread — 1 more reply
All comments shown.
Couldn't load more comments. Check your connection and try again.