supervisely 6.73.204__py3-none-any.whl → 6.73.205__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of supervisely might be problematic. Click here for more details.
- supervisely/app/widgets/fast_table/fast_table.py +42 -0
- {supervisely-6.73.204.dist-info → supervisely-6.73.205.dist-info}/METADATA +1 -1
- {supervisely-6.73.204.dist-info → supervisely-6.73.205.dist-info}/RECORD +7 -7
- {supervisely-6.73.204.dist-info → supervisely-6.73.205.dist-info}/LICENSE +0 -0
- {supervisely-6.73.204.dist-info → supervisely-6.73.205.dist-info}/WHEEL +0 -0
- {supervisely-6.73.204.dist-info → supervisely-6.73.205.dist-info}/entry_points.txt +0 -0
- {supervisely-6.73.204.dist-info → supervisely-6.73.205.dist-info}/top_level.txt +0 -0
|
@@ -168,6 +168,11 @@ class FastTable(Widget):
|
|
|
168
168
|
search_value = StateJson()[self.widget_id]["search"]
|
|
169
169
|
self._filtered_data = self.search(search_value)
|
|
170
170
|
self._rows_total = len(self._filtered_data)
|
|
171
|
+
|
|
172
|
+
if self._rows_total > 0 and self._active_page == 0: # if previous filtered data was empty
|
|
173
|
+
self._active_page = 1
|
|
174
|
+
StateJson()[self.widget_id]["page"] = self._active_page
|
|
175
|
+
|
|
171
176
|
self._sorted_data = self._sort_table_data(self._filtered_data)
|
|
172
177
|
self._sliced_data = self._slice_table_data(
|
|
173
178
|
self._sorted_data, actual_page=self._active_page
|
|
@@ -176,6 +181,7 @@ class FastTable(Widget):
|
|
|
176
181
|
DataJson()[self.widget_id]["data"] = self._parsed_active_data["data"]
|
|
177
182
|
DataJson()[self.widget_id]["total"] = self._rows_total
|
|
178
183
|
DataJson().send_changes()
|
|
184
|
+
StateJson().send_changes()
|
|
179
185
|
|
|
180
186
|
def get_json_data(self) -> Dict[str, Any]:
|
|
181
187
|
"""Returns dictionary with widget data, which defines the appearance and behavior of the widget.
|
|
@@ -327,6 +333,9 @@ class FastTable(Widget):
|
|
|
327
333
|
DataJson()[self.widget_id]["columns"] = self._parsed_active_data["columns"]
|
|
328
334
|
DataJson()[self.widget_id]["total"] = len(self._source_data)
|
|
329
335
|
DataJson().send_changes()
|
|
336
|
+
self._active_page = 1
|
|
337
|
+
StateJson()[self.widget_id]["page"] = self._active_page
|
|
338
|
+
StateJson().send_changes()
|
|
330
339
|
self.clear_selection()
|
|
331
340
|
|
|
332
341
|
def to_json(self, active_page: Optional[bool] = False) -> Dict[str, Any]:
|
|
@@ -815,3 +824,36 @@ class FastTable(Widget):
|
|
|
815
824
|
raise TypeError(
|
|
816
825
|
f"Row contains values of types that do not match the data types in the columns: {failed_column_idxs}"
|
|
817
826
|
)
|
|
827
|
+
|
|
828
|
+
def update_cell_value(self, row: int, column: int, value: Any) -> None:
|
|
829
|
+
"""Updates the value of the cell in the table.
|
|
830
|
+
|
|
831
|
+
:param row: Index of the row
|
|
832
|
+
:type row: int
|
|
833
|
+
:param column: Index of the column
|
|
834
|
+
:type column: int
|
|
835
|
+
:param value: New value
|
|
836
|
+
:type value: Any
|
|
837
|
+
"""
|
|
838
|
+
|
|
839
|
+
self._source_data.iat[row, column] = value
|
|
840
|
+
self._parsed_source_data = self._unpack_pandas_table_data(self._source_data)
|
|
841
|
+
self._sort_column_idx = StateJson()[self.widget_id]["sort"]["column"]
|
|
842
|
+
self._sort_order = StateJson()[self.widget_id]["sort"]["order"]
|
|
843
|
+
self._validate_sort_attrs()
|
|
844
|
+
self._filtered_data = self.search(self._search_str)
|
|
845
|
+
self._rows_total = len(self._filtered_data)
|
|
846
|
+
self._sorted_data = self._sort_table_data(self._filtered_data)
|
|
847
|
+
|
|
848
|
+
increment = 0 if self._rows_total % self._page_size == 0 else 1
|
|
849
|
+
max_page = self._rows_total // self._page_size + increment
|
|
850
|
+
if self._active_page > max_page: # active page is out of range (in case of the filtered data)
|
|
851
|
+
self._active_page = max_page
|
|
852
|
+
StateJson()[self.widget_id]["page"] = self._active_page
|
|
853
|
+
|
|
854
|
+
self._sliced_data = self._slice_table_data(self._sorted_data, actual_page=self._active_page)
|
|
855
|
+
self._parsed_active_data = self._unpack_pandas_table_data(self._sliced_data)
|
|
856
|
+
DataJson()[self.widget_id]["data"] = self._parsed_active_data["data"]
|
|
857
|
+
DataJson()[self.widget_id]["total"] = self._rows_total
|
|
858
|
+
DataJson().send_changes()
|
|
859
|
+
StateJson().send_changes()
|
|
@@ -247,7 +247,7 @@ supervisely/app/widgets/empty/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
247
247
|
supervisely/app/widgets/empty/empty.py,sha256=fCr8I7CQ2XLo59bl2txjDrblOGiu0TzUcM-Pq6s7gKY,1285
|
|
248
248
|
supervisely/app/widgets/empty/template.html,sha256=aDBKkin5aLuqByzNN517-rTYCGIg5SPKgnysYMPYjv8,40
|
|
249
249
|
supervisely/app/widgets/fast_table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
250
|
-
supervisely/app/widgets/fast_table/fast_table.py,sha256=
|
|
250
|
+
supervisely/app/widgets/fast_table/fast_table.py,sha256=hLdb-9Vj18RbOWYGFcm3hGIXzBzTuvNDDTP7bQRGtFs,35321
|
|
251
251
|
supervisely/app/widgets/fast_table/script.js,sha256=U3lmOucE_IJBuW0n6he1y3um6Ge3vFyhC6gKdmfKxOo,8782
|
|
252
252
|
supervisely/app/widgets/fast_table/style.css,sha256=nr3wUB_n9sjQy_A8D85OIxhC6qX9LcEFaCNljzP6DGQ,15409
|
|
253
253
|
supervisely/app/widgets/fast_table/template.html,sha256=P4mkLysZywc5F_jWuRMzYi89juudGm-6Dh7mo5SsDLo,1060
|
|
@@ -953,9 +953,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
953
953
|
supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
|
|
954
954
|
supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
|
|
955
955
|
supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
|
|
956
|
-
supervisely-6.73.
|
|
957
|
-
supervisely-6.73.
|
|
958
|
-
supervisely-6.73.
|
|
959
|
-
supervisely-6.73.
|
|
960
|
-
supervisely-6.73.
|
|
961
|
-
supervisely-6.73.
|
|
956
|
+
supervisely-6.73.205.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
957
|
+
supervisely-6.73.205.dist-info/METADATA,sha256=Ie1M5PxEQCoDhgiXb2RL1NiA8tkVmDO5h0QRzbOJ140,33077
|
|
958
|
+
supervisely-6.73.205.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
959
|
+
supervisely-6.73.205.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
|
|
960
|
+
supervisely-6.73.205.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
|
|
961
|
+
supervisely-6.73.205.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|