GithubHelp home page GithubHelp logo

infinite-table / infinite-react Goto Github PK

View Code? Open in Web Editor NEW
65.0 4.0 5.0 78.31 MB

One Table — Infinite Applications. Infinite Table is the modern DataGrid for building React apps — faster.

Home Page: https://infinite-table.com

JavaScript 39.76% TypeScript 59.41% CSS 0.82% HTML 0.02% MDX 0.01%
react datagrid grid table virtualization datatable grouping pivoting filtering tabular-data

infinite-react's People

Contributors

actions-user avatar dietblue avatar georgeblue92 avatar infinite-table-dev avatar radubrehar avatar roblotter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

infinite-react's Issues

Make generated pivot columns default to the config of original column with same field

All pivot columns generated based on the aggregationReducers that have a field specified, now take all configurations from the respective initial columns that have the same field.

Additionally, an aggregation reducer can also specify a pivotColumn in order to further configure the generated pivot column, and this pivotColumn can have pivotColumn.inheritFromColumn, which can be used to specify that it should inherit properties from a specific column, if the default behavior is not desired

Extra data source events triggered

Version: 0.0.10

Starting from the pagination documentation sandbox , here is a sandbox to illustrate the issue:
https://codesandbox.io/s/events-for-sorting-and-pagination-ypyee?file=/src/App.tsx

When using sort & pagination at the same time, we have extra events which triggers fetching several times the same data.

When sorting, the onDataParamsChange is triggered with the current livePaginationCursor (which should be 0 instead) and it's called twice.
image

Also, this leads to another issue depending on the number of page that can be displayed. In the following screenshot, when sorting on country, it has not requested the next pages (and does not display the vertical scrollbar):
image

Rename column.defaultHiddenWhenGrouped to column.defaultHiddenWhenGroupedBy and enhance with multiple options

Controls default column visibility when is used.

This property does not apply (work) when controlled is used, it only works with uncontrolled column visibility.

The value for this property can be one of the following:

  • the '*' string - this means, the column is hidden whenever there are groups - so any groups.
  • a string, namely a field from the bound type of the DataSource (so type is keyof DATA_TYPE) - the column is hidden whenever there is grouping that includes the specified field. The grouping can contain any other fields, but if it includes the specified field, the column is hidden.
  • an object with keys of type keyof DATA_TYPE and values being true - whenever the grouping includes any of the fields that are in the keys of this object, the column is hidden.

Rename `groupRowsBy` to `groupBy`

DataSourcePropGroupRowsBy, which was an export of @infinite-table/infinite-react should be DataSourcePropGroupBy

DataSourceGroupRowsBy, which was an export of @infinite-table/infinite-react should be DataSourceGroupBy

Implement support for column types

Discussed in #10

Originally posted by vitolpoc December 15, 2021
Add ability to define custom types, custom cell renderer and custom header cell renderer for default and custom types: “string”, “numeric”, “date”, “currency” etc … without having to specify it for each column definition (i.e. as a default configuration) or as a specific column configuration.

Implement column flex sizing

We need to implement column flex sizing, to behave similar to browser flex.

Example:

say infinite table is sized at 1000px and there are 3 columns:

  • 1 fixed column with width: 400px - col A
  • 1 flex column with flex: 2 - col B
  • 1 flex column with flex: 1 - col C

Available flex size: 1000px - 400px = 600px.
Column sizes:

  • col A - 400px
  • col B - 400px
  • col C - 200px

The flex algorithm will distribute space like this:
From the total available size, it will substract the fixed sizes: 1000px - 400px = 600px
It will sum up all flex values: 1+2 = 3
It will compute the width of a flex unit: 600px / 3 = 200px
It will distribute the flex space to every column, taking into account the flex value: col B = 2200px, col C = 1200px

Default columnSizing of `group-by-<field>` columns to `<field>` values

If columnSizing does not have an entry for group-by-<field> cols, take the value from <field> if one exists.

Maybe see if we can do this for other properties, not only columnSizing

From initial proposal in #11 :

Also, it would be great if, when we have groups and group-by- is not defined in columnSizing but is, then the group size could be set by default to the value given for the . This will allow to have only one definition (no matter if it's a group or not) and would be more convenient when the configuration of the groups are dynamic (as a user input for instance).

Implement columnVisibility prop

We need to have a way to manage column visibility - both controlled and uncontrolled

As detailed here #15 (comment) it will make things easier also in the scenario where users switch from one type of grouping to another

Implement grand total columns

For pivoting, it's useful to show grand total columns as well.

Grand total columns are columns that are generated for each aggregator. So they are not under column groups of pivot values, but rather correspond 1:1 to specified aggregators

groupBy column as function does not get applied

I am trying to style the grouped column.

The style object is added only when groupBy.column is a static object.
The following do not work.

groupBy: column: ()  { style: ()  ({ color: ‘red’ }) } // does not get applied 
groupBy: column: ()  { style: { color: ‘red’ } } // does not get applied
groupBy: column: { style: { color: ‘red’ } } // works

Add support for "multi-column" and "inline" groupRenderStrategy when used as pivot

When using pivot, the only groupRenderStrategy available is single-column, please add support for multi-column and inline strategies as well.

In the following code sandbox, inline mode has been set, the default group row state has been set to expand the first node. Notice the groups are displayed as a tree and the expanded node ("TypeScript") is not visible.
https://codesandbox.io/s/sandpack-project-forked-zgml8?file=/src/App.tsx

Provide more information on rows during row rendering

InfiniteTableRowInfo can have different object shape depending on the presence or absence of grouping.

You can use dataSourceHasGrouping: boolean as a discriminator to determine the shape of the object, to know if the dataSource had grouping or not. Furthermore, for when the dataSource has grouping, you can use isGroupRow: boolean to discriminate between group rows vs normal rows.

Now rowInfo has the following props:

  • childrenAvailable - if at least some of the children (for group rows with lazy batching) are available
  • childrenLoading - if some children are loading
  • selfLoaded - if the current row has been loaded (useful for bathing, when scrolling to the current row, when it's lazily fetched)
  • dataSourceHasGrouping
  • directChildrenCount - The count of the direct children of the current group. Direct children can be either normal rows or groups.
  • directChildrenLoadedCount
  • collapsedChildrenCount - The count of all leaf nodes (normal rows) inside the group that are not being visible due to collapsing (either the current row is collapsed or any of its children)
  • deepRowInfoArray - This array contains all the (uncollapsed, so visible) row infos under this group, at any level of nesting, in the order in which they are visible in the table
  • groupData - The array of all leaf nodes (normal rows) that are inside this group.
  • collapsed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.