Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lancelab opened this issue Feb 4, 2018 · 8 comments
Open

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

lancelab opened this issue Feb 4, 2018 · 8 comments

Comments

@lancelab
Copy link

lancelab commented Feb 4, 2018

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
* [new ref] refs/pull/619/head -> origin/pull/619

Thank you.
Konstantin.

@joneit
Copy link
Contributor

joneit commented Feb 5, 2018

@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
Copy link
Author

lancelab commented Feb 5, 2018

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?

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
Copy link
Contributor

joneit commented Feb 28, 2018

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
Copy link
Author

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

@joneit
Copy link
Contributor

joneit commented Mar 5, 2018

@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
Copy link
Contributor

joneit commented Mar 6, 2018

@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
Copy link

ktdilsiz commented Apr 2, 2018

@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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants