Show HN: React-data sheet, Excel-like spreadsheet component
nadbm.github.io
nadbm.github.io
Unless you are Microsoft or Google and you are putting spreadsheets on a website (SoW), you are almost certainly doing something wrong.
---
Case 1: A co-worker (or yourself) previously wrote an excel-based app and now it's time to put it on the web for wider distribution. You implement the app with a custom gridview/spreadsheet.
Error in Case 1: The UI was copied, but what is almost always needed is an input wizard with validations and workflow along with a reporting backend.
---
Case 2: You have a database that you need to share in a human readable format.
Error in Case 2: Implement export functionality instead, you will never be able to implement all the features of Excel, and at some point someone will need that feature.
---
Case 3: You have a very small and well defined case that actually calls for SoW!
Error in Case 3: Your very small SoW app will grow and grow and strangle you.
---
Case 4: You want to challenge the stranglehold of Google Sheets and MS Office 365.
Error in Case 4: There is no error here, only madness.
Then give me madness. The problem is that spreadsheets are one of the most natural interfaces for data that we humans have, and even with Microsoft and Google's efforts included, current spreadsheets on a website (SoW) suck.
So let's say the y-axis is importance of function and the x-axis is compelling implementation --> voila! Right there, plotted on the graph you can see that this is something that needs to be worked on.
I understand your reasoning: you've created a spreadsheet-styled labeled grid in no time and you're pumping your fist, only to find out later that it this is way less than 1% of the effort you will eventually have to dole out to make a basic, respectable spreadsheet. The landscape is littered with 1% efforts that look good until you start working with it.
My point, though, is that this area is too important to not try harder, to not see more true attempts.
Spreadsheets are natural for data, but not for humans. Spreadsheets are excellent for prototyping and data munging; and spreadsheet prototype apps are even fine for personal or small team use.
When you get medium team size or multiple small teams that spreadsheets break down.
Part of that breakdown is in distribution - which SoW solves.
But another part of that breakdown is in not understanding the implicit rules of the spreadsheet app - another team or person will put some garbage in a cell and break the 'app'.
I don't think that's a failure of the model but merely of the implementation. We can fix that. The model is right.
Anything that solves the problem of implicit rules in spreadsheets is a UI or UX solution.
The question is, what is the best UI or UX solution?
My position is that the best UX is not a spreadsheet. To your point, it is possible that there is an acceptable UI or UX based on spreadsheets.
The next question would be, how much more difficult is it to create human driven spreadsheets than to create a classic UX solution (something like an input wizard)?
I absolutely agree - REPLs are excellent for prototyping and exploring data and ideas, and spreadsheets are excellent in that role.
Allow me to ask you this then: when was the last time you shipped prototype code? Unless you live dangerously, you don't ship prototype code!
> The only problem is that Google and Microsoft don't care enough to make them powerful enough to do general purpose computation with, fast enough to build large systems with, versionable enough to enable large teams to use them.
I would counter that a more important problem is "productionalizing" spreadsheets - all of the fiddly things you do to ensure inputs are in the right format, etc, etc, along with testing, securing, and deploying code.
People get fixated on the code or UI in front of them and they don't think about the actual use cases.
fix-data-table is performant and easily extendable. I was able to create an editable grid similar to googlesheets in a months worth of work. working on open sourcing it soon.
We (Metabase) switched from FixedDataTable to React Virtualized and are happier with it. The only major issue with it is doesn't have fixed columns/rows built in, but it's pretty easy to compose a couple Grids with ScrollSync to get that behavior (https://bvaughn.github.io/react-virtualized/#/components/Scr...)
FixedDataTable has performance issues with a larger number of columns because it doesn't "virtualize" columns (https://github.com/facebook/fixed-data-table/issues/49). The DOM it generates is also much heavier (several elements for every cell vs. 1 with React Virtualized)
Thanks for the response. My team fixed those performance issues in the source. It is one of the reasons we want to open source it.
FYI: there was a new "MultiGrid"[1] high level component that was added in 8.9.0 [2] which helps facilitate fixed columns/rows with less boilerplate.
Though, nearly every time I've used the MultiGrid component, I've found myself eventually dropping back to ScrollSync + Grids/Lists. As the product grows in complexity, adding more complex interactions to MultiGrid is difficult as it doesn't expose all of the Grid API.
[1]: https://bvaughn.github.io/react-virtualized/#/components/Mul... [2]: https://github.com/bvaughn/react-virtualized/blob/master/CHA...
That's a good point. We probably don't need to use a Grid for the header (I've wrestled with trying to hide scrollbars in headers a fair amount)
One of the reasons we decided to maintain this library is that it does virtualize both columns and rows. We use it at Schrodinger for our enterprise platform and have demo'd support of billions of rows. This is possible because we don't use a wrapper DOM element to handle scrolling. Right now we are migrating all the state to Redux for better maintainability and performance and hope to make extending and optimizing the library more user friendly.
misiti3780 would you be interested in collaborating with us to help us capture your improvements as well?
[1] https://github.com/AllenFang/react-bootstrap-table
[2] http://allenfang.github.io/react-bootstrap-table/example.htm...
[3] http://allenfang.github.io/react-bootstrap-table/example.htm...
For anyone interested in learning React, I keep a big list of links to high-quality tutorials and articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . Specifically intended to be a great starting point for anyone trying to learn the ecosystem, as well as a solid source of good info on more advanced topics.
The most feature filled spreadsheet component today is Handsontable. My company pays for the enterprise version of it...And we wish there was something better.
It's too expensive IMO. But if you are not using it commercially, it's on Github.
The thing is, it carries too much baggage. It took them many months to even put it on npm. Adding features takes a lot of effort.
Its 149$ for a year - its not at all bad and I love supporting them.
But there's space to innovate - look at Airtable. I would love to have a component that looks like Airtable frontend.
(bias alert: I'm part of the team)
It's not free, but IMO it's the most Excel-like Web-based spreadsheet money can buy. You get support for Excel syntax and formulas, hundreds of Excel functions, XLSX import/export, print-to-PDF, virtual scrolling, OS clipboard integration, etc. — and it all runs in the browser.
If I tried and found myself liking kendo-ui, I'd probably end up even more frustrated from not being able to use it for personal projects.
EDIT: Just wanna add that you guys have done great work. Poking around the component demos is really slick.
Second - we use react and kendo had started exploring react only in oct2016 (we have our react HOT app in production since Nov 2015). I'm Not sure what's the status since googling for a react kendo spreadsheet component does not get me much.
But I would switch If you had a clean pricing for the spreadsheet, clearly showed by comparison where it was superior..And most importantly, react.
Somewhat off-topic, but for those working in React, have you built large systems using Redux? I'm fairly early in what is likely to ultimately be a large-ish application, and while I've got Redux working, I feel working with it is definitely adding cognitive load to each feature I implement. Just wondering whether it's worth the effort and would appreciate feedback from those who may have more experience weighing the pros and cons of using Redux with their application.
Create namespaces in your store, it helps a ton with maintainability in the long run. Name your mutations consistently: describe what you're doing to what kind of data as briefly as you can.
Keeping these few guidelines in mind, building huge applications using any flux-like pattern is quite straight-forward and easy to reason about.
FYI, there's also a bunch of other immutable update utility libs besides immutability-helper. I have a list of them in my Redux addons catalog [2].
[0] https://www.reddit.com/r/javascript/comments/4rcqpx/dan_abra...
[1] https://github.com/markerikson/react-redux-links/blob/master...
[2] https://github.com/markerikson/redux-ecosystem-links/blob/ma...
I'm considering syntax-level support for `immutability-helper`, which seems like the best all-around solution aside from its syntax. This is for a JS Dialect I'm building called LightScript[0].
Would look something like:
store.people[0].friends[0].name~~set("Alice")
which would compile to: update(store, {
people: {
[0]: {
friends: {
[0]: {
name: { $set: "Alice" }
}
}
}
}
})
Would love thoughts/feedback (here or on the project Gitter[1])[0] http://lightscript.org [1] https://gitter.im/lightscript/Lobby
The Redux FAQ has an entry on "scaling" [0], and my React/Redux links list has a large section on Redux architecture and best practices [1].
[0] http://redux.js.org/docs/faq/Performance.html#performance-sc...
[1] https://github.com/markerikson/react-redux-links/blob/master...
If you have more than a few bits of state to manage, use multiple reducers and split your state into logical groups. Within each reducer, I use immutable.js `Record`s as the main state container. I also use Flow to strongly-type these reducers and get autocomplete and type checking of my state, but the benefits of that are mostly orthogonal to the benefits of using Redux.
You should almost never try to "denormalize" data (store the same thing in multiple places) or eg. use Redux state to initialize a component's local state. Trying to keep these in sync will kill your mental model. Instead, use selectors to keep components in sync, and if a particular view is costly to compute as a function of your state you can memoize it (I use https://github.com/reactjs/reselect for that). But that's extra complexity that should only be added in the few cases that warrant it.
I found that by organizing my code this way I was able to keep the parts of the app that I needed to make any particular change in my head easily, which did incredible things for developer velocity and happiness. :)
It's great to see that Nadim started to work on this spreadsheet for React. It's for sure an ambitious project and will require a lot of community support and love;) We at Handsontable benefit from the open source since 2012 and most of ~3400 closed issues to date were reported by users who actually care about our product and/or make a good use of it.
Here are some thoughts which anyone who attempt to create an online spreadsheet from scratch should take into account:
- Separate data logic from the view. Sounds like a cliché but actually it will save you plenty of time when you start adding more and more features to the pile. - Get to know how people want to use your app. Focus on their workflow not on your (false) assumptions. - Don't mix up features typical for grids with those present in spreadsheets. Focus on what's important, not on Excel's blows and whistles. Grouping is OK. Parent-child structure not necessarily. - Don't underestimate the effort connected with building such component. Ask the community for help. Give them a great product in return. - At some point your "data engine" will work just like a small, specialised database (CRUD + search/filter/sort). - Think of how you will scale your solution both horizontally (new technologies) and vertically (new features). Our customers have completely remote requirements in terms of using Handsontable with specific databases, back-ends, JS/CSS frameworks, devices (not to mention different formats of numbers, languages etc.)
Offtopic: In the contemporary history we have seen a lot of attempts to make an ultimate online spreadsheet. Most of those projects are now long gone (see https://www.lifewire.com/best-free-online-spreadsheets-34862...). That was before Google acquired 2Web Technologies and created its own, free solution upon it. The trend is to create spreadsheet-based projects for certain use cases just like Quip, Smartsheet, Airtable and more.
Anyway, fingers crossed for your project. I will be happy to share with you our best practices and thoughts from our work with Handsontable (write @ chris [at] handsoncode.net).
Cheers, Chris
But, I can just imagine running this one by the patent attorneys as an open source library to include in our product.
They're worried about getting sued by Microsoft, Google, etc. for patent infringement.
What they seem to do is hire a grunt to do a naive word search match on the patent database. So I was saying, "just imagine the number of results that will come back for 'spreadsheet' or 'Excel'".
Testing would be the easy part, in some cases it would be easier than DOM because you can do image diffs... The harder part is BUILDING IT.
I've gone back on forth on this topic quite a bit. I used to be a strong believer you should virtualize everything. But then you've broken in-browser search, and you find yourself having to write and support even more code. Using canvas? Say goodbye to accessibility. Now, I'm not saying this is the case for your use-case, but I think that in some cases it's worth seriously reconsidering the design and just going with a simple table that leverages built-in browser functionality and traditional pagination. If you have so much data that you struggle to load and display it with JS, it may be a good idea to take a step back and explore alternative strategies for presenting the data to your users. As an extreme example, a 1 million by 1 million table would probably contain too much data for any consumer to really make sense of it. I only say this because I had a couple experiences where having heard that might've helped keep things simpler. I'll still happily reach for react-virtualized when I find a situation that merits its use.
[0] https://bvaughn.github.io/react-virtualized/#/components/Gri...
[1] spreadserve.com
Perhaps a future version will focus on making sure it scales?
The best option I had when building this was Handsontable. But that doesn't play nicely with react's virtual dom and immutable data.
One thing I'm wondering about... if this is React based, do you reassign and recalculate the whole grid upon every change? Because the grid is probably a component, and has the table as props. I could imagine that is inefficient... Not to even speak of then rendering the whole component and sending it through DOM reconciliation every time a key is pressed.
Well, OTOH I guess it doesn't matter for small tables. The demo feels really snappy!
https://bvaughn.github.io/react-virtualized/#/components/Gri...
Lately I have been looking into javascript grid components and have not found a good solution.
What would be a good javascript grid component that satisfies the following: 1. Integrates easily with Vue 2. Has sorting 3. Has grouping 4. Has inline editing (formulas are not required)?
OTOH I would be happy with a software that is basically a web frontend for Postgres that can be customised in a way that a client can only see and edit specific fields based on assigned rights.
IMO grids (and trees, etc.) only work well if they are framework-specific.
Here's a table that could evolve into an editable grid:
Take a look at Adminer [1] and their Adminer Editor [2] (the later is what you're asking for).
[1] http://adminer.org/ [2] https://www.adminer.org/en/editor/
This project is a proof-of-concept. Nothing more than that.
Can someone suggest something simple for React and/or vanilla Javascript? (would be interested in both)