fin-hypergrid / core

A canvas-based super high performant grid renderer API
MIT License
897 stars 144 forks source link

Filtering demo. Where is #619 pull request? #689

Open lancelab opened 6 years ago

lancelab commented 6 years ago

Dear Community.

I cannot make filtering demo install.

I cannot find pull request #619 to follow the direction: "NOTE: As of this writing, v3.0.0 has not yet been released, nor is it in a committed branch. To build this demo today, pull #619 and build it in another folder .... "

In which branch is it? I don't see it in Github site and not sure what to do with this info:

git config --add remote.origin.fetch +refs/pull//head:refs/remotes/origin/pull/ git fetch origin

Thank you. Konstantin.

joneit commented 6 years ago

@lancelab Thanks for your interest. Sorry for the (temporary) instability here. We are in the process of readying v3* for release. At that point I will update the filtering demo. We hope to be at "that point" within a week. My best advice is to check back next week. Thanks for your patience.


* v3 is a major release with some breaking changes, mostly revolving around the data model.

lancelab commented 6 years ago

Thank you, Jonathan.

It seems this forum is a right place to ask questions ...

  1. From API, it seems that swapping element in columns array is a way to go to build columns swapper on GUI. But it works in one way and does not in another: If to get columns as grid.behavior.getColumn(columnIx); and swap them, this fails. If to do the same with grid.behavior.columns[columnIx]; the approach works. What is the way?

  2. I made a custom data "chunkifier" to load for about half a billion cells. What will be the author advice: use a. incrementally (tested in FF)

    rowsInChunk.forEach( function( row ) { //appar behav. exists only after first data population grid.behavior.dataModel.dataSource.data.push(row); }) rowsInChunk.length is 3000 rows out of full db = 500000 rows.

b. or as one half-a-billion chunk "response" grid.setData(response);

... may be there is an other place to ask questions? ... I have more questions and resorted to read source code ... even this is too time consuming ... ( but understanding the current API docs happens even more time consuming :)

Thank you. K.

joneit commented 6 years ago

Hello @lancelab (Konstantin), sorry I missed this. Here are my responses:

For column swapping, just set grid.properties.columnIndexes or grid.properties.columnNames. Both are array accessors that map the full column list into the active column list.

The active column list is the ordered set of currently active columns. ("Active" means all "visible" columns. This includes all columns currently viewable in the grid, including any that may be horizontally scrolled out of view.)

Note that grid.behavior.getColumn(x) simply dereferences the grid.behavior.allColumns array while grid.behavior.getActiveColumn(x) dereferences grid.behavior.columns array.

Regarding chunks...

  1. In v3, dataSource is no longer defined or referenced by Hypergrid proper. It may be a thing in the external data model, but is no longer of interest to Hypergrid. In v3, the data model is now external. Rather than grid.behavior.dataModel.dataSource to reach the external data model, v3 simply references grid.behavior.dataModel.
  2. gird.behavior.dataModel.dataSource.data is peculiar to the data source and won't (necessarily) work with any other data source. The same is true to some extent regarding setData(). That said, if you are sticking with a local data source that supports these features, either method will work from your application level code. Hypergrid itself does not reference these (at least as of v3).
  3. The default local data model shipped with v3 now has an addRow function. This is obviously a better alternative, and the recommended approach. (Caveat: This was just added and we have no practical experience with it yet.)
lancelab commented 6 years ago

Thank you. I may reply after examining this in details.

joneit commented 6 years ago

@lancelab Regarding the filtering demo, I have updated (and greatly simplified) it.

This demo demonstrates a global grid-level filter with a single filter expression that can reference any and all columns and may be arbitrarily complex.

Note this version is not backwards compatible with v2; it depends on the current alpha (for Hypergrid 3.0) as specified in dependencies in the package.json, which will be updated when 3.0 is eventually released.

Please keep in mind that this is sample code just offered as an example and is not the only way to implement filtering.

Jonathan

joneit commented 6 years ago

@lancelab I have added a column filter demo. Each column filter may be either an arbitrary expression of any complexity or a simpler more convenient syntax (see readme). All column expressions are combined to create a global expression behind the scenes (but shown in the UI of the demo).

ktdilsiz commented 6 years ago

@joneit Regarding the filtering demo, I am working on a very simple implementation of filtering and I am working with v2. I understand that the current demo is not backwards compatible and I was wondering if you could give me some direction into where I can find some information/examples about how to implement filtering/sorting in v2.

Thank you Kemal

deviousasti commented 6 years ago

Hi, I'm sort of facing the same issue. Where can I find a build for v3? I'd like to use the Data Model API, but I'm having a tough time building from master.