jupyterlab-ipyflow 0.0.209 → 0.0.211
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.
- package/lib/index.js +34 -18
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -204,23 +204,32 @@ class IpyflowSessionState {
|
|
|
204
204
|
.sort((a, b) => orderIdxById[a] - orderIdxById[b])
|
|
205
205
|
.map((id) => this.cellsById[id]);
|
|
206
206
|
}
|
|
207
|
-
computeTransitiveClosure(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
computeTransitiveClosure(startCellIds, inclusive = true, parents = false) {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
let cellIds = startCellIds;
|
|
210
|
+
const closure = new Set(cellIds);
|
|
211
|
+
while (true) {
|
|
212
|
+
for (const cellId of cellIds) {
|
|
213
|
+
if (parents) {
|
|
214
|
+
this.computeTransitiveClosureHelper(closure, cellId, this.cellParents, false, true);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
this.computeTransitiveClosureHelper(closure, cellId, this.cellChildren, false, true);
|
|
218
|
+
}
|
|
212
219
|
}
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
if (parents || !((_a = this.settings.pull_reactive_updates) !== null && _a !== void 0 ? _a : false)) {
|
|
221
|
+
break;
|
|
215
222
|
}
|
|
216
|
-
}
|
|
217
|
-
if (!parents) {
|
|
218
223
|
for (const cellId of closure) {
|
|
219
224
|
this.computeTransitiveClosureHelper(closure, cellId, this.cellParents, true, true);
|
|
220
225
|
}
|
|
226
|
+
if (cellIds.length === closure.size || !((_b = this.settings.push_reactive_updates_to_cousins) !== null && _b !== void 0 ? _b : false)) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
cellIds = Array.from(closure);
|
|
221
230
|
}
|
|
222
231
|
if (!inclusive) {
|
|
223
|
-
for (const cellId of
|
|
232
|
+
for (const cellId of startCellIds) {
|
|
224
233
|
closure.delete(cellId);
|
|
225
234
|
}
|
|
226
235
|
}
|
|
@@ -862,23 +871,30 @@ const connectToComm = (session, notebooks, notebook) => {
|
|
|
862
871
|
}
|
|
863
872
|
};
|
|
864
873
|
const updateUI = (notebook) => {
|
|
865
|
-
var _a;
|
|
874
|
+
var _a, _b;
|
|
866
875
|
clearCellState(notebook);
|
|
867
876
|
refreshNodeMapping(notebook);
|
|
868
|
-
const slice = new Set();
|
|
869
877
|
let closureCellIds = state.selectedCells;
|
|
870
878
|
if (closureCellIds.length === 0) {
|
|
871
879
|
closureCellIds = [state.activeCell.model.id];
|
|
872
880
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
881
|
+
const executeSlice = new Set(closureCellIds);
|
|
882
|
+
while (true) {
|
|
883
|
+
for (const cellId of closureCellIds) {
|
|
884
|
+
state.computeTransitiveClosureHelper(executeSlice, cellId, state.cellChildren, false, true);
|
|
885
|
+
}
|
|
886
|
+
if (!((_a = state.settings.pull_reactive_updates) !== null && _a !== void 0 ? _a : false)) {
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
for (const cellId of executeSlice) {
|
|
879
890
|
state.computeTransitiveClosureHelper(executeSlice, cellId, state.cellParents, true, true);
|
|
880
891
|
}
|
|
892
|
+
if (executeSlice.size === closureCellIds.length || !((_b = state.settings.push_reactive_updates_to_cousins) !== null && _b !== void 0 ? _b : false)) {
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
closureCellIds = Array.from(executeSlice);
|
|
881
896
|
}
|
|
897
|
+
const slice = new Set(executeSlice);
|
|
882
898
|
for (const cellId of closureCellIds) {
|
|
883
899
|
slice.delete(cellId);
|
|
884
900
|
state.computeTransitiveClosureHelper(slice, cellId, state.cellParents);
|
package/package.json
CHANGED