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

New plugin @finos/perspective-viewer-datagrid #954

Merged
merged 4 commits into from
Mar 10, 2020

Conversation

texodus
Copy link
Member

@texodus texodus commented Feb 27, 2020

Introduces a new plugin @finos/perspective-viewer-datagrid, which will eventually replace @finos/perspective-viewer-hypergrid.

Example Custom Styles

Example Superstore

Screen Shot 2020-02-27 at 3 19 29 AM

While similar to Hypergrid in UX, Datagrid is

  • Based on HTML <table>
  • Virtualized to a scroll portal with an empty <div> at "real" dimensions, which allows native scrollbars, natural responsiveness to pagedown and spacebar scrolling, etc..
  • .. but with exceptional virtualized performance (vs @finos/perspective-viewer-hypergrid).
  • Can be styled with standard CSS & listen to events on the normal DOM elements of table: td, tr, thead, tbody, with some perspective metadata to E N G A G E analytics.
  • Is very accessible without much effort, since it is just a <table> - screen readers etc. work out of the box.
  • Native async, which eliminates all "jitter" and "screenshear" issues related to @finos/perspective-viewer-hypergrid.
  • Small (50kb with all deps bundled, 15kb standalone).
  • Optional double-buffering on both axes for exceptional render quality (at the expense of performance).

The new styling API simply inlines a <table> element into the light DOM as a child of your <perspective-viewer>, allowing you to style with simple CSS

perspective-viewer table tr { 
    background-color: red; 
}

Combined with simple CustomEvent, "perspective-datagrid-update", complex styling, embedded images, charts and controls are simple and natural to implement, similar to a traditional static HTML table.

Screen Shot 2020-02-27 at 3 26 50 AM

There are a few known issues, and some notable missing features:

  • Horizontal scroll is allowed to the last visible column.
  • Columns are not resizable in UI (but can be set in CSS).
  • No editable or selectable support yet.

@timkpaine timkpaine added enhancement Feature requests or improvements JS WIP labels Feb 28, 2020
"license": "Apache-2.0",
"dependencies": {
"@finos/perspective": "^0.4.2",
"@finos/perspective-viewer": "^0.4.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are older versions of "@finos/perspective" and "@finos/perspective-viewer", mind updating to latest @texodus?


// The largest size virtual <div> in (px) that Chrome can support without
// glitching.
const CHROME_FUCKUP_LIMIT = 10000000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a different name here?

}

constructor(container, table) {
// super();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this super() important

@texodus texodus force-pushed the perspective-viewer-datagrid branch from a3203e7 to 90fa809 Compare March 9, 2020 20:15
Copy link
Contributor

@JHawk JHawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks great, thanks!

@texodus texodus merged commit e8d08fa into master Mar 10, 2020
@texodus texodus deleted the perspective-viewer-datagrid branch March 10, 2020 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements JS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants