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

Give extending classes access to some of the data grid's paint utilities. #111

Merged
merged 8 commits into from Aug 20, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Aug 18, 2020

Hi, my name is Logan McNichols. I am an intern for Jupyter Cal Poly. I am working on a tabular data editor powered by the DataGrid along with @kgoo124 and @ryuntalan.

We are working on a design that involves painting LabIcons onto the DataGrid's canvas to correspond the the type of field in a given column. To achieve this, we would like to provide getters for some of the DataGrid's properties and change some private methods to protected.

This PR would change the access modifier from private to protected on the following methods.

  • paintContent
    repaintContent
    & repaintOverlay

It would also add getters for the following properties.

  • _canvasGC
  • _rowSections
  • _columnSections
  • _columnHeaderSections
  • _rowHeaderSections.

Fixes #110

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks for pushing the boundaries on the grid! Just a couple of comments

packages/datagrid/src/datagrid.ts Outdated Show resolved Hide resolved
packages/datagrid/src/datagrid.ts Outdated Show resolved Hide resolved
@nmichaud
Copy link
Contributor

I'm not sure this is necessary - it's possible to leverage a combination of metadata and renderers to draw images/icons onto the grid. What are you trying to do in a subclass?

@kgoo124
Copy link
Contributor

kgoo124 commented Aug 19, 2020

@nmichaud We are creating a ghost row/column for the data grid to add new rows/columns. Here is a prototype of what we created.

@nmichaud
Copy link
Contributor

@kgoo124 ah ok, that looks interesting! Definitely not possible with the current grid code. It looks like you want to draw on the canvas outside of the grid region.

@kgoo124
Copy link
Contributor

kgoo124 commented Aug 19, 2020

@nmichaud yes that's right. Since the ghost rows/columns serve as UI to add a new row/column, we want to be able to paint an extra row/column on the grid without having the manage the data model underneath it

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks!

@blink1073 blink1073 merged commit a09a1ba into jupyterlab:master Aug 20, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give extending classes access to some of the data grid's paint utilities.
4 participants