GithubHelp home page GithubHelp logo

finos / ipyregulartable Goto Github PK

View Code? Open in Web Editor NEW
100.0 8.0 13.0 7.61 MB

High performance, editable, stylable datagrids in jupyter and jupyterlab

License: Apache License 2.0

Makefile 5.68% Python 39.23% JavaScript 54.43% CSS 0.53% Shell 0.13%
jupyter jupyter-notebook jupyterlab jupyterlab-extension ipywidgets datagrid table data-table data-visualization python

ipyregulartable's People

Contributors

bollwyvl avatar dependabot[bot] avatar njwhite avatar timkpaine 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  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  avatar  avatar  avatar  avatar

ipyregulartable's Issues

Install

Is there a working example?

Consider making widget loading lazy in lab?

Thanks again for this extension!

Another thing I noticed while looking into #23: once enough heavy labextensions are loaded in lab2, the build can start failing because webpack runs out of RAM/open file handles.

Changing the exports when registering the extension to be lazy loading with await import allows the downloading of the widget (and dependencies) to be deferred until the widget is actually requested, and not block the moon animation.

In this case, it knocks 7mb off the main bundle in development (already 30mb), while similarly taking 600kb off the production build (4.5mb)

diff --git a/js/src/plugin.ts b/js/src/plugin.ts
index ca5e534..938fe5b 100644
--- a/js/src/plugin.ts
+++ b/js/src/plugin.ts
@@ -18,7 +18,6 @@ import {
   IJupyterWidgetRegistry,
 } from "@jupyter-widgets/base";
 
-import * as widgetExports from "./widget";
 
 import {
   MODULE_VERSION,
@@ -44,7 +43,7 @@ export default examplePlugin;
  */
 function activateWidgetExtension(app: Application<Widget>, registry: IJupyterWidgetRegistry): void {
   registry.registerWidget({
-    exports: widgetExports,
+    exports: async () => await import(/* webpackChunkName: "ipyregulartable" */ "./widget"),
     name: "ipyregulartable",
     version: MODULE_VERSION,
   });
diff --git a/js/tsconfig.json b/js/tsconfig.json
index 71bc63b..03397b3 100644
--- a/js/tsconfig.json
+++ b/js/tsconfig.json
@@ -3,7 +3,7 @@
     "declaration": true,
     "esModuleInterop":true,
     "lib": ["es2015", "dom"],
-    "module": "commonjs",
+    "module": "esnext",
     "moduleResolution": "node",
     "noUnusedLocals": true,
     "outDir": "./lib",
@@ -13,11 +13,11 @@
     "sourceMap": true,
     "strict": true,
     "strictPropertyInitialization": false,
-    "target": "ES6",
+    "target": "es2015",
     "types": ["jest", "node"]
   },
   "include": [
     "src/**/*.ts",
     "src/**/*.tsx",
   ]
-}
\ No newline at end of file
+}

Readonly pandas dataframe grid

Thanks for this very good component
could be helpful to add an example of read-only grid.

Here is a skeleton:

query = ""  # ...
engine = None #...
description = pd.read_sql_query(query, engine) # add some more context
class DataFrameModel_noedit(rt.datamodel.pandas.DataFrameDataModel):
    def editable(self, x, y):
        return False
    
w1 = rt.RegularTableWidget()
w1.datamodel = DataFrameModel_noedit(description)
w1

More extensive documentation request and some user questions.

This seems an amazing library, but nowhere is clearly explained exactly how you are supposed to update the data in the table, how to access the underlying data structures, and much more. As an example, I'm trying to display the table inside an ipywidget box, and I don't know if it's possible and which function should I use. A practical example of how to construct DataModel class would be very useful too.
Lastly I am using get_state() and setData() to get the data from the table w and to change em, is there any easier way to get the data from the table if using pandas DataFrames like for example a w.to_dataframe() method?

EDIT: I see that using w.datamodel._data i can access the underlying dataframe, but if I change it the table widget doesn't update,is there a way to the refresh the view programmatically?

Packaging for conda-forge?

Hi folks! Congrats on the release!

I'd ❤️ to package this for conda-forge, and am noticing a few irregular things in the metadata/build:

  • ensure_python says (('2.7', '>=3.7')) but the trove classifiers claim 3.6
    • which is right? or is *.7 only required for the build?
  • the source tarballs doesn't include the js/lib
    • yeah, i know it says "source" on the tin, but i don't think it's generally expected that a pip install needs node (much less yarn) at install time, when error messages can get very buried
      • proposal: include the built js in the sdist

Happy to PR some of these things!

Sort on col header click

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Leverage emerging regular-table extension system

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.