You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
an array of ranges ([row_min, row max]) of selected rows <- an issue that it can be corrupted if the ranges overlap for example, or if row max < row min
I like the idea of ranges, and maybe return a struct that include ranges, but ultimately probably need to return the list of rows. The main reason being that the table might be sorted, and so the selection needs to be sorting-aware.
Would it make sense to express the selected rows as a query, as defined in hyparam/hyparquet#56?
Pros:
directly usable by hyparquet
we can express the rows as we prefer given the case:
small list: id: {$in: [3, 4, 5, 6, 7]}
big list: $and: [{id: {$gte: 10000}}, {id: {$lt: 50000}}]
serializable
Note that we don't have such a column right now (id). We might decide to use the same convention as MongoDB with the _id field (https://www.mongodb.com/docs/manual/core/document/#the-_id-field) and use _id to refer to the row index (0 for the first row, etc) in the original data (ie: unordered, unsampled, etc).
Alternative: _id refers to the row index at that step (ie: after a sort, or a sampling). Not sure for now which is better.
I did some research on how other products (google sheets, LibreOffice, airtable) handle the ranges (click, shift+click, ctrl+click..). Every one has its own logic and behavior, no clear standard appears. Let's try to do something simple.
My idea is to handle the selection in the hightable component, while hyperparam handles the actions (filter, for example)
I'm working on selecting the rows with a pointer. But should we allow using the keyboard too? In this case, it can be a big change, because the table cells cannot be focused at all for now.
Let's start with just by clicking, we can evaluate keyboard options later.
At one point I had a branch that allowed clicking on a row number to set a selectedRow, and add it to the url hash. This is useful for sharing a deep link to a specific row. It was also intended to fix the problem where a user would double-click to go into a fullscreen cell view, but then hitting the back button would lose the table positioning. This was before the SidePanel and so it's less of an issue now, but I do think it could be a useful feature in general. And it might be a useful mechanism for keyboard navigation.
OK, cool. I reused the colors and cursor in hyparam/hightable#18. This PR only allows to select rows and dispatch the selection to the subscribers. Updating the URL would be the task of the hightable client, ie. in another PR, depending on the UX we want in hyperparam.
Turn the selection to "sorting aware" (currently: if reordering, the same rows keep being selected, even if they refer to different content: it's not expected) The selection should be sorting aware hightable#32
when changing the order, the selection should stay the same. If finding the indexes is evaluated to be too costly, we should propose an alternative to the user through the UI: 1. clear the selection, 2. acknowledge that it will take time and wait, 3. sample the dataset and apply the sorting on this sample (question: how to transform the selection made on a full dataset to a selection on a sampled dataset?)
propose utility functions to transform (in both directions) between a sorting aware selection (rows 0 -> N, sorted by score) and a filter (score < 10). There is an ambiguity that must be removed (through UI? through some rules?): if we select the first N rows, are we applying WHERE score < 10 or ORDER BY score LIMIT {N}?
consume the result in an app, eg hyperparam-cli: delete (hide -> filter out) the selected rows
control the selection from an app, eg hyperparam-cli: right click, modal: select rows below
The current implementation shows the following warning:
Warning: You provided a checked prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultChecked. Otherwise, set either onChange or readOnly.
Activity
severo commentedon Dec 11, 2024
The selection UI will be implemented in hightable, not in hyperparam-cli.
Which data structure should we use to represent the selected rows?
Note that it can be implemented efficiently (using an array of 32bits integers - the array length is N/32) as a BitSet: https://github.com/uwdata/arquero/blob/main/src/table/BitSet.js
platypii commentedon Dec 11, 2024
Probably 2.
I like the idea of ranges, and maybe return a struct that include ranges, but ultimately probably need to return the list of rows. The main reason being that the table might be sorted, and so the selection needs to be sorting-aware.
severo commentedon Dec 12, 2024
Note that our implementation of the sort operation already creates an array whose length is the number of rows:
hyperparam-cli/packages/components/src/lib/workers/parquetWorkerClient.ts
Line 11 in 4100653
So 1. might also be feasible if sort is feasible.
But for datasets like https://huggingface.co/datasets/HuggingFaceFW/fineweb, not sure it makes sense (22B rows)
severo commentedon Jan 2, 2025
Would it make sense to express the selected rows as a query, as defined in hyparam/hyparquet#56?
Pros:
id: {$in: [3, 4, 5, 6, 7]}$and: [{id: {$gte: 10000}}, {id: {$lt: 50000}}]Note that we don't have such a column right now (
id). We might decide to use the same convention as MongoDB with the_idfield (https://www.mongodb.com/docs/manual/core/document/#the-_id-field) and use_idto refer to the row index (0 for the first row, etc) in the original data (ie: unordered, unsampled, etc).Alternative:
_idrefers to the row index at that step (ie: after a sort, or a sampling). Not sure for now which is better.severo commentedon Jan 3, 2025
I did some research on how other products (google sheets, LibreOffice, airtable) handle the ranges (click, shift+click, ctrl+click..). Every one has its own logic and behavior, no clear standard appears. Let's try to do something simple.
My idea is to handle the selection in the hightable component, while hyperparam handles the actions (filter, for example)
severo commentedon Jan 6, 2025
I'm working on selecting the rows with a pointer. But should we allow using the keyboard too? In this case, it can be a big change, because the table cells cannot be focused at all for now.
platypii commentedon Jan 6, 2025
Let's start with just by clicking, we can evaluate keyboard options later.
At one point I had a branch that allowed clicking on a row number to set a selectedRow, and add it to the url hash. This is useful for sharing a deep link to a specific row. It was also intended to fix the problem where a user would double-click to go into a fullscreen cell view, but then hitting the back button would lose the table positioning. This was before the SidePanel and so it's less of an issue now, but I do think it could be a useful feature in general. And it might be a useful mechanism for keyboard navigation.
severo commentedon Jan 6, 2025
OK, cool. I reused the colors and cursor in hyparam/hightable#18. This PR only allows to select rows and dispatch the selection to the subscribers. Updating the URL would be the task of the hightable client, ie. in another PR, depending on the UX we want in hyperparam.
severo commentedon Jan 7, 2025
In hyparam/hightable#19 I add the ability to toggle the selection for all the rows.
severo commentedon Jan 7, 2025
In hyparam/hightable#20, I added un/selecting a range, with shift+click.
severo commentedon Jan 7, 2025
Next steps:
score) and a filter (score < 10). There is an ambiguity that must be removed (through UI? through some rules?): if we select the first N rows, are we applyingWHERE score < 10orORDER BY score LIMIT {N}?severo commentedon Jan 8, 2025
The current implementation shows the following warning:
severo commentedon Apr 2, 2025
I'm closing, as "selecting multiple rows" is implemented.
I'm creating issues for the points in #103 (comment)