@datagrok/helm 2.13.7 → 3.0.0
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/CREDITS.md +164 -0
- package/dist/489.js +2 -0
- package/dist/489.js.map +1 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/files/samples/helm-showcase.csv +56 -0
- package/package.json +6 -10
- package/src/helm-helper.ts +61 -413
- package/src/package-api.ts +14 -11
- package/src/package-test.ts +0 -2
- package/src/package-utils.ts +8 -298
- package/src/package.g.ts +2 -8
- package/src/package.ts +11 -31
- package/src/tests/helm-activity-cliffs.ts +2 -2
- package/src/tests/helm-input-tests.ts +83 -0
- package/src/tests/parse-helm-tests.ts +7 -57
- package/src/tests/properties-widget-tests.ts +21 -11
- package/src/utils/helm-grid-cell-renderer.ts +141 -151
- package/src/utils/index.ts +3 -7
- package/src/widgets/helm-input.ts +42 -12
- package/src/widgets/properties-widget.ts +18 -11
- package/test-console-output-1.log +103 -706
- package/test-record-1.mp4 +0 -0
- package/webpack.config.js +1 -12
- package/dist/455.js +0 -2
- package/dist/455.js.map +0 -1
- package/dist/package-dojo.js +0 -2
- package/dist/package-dojo.js.map +0 -1
- package/helm/JSDraw/Pistoia.HELM-uncompressed.js +0 -9694
- package/helm/JSDraw/ReadMe.txt +0 -8
- package/helm/JSDraw/Scilligence.JSDraw2.Lite-uncompressed.js +0 -31126
- package/helm/dojo/package.ts +0 -41
- package/helm/dojo/types.ts +0 -12
- package/src/helm-web-editor.ts +0 -68
- package/src/tests/get-monomer-tests.ts +0 -214
- package/src/tests/helm-service-tests.ts +0 -98
- package/src/types/dojo.ts +0 -3
- package/src/types/index.ts +0 -5
- package/src/utils/get-monomer.ts +0 -90
- package/src/utils/helm-service.ts +0 -166
- package/vendor/dojo-1.10.10/dijit/BackgroundIframe.js +0 -63
- package/vendor/dojo-1.10.10/dijit/BackgroundIframe.js.uncompressed.js +0 -116
- package/vendor/dojo-1.10.10/dijit/Destroyable.js +0 -35
- package/vendor/dojo-1.10.10/dijit/Destroyable.js.uncompressed.js +0 -83
- package/vendor/dojo-1.10.10/dijit/Tooltip.js +0 -240
- package/vendor/dojo-1.10.10/dijit/Tooltip.js.uncompressed.js +0 -612
- package/vendor/dojo-1.10.10/dijit/Viewport.js +0 -44
- package/vendor/dojo-1.10.10/dijit/Viewport.js.uncompressed.js +0 -87
- package/vendor/dojo-1.10.10/dijit/WidgetSet.js +0 -76
- package/vendor/dojo-1.10.10/dijit/WidgetSet.js.uncompressed.js +0 -247
- package/vendor/dojo-1.10.10/dijit/_AttachMixin.js +0 -94
- package/vendor/dojo-1.10.10/dijit/_AttachMixin.js.uncompressed.js +0 -238
- package/vendor/dojo-1.10.10/dijit/_Contained.js +0 -17
- package/vendor/dojo-1.10.10/dijit/_Contained.js.uncompressed.js +0 -56
- package/vendor/dojo-1.10.10/dijit/_Container.js +0 -47
- package/vendor/dojo-1.10.10/dijit/_Container.js.uncompressed.js +0 -108
- package/vendor/dojo-1.10.10/dijit/_CssStateMixin.js +0 -198
- package/vendor/dojo-1.10.10/dijit/_CssStateMixin.js.uncompressed.js +0 -372
- package/vendor/dojo-1.10.10/dijit/_FocusMixin.js +0 -11
- package/vendor/dojo-1.10.10/dijit/_FocusMixin.js.uncompressed.js +0 -66
- package/vendor/dojo-1.10.10/dijit/_HasDropDown.js +0 -188
- package/vendor/dojo-1.10.10/dijit/_HasDropDown.js.uncompressed.js +0 -472
- package/vendor/dojo-1.10.10/dijit/_OnDijitClickMixin.js +0 -8
- package/vendor/dojo-1.10.10/dijit/_OnDijitClickMixin.js.uncompressed.js +0 -31
- package/vendor/dojo-1.10.10/dijit/_TemplatedMixin.js +0 -90
- package/vendor/dojo-1.10.10/dijit/_TemplatedMixin.js.uncompressed.js +0 -205
- package/vendor/dojo-1.10.10/dijit/_Widget.js +0 -66
- package/vendor/dojo-1.10.10/dijit/_Widget.js.uncompressed.js +0 -352
- package/vendor/dojo-1.10.10/dijit/_WidgetBase.js +0 -353
- package/vendor/dojo-1.10.10/dijit/_WidgetBase.js.uncompressed.js +0 -1200
- package/vendor/dojo-1.10.10/dijit/_base/focus.js +0 -68
- package/vendor/dojo-1.10.10/dijit/_base/focus.js.uncompressed.js +0 -207
- package/vendor/dojo-1.10.10/dijit/_base/manager.js +0 -10
- package/vendor/dojo-1.10.10/dijit/_base/manager.js.uncompressed.js +0 -35
- package/vendor/dojo-1.10.10/dijit/_base/place.js +0 -52
- package/vendor/dojo-1.10.10/dijit/_base/place.js.uncompressed.js +0 -131
- package/vendor/dojo-1.10.10/dijit/_base/popup.js +0 -23
- package/vendor/dojo-1.10.10/dijit/_base/popup.js.uncompressed.js +0 -58
- package/vendor/dojo-1.10.10/dijit/_base/scroll.js +0 -6
- package/vendor/dojo-1.10.10/dijit/_base/scroll.js.uncompressed.js +0 -22
- package/vendor/dojo-1.10.10/dijit/_base/sniff.js +0 -3
- package/vendor/dojo-1.10.10/dijit/_base/sniff.js.uncompressed.js +0 -12
- package/vendor/dojo-1.10.10/dijit/_base/typematic.js +0 -3
- package/vendor/dojo-1.10.10/dijit/_base/typematic.js.uncompressed.js +0 -10
- package/vendor/dojo-1.10.10/dijit/_base/wai.js +0 -32
- package/vendor/dojo-1.10.10/dijit/_base/wai.js.uncompressed.js +0 -109
- package/vendor/dojo-1.10.10/dijit/_base/window.js +0 -6
- package/vendor/dojo-1.10.10/dijit/_base/window.js.uncompressed.js +0 -18
- package/vendor/dojo-1.10.10/dijit/_base.js +0 -4
- package/vendor/dojo-1.10.10/dijit/_base.js.uncompressed.js +0 -27
- package/vendor/dojo-1.10.10/dijit/a11y.js +0 -109
- package/vendor/dojo-1.10.10/dijit/a11y.js.uncompressed.js +0 -191
- package/vendor/dojo-1.10.10/dijit/a11yclick.js +0 -66
- package/vendor/dojo-1.10.10/dijit/a11yclick.js.uncompressed.js +0 -139
- package/vendor/dojo-1.10.10/dijit/focus.js +0 -188
- package/vendor/dojo-1.10.10/dijit/focus.js.uncompressed.js +0 -371
- package/vendor/dojo-1.10.10/dijit/form/Button.js +0 -49
- package/vendor/dojo-1.10.10/dijit/form/Button.js.uncompressed.js +0 -130
- package/vendor/dojo-1.10.10/dijit/form/ComboBox.js +0 -4
- package/vendor/dojo-1.10.10/dijit/form/ComboBox.js.uncompressed.js +0 -27
- package/vendor/dojo-1.10.10/dijit/form/ComboButton.js +0 -21
- package/vendor/dojo-1.10.10/dijit/form/ComboButton.js.uncompressed.js +0 -86
- package/vendor/dojo-1.10.10/dijit/form/DropDownButton.js +0 -38
- package/vendor/dojo-1.10.10/dijit/form/DropDownButton.js.uncompressed.js +0 -102
- package/vendor/dojo-1.10.10/dijit/form/ToggleButton.js +0 -7
- package/vendor/dojo-1.10.10/dijit/form/ToggleButton.js.uncompressed.js +0 -26
- package/vendor/dojo-1.10.10/dijit/form/_ButtonMixin.js +0 -50
- package/vendor/dojo-1.10.10/dijit/form/_ButtonMixin.js.uncompressed.js +0 -116
- package/vendor/dojo-1.10.10/dijit/form/_FormValueMixin.js +0 -26
- package/vendor/dojo-1.10.10/dijit/form/_FormValueMixin.js.uncompressed.js +0 -81
- package/vendor/dojo-1.10.10/dijit/form/_FormValueWidget.js +0 -24
- package/vendor/dojo-1.10.10/dijit/form/_FormValueWidget.js.uncompressed.js +0 -51
- package/vendor/dojo-1.10.10/dijit/form/_FormWidget.js +0 -22
- package/vendor/dojo-1.10.10/dijit/form/_FormWidget.js.uncompressed.js +0 -67
- package/vendor/dojo-1.10.10/dijit/form/_FormWidgetMixin.js +0 -111
- package/vendor/dojo-1.10.10/dijit/form/_FormWidgetMixin.js.uncompressed.js +0 -254
- package/vendor/dojo-1.10.10/dijit/form/_ToggleButtonMixin.js +0 -32
- package/vendor/dojo-1.10.10/dijit/form/_ToggleButtonMixin.js.uncompressed.js +0 -69
- package/vendor/dojo-1.10.10/dijit/hccss.js +0 -9
- package/vendor/dojo-1.10.10/dijit/hccss.js.uncompressed.js +0 -21
- package/vendor/dojo-1.10.10/dijit/layout/AccordionContainer.js +0 -215
- package/vendor/dojo-1.10.10/dijit/layout/AccordionContainer.js.uncompressed.js +0 -550
- package/vendor/dojo-1.10.10/dijit/layout/AccordionPane.js +0 -7
- package/vendor/dojo-1.10.10/dijit/layout/AccordionPane.js.uncompressed.js +0 -25
- package/vendor/dojo-1.10.10/dijit/layout/ContentPane.js +0 -235
- package/vendor/dojo-1.10.10/dijit/layout/ContentPane.js.uncompressed.js +0 -653
- package/vendor/dojo-1.10.10/dijit/layout/StackContainer.js +0 -171
- package/vendor/dojo-1.10.10/dijit/layout/StackContainer.js.uncompressed.js +0 -411
- package/vendor/dojo-1.10.10/dijit/layout/StackController.js +0 -194
- package/vendor/dojo-1.10.10/dijit/layout/StackController.js.uncompressed.js +0 -410
- package/vendor/dojo-1.10.10/dijit/layout/_ContentPaneResizeMixin.js +0 -99
- package/vendor/dojo-1.10.10/dijit/layout/_ContentPaneResizeMixin.js.uncompressed.js +0 -236
- package/vendor/dojo-1.10.10/dijit/layout/_LayoutWidget.js +0 -47
- package/vendor/dojo-1.10.10/dijit/layout/_LayoutWidget.js.uncompressed.js +0 -190
- package/vendor/dojo-1.10.10/dijit/layout/utils.js +0 -77
- package/vendor/dojo-1.10.10/dijit/layout/utils.js.uncompressed.js +0 -151
- package/vendor/dojo-1.10.10/dijit/main.js +0 -4
- package/vendor/dojo-1.10.10/dijit/main.js.uncompressed.js +0 -16
- package/vendor/dojo-1.10.10/dijit/nls/dijit-all_en-us.js +0 -2
- package/vendor/dojo-1.10.10/dijit/nls/dijit-all_en-us.js.uncompressed.js +0 -21
- package/vendor/dojo-1.10.10/dijit/nls/loading.js +0 -2
- package/vendor/dojo-1.10.10/dijit/nls/loading.js.uncompressed.js +0 -47
- package/vendor/dojo-1.10.10/dijit/place.js +0 -142
- package/vendor/dojo-1.10.10/dijit/place.js.uncompressed.js +0 -407
- package/vendor/dojo-1.10.10/dijit/popup.js +0 -162
- package/vendor/dojo-1.10.10/dijit/popup.js.uncompressed.js +0 -441
- package/vendor/dojo-1.10.10/dijit/registry.js +0 -79
- package/vendor/dojo-1.10.10/dijit/registry.js.uncompressed.js +0 -159
- package/vendor/dojo-1.10.10/dijit/selection.js +0 -364
- package/vendor/dojo-1.10.10/dijit/selection.js.uncompressed.js +0 -525
- package/vendor/dojo-1.10.10/dijit/typematic.js +0 -96
- package/vendor/dojo-1.10.10/dijit/typematic.js.uncompressed.js +0 -211
- package/vendor/dojo-1.10.10/dojo/NodeList-manipulate.js +0 -195
- package/vendor/dojo-1.10.10/dojo/NodeList-manipulate.js.uncompressed.js +0 -761
- package/vendor/dojo-1.10.10/dojo/Stateful.js +0 -90
- package/vendor/dojo-1.10.10/dojo/Stateful.js.uncompressed.js +0 -218
- package/vendor/dojo-1.10.10/dojo/_base/url.js +0 -87
- package/vendor/dojo-1.10.10/dojo/_base/url.js.uncompressed.js +0 -109
- package/vendor/dojo-1.10.10/dojo/cache.js +0 -9
- package/vendor/dojo-1.10.10/dojo/cache.js.uncompressed.js +0 -7
- package/vendor/dojo-1.10.10/dojo/colors.js +0 -74
- package/vendor/dojo-1.10.10/dojo/colors.js.uncompressed.js +0 -232
- package/vendor/dojo-1.10.10/dojo/cookie.js +0 -48
- package/vendor/dojo-1.10.10/dojo/cookie.js.uncompressed.js +0 -98
- package/vendor/dojo-1.10.10/dojo/date/stamp.js +0 -82
- package/vendor/dojo-1.10.10/dojo/date/stamp.js.uncompressed.js +0 -144
- package/vendor/dojo-1.10.10/dojo/dojo.js +0 -7
- package/vendor/dojo-1.10.10/dojo/dojo.js.uncompressed.js +0 -18680
- package/vendor/dojo-1.10.10/dojo/fx/Toggler.js +0 -27
- package/vendor/dojo-1.10.10/dojo/fx/Toggler.js.uncompressed.js +0 -101
- package/vendor/dojo-1.10.10/dojo/fx/easing.js +0 -165
- package/vendor/dojo-1.10.10/dojo/fx/easing.js.uncompressed.js +0 -276
- package/vendor/dojo-1.10.10/dojo/fx.js +0 -271
- package/vendor/dojo-1.10.10/dojo/fx.js.uncompressed.js +0 -443
- package/vendor/dojo-1.10.10/dojo/hccss.js +0 -26
- package/vendor/dojo-1.10.10/dojo/hccss.js.uncompressed.js +0 -52
- package/vendor/dojo-1.10.10/dojo/html.js +0 -161
- package/vendor/dojo-1.10.10/dojo/html.js.uncompressed.js +0 -370
- package/vendor/dojo-1.10.10/dojo/io/iframe.js +0 -71
- package/vendor/dojo-1.10.10/dojo/io/iframe.js.uncompressed.js +0 -190
- package/vendor/dojo-1.10.10/dojo/io/script.js +0 -112
- package/vendor/dojo-1.10.10/dojo/io/script.js.uncompressed.js +0 -280
- package/vendor/dojo-1.10.10/dojo/parser.js +0 -437
- package/vendor/dojo-1.10.10/dojo/parser.js.uncompressed.js +0 -915
- package/vendor/dojo-1.10.10/dojo/promise/all.js +0 -59
- package/vendor/dojo-1.10.10/dojo/promise/all.js.uncompressed.js +0 -77
- package/vendor/dojo-1.10.10/dojo/regexp.js +0 -32
- package/vendor/dojo-1.10.10/dojo/regexp.js.uncompressed.js +0 -70
- package/vendor/dojo-1.10.10/dojo/request/iframe.js +0 -291
- package/vendor/dojo-1.10.10/dojo/request/iframe.js.uncompressed.js +0 -438
- package/vendor/dojo-1.10.10/dojo/request/script.js +0 -129
- package/vendor/dojo-1.10.10/dojo/request/script.js.uncompressed.js +0 -237
- package/vendor/dojo-1.10.10/dojo/require.js +0 -11
- package/vendor/dojo-1.10.10/dojo/require.js.uncompressed.js +0 -7
- package/vendor/dojo-1.10.10/dojo/resources/blank.gif +0 -0
- package/vendor/dojo-1.10.10/dojo/string.js +0 -67
- package/vendor/dojo-1.10.10/dojo/string.js.uncompressed.js +0 -181
- package/vendor/dojo-1.10.10/dojo/touch.js +0 -191
- package/vendor/dojo-1.10.10/dojo/touch.js.uncompressed.js +0 -468
- package/vendor/dojo-1.10.10/dojo/uacss.js +0 -36
- package/vendor/dojo-1.10.10/dojo/uacss.js.uncompressed.js +0 -85
- package/vendor/dojo-1.10.10/dojo/window.js +0 -141
- package/vendor/dojo-1.10.10/dojo/window.js.uncompressed.js +0 -241
- package/vendor/dojo-1.10.10/dojox/charting/Chart.js +0 -626
- package/vendor/dojo-1.10.10/dojox/charting/Chart.js.uncompressed.js +0 -1220
- package/vendor/dojo-1.10.10/dojox/charting/Chart2D.js +0 -5
- package/vendor/dojo-1.10.10/dojox/charting/Chart2D.js.uncompressed.js +0 -16
- package/vendor/dojo-1.10.10/dojox/charting/Element.js +0 -247
- package/vendor/dojo-1.10.10/dojox/charting/Element.js.uncompressed.js +0 -402
- package/vendor/dojo-1.10.10/dojox/charting/Series.js +0 -24
- package/vendor/dojo-1.10.10/dojox/charting/Series.js.uncompressed.js +0 -58
- package/vendor/dojo-1.10.10/dojox/charting/SimpleTheme.js +0 -191
- package/vendor/dojo-1.10.10/dojox/charting/SimpleTheme.js.uncompressed.js +0 -577
- package/vendor/dojo-1.10.10/dojox/charting/Theme.js +0 -42
- package/vendor/dojo-1.10.10/dojox/charting/Theme.js.uncompressed.js +0 -120
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Base.js +0 -11
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Base.js.uncompressed.js +0 -36
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Highlight.js +0 -77
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Highlight.js.uncompressed.js +0 -144
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Magnify.js +0 -58
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Magnify.js.uncompressed.js +0 -123
- package/vendor/dojo-1.10.10/dojox/charting/action2d/MoveSlice.js +0 -54
- package/vendor/dojo-1.10.10/dojox/charting/action2d/MoveSlice.js.uncompressed.js +0 -124
- package/vendor/dojo-1.10.10/dojox/charting/action2d/PlotAction.js +0 -28
- package/vendor/dojo-1.10.10/dojox/charting/action2d/PlotAction.js.uncompressed.js +0 -74
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Tooltip.js +0 -116
- package/vendor/dojo-1.10.10/dojox/charting/action2d/Tooltip.js.uncompressed.js +0 -178
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/Base.js +0 -24
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/Base.js.uncompressed.js +0 -83
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/Default.js +0 -557
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/Default.js.uncompressed.js +0 -980
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/Invisible.js +0 -65
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/Invisible.js.uncompressed.js +0 -224
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/common.js +0 -91
- package/vendor/dojo-1.10.10/dojox/charting/axis2d/common.js.uncompressed.js +0 -164
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Areas.js +0 -7
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Areas.js.uncompressed.js +0 -14
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bars.js +0 -168
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bars.js.uncompressed.js +0 -311
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Base.js +0 -61
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Base.js.uncompressed.js +0 -161
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bubble.js +0 -141
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bubble.js.uncompressed.js +0 -242
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Candlesticks.js +0 -126
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Candlesticks.js.uncompressed.js +0 -243
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/CartesianBase.js +0 -108
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/CartesianBase.js.uncompressed.js +0 -290
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredBars.js +0 -13
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredBars.js.uncompressed.js +0 -14
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredColumns.js +0 -13
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredColumns.js.uncompressed.js +0 -14
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Columns.js +0 -153
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Columns.js.uncompressed.js +0 -249
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Default.js +0 -253
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Default.js.uncompressed.js +0 -472
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Grid.js +0 -182
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Grid.js.uncompressed.js +0 -356
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Lines.js +0 -6
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Lines.js.uncompressed.js +0 -12
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Markers.js +0 -6
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Markers.js.uncompressed.js +0 -12
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/MarkersOnly.js +0 -7
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/MarkersOnly.js.uncompressed.js +0 -13
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/OHLC.js +0 -110
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/OHLC.js.uncompressed.js +0 -208
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Pie.js +0 -303
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Pie.js.uncompressed.js +0 -547
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Scatter.js +0 -134
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Scatter.js.uncompressed.js +0 -207
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Spider.js +0 -299
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Spider.js.uncompressed.js +0 -537
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Stacked.js +0 -24
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/Stacked.js.uncompressed.js +0 -44
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedAreas.js +0 -7
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedAreas.js.uncompressed.js +0 -14
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedBars.js +0 -22
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedBars.js.uncompressed.js +0 -33
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedColumns.js +0 -20
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedColumns.js.uncompressed.js +0 -31
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedLines.js +0 -6
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedLines.js.uncompressed.js +0 -12
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/_PlotEvents.js +0 -68
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/_PlotEvents.js.uncompressed.js +0 -120
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/common.js +0 -209
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/common.js.uncompressed.js +0 -214
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/commonStacked.js +0 -76
- package/vendor/dojo-1.10.10/dojox/charting/plot2d/commonStacked.js.uncompressed.js +0 -77
- package/vendor/dojo-1.10.10/dojox/charting/scaler/common.js +0 -59
- package/vendor/dojo-1.10.10/dojox/charting/scaler/common.js.uncompressed.js +0 -70
- package/vendor/dojo-1.10.10/dojox/charting/scaler/linear.js +0 -220
- package/vendor/dojo-1.10.10/dojox/charting/scaler/linear.js.uncompressed.js +0 -262
- package/vendor/dojo-1.10.10/dojox/charting/scaler/primitive.js +0 -23
- package/vendor/dojo-1.10.10/dojox/charting/scaler/primitive.js.uncompressed.js +0 -36
- package/vendor/dojo-1.10.10/dojox/charting/themes/Claro.js +0 -39
- package/vendor/dojo-1.10.10/dojox/charting/themes/Claro.js.uncompressed.js +0 -106
- package/vendor/dojo-1.10.10/dojox/charting/themes/Wetland.js +0 -5
- package/vendor/dojo-1.10.10/dojox/charting/themes/Wetland.js.uncompressed.js +0 -12
- package/vendor/dojo-1.10.10/dojox/charting/themes/common.js +0 -4
- package/vendor/dojo-1.10.10/dojox/charting/themes/common.js.uncompressed.js +0 -3
- package/vendor/dojo-1.10.10/dojox/charting/widget/Legend.js +0 -102
- package/vendor/dojo-1.10.10/dojox/charting/widget/Legend.js.uncompressed.js +0 -165
- package/vendor/dojo-1.10.10/dojox/color/Palette.js +0 -163
- package/vendor/dojo-1.10.10/dojox/color/Palette.js.uncompressed.js +0 -460
- package/vendor/dojo-1.10.10/dojox/color/_base.js +0 -174
- package/vendor/dojo-1.10.10/dojox/color/_base.js.uncompressed.js +0 -196
- package/vendor/dojo-1.10.10/dojox/gfx/_base.js +0 -253
- package/vendor/dojo-1.10.10/dojox/gfx/_base.js.uncompressed.js +0 -1024
- package/vendor/dojo-1.10.10/dojox/gfx/fx.js +0 -297
- package/vendor/dojo-1.10.10/dojox/gfx/fx.js.uncompressed.js +0 -350
- package/vendor/dojo-1.10.10/dojox/gfx/gradutils.js +0 -63
- package/vendor/dojo-1.10.10/dojox/gfx/gradutils.js.uncompressed.js +0 -91
- package/vendor/dojo-1.10.10/dojox/gfx/matrix.js +0 -170
- package/vendor/dojo-1.10.10/dojox/gfx/matrix.js.uncompressed.js +0 -501
- package/vendor/dojo-1.10.10/dojox/gfx/path.js +0 -319
- package/vendor/dojo-1.10.10/dojox/gfx/path.js.uncompressed.js +0 -478
- package/vendor/dojo-1.10.10/dojox/gfx/shape.js +0 -459
- package/vendor/dojo-1.10.10/dojox/gfx/shape.js.uncompressed.js +0 -1091
- package/vendor/dojo-1.10.10/dojox/gfx/svg.js +0 -662
- package/vendor/dojo-1.10.10/dojox/gfx/svg.js.uncompressed.js +0 -1023
- package/vendor/dojo-1.10.10/dojox/gfx/utils.js +0 -199
- package/vendor/dojo-1.10.10/dojox/gfx/utils.js.uncompressed.js +0 -322
- package/vendor/dojo-1.10.10/dojox/gfx.js +0 -2
- package/vendor/dojo-1.10.10/dojox/gfx.js.uncompressed.js +0 -1136
- package/vendor/dojo-1.10.10/dojox/lang/functional/array.js +0 -151
- package/vendor/dojo-1.10.10/dojox/lang/functional/array.js.uncompressed.js +0 -169
- package/vendor/dojo-1.10.10/dojox/lang/functional/fold.js +0 -93
- package/vendor/dojo-1.10.10/dojox/lang/functional/fold.js.uncompressed.js +0 -125
- package/vendor/dojo-1.10.10/dojox/lang/functional/lambda.js +0 -81
- package/vendor/dojo-1.10.10/dojox/lang/functional/lambda.js.uncompressed.js +0 -132
- package/vendor/dojo-1.10.10/dojox/lang/functional/object.js +0 -54
- package/vendor/dojo-1.10.10/dojox/lang/functional/object.js.uncompressed.js +0 -78
- package/vendor/dojo-1.10.10/dojox/lang/functional/reversed.js +0 -61
- package/vendor/dojo-1.10.10/dojox/lang/functional/reversed.js.uncompressed.js +0 -77
- package/vendor/dojo-1.10.10/dojox/lang/functional/scan.js +0 -87
- package/vendor/dojo-1.10.10/dojox/lang/functional/scan.js.uncompressed.js +0 -107
- package/vendor/dojo-1.10.10/dojox/lang/functional.js +0 -4
- package/vendor/dojo-1.10.10/dojox/lang/functional.js.uncompressed.js +0 -3
- package/vendor/dojo-1.10.10/dojox/lang/utils.js +0 -86
- package/vendor/dojo-1.10.10/dojox/lang/utils.js.uncompressed.js +0 -121
- package/vendor/dojo-1.10.10/dojox/main.js +0 -4
- package/vendor/dojo-1.10.10/dojox/main.js.uncompressed.js +0 -14
- package/vendor/dojo-1.10.10/dojox/storage/LocalStorageProvider.js +0 -112
- package/vendor/dojo-1.10.10/dojox/storage/LocalStorageProvider.js.uncompressed.js +0 -208
- package/vendor/dojo-1.10.10/dojox/storage/Provider.js +0 -62
- package/vendor/dojo-1.10.10/dojox/storage/Provider.js.uncompressed.js +0 -344
- package/vendor/dojo-1.10.10/dojox/storage/manager.js +0 -110
- package/vendor/dojo-1.10.10/dojox/storage/manager.js.uncompressed.js +0 -263
package/src/helm-helper.ts
CHANGED
|
@@ -1,56 +1,63 @@
|
|
|
1
|
-
import * as grok from 'datagrok-api/grok';
|
|
2
|
-
import * as ui from 'datagrok-api/ui';
|
|
3
|
-
import * as DG from 'datagrok-api/dg';
|
|
4
|
-
|
|
5
|
-
import $ from 'cash-dom';
|
|
6
|
-
|
|
7
1
|
/* eslint-disable max-len */
|
|
8
2
|
import {
|
|
9
|
-
App, Point,
|
|
10
|
-
|
|
11
|
-
DojoType, JSDraw2ModuleType, IHelmEditorOptions, IHelmDrawOptions,
|
|
12
|
-
Editor,
|
|
13
|
-
IBio,
|
|
3
|
+
App, Point, HelmAtom, HelmMol, MonomersFuncs,
|
|
4
|
+
IHelmEditorOptions,
|
|
14
5
|
} from '@datagrok-libraries/bio/src/helm/types';
|
|
15
|
-
import {HelmTabKeys, HelmTypes, MonomerTypes, PolymerTypes} from '@datagrok-libraries/bio/src/helm/consts';
|
|
16
6
|
import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
|
|
17
7
|
import {ILogger} from '@datagrok-libraries/bio/src/utils/logger';
|
|
18
8
|
import {
|
|
19
|
-
HelmConvertRes, HelmInputBase,
|
|
9
|
+
HelmConvertRes, HelmInputBase, IHelmHelper, IHelmInputInitOptions
|
|
20
10
|
} from '@datagrok-libraries/bio/src/helm/helm-helper';
|
|
21
11
|
import {IHelmWebEditor} from '@datagrok-libraries/bio/src/helm/types';
|
|
22
|
-
import {IMonomerLib, IMonomerLibBase
|
|
23
|
-
import {GAP_SYMBOL, GapOriginals, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule/consts';
|
|
12
|
+
import {IMonomerLib, IMonomerLibBase} from '@datagrok-libraries/bio/src/types/monomer-library';
|
|
24
13
|
import {ISeqHelper} from '@datagrok-libraries/bio/src/utils/seq-helper';
|
|
14
|
+
import type {RDModule} from '@datagrok-libraries/chem-meta/src/rdkit-api';
|
|
25
15
|
|
|
26
|
-
import {HelmWebEditor} from './helm-web-editor';
|
|
27
|
-
import {OrgHelmModule, ScilModule} from './types';
|
|
28
16
|
import {HelmInput} from './widgets/helm-input';
|
|
29
17
|
import {getHoveredMonomerFromEditorMol} from './utils/get-hovered';
|
|
30
18
|
/* eslint-enable max-len */
|
|
31
19
|
|
|
32
20
|
import {_package} from './package';
|
|
33
|
-
import {IEditorOptions} from '@datagrok-libraries/js-draw-lite/src/types/jsdraw2';
|
|
34
21
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
// hwe migration (Phases 3-7): every editor / parse / calc path now runs through
|
|
23
|
+
// the standalone `@datagrok-libraries/hwe` library via its Datagrok adapter
|
|
24
|
+
// (`HelmHelperAdapter` over `HelmService`). The legacy forked Pistoia HELM Web
|
|
25
|
+
// Editor (`org.helm.webeditor` / JSDraw2 / Dojo) is gone — this class no longer
|
|
26
|
+
// touches any of those globals.
|
|
27
|
+
import {HelmHelperAdapter, bridgeMonomerLib, HelmService} from '@datagrok-libraries/hwe';
|
|
28
|
+
import type {IMonomerLibBaseLike, MonomersFuncsLike} from '@datagrok-libraries/hwe';
|
|
41
29
|
|
|
42
30
|
export class HelmHelper implements IHelmHelper {
|
|
43
31
|
private static instanceCount: number = 0;
|
|
44
32
|
|
|
45
33
|
constructor(
|
|
46
34
|
public readonly seqHelper: ISeqHelper,
|
|
47
|
-
private readonly logger: ILogger
|
|
35
|
+
private readonly logger: ILogger,
|
|
36
|
+
// Datagrok's RDKit module (from `getRdKitModule()`), forwarded to hwe so the
|
|
37
|
+
// editor can render monomer structures (atom / palette / RNA-builder tooltips
|
|
38
|
+
// and the bond-props dialog). hwe consumes only `get_mol(...).get_svg(...)`.
|
|
39
|
+
private readonly rdKitModule?: RDModule,
|
|
48
40
|
) {
|
|
49
41
|
// Watchdog for singleton
|
|
50
42
|
if ((++HelmHelper.instanceCount) > 1)
|
|
51
43
|
throw new Error(`HelmHelper must be a single.`);
|
|
52
44
|
}
|
|
53
45
|
|
|
46
|
+
// -- hwe editor adapter --
|
|
47
|
+
// The adapter owns one `HelmService` reading Bio's monomer library through
|
|
48
|
+
// `bridgeMonomerLib`, so the editor / parser / calculators resolve exactly
|
|
49
|
+
// the same monomers as the rest of the platform. Built lazily on first use
|
|
50
|
+
// (after `completeInit` has populated `_package._libHelper`).
|
|
51
|
+
private _editorAdapter: HelmHelperAdapter | null = null;
|
|
52
|
+
private get editorAdapter(): HelmHelperAdapter {
|
|
53
|
+
if (this._editorAdapter === null) {
|
|
54
|
+
const monomerLib = _package._libHelper!.getMonomerLib() as unknown as IMonomerLibBaseLike;
|
|
55
|
+
const service = new HelmService({monomerLib: bridgeMonomerLib(monomerLib), rdkitModule: this.rdKitModule});
|
|
56
|
+
this._editorAdapter = new HelmHelperAdapter({service, seqHelper: this.seqHelper});
|
|
57
|
+
}
|
|
58
|
+
return this._editorAdapter;
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
createHelmInput(name?: string, options?: IHelmInputInitOptions): HelmInputBase {
|
|
55
62
|
try {
|
|
56
63
|
const monomerLib: IMonomerLibBase = _package._libHelper!.getMonomerLib();
|
|
@@ -63,420 +70,61 @@ export class HelmHelper implements IHelmHelper {
|
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
createHelmWebEditor(host?: HTMLDivElement, options?: Partial<IHelmEditorOptions>): IHelmWebEditor {
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
org.helm.webeditor.MolViewer.molscale = 0.8;
|
|
71
|
-
const webEditorApp: App = new org.helm.webeditor.App(host, {
|
|
72
|
-
showabout: false,
|
|
73
|
-
mexfontsize: '90%',
|
|
74
|
-
mexrnapinontab: true,
|
|
75
|
-
topmargin: 20,
|
|
76
|
-
mexmonomerstab: true,
|
|
77
|
-
sequenceviewonly: false,
|
|
78
|
-
mexfavoritefirst: true,
|
|
79
|
-
mexfilter: true,
|
|
80
|
-
currentTabKey: HelmTabKeys.Helm,
|
|
81
|
-
overrideTabs: (tabs: Partial<TabDescType>[]): Partial<TabDescType>[] => {
|
|
82
|
-
const res: Partial<TabDescType>[] = [...tabs,
|
|
83
|
-
{caption: 'Placeholders', tabkey: 'placeholders'},
|
|
84
|
-
];
|
|
85
|
-
return res;
|
|
86
|
-
},
|
|
87
|
-
onShowTab: (mex: MonomerExplorer, div: HTMLDivElement, key: string): void => {
|
|
88
|
-
switch (key) {
|
|
89
|
-
case 'placeholders': {
|
|
90
|
-
this.onShowTabPlaceholders(mex, div);
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
case 'placeholders-meta': {
|
|
94
|
-
this.onShowTabPlaceholdersMeta(mex, div);
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
case 'placeholders-sets': {
|
|
98
|
-
this.onShowTabPlaceholdersSets(mex, div);
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
dojo.connect(div, 'onmousedown', function(e: MouseEvent) {
|
|
103
|
-
mex.select(e);
|
|
104
|
-
});
|
|
105
|
-
dojo.connect(div, 'ondblclick', function(e: MouseEvent) {
|
|
106
|
-
mex.dblclick(e);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
const sizes = webEditorApp.calculateSizes();
|
|
111
|
-
webEditorApp.canvas!.resize(sizes.rightwidth - 100, sizes.topheight - 210);
|
|
112
|
-
let s: Partial<CSSStyleDeclaration> = {width: sizes.rightwidth - 100 + 'px', height: sizes.bottomheight + 'px'};
|
|
113
|
-
scil.apply(webEditorApp.sequence.style, s);
|
|
114
|
-
scil.apply(webEditorApp.notation!.style, s);
|
|
115
|
-
s = {width: sizes.rightwidth + 'px', height: (sizes.bottomheight + webEditorApp.toolbarheight) + 'px'};
|
|
116
|
-
scil.apply(webEditorApp.properties!.parent.style, s);
|
|
117
|
-
webEditorApp.structureview!.resize(sizes.rightwidth, sizes.bottomheight + webEditorApp.toolbarheight);
|
|
118
|
-
webEditorApp.mex!.resize(sizes.topheight - 80);
|
|
119
|
-
webEditorApp.canvas?.setHelm(helm);
|
|
120
|
-
return webEditorApp;
|
|
73
|
+
return this.editorAdapter.createHelmWebEditor(host, {
|
|
74
|
+
...(options?.width !== undefined ? {width: options.width} : {}),
|
|
75
|
+
...(options?.height !== undefined ? {height: options.height} : {}),
|
|
76
|
+
}) as unknown as IHelmWebEditor;
|
|
121
77
|
}
|
|
122
78
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// });
|
|
134
|
-
// }
|
|
135
|
-
/* eslint-enable max-len*/
|
|
136
|
-
|
|
137
|
-
const phTabs: Partial<TabDescType>[] = [];
|
|
138
|
-
phTabs.push({caption: 'Meta', tabkey: 'placeholders-meta'});
|
|
139
|
-
phTabs.push({caption: 'Sets', tabkey: 'placeholders-sets'});
|
|
140
|
-
const placeholdersTabs = new scil.Tabs(d, {
|
|
141
|
-
onShowTab(td: HTMLTableCellElement) {
|
|
142
|
-
mex.onShowTab(td);
|
|
143
|
-
},
|
|
144
|
-
tabpadding: '5px 2px 1px 2px',
|
|
145
|
-
tabs: phTabs,
|
|
146
|
-
marginBottom: `0`,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
public onShowTabPlaceholdersMeta(mex: MonomerExplorer, div: HTMLDivElement): void {
|
|
151
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Returns the standalone hwe editor (palette + toolbar + canvas +
|
|
81
|
+
* Sequence/HELM/Properties/Atomic tabs) wrapped in a `LegacyAppWrapper` that
|
|
82
|
+
* presents the legacy Pistoia `App` shape — `canvas.getHelm(true)`,
|
|
83
|
+
* `canvas.helm.jsd.m.atoms[i].selected`, `sequence` / `notation` /
|
|
84
|
+
* `properties.parent`, etc. — so the existing dialog consumers swap in
|
|
85
|
+
* unchanged.
|
|
86
|
+
*/
|
|
87
|
+
createWebEditorApp(host: HTMLDivElement, helm?: string): App {
|
|
88
|
+
return this.editorAdapter.createWebEditorApp(host, helm) as unknown as App;
|
|
152
89
|
}
|
|
153
90
|
|
|
154
|
-
|
|
155
|
-
|
|
91
|
+
// -- GetMonomer (monomer-funcs hooks) --
|
|
92
|
+
// Delegated to the adapter. The legacy implementation patched the global
|
|
93
|
+
// `org.helm.webeditor.Monomers` registry so the forked editor used Bio's
|
|
94
|
+
// library; the hwe editor reads `bridgeMonomerLib(...)` directly, so these
|
|
95
|
+
// are now thin pass-throughs kept for the `IHelmHelper` contract.
|
|
156
96
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
let ofPolymerTypeSet = phSet[ph.polymerType];
|
|
160
|
-
if (!ofPolymerTypeSet) ofPolymerTypeSet = phSet[ph.polymerType] = {};
|
|
161
|
-
|
|
162
|
-
const phHelmType = this.toHelmType(ph.polymerType, ph.monomerType);
|
|
163
|
-
let phList = ofPolymerTypeSet[phHelmType];
|
|
164
|
-
if (!phList) phList = ofPolymerTypeSet[phHelmType] = [];
|
|
165
|
-
phList.push(ph);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const fillPlaceholders = (
|
|
169
|
-
parentDiv: HTMLDivElement, phList: IMonomerSetPlaceholder[], helmType: HelmType
|
|
170
|
-
): void => {
|
|
171
|
-
for (const ph of phList) {
|
|
172
|
-
const phDiv = mex.createMonomerDiv(parentDiv, ph.symbol, helmType);
|
|
173
|
-
ui.tooltip.bind(phDiv, () => {
|
|
174
|
-
const phTooltipDiv = ui.div([
|
|
175
|
-
ui.table(ph.monomerLinks, (ml: IMonomerLinkData, idx: number) => {
|
|
176
|
-
return [ml.symbol, ml.source];
|
|
177
|
-
}, ['Symbol', 'Library source'])
|
|
178
|
-
]);
|
|
179
|
-
return phTooltipDiv;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
const polymerTypes: [string, PolymerType][] = [
|
|
185
|
-
['Chem', PolymerTypes.CHEM],
|
|
186
|
-
['Peptide', PolymerTypes.PEPTIDE],
|
|
187
|
-
['RNA', PolymerTypes.RNA],
|
|
188
|
-
['Blob', PolymerTypes.BLOB],
|
|
189
|
-
['G', PolymerTypes.G],
|
|
190
|
-
];
|
|
191
|
-
const polymerTypeAcc = ui.accordion();
|
|
192
|
-
for (const [name, polymerType] of polymerTypes) {
|
|
193
|
-
if (polymerType in phSet) {
|
|
194
|
-
polymerTypeAcc.addPane(name, () => {
|
|
195
|
-
const polymerTypeDiv = ui.div();
|
|
196
|
-
const ofPolymerTypeSet = phSet[polymerType];
|
|
197
|
-
if (Object.keys(ofPolymerTypeSet).length == 1) {
|
|
198
|
-
const [helmType, phList] = Object.entries(ofPolymerTypeSet)[0];
|
|
199
|
-
fillPlaceholders(polymerTypeDiv, phList, helmType as HelmType);
|
|
200
|
-
} else {
|
|
201
|
-
const helmTypeAcc = ui.accordion();
|
|
202
|
-
for (const [helmTypeName, helmType] of Object.entries(HelmTypes)) {
|
|
203
|
-
if (helmType in ofPolymerTypeSet) {
|
|
204
|
-
helmTypeAcc.addPane(helmTypeName, () => {
|
|
205
|
-
const helmTypeDiv = ui.div();
|
|
206
|
-
|
|
207
|
-
const phList = ofPolymerTypeSet[helmType];
|
|
208
|
-
fillPlaceholders(helmTypeDiv, phList, helmType as HelmType);
|
|
209
|
-
|
|
210
|
-
return helmTypeDiv;
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
polymerTypeDiv.appendChild(helmTypeAcc.root);
|
|
215
|
-
}
|
|
216
|
-
return polymerTypeDiv;
|
|
217
|
-
}, true, undefined, false);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
div.appendChild(polymerTypeAcc.root);
|
|
97
|
+
public get originalMonomersFuncs(): MonomersFuncs | null {
|
|
98
|
+
return this.editorAdapter.originalMonomersFuncs as unknown as MonomersFuncs | null;
|
|
221
99
|
}
|
|
222
100
|
|
|
223
|
-
// -- GetMonomer --
|
|
224
|
-
|
|
225
|
-
public originalMonomersFuncs: MonomersFuncs | null = null;
|
|
226
|
-
|
|
227
101
|
public revertOriginalMonomersFuncs(): MonomersFuncs {
|
|
228
|
-
|
|
229
|
-
if (this.originalMonomersFuncs === null)
|
|
230
|
-
throw new Error('Unable to revert original getMonomer');
|
|
231
|
-
|
|
232
|
-
const monomers = org.helm.webeditor.Monomers;
|
|
233
|
-
const overriddenMonomersFuncs: MonomersFuncs = {
|
|
234
|
-
getMonomer: monomers.getMonomer,
|
|
235
|
-
getMonomerSet: monomers.getMonomerSet,
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
monomers.getMonomer = this.originalMonomersFuncs.getMonomer;
|
|
239
|
-
monomers.getMonomerSet = this.originalMonomersFuncs.getMonomerSet;
|
|
240
|
-
this.originalMonomersFuncs = null;
|
|
241
|
-
|
|
242
|
-
return overriddenMonomersFuncs;
|
|
102
|
+
return this.editorAdapter.revertOriginalMonomersFuncs() as unknown as MonomersFuncs;
|
|
243
103
|
}
|
|
244
104
|
|
|
245
105
|
public overrideMonomersFuncs(monomersFuncs: MonomersFuncs): MonomersFuncs {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (this.originalMonomersFuncs != null)
|
|
249
|
-
throw new Error(`${logPrefix}, originalGetMonomer is overridden already`);
|
|
250
|
-
|
|
251
|
-
const monomers = org.helm.webeditor.Monomers;
|
|
252
|
-
this.originalMonomersFuncs = {
|
|
253
|
-
getMonomer: monomers.getMonomer.bind(monomers),
|
|
254
|
-
getMonomerSet: monomers.getMonomerSet.bind(monomers),
|
|
255
|
-
};
|
|
256
|
-
monomers.getMonomer = monomersFuncs.getMonomer;
|
|
257
|
-
monomers.getMonomerSet = monomersFuncs.getMonomerSet;
|
|
258
|
-
return this.originalMonomersFuncs!;
|
|
106
|
+
return this.editorAdapter.overrideMonomersFuncs(
|
|
107
|
+
monomersFuncs as unknown as MonomersFuncsLike) as unknown as MonomersFuncs;
|
|
259
108
|
}
|
|
260
109
|
|
|
261
110
|
public buildMonomersFuncsFromLib(monomerLib: IMonomerLib): MonomersFuncs {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return {
|
|
265
|
-
getMonomer: (a: HelmAtom | HelmType, name?: string): GetMonomerResType => {
|
|
266
|
-
const logPrefixInt = `${logPrefix}, org.helm.webeditor.Monomers.getMonomer()`;
|
|
267
|
-
try {
|
|
268
|
-
// logger.debug(`${logPrefixInt}, a: ${JSON.stringify(a, helmJsonReplacer)}, name: '${name}'`);
|
|
269
|
-
if (name?.startsWith('[') && name.endsWith(']'))
|
|
270
|
-
name = name.substring(1, name.length - 1);
|
|
271
|
-
// Creates monomers in lib
|
|
272
|
-
const dgWem = monomerLib.getWebEditorMonomer(a, name);
|
|
273
|
-
|
|
274
|
-
return dgWem; //dgWem;
|
|
275
|
-
} catch (err) {
|
|
276
|
-
const [errMsg, errStack] = errInfo(err);
|
|
277
|
-
this.logger.error(`${logPrefixInt}, Error: ${errMsg}`, undefined, errStack);
|
|
278
|
-
throw err;
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
getMonomerSet: (a: HelmAtom | HelmType | null): MonomerSetType | null => {
|
|
282
|
-
// if (a == null)
|
|
283
|
-
// return null;
|
|
284
|
-
// const atom = a as HelmAtom;
|
|
285
|
-
// if (atom.T === 'ATOM')
|
|
286
|
-
// a = atom.biotype();
|
|
287
|
-
// return monomerLib.getMonomerSet(a as HelmType);
|
|
288
|
-
return this.originalMonomersFuncs!.getMonomerSet(a);
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// helm2type(seqM: ISeqMonomer): HelmType {
|
|
294
|
-
// if (seqM.polymerType == "PEPTIDE")
|
|
295
|
-
// return org.helm.webeditor.HELM.AA;
|
|
296
|
-
// else if (seqM.polymerType == "CHEM")
|
|
297
|
-
// return org.helm.webeditor.HELM.CHEM;
|
|
298
|
-
// else if (seqM.polymerType == "RNA") {
|
|
299
|
-
// if (seqM.mt == "Branch")
|
|
300
|
-
// return org.helm.webeditor.HELM.BASE;
|
|
301
|
-
// if (seqM.mt == "Backbone") {
|
|
302
|
-
// if (seqM.na == "P" || seqM.na == "p")
|
|
303
|
-
// return org.helm.webeditor.HELM.LINKER;
|
|
304
|
-
// else
|
|
305
|
-
// return org.helm.webeditor.HELM.SUGAR;
|
|
306
|
-
// }
|
|
307
|
-
// }
|
|
308
|
-
// throw new Error(`Not supported seq monomer ${JSON.stringify(seqM)}.`);
|
|
309
|
-
// }
|
|
310
|
-
private toHelmType(polymerType: PolymerType, monomerType: MonomerType, naturalAnalog?: string) {
|
|
311
|
-
if (polymerType == PolymerTypes.PEPTIDE)
|
|
312
|
-
return org.helm.webeditor.HELM.AA;
|
|
313
|
-
else if (polymerType == PolymerTypes.CHEM)
|
|
314
|
-
return org.helm.webeditor.HELM.CHEM;
|
|
315
|
-
else if (polymerType == PolymerTypes.RNA) {
|
|
316
|
-
if (monomerType == MonomerTypes.BRANCH)
|
|
317
|
-
return org.helm.webeditor.HELM.BASE;
|
|
318
|
-
if (monomerType == MonomerTypes.BACKBONE) {
|
|
319
|
-
if (naturalAnalog == 'P' || naturalAnalog == 'p')
|
|
320
|
-
return org.helm.webeditor.HELM.LINKER;
|
|
321
|
-
else
|
|
322
|
-
return org.helm.webeditor.HELM.SUGAR;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
throw new Error(`Not supported monomer polymerType: '${polymerType}', monomerType: '${monomerType}'.`);
|
|
111
|
+
return this.editorAdapter.buildMonomersFuncsFromLib(
|
|
112
|
+
monomerLib as unknown as IMonomerLibBaseLike) as unknown as MonomersFuncs;
|
|
326
113
|
}
|
|
327
114
|
|
|
328
115
|
public getHoveredAtom(x: number, y: number, mol: HelmMol, height: number): HelmAtom | null {
|
|
329
116
|
return getHoveredMonomerFromEditorMol(x, y, mol, height);
|
|
330
117
|
}
|
|
331
118
|
|
|
332
|
-
//if molfiles are accessed too often, it is better to cache it
|
|
333
|
-
private _molfilesEditor: Editor<unknown, IBio<unknown>, IEditorOptions> | null = null;
|
|
334
|
-
private _molfilesEditorHost: HTMLDivElement | null = null;
|
|
335
|
-
private get molfilesEditor(): Editor<unknown, IBio<unknown>, IEditorOptions> {
|
|
336
|
-
if (this._molfilesEditorRemovingTimer)
|
|
337
|
-
clearTimeout(this._molfilesEditorRemovingTimer);
|
|
338
|
-
if (this._molfilesEditor == null) {
|
|
339
|
-
this._molfilesEditorHost = ui.div([], {style: {width: '0px', height: '0px', position: 'fixed'}});
|
|
340
|
-
document.documentElement.appendChild(this._molfilesEditorHost);
|
|
341
|
-
this._molfilesEditor = new JSDraw2.Editor(this._molfilesEditorHost, {viewonly: true});
|
|
342
|
-
}
|
|
343
|
-
this._molfilesEditorRemovingTimer = setTimeout(() => {
|
|
344
|
-
this.removeMolfilesEditor();
|
|
345
|
-
}, 1000);
|
|
346
|
-
return this._molfilesEditor;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// after batch conversion, remove the editor to avoid sliding pages
|
|
350
|
-
private _molfilesEditorRemovingTimer: any = null;
|
|
351
|
-
private removeMolfilesEditor(): void {
|
|
352
|
-
if (this._molfilesEditorHost) {
|
|
353
|
-
$(this._molfilesEditorHost).empty();
|
|
354
|
-
this._molfilesEditorHost.remove();
|
|
355
|
-
this._molfilesEditorHost = null;
|
|
356
|
-
this._molfilesEditor = null;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
119
|
public getMolfiles(helmStrList: string[]): string[] {
|
|
361
|
-
|
|
362
|
-
const editor = this.molfilesEditor;
|
|
363
|
-
const resList = helmStrList.map((helmStr, i) => {
|
|
364
|
-
//no-draw instruction to avoid time spent on rendering
|
|
365
|
-
editor.helm && (editor.helm.noDraw = true);
|
|
366
|
-
editor.setHelm(helmStr);
|
|
367
|
-
const mol = editor.getMolfile();
|
|
368
|
-
return mol;
|
|
369
|
-
});
|
|
370
|
-
return resList;
|
|
371
|
-
} finally {
|
|
372
|
-
// $(host).empty();
|
|
373
|
-
// host.remove();
|
|
374
|
-
}
|
|
120
|
+
return this.editorAdapter.getMolfiles(helmStrList);
|
|
375
121
|
}
|
|
376
122
|
|
|
377
123
|
public parse(helm: string, origin?: Point): HelmMol {
|
|
378
|
-
|
|
379
|
-
const plugin = new org.helm.webeditor.Plugin(molHandler);
|
|
380
|
-
org.helm.webeditor.IO.parseHelm(plugin, helm, origin ?? new JSDraw2.Point(0, 0));
|
|
381
|
-
return plugin.jsd.m;
|
|
124
|
+
return this.editorAdapter.parse(helm, origin) as unknown as HelmMol;
|
|
382
125
|
}
|
|
383
126
|
|
|
384
127
|
removeGaps(srcHelm: string): HelmConvertRes {
|
|
385
|
-
|
|
386
|
-
const mol: HelmMol = this.parse(srcHelm);
|
|
387
|
-
for (let aI: number = mol.atoms.length - 1; aI >= 0; --aI) {
|
|
388
|
-
const a = mol.atoms[aI];
|
|
389
|
-
if (a.elem === HELM_GAP_SYMBOL /* '*' - original */) {
|
|
390
|
-
// Collect all bonds connected to this gap atom, tracking which side the gap is on
|
|
391
|
-
const connectedBonds: { bI: number, gapSide: 1 | 2 }[] = [];
|
|
392
|
-
for (let bI: number = mol.bonds.length - 1; bI >= 0; --bI) {
|
|
393
|
-
const b = mol.bonds[bI];
|
|
394
|
-
if (b.a1 === a) connectedBonds.push({bI, gapSide: 1}); // gap is a1
|
|
395
|
-
else if (b.a2 === a) connectedBonds.push({bI, gapSide: 2}); // gap is a2
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
if (connectedBonds.length > 2) {
|
|
399
|
-
throw new HelmNotSupportedError(
|
|
400
|
-
`Removing gap monomer #${aI} with ${connectedBonds.length} bonds is unsupported (max 2).`);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
// Separate into backbone bonds (R1/R2) and other bonds (R3+ cross-polymer)
|
|
404
|
-
// A backbone bond connects to the gap's R1 or R2 attachment point
|
|
405
|
-
let backboneR1Bond: { bI: number, gapSide: 1 | 2 } | null = null; // bond using gap's R1
|
|
406
|
-
let backboneR2Bond: { bI: number, gapSide: 1 | 2 } | null = null; // bond using gap's R2
|
|
407
|
-
const otherBonds: number[] = []; // bond indices to just remove
|
|
408
|
-
|
|
409
|
-
for (const cb of connectedBonds) {
|
|
410
|
-
const bond = mol.bonds[cb.bI];
|
|
411
|
-
// The R-group on the gap's side tells us which attachment point is used
|
|
412
|
-
const gapR = cb.gapSide === 1 ? bond.r1 : bond.r2;
|
|
413
|
-
const gapRNum = typeof gapR === 'string' ? parseInt(gapR.replace(/\D/g, '')) : gapR;
|
|
414
|
-
if (gapRNum === 1)
|
|
415
|
-
backboneR1Bond = cb;
|
|
416
|
-
else if (gapRNum === 2)
|
|
417
|
-
backboneR2Bond = cb;
|
|
418
|
-
else
|
|
419
|
-
otherBonds.push(cb.bI);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Remove other (non-backbone) bonds first (iterate in reverse to keep indices valid)
|
|
423
|
-
otherBonds.sort((a, b) => b - a);
|
|
424
|
-
for (const bI of otherBonds)
|
|
425
|
-
mol.bonds.splice(bI, 1);
|
|
426
|
-
|
|
427
|
-
// Recalculate bond indices after splice (otherBonds were removed)
|
|
428
|
-
// We need to adjust backboneR1Bond/R2Bond indices
|
|
429
|
-
const adjustIdx = (origBi: number): number => {
|
|
430
|
-
let adj = origBi;
|
|
431
|
-
for (const removedBi of otherBonds)
|
|
432
|
-
if (removedBi < origBi) adj--;
|
|
433
|
-
return adj;
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
const r1 = backboneR1Bond ? {...backboneR1Bond, bI: adjustIdx(backboneR1Bond.bI)} : null;
|
|
437
|
-
const r2 = backboneR2Bond ? {...backboneR2Bond, bI: adjustIdx(backboneR2Bond.bI)} : null;
|
|
438
|
-
|
|
439
|
-
if (r1 && r2) {
|
|
440
|
-
// Re-link: the neighbor on the R1 side connects directly to the neighbor on the R2 side
|
|
441
|
-
const r1Bond = mol.bonds[r1.bI];
|
|
442
|
-
const r2Bond = mol.bonds[r2.bI];
|
|
443
|
-
// The "other" atom (not the gap) on each bond
|
|
444
|
-
const r1Neighbor = r1.gapSide === 1 ? r1Bond.a2 : r1Bond.a1;
|
|
445
|
-
const r2Neighbor = r2.gapSide === 1 ? r2Bond.a2 : r2Bond.a1;
|
|
446
|
-
const r1NeighborR = r1.gapSide === 1 ? r1Bond.r2 : r1Bond.r1;
|
|
447
|
-
const r1NeighborApo = r1.gapSide === 1 ? r1Bond.apo2 : r1Bond.apo1;
|
|
448
|
-
const r2NeighborR = r2.gapSide === 1 ? r2Bond.r2 : r2Bond.r1;
|
|
449
|
-
const r2NeighborApo = r2.gapSide === 1 ? r2Bond.apo2 : r2Bond.apo1;
|
|
450
|
-
|
|
451
|
-
// Rewrite the R1 bond to connect r1Neighbor ↔ r2Neighbor directly
|
|
452
|
-
r1Bond.a1 = r1Neighbor;
|
|
453
|
-
r1Bond.r1 = r1NeighborR;
|
|
454
|
-
r1Bond.apo1 = r1NeighborApo;
|
|
455
|
-
r1Bond.a2 = r2Neighbor;
|
|
456
|
-
r1Bond.r2 = r2NeighborR;
|
|
457
|
-
r1Bond.apo2 = r2NeighborApo;
|
|
458
|
-
|
|
459
|
-
// Remove the R2 bond (no longer needed)
|
|
460
|
-
mol.bonds.splice(r2.bI, 1);
|
|
461
|
-
} else if (r1 && !r2) {
|
|
462
|
-
// Gap at the end (only R1 bond) — just remove
|
|
463
|
-
mol.bonds.splice(r1.bI, 1);
|
|
464
|
-
} else if (!r1 && r2) {
|
|
465
|
-
// Gap at the start (only R2 bond) — just remove
|
|
466
|
-
mol.bonds.splice(r2.bI, 1);
|
|
467
|
-
}
|
|
468
|
-
// else: isolated gap, no backbone bonds — just remove atom
|
|
469
|
-
|
|
470
|
-
mol.atoms.splice(aI, 1);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
for (let aI: number = 0; aI < mol.atoms.length; ++aI) {
|
|
475
|
-
const a: HelmAtom = mol.atoms[aI];
|
|
476
|
-
monomerMap.set(a.bio!.continuousId - 1, aI);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
const resHelm = org.helm.webeditor.IO.getHelm(mol)!;
|
|
480
|
-
return {srcHelm, resHelm, monomerMap};
|
|
128
|
+
return this.editorAdapter.removeGaps(srcHelm);
|
|
481
129
|
}
|
|
482
130
|
}
|
package/src/package-api.ts
CHANGED
|
@@ -12,35 +12,38 @@ export namespace funcs {
|
|
|
12
12
|
return await grok.functions.call('Helm:InitHelm', {});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
Helm renderer service
|
|
17
|
-
*/
|
|
18
|
-
export async function getHelmService(): Promise<any> {
|
|
19
|
-
return await grok.functions.call('Helm:GetHelmService', {});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
15
|
export async function helmCellRenderer(): Promise<any> {
|
|
23
16
|
return await grok.functions.call('Helm:HelmCellRenderer', {});
|
|
24
17
|
}
|
|
25
18
|
|
|
26
19
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
* Macromolecule
|
|
21
|
+
*/
|
|
29
22
|
export async function editMoleculeCell(cell: any ): Promise<void> {
|
|
30
23
|
return await grok.functions.call('Helm:EditMoleculeCell', { cell });
|
|
31
24
|
}
|
|
32
25
|
|
|
33
26
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
* Adds editor
|
|
28
|
+
* @param {any} mol
|
|
29
|
+
* semType: Macromolecule
|
|
30
|
+
*/
|
|
36
31
|
export async function openEditor(mol: any ): Promise<void> {
|
|
37
32
|
return await grok.functions.call('Helm:OpenEditor', { mol });
|
|
38
33
|
}
|
|
39
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @param {any} sequence
|
|
37
|
+
* semType: Macromolecule
|
|
38
|
+
*/
|
|
40
39
|
export async function propertiesWidget(sequence: any ): Promise<any> {
|
|
41
40
|
return await grok.functions.call('Helm:PropertiesWidget', { sequence });
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @param {DG.Column} col
|
|
45
|
+
* semType: Macromolecule
|
|
46
|
+
*/
|
|
44
47
|
export async function getMolfiles(col: DG.Column ): Promise<DG.Column> {
|
|
45
48
|
return await grok.functions.call('Helm:GetMolfiles', { col });
|
|
46
49
|
}
|
package/src/package-test.ts
CHANGED
|
@@ -10,11 +10,9 @@ import {runTests, tests, TestContext, initAutoTests as initTests} from '@datagro
|
|
|
10
10
|
import './tests/_first-tests';
|
|
11
11
|
import './tests/helm-tests';
|
|
12
12
|
import './tests/findMonomers-tests';
|
|
13
|
-
import './tests/helm-service-tests';
|
|
14
13
|
import './tests/renderers-tests';
|
|
15
14
|
import './tests/get-molfiles-tests';
|
|
16
15
|
import './tests/properties-widget-tests';
|
|
17
|
-
import './tests/get-monomer-tests';
|
|
18
16
|
import './tests/parse-helm-tests';
|
|
19
17
|
import './tests/helm-web-editor-tests';
|
|
20
18
|
import './tests/helm-input-tests';
|