Replies: 11 comments
-
|
Very good questions! I remember doing a demo of an html browser before with Element's predescesor, and it was very fast and efficient, scrolling through pages and pages of content. But thinking back, it can be done better. There should be the notion of hidden virtual elements, where you add content on demand. For really big data, basically, the physical UI structure you have may not necessarily map 1-1 with the logical structure. So you 'materialize' the elements only when needed when they come into view. IMO, this is a concept that even UI libs do not do. I'm not sure how nana does it. I doubt they do the way I described. Look at what facebook is doing, for example. They have an infinite scroll notion where fresh data is materialized only when they scroll into view. Having said that, this one is not simple and involves a lot of design and strategical implementation to get right. I my mind, this 'virtual' element is normally just a placeholder. Then it gets notified to 'materialize' only when the element gets close to the physical view-port bounds (say page up or down). This strategy is also very effective with data that is computed on the fly, such as, say displaying files and directories, or even some scientific data that is hard to compute all at once. This virtual element should be able to unmaterialize to save on memory when it scrolls out of view within some meaningful distance from the port. |
Beta Was this translation helpful? Give feedback.
-
This gets problematic when you don't know the size of the widget until its materialized. I'm thinking whether elements library can help with such complex widgets (eg by certain in-library-code optimizations) or the library user has to implement the whole logic. Just anything that would support implementing such complex tables. |
Beta Was this translation helpful? Give feedback.
-
Take a look at what the social media guys are doing. Basically, you initially have a generic, fixed size box. Then it resizes when you actually have the real thing. In the case of FB's infinite scroll, you actually see it materialize as it scrolls into view because it loads them from the web. In my mind, we should perform materialization ahead of time (e.g. when it comes closer to view by a page or so). |
Beta Was this translation helpful? Give feedback.
-
|
Also, I think this is the normal behavior now with, say the MacOS finder. You want efficiency with HUGE data? There's no way around it but make data computed on demand. |
Beta Was this translation helpful? Give feedback.
-
|
Thinking about it some more. Perhaps what we really want is a virtual port that only asks to display a range at any time with a callback to compute some more on demand. Imagine a waveform editor with gigabytes of audio data. In such a case, the normal thing to do is to draw only what's needed given the 'window'. It's the same thing. With elements, you only compose/layout a portion of the data at any given time. But your intuition is correct. The important thing is how elements can help the client in doing such a thing. I think yes. And the key is abstraction. |
Beta Was this translation helpful? Give feedback.
-
Back to this one. Some more thought: there are two kinds here: one that you know the size of the data (no. of rows) ahead of time, and one where you don't. The first is common in typical data structures e.g. streams. The first one can be done by the 'virtual' element I suggested above. The second is just a dynamic data structure with a known data size --easy, esp. if you have fixed row sizes like in your picture. |
Beta Was this translation helpful? Give feedback.
-
|
In my case I know the number of rows and it will rarely change (only after certain user actions). So my interest is what API of a potential virtual element can offer to make implementing such table easier. A sort of a vtile/htile element that uses provided callback to materialize rows from the data. |
Beta Was this translation helpful? Give feedback.
-
|
Update: The "dynamic" branch has a new "dynamic" element with an example that dynamically 'composes' 100,000 rows. The demo scrolls through the rows very smoothly with two-finger scroll using a track pad on my Macbook Pro). Here's a video clip: The sample code: |
Beta Was this translation helpful? Give feedback.
-
|
Oh, just to be clear, this is just a proof of concept for testing performance, far from the real thing. I tried 1,000,000 elements. It was just as fast. |
Beta Was this translation helpful? Give feedback.
-
|
Doesn't build for me :/ |
Beta Was this translation helpful? Give feedback.
-
It's OK... WIP, just a POC... I'll make it work in all platforms as soon as I can. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Example screenshot: https://github.com/qPCR4vir/nana-docs/raw/master/screenshots/thdy_seq_expl.png (ignore the tree view on the left, although I also want this kind of widget, but this is covered by #39)
What is obvious is that I can fully compose such table from smaller widgets. That's the main goal of elements. I can even have the fancy features like the colored temperature column as on the linked image. What I have concerns about, is performance.
Beta Was this translation helpful? Give feedback.
All reactions