@holoviz/panel 0.12.4 → 0.13.0-a.12
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/dist/bundled/abstractvtkplot/vtk.js@20.0.1/vtk.js +3 -0
- package/dist/bundled/abstractvtkplot/vtk.js@20.0.1/vtk.js.map +1 -0
- package/dist/bundled/quillinput/1.3.6/quill.bubble.css +952 -0
- package/dist/bundled/quillinput/1.3.6/quill.js +11489 -0
- package/dist/bundled/quillinput/1.3.6/quill.snow.css +945 -0
- package/dist/bundled/terminal/xterm@4.14.1/lib/xterm.js +2 -0
- package/dist/bundled/terminal/xterm@4.14.1/lib/xterm.js.map +1 -0
- package/dist/css/widgets.css +4 -0
- package/dist/lib/models/html.d.ts +2 -0
- package/dist/lib/models/html.js +24 -2
- package/dist/lib/models/html.js.map +1 -1
- package/dist/lib/models/index.d.ts +1 -0
- package/dist/lib/models/index.js +1 -0
- package/dist/lib/models/index.js.map +1 -1
- package/dist/lib/models/plotly.d.ts +4 -3
- package/dist/lib/models/plotly.js +32 -32
- package/dist/lib/models/plotly.js.map +1 -1
- package/dist/lib/models/progress.js +6 -1
- package/dist/lib/models/progress.js.map +1 -1
- package/dist/lib/models/quill.d.ts +34 -0
- package/dist/lib/models/quill.js +85 -0
- package/dist/lib/models/quill.js.map +1 -0
- package/dist/lib/models/tabulator.d.ts +8 -1
- package/dist/lib/models/tabulator.js +119 -5
- package/dist/lib/models/tabulator.js.map +1 -1
- package/dist/lib/models/terminal.d.ts +9 -3
- package/dist/lib/models/terminal.js +20 -14
- package/dist/lib/models/terminal.js.map +1 -1
- package/dist/lib/models/vega.d.ts +2 -0
- package/dist/lib/models/vega.js +9 -3
- package/dist/lib/models/vega.js.map +1 -1
- package/dist/lib/models/vtk/panel_fullscreen_renwin_sync.d.ts +1 -1
- package/dist/lib/models/vtk/panel_fullscreen_renwin_sync.js +92 -92
- package/dist/lib/models/vtk/panel_fullscreen_renwin_sync.js.map +1 -1
- package/dist/lib/models/vtk/util.d.ts +1 -1
- package/dist/lib/models/vtk/util.js +6 -2
- package/dist/lib/models/vtk/util.js.map +1 -1
- package/dist/lib/models/vtk/vtkaxes.js +3 -3
- package/dist/lib/models/vtk/vtkaxes.js.map +1 -1
- package/dist/lib/models/vtk/vtkjs.js +2 -2
- package/dist/lib/models/vtk/vtkjs.js.map +1 -1
- package/dist/lib/models/vtk/vtklayout.js +5 -2
- package/dist/lib/models/vtk/vtklayout.js.map +1 -1
- package/dist/lib/models/vtk/vtksynchronized.d.ts +0 -1
- package/dist/lib/models/vtk/vtksynchronized.js +11 -20
- package/dist/lib/models/vtk/vtksynchronized.js.map +1 -1
- package/dist/lib/models/vtk/vtkvolume.d.ts +1 -0
- package/dist/lib/models/vtk/vtkvolume.js +15 -6
- package/dist/lib/models/vtk/vtkvolume.js.map +1 -1
- package/dist/lib/styles/widgets.css.js +4 -0
- package/dist/panel.js +583 -329
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +23 -22
- package/package.json +2 -2
- package/dist/bundled/abstractvtkplot/vtk.js@14.16.4/dist/vtk.js +0 -3
- package/dist/bundled/abstractvtkplot/vtk.js@14.16.4/dist/vtk.js.map +0 -1
- package/dist/bundled/terminal/xterm@4.11.0/lib/xterm.js +0 -2
- package/dist/bundled/terminal/xterm@4.11.0/lib/xterm.js.map +0 -1
package/dist/panel.js
CHANGED
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"4e90918c0a": /* index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
45
45
|
__esModule();
|
|
46
46
|
const tslib_1 = require("tslib");
|
|
47
|
-
const Panel = (0, tslib_1.__importStar)(require("
|
|
47
|
+
const Panel = (0, tslib_1.__importStar)(require("1abe9b6912") /* ./models */);
|
|
48
48
|
exports.Panel = Panel;
|
|
49
49
|
const base_1 = require("@bokehjs/base");
|
|
50
50
|
(0, base_1.register_models)(Panel);
|
|
51
51
|
},
|
|
52
|
-
"
|
|
52
|
+
"1abe9b6912": /* models/index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
53
53
|
__esModule();
|
|
54
54
|
const tslib_1 = require("tslib");
|
|
55
55
|
var ace_1 = require("9fecc8d0f9") /* ./ace */;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
__esExport("Card", card_1.Card);
|
|
61
61
|
var comm_manager_1 = require("e552778259") /* ./comm_manager */;
|
|
62
62
|
__esExport("CommManager", comm_manager_1.CommManager);
|
|
63
|
-
var tabulator_1 = require("
|
|
63
|
+
var tabulator_1 = require("0fb5c5eacd") /* ./tabulator */;
|
|
64
64
|
__esExport("DataTabulator", tabulator_1.DataTabulator);
|
|
65
65
|
var datetime_picker_1 = require("6e11b2cfe2") /* ./datetime_picker */;
|
|
66
66
|
__esExport("DatetimePicker", datetime_picker_1.DatetimePicker);
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
__esExport("DeckGLPlot", deckgl_1.DeckGLPlot);
|
|
69
69
|
var echarts_1 = require("9d046c4720") /* ./echarts */;
|
|
70
70
|
__esExport("ECharts", echarts_1.ECharts);
|
|
71
|
-
var html_1 = require("
|
|
71
|
+
var html_1 = require("c424a3bd17") /* ./html */;
|
|
72
72
|
__esExport("HTML", html_1.HTML);
|
|
73
73
|
var idom_1 = require("7d45bd3bc4") /* ./idom */;
|
|
74
74
|
__esExport("IDOM", idom_1.IDOM);
|
|
@@ -88,10 +88,12 @@
|
|
|
88
88
|
__esExport("Perspective", perspective_1.Perspective);
|
|
89
89
|
var player_1 = require("2e8044c920") /* ./player */;
|
|
90
90
|
__esExport("Player", player_1.Player);
|
|
91
|
-
var plotly_1 = require("
|
|
91
|
+
var plotly_1 = require("a2080c6bc8") /* ./plotly */;
|
|
92
92
|
__esExport("PlotlyPlot", plotly_1.PlotlyPlot);
|
|
93
|
-
var progress_1 = require("
|
|
93
|
+
var progress_1 = require("fd3806082d") /* ./progress */;
|
|
94
94
|
__esExport("Progress", progress_1.Progress);
|
|
95
|
+
var quill_1 = require("6895629dfc") /* ./quill */;
|
|
96
|
+
__esExport("QuillInput", quill_1.QuillInput);
|
|
95
97
|
var reactive_html_1 = require("eb3a49319b") /* ./reactive_html */;
|
|
96
98
|
__esExport("ReactiveHTML", reactive_html_1.ReactiveHTML);
|
|
97
99
|
var singleselect_1 = require("5ed2116e26") /* ./singleselect */;
|
|
@@ -100,13 +102,13 @@
|
|
|
100
102
|
__esExport("SpeechToText", speech_to_text_1.SpeechToText);
|
|
101
103
|
var state_1 = require("bfa46a5f19") /* ./state */;
|
|
102
104
|
__esExport("State", state_1.State);
|
|
103
|
-
var terminal_1 = require("
|
|
105
|
+
var terminal_1 = require("edf66f5228") /* ./terminal */;
|
|
104
106
|
__esExport("Terminal", terminal_1.Terminal);
|
|
105
107
|
var text_to_speech_1 = require("33cd2c254e") /* ./text_to_speech */;
|
|
106
108
|
__esExport("TextToSpeech", text_to_speech_1.TextToSpeech);
|
|
107
109
|
var trend_1 = require("effe070807") /* ./trend */;
|
|
108
110
|
__esExport("TrendIndicator", trend_1.TrendIndicator);
|
|
109
|
-
var vega_1 = require("
|
|
111
|
+
var vega_1 = require("04fd346566") /* ./vega */;
|
|
110
112
|
__esExport("VegaPlot", vega_1.VegaPlot);
|
|
111
113
|
var video_1 = require("ffe54b53c3") /* ./video */;
|
|
112
114
|
__esExport("Video", video_1.Video);
|
|
@@ -693,14 +695,16 @@
|
|
|
693
695
|
CommManager.__module__ = "panel.models.comm_manager";
|
|
694
696
|
CommManager.init_CommManager();
|
|
695
697
|
},
|
|
696
|
-
"
|
|
698
|
+
"0fb5c5eacd": /* models/tabulator.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
697
699
|
__esModule();
|
|
698
700
|
const types_1 = require("@bokehjs/core/util/types");
|
|
699
701
|
const html_box_1 = require("@bokehjs/models/layouts/html_box");
|
|
702
|
+
const build_views_1 = require("@bokehjs/core/build_views");
|
|
700
703
|
const dom_1 = require("@bokehjs/core/dom");
|
|
701
704
|
const kinds_1 = require("@bokehjs/core/kinds");
|
|
702
705
|
const column_data_source_1 = require("@bokehjs/models/sources/column_data_source");
|
|
703
706
|
const tables_1 = require("@bokehjs/models/widgets/tables");
|
|
707
|
+
const debounce_1 = require("99a25e6992") /* debounce */;
|
|
704
708
|
const data_1 = require("f1971f81bf") /* ./data */;
|
|
705
709
|
const layout_1 = require("4c755983eb") /* ./layout */;
|
|
706
710
|
function find_group(key, value, records) {
|
|
@@ -799,6 +803,15 @@
|
|
|
799
803
|
const ftype = this.model.filename.endsWith('.json') ? "json" : "csv";
|
|
800
804
|
this.tabulator.download(ftype, this.model.filename);
|
|
801
805
|
});
|
|
806
|
+
this.connect(this.model.properties.children.change, () => {
|
|
807
|
+
this._render_children();
|
|
808
|
+
});
|
|
809
|
+
this.connect(this.model.properties.expanded.change, () => {
|
|
810
|
+
for (const row of this.tabulator.rowManager.getRows()) {
|
|
811
|
+
if (row.cells.length > 0)
|
|
812
|
+
row.cells[0].layoutElement();
|
|
813
|
+
}
|
|
814
|
+
});
|
|
802
815
|
this.connect(this.model.properties.hidden_columns.change, () => {
|
|
803
816
|
this.hideColumns();
|
|
804
817
|
});
|
|
@@ -844,6 +857,7 @@
|
|
|
844
857
|
(0, layout_1.set_size)(container, this.model);
|
|
845
858
|
let configuration = this.getConfiguration();
|
|
846
859
|
this.tabulator = new Tabulator(container, configuration);
|
|
860
|
+
this._render_children();
|
|
847
861
|
// Swap pagination mode
|
|
848
862
|
if (this.model.pagination === 'remote') {
|
|
849
863
|
this.tabulator.options.pagination = this.model.pagination;
|
|
@@ -917,13 +931,19 @@
|
|
|
917
931
|
}
|
|
918
932
|
getConfiguration() {
|
|
919
933
|
const pagination = this.model.pagination == 'remote' ? 'local' : (this.model.pagination || false);
|
|
920
|
-
|
|
934
|
+
// Only use selectable mode if explicitly requested otherwise manually handle selections
|
|
935
|
+
let selectable = this.model.select_mode === 'toggle' ? true : NaN;
|
|
921
936
|
const that = this;
|
|
922
937
|
let configuration = Object.assign(Object.assign({}, this.model.configuration), { index: "_index", nestedFieldSeparator: false, selectable: selectable, tableBuilding: function () { that.tableInit(that, this); }, renderComplete: () => this.renderComplete(), rowSelectionChanged: (data, rows) => this.rowSelectionChanged(data, rows), rowClick: (e, row) => this.rowClicked(e, row), cellEdited: (cell) => this.cellEdited(cell), columns: this.getColumns(), layout: this.getLayout(), pagination: pagination, paginationSize: this.model.page_size, paginationInitialPage: 1, selectableCheck: (row) => {
|
|
923
938
|
const selectable = this.model.selectable_rows;
|
|
924
939
|
return (selectable == null) || (selectable.indexOf(row._row.data._index) >= 0);
|
|
925
940
|
}, tooltips: (cell) => {
|
|
926
941
|
return cell.getColumn().getField() + ": " + cell.getValue();
|
|
942
|
+
}, scrollVertical: (0, debounce_1.debounce)(() => {
|
|
943
|
+
this.updateStyles();
|
|
944
|
+
}, 50, false), rowFormatter: (row) => this._render_row(row), dataFiltering: () => {
|
|
945
|
+
if (this.tabulator != null)
|
|
946
|
+
this.model.filters = this.tabulator.getHeaderFilters();
|
|
927
947
|
} });
|
|
928
948
|
if (pagination) {
|
|
929
949
|
configuration['ajaxURL'] = "http://panel.pyviz.org";
|
|
@@ -939,6 +959,67 @@
|
|
|
939
959
|
data = group_data(data, this.model.columns, this.model.indexes, this.model.aggregators);
|
|
940
960
|
return Object.assign(Object.assign({}, configuration), { "data": data });
|
|
941
961
|
}
|
|
962
|
+
_render_children() {
|
|
963
|
+
new Promise(async (resolve) => {
|
|
964
|
+
const children = [];
|
|
965
|
+
for (const idx of this.model.expanded) {
|
|
966
|
+
if (idx in this.model.children)
|
|
967
|
+
children.push(this.model.children[idx]);
|
|
968
|
+
}
|
|
969
|
+
await (0, build_views_1.build_views)(this._child_views, children, { parent: null });
|
|
970
|
+
resolve(null);
|
|
971
|
+
}).then(() => {
|
|
972
|
+
for (const r of this.model.expanded) {
|
|
973
|
+
const row = this.tabulator.getRow(r);
|
|
974
|
+
this._render_row(row);
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
_render_row(row) {
|
|
979
|
+
const index = row._row.data._index;
|
|
980
|
+
if (this.model.expanded.indexOf(index) < 0 || !(index in this.model.children))
|
|
981
|
+
return;
|
|
982
|
+
const model = this.model.children[index];
|
|
983
|
+
const view = this._child_views.get(model);
|
|
984
|
+
if (view == null)
|
|
985
|
+
return;
|
|
986
|
+
const rowEl = row.getElement();
|
|
987
|
+
const viewEl = rowEl.children[rowEl.children.length - 1];
|
|
988
|
+
if ((viewEl.className === 'bk') && viewEl.children.length)
|
|
989
|
+
return;
|
|
990
|
+
const style = getComputedStyle(this.tabulator.element.children[1].children[0]);
|
|
991
|
+
const bg = style.backgroundColor;
|
|
992
|
+
const neg_margin = "-" + rowEl.style.paddingLeft;
|
|
993
|
+
const row_view = (0, dom_1.div)({ style: "background-color: " + bg + "; margin-left:" + neg_margin });
|
|
994
|
+
view.renderTo(row_view);
|
|
995
|
+
row.getElement().appendChild(row_view);
|
|
996
|
+
}
|
|
997
|
+
_expand_render(cell) {
|
|
998
|
+
const index = cell._cell.row.data._index;
|
|
999
|
+
const icon = this.model.expanded.indexOf(index) < 0 ? "\u25ba" : "\u25bc";
|
|
1000
|
+
return "<i>" + icon + "</i>";
|
|
1001
|
+
}
|
|
1002
|
+
_update_expand(cell) {
|
|
1003
|
+
const index = cell._cell.row.data._index;
|
|
1004
|
+
const expanded = [...this.model.expanded];
|
|
1005
|
+
const exp_index = expanded.indexOf(index);
|
|
1006
|
+
if (exp_index < 0)
|
|
1007
|
+
expanded.push(index);
|
|
1008
|
+
else
|
|
1009
|
+
expanded.splice(exp_index, 1);
|
|
1010
|
+
this.model.expanded = expanded;
|
|
1011
|
+
if (expanded.indexOf(index) < 0)
|
|
1012
|
+
return;
|
|
1013
|
+
let ready = true;
|
|
1014
|
+
for (const idx of this.model.expanded) {
|
|
1015
|
+
if (!(idx in this.model.children)) {
|
|
1016
|
+
ready = false;
|
|
1017
|
+
break;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
if (ready)
|
|
1021
|
+
this._render_children();
|
|
1022
|
+
}
|
|
942
1023
|
getColumns() {
|
|
943
1024
|
var _a;
|
|
944
1025
|
const config_columns = (_a = this.model.configuration) === null || _a === void 0 ? void 0 : _a.columns;
|
|
@@ -951,8 +1032,24 @@
|
|
|
951
1032
|
group_columns.push(Object.assign({}, col));
|
|
952
1033
|
columns.push(Object.assign(Object.assign({}, column), { columns: group_columns }));
|
|
953
1034
|
}
|
|
954
|
-
else
|
|
955
|
-
|
|
1035
|
+
else if (column.formatter === "expand") {
|
|
1036
|
+
const expand = {
|
|
1037
|
+
hozAlign: "center",
|
|
1038
|
+
cellClick: (_, cell) => { this._update_expand(cell); },
|
|
1039
|
+
formatter: (cell) => { return this._expand_render(cell); },
|
|
1040
|
+
width: 40,
|
|
1041
|
+
frozen: true
|
|
1042
|
+
};
|
|
1043
|
+
columns.push(expand);
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
if (column.formatter === "rowSelection") {
|
|
1047
|
+
column.cellClick = (_, cell) => {
|
|
1048
|
+
cell.getRow().toggleSelect();
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
columns.push(column);
|
|
1052
|
+
}
|
|
956
1053
|
}
|
|
957
1054
|
for (const column of this.model.columns) {
|
|
958
1055
|
let tab_column = null;
|
|
@@ -1025,6 +1122,13 @@
|
|
|
1025
1122
|
tab_column.editor = (cell, onRendered, success, cancel) => this.renderEditor(column, cell, onRendered, success, cancel);
|
|
1026
1123
|
}
|
|
1027
1124
|
tab_column.editable = () => (this.model.editable && (editor.default_view != null));
|
|
1125
|
+
if (tab_column.headerFilter) {
|
|
1126
|
+
if ((typeof tab_column.headerFilter) === 'boolean' &&
|
|
1127
|
+
(typeof tab_column.editor) === 'string') {
|
|
1128
|
+
tab_column.headerFilter = tab_column.editor;
|
|
1129
|
+
tab_column.headerFilterParams = tab_column.editorParams;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1028
1132
|
if (config_columns == null)
|
|
1029
1133
|
columns.push(tab_column);
|
|
1030
1134
|
}
|
|
@@ -1215,7 +1319,7 @@
|
|
|
1215
1319
|
}
|
|
1216
1320
|
// Update model
|
|
1217
1321
|
rowClicked(e, row) {
|
|
1218
|
-
if (this._selection_updating || this._initializing || this.model.select_mode
|
|
1322
|
+
if (this._selection_updating || this._initializing || (typeof this.model.select_mode) === 'string' || this.model.select_mode === false)
|
|
1219
1323
|
return;
|
|
1220
1324
|
let indices = [];
|
|
1221
1325
|
const selected = this.model.source.selected;
|
|
@@ -1238,6 +1342,12 @@
|
|
|
1238
1342
|
indices.push(index);
|
|
1239
1343
|
else
|
|
1240
1344
|
indices.splice(indices.indexOf(index), 1);
|
|
1345
|
+
// Remove the first selected indices when selectable is an int.
|
|
1346
|
+
if (typeof this.model.select_mode === 'number') {
|
|
1347
|
+
while (indices.length > this.model.select_mode) {
|
|
1348
|
+
indices.shift();
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1241
1351
|
const filtered = this._filter_selected(indices);
|
|
1242
1352
|
this.tabulator.deselectRow();
|
|
1243
1353
|
this.tabulator.selectRow(filtered);
|
|
@@ -1255,7 +1365,7 @@
|
|
|
1255
1365
|
return filtered;
|
|
1256
1366
|
}
|
|
1257
1367
|
rowSelectionChanged(data, _) {
|
|
1258
|
-
if (this._selection_updating || this._initializing || (typeof this.model.select_mode) === 'boolean')
|
|
1368
|
+
if (this._selection_updating || this._initializing || (typeof this.model.select_mode) === 'boolean' || (this.model.select_mode.startsWith('checkbox')))
|
|
1259
1369
|
return;
|
|
1260
1370
|
const indices = data.map((row) => row._index);
|
|
1261
1371
|
const filtered = this._filter_selected(indices);
|
|
@@ -1284,11 +1394,14 @@
|
|
|
1284
1394
|
this.prototype.default_view = DataTabulatorView;
|
|
1285
1395
|
this.define(({ Any, Array, Boolean, Nullable, Number, Ref, String }) => ({
|
|
1286
1396
|
aggregators: [Any, {}],
|
|
1397
|
+
children: [Any, {}],
|
|
1287
1398
|
configuration: [Any, {}],
|
|
1288
1399
|
columns: [Array(Ref(tables_1.TableColumn)), []],
|
|
1289
1400
|
download: [Boolean, true],
|
|
1290
1401
|
editable: [Boolean, true],
|
|
1402
|
+
expanded: [Array(Number), []],
|
|
1291
1403
|
filename: [String, "table.csv"],
|
|
1404
|
+
filters: [Array(Any), []],
|
|
1292
1405
|
follow: [Boolean, true],
|
|
1293
1406
|
frozen_rows: [Array(Number), []],
|
|
1294
1407
|
groupby: [Array(String), []],
|
|
@@ -1314,6 +1427,73 @@
|
|
|
1314
1427
|
DataTabulator.__module__ = "panel.models.tabulator";
|
|
1315
1428
|
DataTabulator.init_DataTabulator();
|
|
1316
1429
|
},
|
|
1430
|
+
"99a25e6992": /* debounce/index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
1431
|
+
/**
|
|
1432
|
+
* Returns a function, that, as long as it continues to be invoked, will not
|
|
1433
|
+
* be triggered. The function will be called after it stops being called for
|
|
1434
|
+
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
1435
|
+
* leading edge, instead of the trailing. The function also has a property 'clear'
|
|
1436
|
+
* that is a function which will clear the timer to prevent previously scheduled executions.
|
|
1437
|
+
*
|
|
1438
|
+
* @source underscore.js
|
|
1439
|
+
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
|
1440
|
+
* @param {Function} function to wrap
|
|
1441
|
+
* @param {Number} timeout in ms (`100`)
|
|
1442
|
+
* @param {Boolean} whether to execute at the beginning (`false`)
|
|
1443
|
+
* @api public
|
|
1444
|
+
*/
|
|
1445
|
+
function debounce(func, wait, immediate) {
|
|
1446
|
+
var timeout, args, context, timestamp, result;
|
|
1447
|
+
if (null == wait)
|
|
1448
|
+
wait = 100;
|
|
1449
|
+
function later() {
|
|
1450
|
+
var last = Date.now() - timestamp;
|
|
1451
|
+
if (last < wait && last >= 0) {
|
|
1452
|
+
timeout = setTimeout(later, wait - last);
|
|
1453
|
+
}
|
|
1454
|
+
else {
|
|
1455
|
+
timeout = null;
|
|
1456
|
+
if (!immediate) {
|
|
1457
|
+
result = func.apply(context, args);
|
|
1458
|
+
context = args = null;
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
;
|
|
1463
|
+
var debounced = function () {
|
|
1464
|
+
context = this;
|
|
1465
|
+
args = arguments;
|
|
1466
|
+
timestamp = Date.now();
|
|
1467
|
+
var callNow = immediate && !timeout;
|
|
1468
|
+
if (!timeout)
|
|
1469
|
+
timeout = setTimeout(later, wait);
|
|
1470
|
+
if (callNow) {
|
|
1471
|
+
result = func.apply(context, args);
|
|
1472
|
+
context = args = null;
|
|
1473
|
+
}
|
|
1474
|
+
return result;
|
|
1475
|
+
};
|
|
1476
|
+
debounced.clear = function () {
|
|
1477
|
+
if (timeout) {
|
|
1478
|
+
clearTimeout(timeout);
|
|
1479
|
+
timeout = null;
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
debounced.flush = function () {
|
|
1483
|
+
if (timeout) {
|
|
1484
|
+
result = func.apply(context, args);
|
|
1485
|
+
context = args = null;
|
|
1486
|
+
clearTimeout(timeout);
|
|
1487
|
+
timeout = null;
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
return debounced;
|
|
1491
|
+
}
|
|
1492
|
+
;
|
|
1493
|
+
// Adds compatibility for ES modules
|
|
1494
|
+
debounce.debounce = debounce;
|
|
1495
|
+
module.exports = debounce;
|
|
1496
|
+
},
|
|
1317
1497
|
"f1971f81bf": /* models/data.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
1318
1498
|
__esModule();
|
|
1319
1499
|
function transform_cds_to_records(cds, addId = false) {
|
|
@@ -5299,7 +5479,7 @@
|
|
|
5299
5479
|
ECharts.__module__ = "panel.models.echarts";
|
|
5300
5480
|
ECharts.init_ECharts();
|
|
5301
5481
|
},
|
|
5302
|
-
"
|
|
5482
|
+
"c424a3bd17": /* models/html.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
5303
5483
|
__esModule();
|
|
5304
5484
|
const markup_1 = require("@bokehjs/models/widgets/markup");
|
|
5305
5485
|
const bokeh_events_1 = require("@bokehjs/core/bokeh_events");
|
|
@@ -5348,8 +5528,7 @@
|
|
|
5348
5528
|
}
|
|
5349
5529
|
render() {
|
|
5350
5530
|
super.render();
|
|
5351
|
-
const
|
|
5352
|
-
const html = decoded || this.model.text;
|
|
5531
|
+
const html = this.process_tex();
|
|
5353
5532
|
if (!html) {
|
|
5354
5533
|
this.markup_el.innerHTML = '';
|
|
5355
5534
|
return;
|
|
@@ -5358,6 +5537,29 @@
|
|
|
5358
5537
|
runScripts(this.markup_el);
|
|
5359
5538
|
this._setup_event_listeners();
|
|
5360
5539
|
}
|
|
5540
|
+
process_tex() {
|
|
5541
|
+
const decoded = htmlDecode(this.model.text);
|
|
5542
|
+
const text = decoded || this.model.text;
|
|
5543
|
+
if (this.model.disable_math || !this.contains_tex(text))
|
|
5544
|
+
return text;
|
|
5545
|
+
const tex_parts = this.provider.MathJax.find_tex(text);
|
|
5546
|
+
const processed_text = [];
|
|
5547
|
+
let last_index = 0;
|
|
5548
|
+
for (const part of tex_parts) {
|
|
5549
|
+
processed_text.push(text.slice(last_index, part.start.n));
|
|
5550
|
+
processed_text.push(this.provider.MathJax.tex2svg(part.math, { display: part.display }).outerHTML);
|
|
5551
|
+
last_index = part.end.n;
|
|
5552
|
+
}
|
|
5553
|
+
if (last_index < text.length)
|
|
5554
|
+
processed_text.push(text.slice(last_index));
|
|
5555
|
+
return processed_text.join("");
|
|
5556
|
+
}
|
|
5557
|
+
contains_tex(html) {
|
|
5558
|
+
if (!this.provider.MathJax)
|
|
5559
|
+
return false;
|
|
5560
|
+
return this.provider.MathJax.find_tex(html).length > 0;
|
|
5561
|
+
}
|
|
5562
|
+
;
|
|
5361
5563
|
_remove_event_listeners() {
|
|
5362
5564
|
for (const node in this._event_listeners) {
|
|
5363
5565
|
const el = document.getElementById(node);
|
|
@@ -8128,7 +8330,7 @@
|
|
|
8128
8330
|
Player.__module__ = "panel.models.widgets";
|
|
8129
8331
|
Player.init_Player();
|
|
8130
8332
|
},
|
|
8131
|
-
"
|
|
8333
|
+
"a2080c6bc8": /* models/plotly.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
8132
8334
|
__esModule();
|
|
8133
8335
|
const dom_1 = require("@bokehjs/core/dom");
|
|
8134
8336
|
const object_1 = require("@bokehjs/core/util/object");
|
|
@@ -8217,6 +8419,10 @@
|
|
|
8217
8419
|
this._relayouting = false;
|
|
8218
8420
|
}, 2000, false);
|
|
8219
8421
|
}
|
|
8422
|
+
initialize() {
|
|
8423
|
+
super.initialize();
|
|
8424
|
+
this._layout_wrapper = (0, dom_1.div)({ style: "height: 100%; width: 100%;" });
|
|
8425
|
+
}
|
|
8220
8426
|
connect_signals() {
|
|
8221
8427
|
super.connect_signals();
|
|
8222
8428
|
const { data, data_sources, layout, relayout, restyle } = this.model.properties;
|
|
@@ -8245,23 +8451,21 @@
|
|
|
8245
8451
|
this.connect(this.model.properties.viewport_update_throttle.change, () => {
|
|
8246
8452
|
this._updateSetViewportFunction();
|
|
8247
8453
|
});
|
|
8248
|
-
this.connect(this.model.properties._render_count.change, () =>
|
|
8454
|
+
this.connect(this.model.properties._render_count.change, () => {
|
|
8455
|
+
this.plot();
|
|
8456
|
+
});
|
|
8249
8457
|
this.connect(this.model.properties.viewport.change, () => this._updateViewportFromProperty());
|
|
8250
8458
|
}
|
|
8251
|
-
render() {
|
|
8459
|
+
async render() {
|
|
8252
8460
|
super.render();
|
|
8253
|
-
this._layout_wrapper = (0, dom_1.div)({ style: "height: 100%; width: 100%" });
|
|
8254
8461
|
this.el.appendChild(this._layout_wrapper);
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
}
|
|
8258
|
-
this.plot();
|
|
8462
|
+
await this.plot();
|
|
8463
|
+
window.Plotly.relayout(this._layout_wrapper, this.model.relayout);
|
|
8259
8464
|
}
|
|
8260
8465
|
_trace_data() {
|
|
8261
8466
|
const data = [];
|
|
8262
|
-
for (let i = 0; i < this.model.data.length; i++)
|
|
8467
|
+
for (let i = 0; i < this.model.data.length; i++)
|
|
8263
8468
|
data.push(this._get_trace(i, false));
|
|
8264
|
-
}
|
|
8265
8469
|
return data;
|
|
8266
8470
|
}
|
|
8267
8471
|
_layout_data() {
|
|
@@ -8326,29 +8530,27 @@
|
|
|
8326
8530
|
this.model.hover_data = null;
|
|
8327
8531
|
});
|
|
8328
8532
|
}
|
|
8329
|
-
plot() {
|
|
8330
|
-
if (!window.Plotly)
|
|
8533
|
+
async plot() {
|
|
8534
|
+
if (!window.Plotly)
|
|
8331
8535
|
return;
|
|
8332
|
-
}
|
|
8333
8536
|
const data = this._trace_data();
|
|
8334
8537
|
const newLayout = this._layout_data();
|
|
8335
8538
|
this._reacting = true;
|
|
8336
|
-
window.Plotly.react(this._layout_wrapper, data, newLayout, this.model.config)
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
this.
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
});
|
|
8539
|
+
await window.Plotly.react(this._layout_wrapper, data, newLayout, this.model.config);
|
|
8540
|
+
this._updateSetViewportFunction();
|
|
8541
|
+
this._updateViewportProperty();
|
|
8542
|
+
if (!this._plotInitialized)
|
|
8543
|
+
this._install_callbacks();
|
|
8544
|
+
else if (!_isHidden(this._layout_wrapper))
|
|
8545
|
+
window.Plotly.Plots.resize(this._layout_wrapper);
|
|
8546
|
+
this._reacting = false;
|
|
8547
|
+
this._plotInitialized = true;
|
|
8346
8548
|
}
|
|
8347
8549
|
after_layout() {
|
|
8348
8550
|
super.after_layout();
|
|
8349
|
-
|
|
8551
|
+
(0, layout_1.set_size)(this.el, this.model);
|
|
8552
|
+
if (window.Plotly && this._plotInitialized)
|
|
8350
8553
|
window.Plotly.Plots.resize(this._layout_wrapper);
|
|
8351
|
-
}
|
|
8352
8554
|
}
|
|
8353
8555
|
_get_trace(index, update) {
|
|
8354
8556
|
const trace = (0, object_1.clone)(this.model.data[index]);
|
|
@@ -8388,7 +8590,10 @@
|
|
|
8388
8590
|
if (!(0, eq_1.isEqual)((0, util_1.get)(fullLayout, key), value)) {
|
|
8389
8591
|
let clonedViewport = (0, util_1.deepCopy)(this.model.viewport);
|
|
8390
8592
|
clonedViewport['_update_from_property'] = true;
|
|
8391
|
-
|
|
8593
|
+
this._settingViewport = true;
|
|
8594
|
+
window.Plotly.relayout(this.el, clonedViewport).then(() => {
|
|
8595
|
+
this._settingViewport = false;
|
|
8596
|
+
});
|
|
8392
8597
|
return false;
|
|
8393
8598
|
}
|
|
8394
8599
|
else {
|
|
@@ -8401,17 +8606,14 @@
|
|
|
8401
8606
|
let viewport = {};
|
|
8402
8607
|
// Get range for all xaxis and yaxis properties
|
|
8403
8608
|
for (let prop in fullLayout) {
|
|
8404
|
-
if (!fullLayout.hasOwnProperty(prop))
|
|
8609
|
+
if (!fullLayout.hasOwnProperty(prop))
|
|
8405
8610
|
continue;
|
|
8406
|
-
}
|
|
8407
8611
|
let maybe_axis = prop.slice(0, 5);
|
|
8408
|
-
if (maybe_axis === 'xaxis' || maybe_axis === 'yaxis')
|
|
8612
|
+
if (maybe_axis === 'xaxis' || maybe_axis === 'yaxis')
|
|
8409
8613
|
viewport[prop + '.range'] = (0, util_1.deepCopy)(fullLayout[prop].range);
|
|
8410
|
-
}
|
|
8411
8614
|
}
|
|
8412
|
-
if (!(0, eq_1.isEqual)(viewport, this.model.viewport))
|
|
8615
|
+
if (!(0, eq_1.isEqual)(viewport, this.model.viewport))
|
|
8413
8616
|
this._setViewport(viewport);
|
|
8414
|
-
}
|
|
8415
8617
|
}
|
|
8416
8618
|
_updateSetViewportFunction() {
|
|
8417
8619
|
if (this.model.viewport_update_policy === "continuous" ||
|
|
@@ -8468,73 +8670,6 @@
|
|
|
8468
8670
|
PlotlyPlot.__module__ = "panel.models.plotly";
|
|
8469
8671
|
PlotlyPlot.init_PlotlyPlot();
|
|
8470
8672
|
},
|
|
8471
|
-
"99a25e6992": /* debounce/index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
8472
|
-
/**
|
|
8473
|
-
* Returns a function, that, as long as it continues to be invoked, will not
|
|
8474
|
-
* be triggered. The function will be called after it stops being called for
|
|
8475
|
-
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
8476
|
-
* leading edge, instead of the trailing. The function also has a property 'clear'
|
|
8477
|
-
* that is a function which will clear the timer to prevent previously scheduled executions.
|
|
8478
|
-
*
|
|
8479
|
-
* @source underscore.js
|
|
8480
|
-
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
|
8481
|
-
* @param {Function} function to wrap
|
|
8482
|
-
* @param {Number} timeout in ms (`100`)
|
|
8483
|
-
* @param {Boolean} whether to execute at the beginning (`false`)
|
|
8484
|
-
* @api public
|
|
8485
|
-
*/
|
|
8486
|
-
function debounce(func, wait, immediate) {
|
|
8487
|
-
var timeout, args, context, timestamp, result;
|
|
8488
|
-
if (null == wait)
|
|
8489
|
-
wait = 100;
|
|
8490
|
-
function later() {
|
|
8491
|
-
var last = Date.now() - timestamp;
|
|
8492
|
-
if (last < wait && last >= 0) {
|
|
8493
|
-
timeout = setTimeout(later, wait - last);
|
|
8494
|
-
}
|
|
8495
|
-
else {
|
|
8496
|
-
timeout = null;
|
|
8497
|
-
if (!immediate) {
|
|
8498
|
-
result = func.apply(context, args);
|
|
8499
|
-
context = args = null;
|
|
8500
|
-
}
|
|
8501
|
-
}
|
|
8502
|
-
}
|
|
8503
|
-
;
|
|
8504
|
-
var debounced = function () {
|
|
8505
|
-
context = this;
|
|
8506
|
-
args = arguments;
|
|
8507
|
-
timestamp = Date.now();
|
|
8508
|
-
var callNow = immediate && !timeout;
|
|
8509
|
-
if (!timeout)
|
|
8510
|
-
timeout = setTimeout(later, wait);
|
|
8511
|
-
if (callNow) {
|
|
8512
|
-
result = func.apply(context, args);
|
|
8513
|
-
context = args = null;
|
|
8514
|
-
}
|
|
8515
|
-
return result;
|
|
8516
|
-
};
|
|
8517
|
-
debounced.clear = function () {
|
|
8518
|
-
if (timeout) {
|
|
8519
|
-
clearTimeout(timeout);
|
|
8520
|
-
timeout = null;
|
|
8521
|
-
}
|
|
8522
|
-
};
|
|
8523
|
-
debounced.flush = function () {
|
|
8524
|
-
if (timeout) {
|
|
8525
|
-
result = func.apply(context, args);
|
|
8526
|
-
context = args = null;
|
|
8527
|
-
clearTimeout(timeout);
|
|
8528
|
-
timeout = null;
|
|
8529
|
-
}
|
|
8530
|
-
};
|
|
8531
|
-
return debounced;
|
|
8532
|
-
}
|
|
8533
|
-
;
|
|
8534
|
-
// Adds compatibility for ES modules
|
|
8535
|
-
debounce.debounce = debounce;
|
|
8536
|
-
module.exports = debounce;
|
|
8537
|
-
},
|
|
8538
8673
|
"990b5dd5c7": /* models/util.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
8539
8674
|
__esModule();
|
|
8540
8675
|
const get = (obj, path, defaultValue = undefined) => {
|
|
@@ -8588,7 +8723,7 @@
|
|
|
8588
8723
|
}
|
|
8589
8724
|
exports.isPlainObject = isPlainObject;
|
|
8590
8725
|
},
|
|
8591
|
-
"
|
|
8726
|
+
"fd3806082d": /* models/progress.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
8592
8727
|
__esModule();
|
|
8593
8728
|
const tslib_1 = require("tslib");
|
|
8594
8729
|
const p = (0, tslib_1.__importStar)(require("@bokehjs/core/properties"));
|
|
@@ -8632,8 +8767,13 @@
|
|
|
8632
8767
|
this.progressEl.className = css;
|
|
8633
8768
|
}
|
|
8634
8769
|
setValue() {
|
|
8635
|
-
if (this.model.value
|
|
8770
|
+
if (this.model.value == null)
|
|
8771
|
+
this.progressEl.value = 0;
|
|
8772
|
+
else if (this.model.value >= 0)
|
|
8636
8773
|
this.progressEl.value = this.model.value;
|
|
8774
|
+
else if (this.model.value < 0)
|
|
8775
|
+
this.progressEl.removeAttribute("value");
|
|
8776
|
+
console.log(this.progressEl);
|
|
8637
8777
|
}
|
|
8638
8778
|
setMax() {
|
|
8639
8779
|
if (this.model.max != null)
|
|
@@ -8669,6 +8809,95 @@
|
|
|
8669
8809
|
Progress.__module__ = "panel.models.widgets";
|
|
8670
8810
|
Progress.init_Progress();
|
|
8671
8811
|
},
|
|
8812
|
+
"6895629dfc": /* models/quill.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
8813
|
+
__esModule();
|
|
8814
|
+
const dom_1 = require("@bokehjs/core/dom");
|
|
8815
|
+
const html_box_1 = require("@bokehjs/models/layouts/html_box");
|
|
8816
|
+
const layout_1 = require("4c755983eb") /* ./layout */;
|
|
8817
|
+
class QuillInputView extends layout_1.PanelHTMLBoxView {
|
|
8818
|
+
initialize() {
|
|
8819
|
+
super.initialize();
|
|
8820
|
+
this._container = (0, dom_1.div)({});
|
|
8821
|
+
}
|
|
8822
|
+
connect_signals() {
|
|
8823
|
+
super.connect_signals();
|
|
8824
|
+
this.connect(this.model.properties.disabled.change, () => this.quill.enable(!this.model.disabled));
|
|
8825
|
+
this.connect(this.model.properties.text.change, () => {
|
|
8826
|
+
if (this._editing)
|
|
8827
|
+
return;
|
|
8828
|
+
this._editing = true;
|
|
8829
|
+
this.quill.setContents([]);
|
|
8830
|
+
this.quill.clipboard.dangerouslyPasteHTML(this.model.text);
|
|
8831
|
+
this._editing = false;
|
|
8832
|
+
});
|
|
8833
|
+
const { mode, toolbar } = this.model.properties;
|
|
8834
|
+
this.on_change([mode, toolbar], () => {
|
|
8835
|
+
this.render();
|
|
8836
|
+
this._layout_toolbar();
|
|
8837
|
+
});
|
|
8838
|
+
}
|
|
8839
|
+
_layout_toolbar() {
|
|
8840
|
+
if (this._toolbar == null) {
|
|
8841
|
+
this.el.style.removeProperty('padding-top');
|
|
8842
|
+
}
|
|
8843
|
+
else {
|
|
8844
|
+
const height = this._toolbar.getBoundingClientRect().height + 1;
|
|
8845
|
+
this.el.style.paddingTop = height + "px";
|
|
8846
|
+
this._toolbar.style.marginTop = -height + "px";
|
|
8847
|
+
}
|
|
8848
|
+
}
|
|
8849
|
+
render() {
|
|
8850
|
+
super.render();
|
|
8851
|
+
this.el.appendChild(this._container);
|
|
8852
|
+
const theme = (this.model.mode === 'bubble') ? 'bubble' : 'snow';
|
|
8853
|
+
this.quill = new window.Quill(this._container, {
|
|
8854
|
+
modules: {
|
|
8855
|
+
toolbar: this.model.toolbar
|
|
8856
|
+
},
|
|
8857
|
+
placeholder: this.model.placeholder,
|
|
8858
|
+
theme: theme
|
|
8859
|
+
});
|
|
8860
|
+
this._editor = this.el.querySelector('.ql-editor');
|
|
8861
|
+
this._toolbar = this.el.querySelector('.ql-toolbar');
|
|
8862
|
+
this.quill.clipboard.dangerouslyPasteHTML(this.model.text);
|
|
8863
|
+
this.quill.on('text-change', () => {
|
|
8864
|
+
if (this._editing)
|
|
8865
|
+
return;
|
|
8866
|
+
this._editing = true;
|
|
8867
|
+
this.model.text = this._editor.innerHTML;
|
|
8868
|
+
this._editing = false;
|
|
8869
|
+
});
|
|
8870
|
+
}
|
|
8871
|
+
after_layout() {
|
|
8872
|
+
super.after_layout();
|
|
8873
|
+
this._layout_toolbar();
|
|
8874
|
+
}
|
|
8875
|
+
}
|
|
8876
|
+
exports.QuillInputView = QuillInputView;
|
|
8877
|
+
QuillInputView.__name__ = "QuillInputView";
|
|
8878
|
+
class QuillInput extends html_box_1.HTMLBox {
|
|
8879
|
+
constructor(attrs) {
|
|
8880
|
+
super(attrs);
|
|
8881
|
+
}
|
|
8882
|
+
static init_QuillInput() {
|
|
8883
|
+
this.prototype.default_view = QuillInputView;
|
|
8884
|
+
this.define(({ Any, Boolean, String }) => ({
|
|
8885
|
+
mode: [String, 'toolbar'],
|
|
8886
|
+
placeholder: [String, ''],
|
|
8887
|
+
readonly: [Boolean, false],
|
|
8888
|
+
text: [String, ''],
|
|
8889
|
+
toolbar: [Any, null],
|
|
8890
|
+
}));
|
|
8891
|
+
this.override({
|
|
8892
|
+
height: 300
|
|
8893
|
+
});
|
|
8894
|
+
}
|
|
8895
|
+
}
|
|
8896
|
+
exports.QuillInput = QuillInput;
|
|
8897
|
+
QuillInput.__name__ = "QuillInput";
|
|
8898
|
+
QuillInput.__module__ = "panel.models.quill";
|
|
8899
|
+
QuillInput.init_QuillInput();
|
|
8900
|
+
},
|
|
8672
8901
|
"eb3a49319b": /* models/reactive_html.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
8673
8902
|
__esModule();
|
|
8674
8903
|
const preact_1 = require("6f11f2ef27") /* preact */;
|
|
@@ -8681,7 +8910,7 @@
|
|
|
8681
8910
|
const color_1 = require("@bokehjs/core/util/color");
|
|
8682
8911
|
const data_1 = require("f1971f81bf") /* ./data */;
|
|
8683
8912
|
const event_to_object_1 = require("3329d4aa5b") /* ./event-to-object */;
|
|
8684
|
-
const html_1 = require("
|
|
8913
|
+
const html_1 = require("c424a3bd17") /* ./html */;
|
|
8685
8914
|
const layout_1 = require("4c755983eb") /* ./layout */;
|
|
8686
8915
|
function serialize_attrs(attrs) {
|
|
8687
8916
|
const serialized = {};
|
|
@@ -9559,11 +9788,24 @@
|
|
|
9559
9788
|
State.__module__ = "panel.models.state";
|
|
9560
9789
|
State.init_State();
|
|
9561
9790
|
},
|
|
9562
|
-
"
|
|
9791
|
+
"edf66f5228": /* models/terminal.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
9563
9792
|
__esModule();
|
|
9564
9793
|
const html_box_1 = require("@bokehjs/models/layouts/html_box");
|
|
9565
9794
|
const dom_1 = require("@bokehjs/core/dom");
|
|
9795
|
+
const bokeh_events_1 = require("@bokehjs/core/bokeh_events");
|
|
9566
9796
|
const layout_1 = require("4c755983eb") /* ./layout */;
|
|
9797
|
+
class KeystrokeEvent extends bokeh_events_1.ModelEvent {
|
|
9798
|
+
constructor(key) {
|
|
9799
|
+
super();
|
|
9800
|
+
this.key = key;
|
|
9801
|
+
this.event_name = "keystroke";
|
|
9802
|
+
}
|
|
9803
|
+
_to_json() {
|
|
9804
|
+
return { model: this.origin, key: this.key };
|
|
9805
|
+
}
|
|
9806
|
+
}
|
|
9807
|
+
exports.KeystrokeEvent = KeystrokeEvent;
|
|
9808
|
+
KeystrokeEvent.__name__ = "KeystrokeEvent";
|
|
9567
9809
|
class TerminalView extends layout_1.PanelHTMLBoxView {
|
|
9568
9810
|
connect_signals() {
|
|
9569
9811
|
super.connect_signals();
|
|
@@ -9582,9 +9824,8 @@
|
|
|
9582
9824
|
this.term.loadAddon(this.webLinksAddon);
|
|
9583
9825
|
this.term.open(this.container);
|
|
9584
9826
|
this.term.onRender(() => {
|
|
9585
|
-
if (!this._rendered)
|
|
9827
|
+
if (!this._rendered)
|
|
9586
9828
|
this.fit();
|
|
9587
|
-
}
|
|
9588
9829
|
});
|
|
9589
9830
|
this.write();
|
|
9590
9831
|
this.el.appendChild(this.container);
|
|
@@ -9601,11 +9842,7 @@
|
|
|
9601
9842
|
return new wn.WebLinksAddon.WebLinksAddon();
|
|
9602
9843
|
}
|
|
9603
9844
|
handleOnData(value) {
|
|
9604
|
-
|
|
9605
|
-
if (this.model.input === value)
|
|
9606
|
-
this.model._value_repeats += 1;
|
|
9607
|
-
else
|
|
9608
|
-
this.model.input = value;
|
|
9845
|
+
this.model.trigger_event(new KeystrokeEvent(value));
|
|
9609
9846
|
}
|
|
9610
9847
|
write() {
|
|
9611
9848
|
const text = this.model.output;
|
|
@@ -9617,7 +9854,6 @@
|
|
|
9617
9854
|
this.term.write(cleaned);
|
|
9618
9855
|
}
|
|
9619
9856
|
clear() {
|
|
9620
|
-
// https://stackoverflow.com/questions/65367607/how-to-handle-new-line-in-xterm-js-while-writing-data-into-the-terminal
|
|
9621
9857
|
this.term.clear();
|
|
9622
9858
|
}
|
|
9623
9859
|
fit() {
|
|
@@ -9630,10 +9866,10 @@
|
|
|
9630
9866
|
return;
|
|
9631
9867
|
const cols = Math.max(2, Math.floor(width / cell_width));
|
|
9632
9868
|
const rows = Math.max(1, Math.floor(height / cell_height));
|
|
9633
|
-
if (this.term.rows !== rows || this.term.cols !== cols)
|
|
9634
|
-
renderer.clear();
|
|
9869
|
+
if (this.term.rows !== rows || this.term.cols !== cols)
|
|
9635
9870
|
this.term.resize(cols, rows);
|
|
9636
|
-
|
|
9871
|
+
this.model.ncols = cols;
|
|
9872
|
+
this.model.nrows = rows;
|
|
9637
9873
|
this._rendered = true;
|
|
9638
9874
|
}
|
|
9639
9875
|
after_layout() {
|
|
@@ -9655,11 +9891,11 @@
|
|
|
9655
9891
|
static init_Terminal() {
|
|
9656
9892
|
this.prototype.default_view = TerminalView;
|
|
9657
9893
|
this.define(({ Any, Int, String }) => ({
|
|
9894
|
+
_clears: [Int, 0],
|
|
9658
9895
|
options: [Any, {}],
|
|
9659
9896
|
output: [String,],
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
_value_repeats: [Int, 0],
|
|
9897
|
+
ncols: [Int],
|
|
9898
|
+
nrows: [Int],
|
|
9663
9899
|
}));
|
|
9664
9900
|
}
|
|
9665
9901
|
}
|
|
@@ -10012,14 +10248,17 @@
|
|
|
10012
10248
|
TrendIndicator.__module__ = "panel.models.trend";
|
|
10013
10249
|
TrendIndicator.init_TrendIndicator();
|
|
10014
10250
|
},
|
|
10015
|
-
"
|
|
10251
|
+
"04fd346566": /* models/vega.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10016
10252
|
__esModule();
|
|
10017
10253
|
const types_1 = require("@bokehjs/core/util/types");
|
|
10018
10254
|
const html_box_1 = require("@bokehjs/models/layouts/html_box");
|
|
10019
10255
|
class VegaPlotView extends html_box_1.HTMLBoxView {
|
|
10020
10256
|
connect_signals() {
|
|
10021
10257
|
super.connect_signals();
|
|
10022
|
-
this.
|
|
10258
|
+
const { data, show_actions, theme } = this.model.properties;
|
|
10259
|
+
this.on_change([data, show_actions, theme], () => {
|
|
10260
|
+
this._plot();
|
|
10261
|
+
});
|
|
10023
10262
|
this.connect(this.model.properties.data_sources.change, () => this._connect_sources());
|
|
10024
10263
|
this._connected = [];
|
|
10025
10264
|
this._connect_sources();
|
|
@@ -10075,7 +10314,8 @@
|
|
|
10075
10314
|
}
|
|
10076
10315
|
this.model.data['datasets'] = datasets;
|
|
10077
10316
|
}
|
|
10078
|
-
|
|
10317
|
+
const config = { actions: this.model.show_actions, theme: this.model.theme };
|
|
10318
|
+
window.vegaEmbed(this.el, this.model.data, config);
|
|
10079
10319
|
}
|
|
10080
10320
|
}
|
|
10081
10321
|
exports.VegaPlotView = VegaPlotView;
|
|
@@ -10086,9 +10326,11 @@
|
|
|
10086
10326
|
}
|
|
10087
10327
|
static init_VegaPlot() {
|
|
10088
10328
|
this.prototype.default_view = VegaPlotView;
|
|
10089
|
-
this.define(({ Any }) => ({
|
|
10329
|
+
this.define(({ Any, Boolean, String }) => ({
|
|
10090
10330
|
data: [Any, {}],
|
|
10091
10331
|
data_sources: [Any, {}],
|
|
10332
|
+
show_actions: [Boolean, false],
|
|
10333
|
+
theme: [String,]
|
|
10092
10334
|
}));
|
|
10093
10335
|
}
|
|
10094
10336
|
}
|
|
@@ -10330,19 +10572,19 @@
|
|
|
10330
10572
|
},
|
|
10331
10573
|
"c51f25e2a7": /* models/vtk/index.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10332
10574
|
__esModule();
|
|
10333
|
-
var vtkjs_1 = require("
|
|
10575
|
+
var vtkjs_1 = require("b6d9199d03") /* ./vtkjs */;
|
|
10334
10576
|
__esExport("VTKJSPlot", vtkjs_1.VTKJSPlot);
|
|
10335
|
-
var vtkvolume_1 = require("
|
|
10577
|
+
var vtkvolume_1 = require("7785475bdd") /* ./vtkvolume */;
|
|
10336
10578
|
__esExport("VTKVolumePlot", vtkvolume_1.VTKVolumePlot);
|
|
10337
|
-
var vtkaxes_1 = require("
|
|
10579
|
+
var vtkaxes_1 = require("204e2f98bd") /* ./vtkaxes */;
|
|
10338
10580
|
__esExport("VTKAxes", vtkaxes_1.VTKAxes);
|
|
10339
|
-
var vtksynchronized_1 = require("
|
|
10581
|
+
var vtksynchronized_1 = require("0a57062475") /* ./vtksynchronized */;
|
|
10340
10582
|
__esExport("VTKSynchronizedPlot", vtksynchronized_1.VTKSynchronizedPlot);
|
|
10341
10583
|
},
|
|
10342
|
-
"
|
|
10584
|
+
"b6d9199d03": /* models/vtk/vtkjs.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10343
10585
|
__esModule();
|
|
10344
|
-
const vtklayout_1 = require("
|
|
10345
|
-
const util_1 = require("
|
|
10586
|
+
const vtklayout_1 = require("e13c143c7d") /* ./vtklayout */;
|
|
10587
|
+
const util_1 = require("993f3118b2") /* ./util */;
|
|
10346
10588
|
class VTKJSPlotView extends vtklayout_1.AbstractVTKView {
|
|
10347
10589
|
connect_signals() {
|
|
10348
10590
|
super.connect_signals();
|
|
@@ -10377,7 +10619,7 @@
|
|
|
10377
10619
|
renderer: this._vtk_renwin.getRenderer(),
|
|
10378
10620
|
dataAccessHelper,
|
|
10379
10621
|
});
|
|
10380
|
-
const fn =
|
|
10622
|
+
const fn = window.vtk.macro.debounce(() => setTimeout(() => {
|
|
10381
10623
|
if (this._axes == null && this.model.axes)
|
|
10382
10624
|
this._set_axes();
|
|
10383
10625
|
this._set_camera_state();
|
|
@@ -10404,7 +10646,7 @@
|
|
|
10404
10646
|
VTKJSPlot.__name__ = "VTKJSPlot";
|
|
10405
10647
|
VTKJSPlot.init_VTKJSPlot();
|
|
10406
10648
|
},
|
|
10407
|
-
"
|
|
10649
|
+
"e13c143c7d": /* models/vtk/vtklayout.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10408
10650
|
__esModule();
|
|
10409
10651
|
const dom_1 = require("@bokehjs/core/dom");
|
|
10410
10652
|
const html_box_1 = require("@bokehjs/models/layouts/html_box");
|
|
@@ -10412,9 +10654,9 @@
|
|
|
10412
10654
|
const color_mapper_1 = require("@bokehjs/models/mappers/color_mapper");
|
|
10413
10655
|
const kinds_1 = require("@bokehjs/core/kinds");
|
|
10414
10656
|
const layout_1 = require("4c755983eb") /* ../layout */;
|
|
10415
|
-
const util_1 = require("
|
|
10657
|
+
const util_1 = require("993f3118b2") /* ./util */;
|
|
10416
10658
|
const vtkcolorbar_1 = require("c010237f8b") /* ./vtkcolorbar */;
|
|
10417
|
-
const vtkaxes_1 = require("
|
|
10659
|
+
const vtkaxes_1 = require("204e2f98bd") /* ./vtkaxes */;
|
|
10418
10660
|
const INFO_DIV_STYLE = {
|
|
10419
10661
|
padding: "0px 2px 0px 2px",
|
|
10420
10662
|
maxHeight: "150px",
|
|
@@ -10552,7 +10794,6 @@
|
|
|
10552
10794
|
});
|
|
10553
10795
|
}
|
|
10554
10796
|
}
|
|
10555
|
-
console.log(this.model.annotations);
|
|
10556
10797
|
}
|
|
10557
10798
|
connect_signals() {
|
|
10558
10799
|
super.connect_signals();
|
|
@@ -10616,6 +10857,9 @@
|
|
|
10616
10857
|
remove() {
|
|
10617
10858
|
this._unsubscribe_camera_cb();
|
|
10618
10859
|
window.removeEventListener("resize", this._vtk_renwin.resize);
|
|
10860
|
+
if (this._orientationWidget != null)
|
|
10861
|
+
this._orientationWidget.delete();
|
|
10862
|
+
this._vtk_renwin.getRenderWindow().getInteractor().delete();
|
|
10619
10863
|
this._vtk_renwin.delete();
|
|
10620
10864
|
super.remove();
|
|
10621
10865
|
}
|
|
@@ -10815,6 +11059,7 @@
|
|
|
10815
11059
|
AbstractVTKView.__name__ = "AbstractVTKView";
|
|
10816
11060
|
class AbstractVTKPlot extends html_box_1.HTMLBox {
|
|
10817
11061
|
constructor(attrs) {
|
|
11062
|
+
(0, util_1.setup_vtkns)();
|
|
10818
11063
|
super(attrs);
|
|
10819
11064
|
}
|
|
10820
11065
|
getActors() {
|
|
@@ -10840,7 +11085,7 @@
|
|
|
10840
11085
|
AbstractVTKPlot.__module__ = "panel.models.vtk";
|
|
10841
11086
|
AbstractVTKPlot.init_AbstractVTKPlot();
|
|
10842
11087
|
},
|
|
10843
|
-
"
|
|
11088
|
+
"993f3118b2": /* models/vtk/util.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
10844
11089
|
__esModule();
|
|
10845
11090
|
const array_1 = require("@bokehjs/core/util/array");
|
|
10846
11091
|
const kinds_1 = require("@bokehjs/core/kinds");
|
|
@@ -10854,65 +11099,70 @@
|
|
|
10854
11099
|
float32: Float32Array,
|
|
10855
11100
|
float64: Float64Array,
|
|
10856
11101
|
};
|
|
10857
|
-
exports.vtk = window.vtk;
|
|
10858
11102
|
exports.vtkns = {};
|
|
10859
|
-
|
|
10860
|
-
exports.vtkns
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
exports.vtkns["
|
|
10864
|
-
exports.vtkns["
|
|
10865
|
-
exports.vtkns["
|
|
10866
|
-
exports.vtkns["
|
|
10867
|
-
exports.vtkns["
|
|
10868
|
-
exports.vtkns["
|
|
10869
|
-
exports.vtkns["
|
|
10870
|
-
exports.vtkns["
|
|
10871
|
-
exports.vtkns["
|
|
10872
|
-
exports.vtkns["
|
|
10873
|
-
exports.vtkns["
|
|
10874
|
-
exports.vtkns["
|
|
10875
|
-
exports.vtkns["
|
|
10876
|
-
exports.vtkns["
|
|
11103
|
+
function setup_vtkns() {
|
|
11104
|
+
if (exports.vtkns.Actor != null)
|
|
11105
|
+
return;
|
|
11106
|
+
const vtk = window.vtk;
|
|
11107
|
+
exports.vtkns["Actor"] = vtk.Rendering.Core.vtkActor;
|
|
11108
|
+
exports.vtkns["AxesActor"] = vtk.Rendering.Core.vtkAxesActor;
|
|
11109
|
+
exports.vtkns["Base64"] = vtk.Common.Core.vtkBase64;
|
|
11110
|
+
exports.vtkns["BoundingBox"] = vtk.Common.DataModel.vtkBoundingBox;
|
|
11111
|
+
exports.vtkns["Camera"] = vtk.Rendering.Core.vtkCamera;
|
|
11112
|
+
exports.vtkns["ColorTransferFunction"] = vtk.Rendering.Core.vtkColorTransferFunction;
|
|
11113
|
+
exports.vtkns["CubeSource"] = vtk.Filters.Sources.vtkCubeSource;
|
|
11114
|
+
exports.vtkns["DataAccessHelper"] = vtk.IO.Core.DataAccessHelper;
|
|
11115
|
+
exports.vtkns["DataArray"] = vtk.Common.Core.vtkDataArray;
|
|
11116
|
+
exports.vtkns["Follower"] = vtk.Rendering.Core.vtkFollower;
|
|
11117
|
+
exports.vtkns["FullScreenRenderWindow"] = vtk.Rendering.Misc.vtkFullScreenRenderWindow;
|
|
11118
|
+
exports.vtkns["Glyph3DMapper"] = vtk.Rendering.Core.vtkGlyph3DMapper;
|
|
11119
|
+
exports.vtkns["HttpSceneLoader"] = vtk.IO.Core.vtkHttpSceneLoader;
|
|
11120
|
+
exports.vtkns["ImageData"] = vtk.Common.DataModel.vtkImageData;
|
|
11121
|
+
exports.vtkns["ImageMapper"] = vtk.Rendering.Core.vtkImageMapper;
|
|
11122
|
+
exports.vtkns["ImageProperty"] = vtk.Rendering.Core.vtkImageProperty;
|
|
11123
|
+
exports.vtkns["ImageSlice"] = vtk.Rendering.Core.vtkImageSlice;
|
|
10877
11124
|
exports.vtkns["InteractiveOrientationWidget"] =
|
|
10878
|
-
|
|
11125
|
+
vtk.Widgets.Widgets3D.vtkInteractiveOrientationWidget;
|
|
10879
11126
|
exports.vtkns["InteractorStyleTrackballCamera"] =
|
|
10880
|
-
|
|
10881
|
-
exports.vtkns["Light"] =
|
|
10882
|
-
exports.vtkns["LineSource"] =
|
|
10883
|
-
exports.vtkns["LookupTable"] =
|
|
10884
|
-
exports.vtkns["macro"] =
|
|
10885
|
-
exports.vtkns["Mapper"] =
|
|
10886
|
-
exports.vtkns["OpenGLRenderWindow"] =
|
|
11127
|
+
vtk.Interaction.Style.vtkInteractorStyleTrackballCamera;
|
|
11128
|
+
exports.vtkns["Light"] = vtk.Rendering.Core.vtkLight;
|
|
11129
|
+
exports.vtkns["LineSource"] = vtk.Filters.Sources.vtkLineSource;
|
|
11130
|
+
exports.vtkns["LookupTable"] = vtk.Common.Core.vtkLookupTable;
|
|
11131
|
+
exports.vtkns["macro"] = vtk.macro;
|
|
11132
|
+
exports.vtkns["Mapper"] = vtk.Rendering.Core.vtkMapper;
|
|
11133
|
+
exports.vtkns["OpenGLRenderWindow"] = vtk.Rendering.OpenGL.vtkRenderWindow;
|
|
10887
11134
|
exports.vtkns["OrientationMarkerWidget"] =
|
|
10888
|
-
|
|
10889
|
-
exports.vtkns["OutlineFilter"] =
|
|
10890
|
-
exports.vtkns["PiecewiseFunction"] =
|
|
11135
|
+
vtk.Interaction.Widgets.vtkOrientationMarkerWidget;
|
|
11136
|
+
exports.vtkns["OutlineFilter"] = vtk.Filters.General.vtkOutlineFilter;
|
|
11137
|
+
exports.vtkns["PiecewiseFunction"] = vtk.Common.DataModel.vtkPiecewiseFunction;
|
|
10891
11138
|
exports.vtkns["PixelSpaceCallbackMapper"] =
|
|
10892
|
-
|
|
10893
|
-
exports.vtkns["PlaneSource"] =
|
|
10894
|
-
exports.vtkns["PointSource"] =
|
|
10895
|
-
exports.vtkns["PolyData"] =
|
|
10896
|
-
exports.vtkns["Property"] =
|
|
10897
|
-
exports.vtkns["Renderer"] =
|
|
10898
|
-
exports.vtkns["RenderWindow"] =
|
|
10899
|
-
exports.vtkns["RenderWindowInteractor"] =
|
|
10900
|
-
exports.vtkns["SphereMapper"] =
|
|
11139
|
+
vtk.Rendering.Core.vtkPixelSpaceCallbackMapper;
|
|
11140
|
+
exports.vtkns["PlaneSource"] = vtk.Filters.Sources.vtkPlaneSource;
|
|
11141
|
+
exports.vtkns["PointSource"] = vtk.Filters.Sources.vtkPointSource;
|
|
11142
|
+
exports.vtkns["PolyData"] = vtk.Common.DataModel.vtkPolyData;
|
|
11143
|
+
exports.vtkns["Property"] = vtk.Rendering.Core.vtkProperty;
|
|
11144
|
+
exports.vtkns["Renderer"] = vtk.Rendering.Core.vtkRenderer;
|
|
11145
|
+
exports.vtkns["RenderWindow"] = vtk.Rendering.Core.vtkRenderWindow;
|
|
11146
|
+
exports.vtkns["RenderWindowInteractor"] = vtk.Rendering.Core.vtkRenderWindowInteractor;
|
|
11147
|
+
exports.vtkns["SphereMapper"] = vtk.Rendering.Core.vtkSphereMapper;
|
|
10901
11148
|
exports.vtkns["SynchronizableRenderWindow"] =
|
|
10902
|
-
|
|
10903
|
-
exports.vtkns["ThirdParty"] =
|
|
10904
|
-
exports.vtkns["Texture"] =
|
|
10905
|
-
exports.vtkns["Volume"] =
|
|
10906
|
-
exports.vtkns["VolumeController"] =
|
|
10907
|
-
exports.vtkns["VolumeMapper"] =
|
|
10908
|
-
exports.vtkns["VolumeProperty"] =
|
|
10909
|
-
exports.vtkns["WidgetManager"] =
|
|
11149
|
+
vtk.Rendering.Misc.vtkSynchronizableRenderWindow;
|
|
11150
|
+
exports.vtkns["ThirdParty"] = vtk.ThirdParty;
|
|
11151
|
+
exports.vtkns["Texture"] = vtk.Rendering.Core.vtkTexture;
|
|
11152
|
+
exports.vtkns["Volume"] = vtk.Rendering.Core.vtkVolume;
|
|
11153
|
+
exports.vtkns["VolumeController"] = vtk.Interaction.UI.vtkVolumeController;
|
|
11154
|
+
exports.vtkns["VolumeMapper"] = vtk.Rendering.Core.vtkVolumeMapper;
|
|
11155
|
+
exports.vtkns["VolumeProperty"] = vtk.Rendering.Core.vtkVolumeProperty;
|
|
11156
|
+
exports.vtkns["WidgetManager"] = vtk.Widgets.Core.vtkWidgetManager;
|
|
10910
11157
|
const { vtkObjectManager } = exports.vtkns.SynchronizableRenderWindow;
|
|
10911
11158
|
vtkObjectManager.setTypeMapping("vtkVolumeMapper", exports.vtkns.VolumeMapper.newInstance, vtkObjectManager.oneTimeGenericUpdater);
|
|
10912
11159
|
vtkObjectManager.setTypeMapping("vtkSmartVolumeMapper", exports.vtkns.VolumeMapper.newInstance, vtkObjectManager.oneTimeGenericUpdater);
|
|
10913
11160
|
vtkObjectManager.setTypeMapping("vtkFollower", exports.vtkns.Follower.newInstance, vtkObjectManager.genericUpdater);
|
|
10914
11161
|
vtkObjectManager.setTypeMapping("vtkOpenGLGlyph3DMapper", exports.vtkns.Glyph3DMapper.newInstance, vtkObjectManager.genericUpdater);
|
|
10915
11162
|
}
|
|
11163
|
+
exports.setup_vtkns = setup_vtkns;
|
|
11164
|
+
if (window.vtk)
|
|
11165
|
+
setup_vtkns();
|
|
10916
11166
|
exports.Interpolation = (0, kinds_1.Enum)("fast_linear", "linear", "nearest");
|
|
10917
11167
|
function applyStyle(el, style) {
|
|
10918
11168
|
Object.keys(style).forEach((key) => {
|
|
@@ -11090,13 +11340,13 @@
|
|
|
11090
11340
|
exports.VTKColorBar = VTKColorBar;
|
|
11091
11341
|
VTKColorBar.__name__ = "VTKColorBar";
|
|
11092
11342
|
},
|
|
11093
|
-
"
|
|
11343
|
+
"204e2f98bd": /* models/vtk/vtkaxes.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
11094
11344
|
__esModule();
|
|
11095
11345
|
const tslib_1 = require("tslib");
|
|
11096
11346
|
const p = (0, tslib_1.__importStar)(require("@bokehjs/core/properties"));
|
|
11097
11347
|
const model_1 = require("@bokehjs/model");
|
|
11098
11348
|
const gl_matrix_1 = require("2f3fd5db07") /* gl-matrix */;
|
|
11099
|
-
const util_1 = require("
|
|
11349
|
+
const util_1 = require("993f3118b2") /* ./util */;
|
|
11100
11350
|
class VTKAxes extends model_1.Model {
|
|
11101
11351
|
constructor(attrs) {
|
|
11102
11352
|
super(attrs);
|
|
@@ -11173,7 +11423,7 @@
|
|
|
11173
11423
|
polys.push(this._make_grid_lines(this.yticks.length, this.zticks.length, offset)); //yz
|
|
11174
11424
|
offset += this.yticks.length * this.zticks.length;
|
|
11175
11425
|
polys.push(this._make_grid_lines(this.xticks.length, this.zticks.length, offset)); //xz
|
|
11176
|
-
const gridPolyData =
|
|
11426
|
+
const gridPolyData = window.vtk({
|
|
11177
11427
|
vtkClass: "vtkPolyData",
|
|
11178
11428
|
points: {
|
|
11179
11429
|
vtkClass: "vtkPoints",
|
|
@@ -11213,7 +11463,7 @@
|
|
|
11213
11463
|
}
|
|
11214
11464
|
return coords;
|
|
11215
11465
|
}).flat(2);
|
|
11216
|
-
const axesPolyData =
|
|
11466
|
+
const axesPolyData = window.vtk({
|
|
11217
11467
|
vtkClass: "vtkPolyData",
|
|
11218
11468
|
points: {
|
|
11219
11469
|
vtkClass: "vtkPoints",
|
|
@@ -17880,10 +18130,10 @@
|
|
|
17880
18130
|
};
|
|
17881
18131
|
}();
|
|
17882
18132
|
},
|
|
17883
|
-
"
|
|
18133
|
+
"7785475bdd": /* models/vtk/vtkvolume.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
17884
18134
|
__esModule();
|
|
17885
|
-
const vtklayout_1 = require("
|
|
17886
|
-
const util_1 = require("
|
|
18135
|
+
const vtklayout_1 = require("e13c143c7d") /* ./vtklayout */;
|
|
18136
|
+
const util_1 = require("993f3118b2") /* ./util */;
|
|
17887
18137
|
class VTKVolumePlotView extends vtklayout_1.AbstractVTKView {
|
|
17888
18138
|
connect_signals() {
|
|
17889
18139
|
super.connect_signals();
|
|
@@ -17971,6 +18221,12 @@
|
|
|
17971
18221
|
if (this._controllerWidget != null)
|
|
17972
18222
|
this._controllerWidget.setExpanded(this.model.controller_expanded);
|
|
17973
18223
|
});
|
|
18224
|
+
this.connect(this.model.properties.nan_opacity.change, () => {
|
|
18225
|
+
const scalar_opacity = this.image_actor_i.getProperty().getScalarOpacity();
|
|
18226
|
+
scalar_opacity.get(["nodes"]).nodes[0].y = this.model.nan_opacity;
|
|
18227
|
+
scalar_opacity.modified();
|
|
18228
|
+
this._vtk_renwin.getRenderWindow().render();
|
|
18229
|
+
});
|
|
17974
18230
|
}
|
|
17975
18231
|
render() {
|
|
17976
18232
|
this._vtk_renwin = null;
|
|
@@ -18101,9 +18357,12 @@
|
|
|
18101
18357
|
image_actor_k.setMapper(image_mapper_k);
|
|
18102
18358
|
// set_color and opacity
|
|
18103
18359
|
const piecewiseFunction = util_1.vtkns.PiecewiseFunction.newInstance();
|
|
18104
|
-
piecewiseFunction.removeAllPoints();
|
|
18105
|
-
piecewiseFunction.addPoint(0, 1);
|
|
18106
18360
|
const lookupTable = this.volume.getProperty().getRGBTransferFunction(0);
|
|
18361
|
+
const range = this.volume.getMapper().getInputData().getPointData().getScalars().getRange();
|
|
18362
|
+
piecewiseFunction.removeAllPoints();
|
|
18363
|
+
piecewiseFunction.addPoint(range[0] - 1, this.model.nan_opacity);
|
|
18364
|
+
piecewiseFunction.addPoint(range[0], 1);
|
|
18365
|
+
piecewiseFunction.addPoint(range[1], 1);
|
|
18107
18366
|
const property = image_actor_i.getProperty();
|
|
18108
18367
|
image_actor_j.setProperty(property);
|
|
18109
18368
|
image_actor_k.setProperty(property);
|
|
@@ -18180,10 +18439,9 @@
|
|
|
18180
18439
|
}
|
|
18181
18440
|
}
|
|
18182
18441
|
_set_slices_visibility(visibility) {
|
|
18183
|
-
this.
|
|
18184
|
-
|
|
18185
|
-
|
|
18186
|
-
.map((actor) => actor.setVisibility(visibility));
|
|
18442
|
+
this.image_actor_i.setVisibility(visibility);
|
|
18443
|
+
this.image_actor_j.setVisibility(visibility);
|
|
18444
|
+
this.image_actor_k.setVisibility(visibility);
|
|
18187
18445
|
}
|
|
18188
18446
|
_set_volume_visibility(visibility) {
|
|
18189
18447
|
this.volume.setVisibility(visibility);
|
|
@@ -18207,6 +18465,7 @@
|
|
|
18207
18465
|
edge_gradient: [Number, 0.2],
|
|
18208
18466
|
interpolation: [util_1.Interpolation, 'fast_linear'],
|
|
18209
18467
|
mapper: [Struct({ palette: Array(String), low: Number, high: Number })],
|
|
18468
|
+
nan_opacity: [Number, 1],
|
|
18210
18469
|
render_background: [String, '#52576e'],
|
|
18211
18470
|
rescale: [Boolean, false],
|
|
18212
18471
|
sampling: [Number, 0.4],
|
|
@@ -18224,14 +18483,12 @@
|
|
|
18224
18483
|
VTKVolumePlot.__name__ = "VTKVolumePlot";
|
|
18225
18484
|
VTKVolumePlot.init_VTKVolumePlot();
|
|
18226
18485
|
},
|
|
18227
|
-
"
|
|
18486
|
+
"0a57062475": /* models/vtk/vtksynchronized.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
18228
18487
|
__esModule();
|
|
18229
|
-
const tslib_1 = require("tslib");
|
|
18230
|
-
const p = (0, tslib_1.__importStar)(require("@bokehjs/core/properties"));
|
|
18231
18488
|
const object_1 = require("@bokehjs/core/util/object");
|
|
18232
|
-
const vtklayout_1 = require("
|
|
18233
|
-
const
|
|
18234
|
-
const
|
|
18489
|
+
const vtklayout_1 = require("e13c143c7d") /* ./vtklayout */;
|
|
18490
|
+
const panel_fullscreen_renwin_sync_1 = require("877619fe71") /* ./panel_fullscreen_renwin_sync */;
|
|
18491
|
+
const util_1 = require("993f3118b2") /* ./util */;
|
|
18235
18492
|
const CONTEXT_NAME = "panel";
|
|
18236
18493
|
class VTKSynchronizedPlotView extends vtklayout_1.AbstractVTKView {
|
|
18237
18494
|
initialize() {
|
|
@@ -18241,15 +18498,6 @@
|
|
|
18241
18498
|
this._arrays = {};
|
|
18242
18499
|
this._decoded_arrays = {};
|
|
18243
18500
|
this._pending_arrays = {};
|
|
18244
|
-
// Internal closures
|
|
18245
|
-
this.getArray = (hash) => {
|
|
18246
|
-
if (this._arrays[hash]) {
|
|
18247
|
-
return Promise.resolve(this._arrays[hash]);
|
|
18248
|
-
}
|
|
18249
|
-
return new Promise((resolve, reject) => {
|
|
18250
|
-
this._pending_arrays[hash] = { resolve, reject };
|
|
18251
|
-
});
|
|
18252
|
-
};
|
|
18253
18501
|
this.registerArray = (hash, array) => {
|
|
18254
18502
|
this._arrays[hash] = array;
|
|
18255
18503
|
if (this._pending_arrays[hash]) {
|
|
@@ -18282,7 +18530,7 @@
|
|
|
18282
18530
|
});
|
|
18283
18531
|
}
|
|
18284
18532
|
init_vtk_renwin() {
|
|
18285
|
-
this._vtk_renwin =
|
|
18533
|
+
this._vtk_renwin = util_1.vtkns.FullScreenRenderWindowSynchronized.newInstance({
|
|
18286
18534
|
rootContainer: this.el,
|
|
18287
18535
|
container: this._vtk_container,
|
|
18288
18536
|
synchronizerContext: this._synchronizer_context,
|
|
@@ -18359,6 +18607,7 @@
|
|
|
18359
18607
|
class VTKSynchronizedPlot extends vtklayout_1.AbstractVTKPlot {
|
|
18360
18608
|
constructor(attrs) {
|
|
18361
18609
|
super(attrs);
|
|
18610
|
+
(0, panel_fullscreen_renwin_sync_1.initialize_fullscreen_render)();
|
|
18362
18611
|
this.outline = util_1.vtkns.OutlineFilter.newInstance(); //use to display bouding box of a selected actor
|
|
18363
18612
|
const mapper = util_1.vtkns.Mapper.newInstance();
|
|
18364
18613
|
mapper.setInputConnection(this.outline.getOutputPort());
|
|
@@ -18378,14 +18627,14 @@
|
|
|
18378
18627
|
}
|
|
18379
18628
|
static init_VTKSynchronizedPlot() {
|
|
18380
18629
|
this.prototype.default_view = VTKSynchronizedPlotView;
|
|
18381
|
-
this.define({
|
|
18382
|
-
arrays: [
|
|
18383
|
-
arrays_processed: [
|
|
18384
|
-
enable_keybindings: [
|
|
18385
|
-
one_time_reset: [
|
|
18386
|
-
rebuild: [
|
|
18387
|
-
scene: [
|
|
18388
|
-
});
|
|
18630
|
+
this.define(({ Any, Array, Boolean, String }) => ({
|
|
18631
|
+
arrays: [Any, {}],
|
|
18632
|
+
arrays_processed: [Array(String), []],
|
|
18633
|
+
enable_keybindings: [Boolean, false],
|
|
18634
|
+
one_time_reset: [Boolean],
|
|
18635
|
+
rebuild: [Boolean, false],
|
|
18636
|
+
scene: [Any, {}],
|
|
18637
|
+
}));
|
|
18389
18638
|
this.override({
|
|
18390
18639
|
height: 300,
|
|
18391
18640
|
width: 300,
|
|
@@ -18397,108 +18646,111 @@
|
|
|
18397
18646
|
VTKSynchronizedPlot.__module__ = "panel.models.vtk";
|
|
18398
18647
|
VTKSynchronizedPlot.init_VTKSynchronizedPlot();
|
|
18399
18648
|
},
|
|
18400
|
-
"
|
|
18649
|
+
"877619fe71": /* models/vtk/panel_fullscreen_renwin_sync.js */ function _(require, module, exports, __esModule, __esExport) {
|
|
18401
18650
|
__esModule();
|
|
18402
|
-
const util_1 = require("
|
|
18403
|
-
|
|
18404
|
-
|
|
18405
|
-
|
|
18406
|
-
|
|
18407
|
-
|
|
18408
|
-
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18413
|
-
|
|
18414
|
-
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
|
|
18418
|
-
|
|
18419
|
-
|
|
18420
|
-
|
|
18421
|
-
|
|
18422
|
-
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
|
|
18651
|
+
const util_1 = require("993f3118b2") /* ./util */;
|
|
18652
|
+
//------------------------//
|
|
18653
|
+
//Custom Extended Classes
|
|
18654
|
+
//------------------------//
|
|
18655
|
+
const DEFAULT_VALUES = {
|
|
18656
|
+
containerStyle: null,
|
|
18657
|
+
controlPanelStyle: null,
|
|
18658
|
+
listenWindowResize: true,
|
|
18659
|
+
resizeCallback: null,
|
|
18660
|
+
controllerVisibility: true,
|
|
18661
|
+
synchronizerContextName: "default",
|
|
18662
|
+
};
|
|
18663
|
+
const STYLE_CONTROL_PANEL = {
|
|
18664
|
+
position: "absolute",
|
|
18665
|
+
left: "25px",
|
|
18666
|
+
top: "25px",
|
|
18667
|
+
backgroundColor: "white",
|
|
18668
|
+
borderRadius: "5px",
|
|
18669
|
+
listStyle: "none",
|
|
18670
|
+
padding: "5px 10px",
|
|
18671
|
+
margin: "0",
|
|
18672
|
+
display: "block",
|
|
18673
|
+
border: "solid 1px black",
|
|
18674
|
+
maxWidth: "calc(100vw - 70px)",
|
|
18675
|
+
maxHeight: "calc(100vh - 60px)",
|
|
18676
|
+
overflow: "auto",
|
|
18677
|
+
};
|
|
18678
|
+
function panelFullScreenRenderWindowSynchronized(publicAPI, model) {
|
|
18679
|
+
// Panel (modification) synchronizable renderWindow
|
|
18680
|
+
model.renderWindow = util_1.vtkns.SynchronizableRenderWindow.newInstance({
|
|
18681
|
+
synchronizerContext: model.synchronizerContext,
|
|
18682
|
+
});
|
|
18683
|
+
// OpenGlRenderWindow
|
|
18684
|
+
model.openGLRenderWindow = util_1.vtkns.OpenGLRenderWindow.newInstance();
|
|
18685
|
+
model.openGLRenderWindow.setContainer(model.container);
|
|
18686
|
+
model.renderWindow.addView(model.openGLRenderWindow);
|
|
18687
|
+
// Interactor
|
|
18688
|
+
model.interactor = util_1.vtkns.RenderWindowInteractor.newInstance();
|
|
18689
|
+
model.interactor.setInteractorStyle(util_1.vtkns.InteractorStyleTrackballCamera.newInstance());
|
|
18690
|
+
model.interactor.setView(model.openGLRenderWindow);
|
|
18691
|
+
model.interactor.initialize();
|
|
18692
|
+
model.interactor.bindEvents(model.container);
|
|
18693
|
+
publicAPI.getRenderer = () => model.renderWindow.getRenderers()[0];
|
|
18694
|
+
publicAPI.removeController = () => {
|
|
18695
|
+
const el = model.controlContainer;
|
|
18696
|
+
if (el) {
|
|
18697
|
+
el.parentNode.removeChild(el);
|
|
18698
|
+
}
|
|
18426
18699
|
};
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
model.
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
// OpenGlRenderWindow
|
|
18433
|
-
model.openGLRenderWindow = util_1.vtkns.OpenGLRenderWindow.newInstance();
|
|
18434
|
-
model.openGLRenderWindow.setContainer(model.container);
|
|
18435
|
-
model.renderWindow.addView(model.openGLRenderWindow);
|
|
18436
|
-
// Interactor
|
|
18437
|
-
model.interactor = util_1.vtkns.RenderWindowInteractor.newInstance();
|
|
18438
|
-
model.interactor.setInteractorStyle(util_1.vtkns.InteractorStyleTrackballCamera.newInstance());
|
|
18439
|
-
model.interactor.setView(model.openGLRenderWindow);
|
|
18440
|
-
model.interactor.initialize();
|
|
18441
|
-
model.interactor.bindEvents(model.container);
|
|
18442
|
-
publicAPI.getRenderer = () => model.renderWindow.getRenderers()[0];
|
|
18443
|
-
publicAPI.removeController = () => {
|
|
18444
|
-
const el = model.controlContainer;
|
|
18445
|
-
if (el) {
|
|
18446
|
-
el.parentNode.removeChild(el);
|
|
18700
|
+
publicAPI.setControllerVisibility = (visible) => {
|
|
18701
|
+
model.controllerVisibility = visible;
|
|
18702
|
+
if (model.controlContainer) {
|
|
18703
|
+
if (visible) {
|
|
18704
|
+
model.controlContainer.style.display = "block";
|
|
18447
18705
|
}
|
|
18448
|
-
|
|
18449
|
-
|
|
18450
|
-
model.controllerVisibility = visible;
|
|
18451
|
-
if (model.controlContainer) {
|
|
18452
|
-
if (visible) {
|
|
18453
|
-
model.controlContainer.style.display = "block";
|
|
18454
|
-
}
|
|
18455
|
-
else {
|
|
18456
|
-
model.controlContainer.style.display = "none";
|
|
18457
|
-
}
|
|
18706
|
+
else {
|
|
18707
|
+
model.controlContainer.style.display = "none";
|
|
18458
18708
|
}
|
|
18459
|
-
};
|
|
18460
|
-
publicAPI.toggleControllerVisibility = () => {
|
|
18461
|
-
publicAPI.setControllerVisibility(!model.controllerVisibility);
|
|
18462
|
-
};
|
|
18463
|
-
publicAPI.addController = (html) => {
|
|
18464
|
-
model.controlContainer = document.createElement("div");
|
|
18465
|
-
(0, util_1.applyStyle)(model.controlContainer, model.controlPanelStyle || STYLE_CONTROL_PANEL);
|
|
18466
|
-
model.rootContainer.appendChild(model.controlContainer);
|
|
18467
|
-
model.controlContainer.innerHTML = html;
|
|
18468
|
-
publicAPI.setControllerVisibility(model.controllerVisibility);
|
|
18469
|
-
model.rootContainer.addEventListener("keypress", (e) => {
|
|
18470
|
-
if (String.fromCharCode(e.charCode) === "c") {
|
|
18471
|
-
publicAPI.toggleControllerVisibility();
|
|
18472
|
-
}
|
|
18473
|
-
});
|
|
18474
|
-
};
|
|
18475
|
-
// Properly release GL context
|
|
18476
|
-
publicAPI.delete = util_1.vtk.macro.chain(publicAPI.setContainer, model.openGLRenderWindow.delete, publicAPI.delete);
|
|
18477
|
-
// Handle window resize
|
|
18478
|
-
publicAPI.resize = () => {
|
|
18479
|
-
const dims = model.container.getBoundingClientRect();
|
|
18480
|
-
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
18481
|
-
model.openGLRenderWindow.setSize(Math.floor(dims.width * devicePixelRatio), Math.floor(dims.height * devicePixelRatio));
|
|
18482
|
-
if (model.resizeCallback) {
|
|
18483
|
-
model.resizeCallback(dims);
|
|
18484
|
-
}
|
|
18485
|
-
model.renderWindow.render();
|
|
18486
|
-
};
|
|
18487
|
-
publicAPI.setResizeCallback = (cb) => {
|
|
18488
|
-
model.resizeCallback = cb;
|
|
18489
|
-
publicAPI.resize();
|
|
18490
|
-
};
|
|
18491
|
-
if (model.listenWindowResize) {
|
|
18492
|
-
window.addEventListener("resize", publicAPI.resize);
|
|
18493
18709
|
}
|
|
18710
|
+
};
|
|
18711
|
+
publicAPI.toggleControllerVisibility = () => {
|
|
18712
|
+
publicAPI.setControllerVisibility(!model.controllerVisibility);
|
|
18713
|
+
};
|
|
18714
|
+
publicAPI.addController = (html) => {
|
|
18715
|
+
model.controlContainer = document.createElement("div");
|
|
18716
|
+
(0, util_1.applyStyle)(model.controlContainer, model.controlPanelStyle || STYLE_CONTROL_PANEL);
|
|
18717
|
+
model.rootContainer.appendChild(model.controlContainer);
|
|
18718
|
+
model.controlContainer.innerHTML = html;
|
|
18719
|
+
publicAPI.setControllerVisibility(model.controllerVisibility);
|
|
18720
|
+
model.rootContainer.addEventListener("keypress", (e) => {
|
|
18721
|
+
if (String.fromCharCode(e.charCode) === "c") {
|
|
18722
|
+
publicAPI.toggleControllerVisibility();
|
|
18723
|
+
}
|
|
18724
|
+
});
|
|
18725
|
+
};
|
|
18726
|
+
// Properly release GL context
|
|
18727
|
+
publicAPI.delete = window.vtk.macro.chain(publicAPI.setContainer, model.openGLRenderWindow.delete, publicAPI.delete);
|
|
18728
|
+
// Handle window resize
|
|
18729
|
+
publicAPI.resize = () => {
|
|
18730
|
+
const dims = model.container.getBoundingClientRect();
|
|
18731
|
+
const devicePixelRatio = window.devicePixelRatio || 1;
|
|
18732
|
+
model.openGLRenderWindow.setSize(Math.floor(dims.width * devicePixelRatio), Math.floor(dims.height * devicePixelRatio));
|
|
18733
|
+
if (model.resizeCallback) {
|
|
18734
|
+
model.resizeCallback(dims);
|
|
18735
|
+
}
|
|
18736
|
+
model.renderWindow.render();
|
|
18737
|
+
};
|
|
18738
|
+
publicAPI.setResizeCallback = (cb) => {
|
|
18739
|
+
model.resizeCallback = cb;
|
|
18494
18740
|
publicAPI.resize();
|
|
18741
|
+
};
|
|
18742
|
+
if (model.listenWindowResize) {
|
|
18743
|
+
window.addEventListener("resize", publicAPI.resize);
|
|
18495
18744
|
}
|
|
18496
|
-
|
|
18497
|
-
|
|
18745
|
+
publicAPI.resize();
|
|
18746
|
+
}
|
|
18747
|
+
function initialize_fullscreen_render() {
|
|
18748
|
+
let FullScreenRenderWindowSynchronized = {
|
|
18749
|
+
newInstance: window.vtk.macro.newInstance((publicAPI, model, initialValues = {}) => {
|
|
18498
18750
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
18499
18751
|
// Object methods
|
|
18500
|
-
|
|
18501
|
-
|
|
18752
|
+
window.vtk.macro.obj(publicAPI, model);
|
|
18753
|
+
window.vtk.macro.get(publicAPI, model, [
|
|
18502
18754
|
"renderWindow",
|
|
18503
18755
|
"openGLRenderWindow",
|
|
18504
18756
|
"interactor",
|
|
@@ -18511,7 +18763,9 @@
|
|
|
18511
18763
|
panelFullScreenRenderWindowSynchronized(publicAPI, model);
|
|
18512
18764
|
}),
|
|
18513
18765
|
};
|
|
18766
|
+
util_1.vtkns.FullScreenRenderWindowSynchronized = FullScreenRenderWindowSynchronized;
|
|
18514
18767
|
}
|
|
18768
|
+
exports.initialize_fullscreen_render = initialize_fullscreen_render;
|
|
18515
18769
|
},
|
|
18516
|
-
}, "4e90918c0a", {"index":"4e90918c0a","models/index":"
|
|
18770
|
+
}, "4e90918c0a", {"index":"4e90918c0a","models/index":"1abe9b6912","models/ace":"9fecc8d0f9","models/layout":"4c755983eb","models/audio":"339f84d639","models/card":"c816112d20","models/comm_manager":"e552778259","models/tabulator":"0fb5c5eacd","models/data":"f1971f81bf","models/datetime_picker":"6e11b2cfe2","models/deckgl":"df2378664f","models/tooltips":"6e04fbe567","models/echarts":"9d046c4720","models/html":"c424a3bd17","models/event-to-object":"3329d4aa5b","models/idom":"7d45bd3bc4","models/ipywidget":"0eae77d68f","models/json":"0d30bea0c8","models/file_download":"1767172ffa","models/katex":"7b859fb3cf","models/location":"642aa56b24","models/mathjax":"0c21036737","models/perspective":"84a772681d","models/player":"2e8044c920","models/plotly":"a2080c6bc8","models/util":"990b5dd5c7","models/progress":"fd3806082d","models/quill":"6895629dfc","models/reactive_html":"eb3a49319b","models/singleselect":"5ed2116e26","models/speech_to_text":"aaa48703af","models/state":"bfa46a5f19","models/terminal":"edf66f5228","models/text_to_speech":"33cd2c254e","models/trend":"effe070807","models/vega":"04fd346566","models/video":"ffe54b53c3","models/videostream":"e3e9b8e495","models/vtk/index":"c51f25e2a7","models/vtk/vtkjs":"b6d9199d03","models/vtk/vtklayout":"e13c143c7d","models/vtk/util":"993f3118b2","models/vtk/vtkcolorbar":"c010237f8b","models/vtk/vtkaxes":"204e2f98bd","models/vtk/vtkvolume":"7785475bdd","models/vtk/vtksynchronized":"0a57062475","models/vtk/panel_fullscreen_renwin_sync":"877619fe71"}, {});});
|
|
18517
18771
|
//# sourceMappingURL=panel.js.map
|