3 |
4 |
19 |
20 |
21 | ### Display DataFrames
22 |
23 | You can preview the DataFrame values as an interactive table.
24 |
25 |
26 |
27 |
28 | ### Display DataFrames with updates
29 |
30 | The preview of DataFrame will be automatically refreshed when you change it in the Python code.
31 |
32 |
33 |
34 |
35 | ### Customize displayed columns
36 |
37 | You can select which properties of the variables you'd like to display:
38 |
39 | 
40 |
41 | ### Automatic or manual refresh
42 |
43 | The list of variables will automatically update whenever you execute a cell. However, you can choose the Manual Refresh option to update the list at your convenience.
44 |
45 | 
46 |
47 | ### Dark theme
48 |
49 | If you prefer a darker look, a Dark Theme is also available!
50 |
51 | 
52 |
53 | ## Variable Inspector requirements
54 |
55 | - JupyterLab >= 4.0.0
56 |
57 | ## Install extension
58 |
59 | To install the extension, execute:
60 |
61 | ```bash
62 | pip install variable_inspector
63 | ```
64 |
65 | ## Uninstall extension
66 |
67 | To remove the extension, execute:
68 |
69 | ```bash
70 | pip uninstall variable_inspector
71 | ```
72 |
73 | ## Contributing
74 |
75 | ### Development install
76 |
77 | Note: You will need NodeJS to build the extension package.
78 |
79 | The `jlpm` command is JupyterLab's pinned version of
80 | [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
81 | `yarn` or `npm` in lieu of `jlpm` below.
82 |
83 | ```bash
84 | # Clone the repo to your local environment
85 | # Change directory to the variable_inspector directory
86 | # Install package in development mode
87 | pip install -e "."
88 | # Link your development version of the extension with JupyterLab
89 | jupyter labextension develop . --overwrite
90 | # Rebuild extension Typescript source after making changes
91 | jlpm build
92 | ```
93 |
94 | You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
95 |
96 | ```bash
97 | # Watch the source directory in one terminal, automatically rebuilding when needed
98 | jlpm watch
99 | # Run JupyterLab in another terminal
100 | jupyter lab
101 | ```
102 |
103 | With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
104 |
105 | By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
106 |
107 | ```bash
108 | jupyter lab build --minimize=False
109 | ```
110 |
111 | ### Development uninstall
112 |
113 | ```bash
114 | pip uninstall variable_inspector
115 | ```
116 |
117 | In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
118 | command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
119 | folder is located. Then you can remove the symlink named `variable-inspector` within that folder.
120 |
121 |
122 | Here’s a simple `README.md` you can drop into your repo 👇
123 |
124 | ## Running End-to-End UI Tests
125 |
126 | This project uses **Playwright** to run UI tests against JupyterLab with the MLJAR extension.
127 |
128 | ### Prerequisites
129 |
130 | - Node.js / Yarn
131 | - Playwright installed (`jlpm playwright install`)
132 |
133 | ### How to Run Tests
134 |
135 | You need **two terminals**:
136 |
137 | #### 1. Start JupyterLab
138 | In the first terminal, run:
139 |
140 | ```bash
141 | jlpm lab
142 | ```
143 |
144 | This will start JupyterLab at `http://localhost:8899/lab`.
145 |
146 | #### 2. Run UI Tests
147 |
148 | In the second terminal, run:
149 |
150 | ```bash
151 | jlpm test:ui:headed
152 | ```
153 |
154 | This will:
155 |
156 | * Remove any temporary `Untitled*.ipynb` files
157 | * Launch Playwright in **headed mode** (with a visible browser)
158 | * Run the end-to-end tests defined in `tests/e2e`
159 | * Remove leftover `Untitled*.ipynb` files after tests finish
160 |
161 | ### Notes
162 |
163 | * Logs are printed to the console during test execution for easier debugging.
164 | * If you encounter navigation timeout errors, make sure JupyterLab is fully started before running the tests.
165 |
166 |
167 | ### Packaging the extension
168 |
169 | See [RELEASE](RELEASE.md)
170 |
--------------------------------------------------------------------------------
/src/components/variableSettingsButton.tsx:
--------------------------------------------------------------------------------
1 | import { settingsIcon } from '../icons/settingsIcon';
2 | import { checkIcon } from '../icons/checkIcon';
3 | import React, { useEffect, useRef, useState } from 'react';
4 | import { ISettingRegistry } from '@jupyterlab/settingregistry';
5 | import { t } from '../translator';
6 |
7 | import {
8 | VARIABLE_INSPECTOR_ID,
9 | // autoRefreshProperty,
10 | showTypeProperty,
11 | showShapeProperty,
12 | showSizeProperty
13 | } from '../index';
14 |
15 | interface ISettingsButtonProps {
16 | settingRegistry: ISettingRegistry | null;
17 | }
18 |
19 | export const SettingsButton: React.FC338 | {t('Wrong variable type:')} {variableType} 339 |
340 |