Live data from Hacker News

Show HN: X-spreadsheet – A JavaScript canvas spreadsheet for web

github.com

1–10 of 108 posts

Re: Show HN: X-spreadsheet – A JavaScript canvas spreadsheet for web

#7
post #4

I think a description of why canvas was used would be nice in the README. My (probably naive) view is that browsers are pretty good at table-ish layouts so it’d be great to know why canvas was chosen.

> My (probably naive) view is that browsers are pretty good at table-ish layouts so it’d be great to know why canvas was chosen.

The browser certainly makes this convenient... until you have more than a few thousand cells. At some point even just having the whole table loaded into the DOM is too layout and memory intensive (except on servo, sometimes).

When you try, then, to work around those limitations, continuing to use the DOM for it becomes impractical. This gets especially difficult with a spreadsheet, where row and column size is user defined, and thus a scroll offset is a sum of all of those sizes.

I've done this several times, so I eventually settled on a bucketed, run-length encoded cache of row and column sizes, but keeping this data structure current was a mess. The mess further escalated since eventually I worked on an application where the row and column sizes could change in a different chunk with a network update, and that would need to be reconciled somehow.

Re: Show HN: X-spreadsheet – A JavaScript canvas spreadsheet for web

#9
post #3

X Spread Sheet XSS probably not the best abbreviation

I have literally never seen spreadsheet abbreviated as SS. Spreadsheet is one word. Your comment comes off as trying too hard to be negative. Try some actual constructive feedback why don't ya?

Re: Show HN: X-spreadsheet – A JavaScript canvas spreadsheet for web

#10

Fun concept, but the cell text is blurry to the point of being a distraction for me, unfortunately. Is this a side effect of rendering to a canvas?

I’ve often seen this solved by drawing a canvas at at least 2x the viewable size and then using css to force it to be smaller. This is because of retina displays. Very much like images these days. It is often a very easy thing to solve.
Post reply on HN