Hacker Newsnew | past | comments | ask | show | jobs | submit | sidthegeek's commentslogin

Would someone elaborate on the choice of canvas vs DOM for grids like this? There is this older stackoverflow discussion[1] that seems to indicate that one can get decent performance with large data volumes by maintaining DOM cells for just the viewport area and managing the grid content in response to scroll events. Since the row heights are fixed, the scrolling algorithm should be manageable. So why a canvas rather than DOM?

[1] https://stackoverflow.com/questions/2402953/javascript-data-...


I can only give you the reasons why I picked canvas. So here you go.

1. Scroll performance is much better than HTML

2. Drawing on canvas is cheap compared to modifying DOM or attributes

3. Streaming updates are much smoother in canvas as drawing is quick. I had used Canvas as an interface for high-frequency trading

4. Canvas is easy to work with. And with Konva - https://github.com/konvajs/react-konva/, any React developer will find it at home

5. No Browser bugs :)

6. Performance tuning is quicker with Canvas

7. In the future, we can decide to use WebGL (using PixiJS)

Some problems with canvas IMO

1. There is no relative positioning :(. It sounds silly, but coming from HTML, any element can be positioned relative to its parent.

2. Styling/Pixel ratio/Stroke - can be hard to figure out first. And the 0.5px crisp stroke workaround on DPR 1 devices. Took me a long time to figure out

There are pros and cons for both, I guess it all comes down to your personal preference and picking the right tools for the task in hand.


DOM can be even faster than canvas as long as you’re smart about it, as discussed in last week’s Show HN of DatagridXL: https://news.ycombinator.com/item?id=23909894, https://datagridxl.com


I couldn't live without Wine (or Crossover). I develop web apps for a small company, and Ubuntu Mate is my primary development environment. A lot of our software relies heavily on Word and Excel because that's what our customers use. And Wine does a superb job of integrating Word and Excel into the Ubuntu desktop. Hats off the the Wine developers for the amazing job they've done.


This sounds very useful! I googled but didn't find much - perhaps I did not use the right terms. Can you please post some links that point me in the right direction?


Here:

https://help.ubuntu.com/community/LiveCdRecovery#Update_Fail...

Rather than Ctrl+Alt+F1 (which switches to a TTY), you can open a Terminal instead and run 'sudo -i' to get a root shell.

Replace 'sda1' with your root disk (you may have LVM enabled, and definitely if you have full disk encryption). If you don't have disk encryption, run 'pvscan' and see if it reports anything.

To get the update to finish, you can run 'dpkg --configure --all'.


@gargravarr Thanks so much!


Can you elaborate a bit about your implementation? I'd love to learn more about the techniques you have used.



I elaborated a little bit in the past here: https://groups.google.com/forum/#!topic/devdocs/T9_FsjB1kHw

I've been thinking about writing blog posts on DevDocs's internals and the techniques it uses for a while, but it's hard to find the time, especially when I already spend a lot of my spare time maintaining/updating the app.

That said, feel free to open a GitHub issue to remind me to write blog posts at some point (if there is interest), or if you have specific questions.


I've had good luck with Wine on all my Linux machines.


Me too! Please post the link on HN when you have it available!


Whole-heartedly agree with this post. I will be 58 this year, and have been a developer for the last 20 years, after having been in academia for the first part of my career. As you say, the key is to never stop learning.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: