@ixfx/components 0.2.2 → 0.2.4
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/LICENSE +1 -1
- package/bundle/chunk-pbuEa-1d.js +13 -0
- package/bundle/index.d.ts +4702 -569
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +34929 -2802
- package/bundle/index.js.map +1 -1
- package/bundle/style.css +133 -0
- package/dist/ac-text/ac-text.d.ts +99 -0
- package/dist/ac-text/ac-text.d.ts.map +1 -0
- package/dist/ac-text/ac-text.js +571 -0
- package/dist/ac-text/ac-text.js.map +1 -0
- package/dist/button/button-styles.d.ts +2 -0
- package/dist/button/button-styles.d.ts.map +1 -0
- package/dist/button/button-styles.js +75 -0
- package/dist/button/button-styles.js.map +1 -0
- package/dist/button/button.d.ts +16 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +58 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button/radio-group.d.ts +44 -0
- package/dist/button/radio-group.d.ts.map +1 -0
- package/dist/button/radio-group.js +385 -0
- package/dist/button/radio-group.js.map +1 -0
- package/dist/button/split-button.d.ts +59 -0
- package/dist/button/split-button.d.ts.map +1 -0
- package/dist/button/split-button.js +480 -0
- package/dist/button/split-button.js.map +1 -0
- package/dist/button/types.d.ts +18 -0
- package/dist/button/types.d.ts.map +1 -0
- package/dist/button/types.js +2 -0
- package/dist/button/types.js.map +1 -0
- package/dist/checkbox.d.ts +64 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +265 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/colour-picker/colour-picker-popup.d.ts +102 -0
- package/dist/colour-picker/colour-picker-popup.d.ts.map +1 -0
- package/dist/colour-picker/colour-picker-popup.js +399 -0
- package/dist/colour-picker/colour-picker-popup.js.map +1 -0
- package/dist/colour-picker/colour-picker.d.ts +100 -0
- package/dist/colour-picker/colour-picker.d.ts.map +1 -0
- package/dist/colour-picker/colour-picker.js +567 -0
- package/dist/colour-picker/colour-picker.js.map +1 -0
- package/dist/colour-picker/index.d.ts +4 -0
- package/dist/colour-picker/index.d.ts.map +1 -0
- package/dist/colour-picker/index.js +3 -0
- package/dist/colour-picker/index.js.map +1 -0
- package/dist/colour-picker/styles.d.ts +2 -0
- package/dist/colour-picker/styles.d.ts.map +1 -0
- package/dist/colour-picker/styles.js +139 -0
- package/dist/colour-picker/styles.js.map +1 -0
- package/dist/colour-picker/types.d.ts +33 -0
- package/dist/colour-picker/types.d.ts.map +1 -0
- package/dist/colour-picker/types.js +2 -0
- package/dist/colour-picker/types.js.map +1 -0
- package/dist/colour-picker/util.d.ts +15 -0
- package/dist/colour-picker/util.d.ts.map +1 -0
- package/dist/colour-picker/util.js +35 -0
- package/dist/colour-picker/util.js.map +1 -0
- package/dist/common/searchable.d.ts +9 -0
- package/dist/common/searchable.d.ts.map +1 -0
- package/dist/common/searchable.js +9 -0
- package/dist/common/searchable.js.map +1 -0
- package/dist/common/tree-component.d.ts +172 -0
- package/dist/common/tree-component.d.ts.map +1 -0
- package/dist/common/tree-component.js +8 -0
- package/dist/common/tree-component.js.map +1 -0
- package/dist/common/tree-data-model.d.ts +100 -0
- package/dist/common/tree-data-model.d.ts.map +1 -0
- package/dist/common/tree-data-model.js +207 -0
- package/dist/common/tree-data-model.js.map +1 -0
- package/dist/common/tree-item.d.ts +7 -0
- package/dist/common/tree-item.d.ts.map +1 -0
- package/dist/common/tree-item.js +2 -0
- package/dist/common/tree-item.js.map +1 -0
- package/dist/common/types.d.ts +69 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/types.js +6 -0
- package/dist/common/types.js.map +1 -0
- package/dist/crumbs/crumb-navigation.d.ts +96 -0
- package/dist/crumbs/crumb-navigation.d.ts.map +1 -0
- package/dist/crumbs/crumb-navigation.js +911 -0
- package/dist/crumbs/crumb-navigation.js.map +1 -0
- package/dist/crumbs/crumb-path-controller.d.ts +18 -0
- package/dist/crumbs/crumb-path-controller.d.ts.map +1 -0
- package/dist/crumbs/crumb-path-controller.js +81 -0
- package/dist/crumbs/crumb-path-controller.js.map +1 -0
- package/dist/crumbs/crumb-path.d.ts +65 -0
- package/dist/crumbs/crumb-path.d.ts.map +1 -0
- package/dist/crumbs/crumb-path.js +691 -0
- package/dist/crumbs/crumb-path.js.map +1 -0
- package/dist/data-display.d.ts +10 -3
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-display.js +45 -28
- package/dist/data-display.js.map +1 -1
- package/dist/editable-label/editable-label.d.ts +98 -0
- package/dist/editable-label/editable-label.d.ts.map +1 -0
- package/dist/editable-label/editable-label.js +348 -0
- package/dist/editable-label/editable-label.js.map +1 -0
- package/dist/editable-label/editable-number.d.ts +96 -0
- package/dist/editable-label/editable-number.d.ts.map +1 -0
- package/dist/editable-label/editable-number.js +702 -0
- package/dist/editable-label/editable-number.js.map +1 -0
- package/dist/hex/colour.d.ts +6 -0
- package/dist/hex/colour.d.ts.map +1 -0
- package/dist/hex/colour.js +33 -0
- package/dist/hex/colour.js.map +1 -0
- package/dist/hex/data.d.ts +18 -0
- package/dist/hex/data.d.ts.map +1 -0
- package/dist/hex/data.js +61 -0
- package/dist/hex/data.js.map +1 -0
- package/dist/hex/diff.d.ts +14 -0
- package/dist/hex/diff.d.ts.map +1 -0
- package/dist/hex/diff.js +31 -0
- package/dist/hex/diff.js.map +1 -0
- package/dist/hex/hex-editor.d.ts +101 -0
- package/dist/hex/hex-editor.d.ts.map +1 -0
- package/dist/hex/hex-editor.js +894 -0
- package/dist/hex/hex-editor.js.map +1 -0
- package/dist/hex/selection.d.ts +11 -0
- package/dist/hex/selection.d.ts.map +1 -0
- package/dist/hex/selection.js +218 -0
- package/dist/hex/selection.js.map +1 -0
- package/dist/hex/types.d.ts +34 -0
- package/dist/hex/types.d.ts.map +1 -0
- package/dist/hex/types.js +4 -0
- package/dist/hex/types.js.map +1 -0
- package/dist/icons/defaults.d.ts +27 -0
- package/dist/icons/defaults.d.ts.map +1 -0
- package/dist/icons/defaults.js +34 -0
- package/dist/icons/defaults.js.map +1 -0
- package/dist/icons/icon.d.ts +31 -0
- package/dist/icons/icon.d.ts.map +1 -0
- package/dist/icons/icon.js +125 -0
- package/dist/icons/icon.js.map +1 -0
- package/dist/icons/index.d.ts +5 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +6 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/registry.d.ts +11 -0
- package/dist/icons/registry.d.ts.map +1 -0
- package/dist/icons/registry.js +17 -0
- package/dist/icons/registry.js.map +1 -0
- package/dist/incr-search/ac-adapter.d.ts +18 -0
- package/dist/incr-search/ac-adapter.d.ts.map +1 -0
- package/dist/incr-search/ac-adapter.js +29 -0
- package/dist/incr-search/ac-adapter.js.map +1 -0
- package/dist/incr-search/controller-miller.d.ts +9 -0
- package/dist/incr-search/controller-miller.d.ts.map +1 -0
- package/dist/incr-search/controller-miller.js +8 -0
- package/dist/incr-search/controller-miller.js.map +1 -0
- package/dist/incr-search/controller-tree.d.ts +55 -0
- package/dist/incr-search/controller-tree.d.ts.map +1 -0
- package/dist/incr-search/controller-tree.js +106 -0
- package/dist/incr-search/controller-tree.js.map +1 -0
- package/dist/incr-search/element-search.d.ts +15 -0
- package/dist/incr-search/element-search.d.ts.map +1 -0
- package/dist/incr-search/element-search.js +82 -0
- package/dist/incr-search/element-search.js.map +1 -0
- package/dist/incr-search/fuzzy.d.ts +3 -0
- package/dist/incr-search/fuzzy.d.ts.map +1 -0
- package/dist/incr-search/fuzzy.js +37 -0
- package/dist/incr-search/fuzzy.js.map +1 -0
- package/dist/incr-search/highlight.d.ts +5 -0
- package/dist/incr-search/highlight.d.ts.map +1 -0
- package/dist/incr-search/highlight.js +54 -0
- package/dist/incr-search/highlight.js.map +1 -0
- package/dist/incr-search/incr-search.d.ts +3 -0
- package/dist/incr-search/incr-search.d.ts.map +1 -0
- package/dist/incr-search/incr-search.js +73 -0
- package/dist/incr-search/incr-search.js.map +1 -0
- package/dist/incr-search/index.d.ts +12 -0
- package/dist/incr-search/index.d.ts.map +1 -0
- package/dist/incr-search/index.js +8 -0
- package/dist/incr-search/index.js.map +1 -0
- package/dist/incr-search/types.d.ts +59 -0
- package/dist/incr-search/types.d.ts.map +1 -0
- package/dist/incr-search/types.js +2 -0
- package/dist/incr-search/types.js.map +1 -0
- package/dist/index.d.ts +49 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -10
- package/dist/index.js.map +1 -1
- package/dist/interaction/index.d.ts +10 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +10 -0
- package/dist/interaction/index.js.map +1 -0
- package/dist/interaction/tickled-controller.d.ts +186 -0
- package/dist/interaction/tickled-controller.d.ts.map +1 -0
- package/dist/interaction/tickled-controller.js +256 -0
- package/dist/interaction/tickled-controller.js.map +1 -0
- package/dist/interaction/tickled-styles.d.ts +53 -0
- package/dist/interaction/tickled-styles.d.ts.map +1 -0
- package/dist/interaction/tickled-styles.js +106 -0
- package/dist/interaction/tickled-styles.js.map +1 -0
- package/dist/interaction/tree-keyboard-controller.d.ts +30 -0
- package/dist/interaction/tree-keyboard-controller.d.ts.map +1 -0
- package/dist/interaction/tree-keyboard-controller.js +105 -0
- package/dist/interaction/tree-keyboard-controller.js.map +1 -0
- package/dist/keyboard.d.ts +16 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +22 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/labelled-radial-input/index.d.ts +2 -0
- package/dist/labelled-radial-input/index.d.ts.map +1 -0
- package/dist/labelled-radial-input/index.js +2 -0
- package/dist/labelled-radial-input/index.js.map +1 -0
- package/dist/labelled-radial-input/labelled-radial-input.d.ts +77 -0
- package/dist/labelled-radial-input/labelled-radial-input.d.ts.map +1 -0
- package/dist/labelled-radial-input/labelled-radial-input.js +214 -0
- package/dist/labelled-radial-input/labelled-radial-input.js.map +1 -0
- package/dist/labelled-range-input/index.d.ts +2 -0
- package/dist/labelled-range-input/index.d.ts.map +1 -0
- package/dist/labelled-range-input/index.js +2 -0
- package/dist/labelled-range-input/index.js.map +1 -0
- package/dist/labelled-range-input/labelled-range-input.d.ts +80 -0
- package/dist/labelled-range-input/labelled-range-input.d.ts.map +1 -0
- package/dist/labelled-range-input/labelled-range-input.js +137 -0
- package/dist/labelled-range-input/labelled-range-input.js.map +1 -0
- package/dist/led.d.ts +20 -0
- package/dist/led.d.ts.map +1 -0
- package/dist/led.js +100 -0
- package/dist/led.js.map +1 -0
- package/dist/menu/index.d.ts +14 -0
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/menu/index.js +13 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/menu/menu-bar.d.ts +23 -0
- package/dist/menu/menu-bar.d.ts.map +1 -0
- package/dist/menu/menu-bar.js +110 -0
- package/dist/menu/menu-bar.js.map +1 -0
- package/dist/menu/menu-check-item.d.ts +33 -0
- package/dist/menu/menu-check-item.d.ts.map +1 -0
- package/dist/menu/menu-check-item.js +175 -0
- package/dist/menu/menu-check-item.js.map +1 -0
- package/dist/menu/menu-command-controller.d.ts +14 -0
- package/dist/menu/menu-command-controller.d.ts.map +1 -0
- package/dist/menu/menu-command-controller.js +22 -0
- package/dist/menu/menu-command-controller.js.map +1 -0
- package/dist/menu/menu-container.d.ts +36 -0
- package/dist/menu/menu-container.d.ts.map +1 -0
- package/dist/menu/menu-container.js +351 -0
- package/dist/menu/menu-container.js.map +1 -0
- package/dist/menu/menu-from-tree.d.ts +17 -0
- package/dist/menu/menu-from-tree.d.ts.map +1 -0
- package/dist/menu/menu-from-tree.js +103 -0
- package/dist/menu/menu-from-tree.js.map +1 -0
- package/dist/menu/menu-header.d.ts +12 -0
- package/dist/menu/menu-header.d.ts.map +1 -0
- package/dist/menu/menu-header.js +36 -0
- package/dist/menu/menu-header.js.map +1 -0
- package/dist/menu/menu-item.d.ts +41 -0
- package/dist/menu/menu-item.d.ts.map +1 -0
- package/dist/menu/menu-item.js +240 -0
- package/dist/menu/menu-item.js.map +1 -0
- package/dist/menu/menu-radio-group.d.ts +24 -0
- package/dist/menu/menu-radio-group.d.ts.map +1 -0
- package/dist/menu/menu-radio-group.js +71 -0
- package/dist/menu/menu-radio-group.js.map +1 -0
- package/dist/menu/menu-radio-item.d.ts +22 -0
- package/dist/menu/menu-radio-item.d.ts.map +1 -0
- package/dist/menu/menu-radio-item.js +116 -0
- package/dist/menu/menu-radio-item.js.map +1 -0
- package/dist/menu/menu-separator.d.ts +11 -0
- package/dist/menu/menu-separator.d.ts.map +1 -0
- package/dist/menu/menu-separator.js +29 -0
- package/dist/menu/menu-separator.js.map +1 -0
- package/dist/menu/menu-sub-trigger.d.ts +46 -0
- package/dist/menu/menu-sub-trigger.d.ts.map +1 -0
- package/dist/menu/menu-sub-trigger.js +302 -0
- package/dist/menu/menu-sub-trigger.js.map +1 -0
- package/dist/menu/menu-trigger.d.ts +57 -0
- package/dist/menu/menu-trigger.d.ts.map +1 -0
- package/dist/menu/menu-trigger.js +351 -0
- package/dist/menu/menu-trigger.js.map +1 -0
- package/dist/miller/index.d.ts +5 -0
- package/dist/miller/index.d.ts.map +1 -0
- package/dist/miller/index.js +5 -0
- package/dist/miller/index.js.map +1 -0
- package/dist/miller/miller-base.d.ts +184 -0
- package/dist/miller/miller-base.d.ts.map +1 -0
- package/dist/miller/miller-base.js +1249 -0
- package/dist/miller/miller-base.js.map +1 -0
- package/dist/miller/miller-list.d.ts +30 -0
- package/dist/miller/miller-list.d.ts.map +1 -0
- package/dist/miller/miller-list.js +192 -0
- package/dist/miller/miller-list.js.map +1 -0
- package/dist/miller/miller-tree-controller.d.ts +58 -0
- package/dist/miller/miller-tree-controller.d.ts.map +1 -0
- package/dist/miller/miller-tree-controller.js +134 -0
- package/dist/miller/miller-tree-controller.js.map +1 -0
- package/dist/miller/types.d.ts +63 -0
- package/dist/miller/types.d.ts.map +1 -0
- package/dist/miller/types.js +6 -0
- package/dist/miller/types.js.map +1 -0
- package/dist/mixins/labelled-input-base.d.ts +38 -0
- package/dist/mixins/labelled-input-base.d.ts.map +1 -0
- package/dist/mixins/labelled-input-base.js +171 -0
- package/dist/mixins/labelled-input-base.js.map +1 -0
- package/dist/mixins/labelled-input-util.d.ts +3 -0
- package/dist/mixins/labelled-input-util.d.ts.map +1 -0
- package/dist/mixins/labelled-input-util.js +10 -0
- package/dist/mixins/labelled-input-util.js.map +1 -0
- package/dist/my-element.d.ts.map +1 -1
- package/dist/my-element.js +1 -1
- package/dist/my-element.js.map +1 -1
- package/dist/narrowed-text/index.d.ts +3 -0
- package/dist/narrowed-text/index.d.ts.map +1 -0
- package/dist/narrowed-text/index.js +3 -0
- package/dist/narrowed-text/index.js.map +1 -0
- package/dist/narrowed-text/narrowed-text.d.ts +48 -0
- package/dist/narrowed-text/narrowed-text.d.ts.map +1 -0
- package/dist/narrowed-text/narrowed-text.js +668 -0
- package/dist/narrowed-text/narrowed-text.js.map +1 -0
- package/dist/narrowed-text/types.d.ts +20 -0
- package/dist/narrowed-text/types.d.ts.map +1 -0
- package/dist/narrowed-text/types.js +2 -0
- package/dist/narrowed-text/types.js.map +1 -0
- package/dist/panel/panel-group.d.ts +23 -0
- package/dist/panel/panel-group.d.ts.map +1 -0
- package/dist/panel/panel-group.js +109 -0
- package/dist/panel/panel-group.js.map +1 -0
- package/dist/panel/panel.d.ts +39 -0
- package/dist/panel/panel.d.ts.map +1 -0
- package/dist/panel/panel.js +417 -0
- package/dist/panel/panel.js.map +1 -0
- package/dist/plots/colour-map.d.ts +31 -0
- package/dist/plots/colour-map.d.ts.map +1 -0
- package/dist/plots/colour-map.js +133 -0
- package/dist/plots/colour-map.js.map +1 -0
- package/dist/plots/data.d.ts +27 -0
- package/dist/plots/data.d.ts.map +1 -0
- package/dist/plots/data.js +47 -0
- package/dist/plots/data.js.map +1 -0
- package/dist/plots/single-axis.d.ts +41 -0
- package/dist/plots/single-axis.d.ts.map +1 -0
- package/dist/plots/single-axis.js +428 -0
- package/dist/plots/single-axis.js.map +1 -0
- package/dist/plots/svg-utils.d.ts +12 -0
- package/dist/plots/svg-utils.d.ts.map +1 -0
- package/dist/plots/svg-utils.js +64 -0
- package/dist/plots/svg-utils.js.map +1 -0
- package/dist/plots/xy-axis.d.ts +42 -0
- package/dist/plots/xy-axis.d.ts.map +1 -0
- package/dist/plots/xy-axis.js +307 -0
- package/dist/plots/xy-axis.js.map +1 -0
- package/dist/polar-pad/polar-pad.d.ts +132 -0
- package/dist/polar-pad/polar-pad.d.ts.map +1 -0
- package/dist/polar-pad/polar-pad.js +598 -0
- package/dist/polar-pad/polar-pad.js.map +1 -0
- package/dist/radial-input/radial-input.d.ts +45 -0
- package/dist/radial-input/radial-input.d.ts.map +1 -0
- package/dist/radial-input/radial-input.js +692 -0
- package/dist/radial-input/radial-input.js.map +1 -0
- package/dist/radial-input/svg-utils.d.ts +147 -0
- package/dist/radial-input/svg-utils.d.ts.map +1 -0
- package/dist/radial-input/svg-utils.js +346 -0
- package/dist/radial-input/svg-utils.js.map +1 -0
- package/dist/radial-input/types.d.ts +25 -0
- package/dist/radial-input/types.d.ts.map +1 -0
- package/dist/radial-input/types.js +5 -0
- package/dist/radial-input/types.js.map +1 -0
- package/dist/range/range-multi.d.ts +62 -0
- package/dist/range/range-multi.d.ts.map +1 -0
- package/dist/range/range-multi.js +652 -0
- package/dist/range/range-multi.js.map +1 -0
- package/dist/range/range.d.ts +23 -0
- package/dist/range/range.d.ts.map +1 -0
- package/dist/range/range.js +153 -0
- package/dist/range/range.js.map +1 -0
- package/dist/range-input/index.d.ts +2 -0
- package/dist/range-input/index.d.ts.map +1 -0
- package/dist/range-input/index.js +2 -0
- package/dist/range-input/index.js.map +1 -0
- package/dist/range-input/range-input.d.ts +92 -0
- package/dist/range-input/range-input.d.ts.map +1 -0
- package/dist/range-input/range-input.js +472 -0
- package/dist/range-input/range-input.js.map +1 -0
- package/dist/selecthorizontal.d.ts +1 -1
- package/dist/selecthorizontal.d.ts.map +1 -1
- package/dist/selecthorizontal.js +3 -3
- package/dist/selecthorizontal.js.map +1 -1
- package/dist/snap-container/snap-container.d.ts +45 -0
- package/dist/snap-container/snap-container.d.ts.map +1 -0
- package/dist/snap-container/snap-container.js +352 -0
- package/dist/snap-container/snap-container.js.map +1 -0
- package/dist/split-layout/split-layout.d.ts +25 -9
- package/dist/split-layout/split-layout.d.ts.map +1 -1
- package/dist/split-layout/split-layout.js +520 -66
- package/dist/split-layout/split-layout.js.map +1 -1
- package/dist/styles/popup.d.ts +11 -0
- package/dist/styles/popup.d.ts.map +1 -0
- package/dist/styles/popup.js +20 -0
- package/dist/styles/popup.js.map +1 -0
- package/dist/styles/prominence.d.ts +58 -0
- package/dist/styles/prominence.d.ts.map +1 -0
- package/dist/styles/prominence.js +94 -0
- package/dist/styles/prominence.js.map +1 -0
- package/dist/styles/tooltip.d.ts +2 -0
- package/dist/styles/tooltip.d.ts.map +1 -0
- package/dist/styles/tooltip.js +100 -0
- package/dist/styles/tooltip.js.map +1 -0
- package/dist/svg-edit-label.js +1 -1
- package/dist/svg-edit-label.js.map +1 -1
- package/dist/swipe/index.d.ts +2 -0
- package/dist/swipe/index.d.ts.map +1 -0
- package/dist/swipe/index.js +2 -0
- package/dist/swipe/index.js.map +1 -0
- package/dist/swipe/swipe.d.ts +65 -0
- package/dist/swipe/swipe.d.ts.map +1 -0
- package/dist/swipe/swipe.js +229 -0
- package/dist/swipe/swipe.js.map +1 -0
- package/dist/tabs/tab-layout-item.d.ts.map +1 -1
- package/dist/tabs/tab-layout-item.js +1 -1
- package/dist/tabs/tab-layout-item.js.map +1 -1
- package/dist/tabs/tab-layout.d.ts.map +1 -1
- package/dist/tabs/tab-layout.js +1 -1
- package/dist/tabs/tab-layout.js.map +1 -1
- package/dist/tabs/tab-list-item.d.ts +22 -6
- package/dist/tabs/tab-list-item.d.ts.map +1 -1
- package/dist/tabs/tab-list-item.js +174 -42
- package/dist/tabs/tab-list-item.js.map +1 -1
- package/dist/tabs/tab-list.d.ts +15 -5
- package/dist/tabs/tab-list.d.ts.map +1 -1
- package/dist/tabs/tab-list.js +159 -50
- package/dist/tabs/tab-list.js.map +1 -1
- package/dist/tabs/tab-panel.d.ts +1 -1
- package/dist/tabs/tab-panel.d.ts.map +1 -1
- package/dist/tabs/tab-panel.js +2 -2
- package/dist/tabs/tab-panel.js.map +1 -1
- package/dist/tabs/tab-panels.d.ts +3 -3
- package/dist/tabs/tab-panels.d.ts.map +1 -1
- package/dist/tabs/tab-panels.js +6 -6
- package/dist/tabs/tab-panels.js.map +1 -1
- package/dist/timeline/index.d.ts +9 -0
- package/dist/timeline/index.d.ts.map +1 -0
- package/dist/timeline/index.js +8 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/timeline-controller.d.ts +48 -0
- package/dist/timeline/timeline-controller.d.ts.map +1 -0
- package/dist/timeline/timeline-controller.js +81 -0
- package/dist/timeline/timeline-controller.js.map +1 -0
- package/dist/timeline/timeline-draw.d.ts +28 -0
- package/dist/timeline/timeline-draw.d.ts.map +1 -0
- package/dist/timeline/timeline-draw.js +330 -0
- package/dist/timeline/timeline-draw.js.map +1 -0
- package/dist/timeline/timeline-element.d.ts +140 -0
- package/dist/timeline/timeline-element.d.ts.map +1 -0
- package/dist/timeline/timeline-element.js +888 -0
- package/dist/timeline/timeline-element.js.map +1 -0
- package/dist/timeline/timeline-interactions.d.ts +40 -0
- package/dist/timeline/timeline-interactions.d.ts.map +1 -0
- package/dist/timeline/timeline-interactions.js +393 -0
- package/dist/timeline/timeline-interactions.js.map +1 -0
- package/dist/timeline/timeline-styles.d.ts +2 -0
- package/dist/timeline/timeline-styles.d.ts.map +1 -0
- package/dist/timeline/timeline-styles.js +153 -0
- package/dist/timeline/timeline-styles.js.map +1 -0
- package/dist/timeline/timeline-track-tabs.d.ts +30 -0
- package/dist/timeline/timeline-track-tabs.d.ts.map +1 -0
- package/dist/timeline/timeline-track-tabs.js +204 -0
- package/dist/timeline/timeline-track-tabs.js.map +1 -0
- package/dist/timeline/types.d.ts +144 -0
- package/dist/timeline/types.d.ts.map +1 -0
- package/dist/timeline/types.js +3 -0
- package/dist/timeline/types.js.map +1 -0
- package/dist/tree/index.d.ts +5 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/index.js +5 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/tree-base.d.ts +70 -0
- package/dist/tree/tree-base.d.ts.map +1 -0
- package/dist/tree/tree-base.js +1028 -0
- package/dist/tree/tree-base.js.map +1 -0
- package/dist/tree/tree-controller.d.ts +14 -0
- package/dist/tree/tree-controller.d.ts.map +1 -0
- package/dist/tree/tree-controller.js +96 -0
- package/dist/tree/tree-controller.js.map +1 -0
- package/dist/tree/tree-list.d.ts +20 -0
- package/dist/tree/tree-list.d.ts.map +1 -0
- package/dist/tree/tree-list.js +174 -0
- package/dist/tree/tree-list.js.map +1 -0
- package/dist/tree/types.d.ts +14 -0
- package/dist/tree/types.d.ts.map +1 -0
- package/dist/tree/types.js +7 -0
- package/dist/tree/types.js.map +1 -0
- package/dist/util/checkbox.d.ts +2 -0
- package/dist/util/checkbox.d.ts.map +1 -0
- package/dist/util/checkbox.js +69 -0
- package/dist/util/checkbox.js.map +1 -0
- package/dist/util/circle-arc.d.ts +6 -6
- package/dist/util/circle-arc.d.ts.map +1 -1
- package/dist/util/circle-arc.js +28 -20
- package/dist/util/circle-arc.js.map +1 -1
- package/dist/util/clamp.d.ts +4 -0
- package/dist/util/clamp.d.ts.map +1 -0
- package/dist/util/clamp.js +23 -0
- package/dist/util/clamp.js.map +1 -0
- package/dist/util/compare.d.ts +8 -8
- package/dist/util/compare.d.ts.map +1 -1
- package/dist/util/compare.js +13 -13
- package/dist/util/compare.js.map +1 -1
- package/dist/util/content-editable.d.ts +1 -1
- package/dist/util/content-editable.d.ts.map +1 -1
- package/dist/util/content-editable.js +2 -2
- package/dist/util/content-editable.js.map +1 -1
- package/dist/util/coordinates.d.ts +3 -0
- package/dist/util/coordinates.d.ts.map +1 -0
- package/dist/util/coordinates.js +11 -0
- package/dist/util/coordinates.js.map +1 -0
- package/dist/util/drag.d.ts +16 -0
- package/dist/util/drag.d.ts.map +1 -0
- package/dist/util/drag.js +20 -0
- package/dist/util/drag.js.map +1 -0
- package/dist/util/is-numeric.d.ts +2 -0
- package/dist/util/is-numeric.d.ts.map +1 -0
- package/dist/util/is-numeric.js +9 -0
- package/dist/util/is-numeric.js.map +1 -0
- package/dist/util/key-value.d.ts +2 -2
- package/dist/util/key-value.d.ts.map +1 -1
- package/dist/util/key-value.js +4 -5
- package/dist/util/key-value.js.map +1 -1
- package/dist/util/near.d.ts +2 -0
- package/dist/util/near.d.ts.map +1 -0
- package/dist/util/near.js +6 -0
- package/dist/util/near.js.map +1 -0
- package/dist/util/svg-editable-text.d.ts +6 -2
- package/dist/util/svg-editable-text.d.ts.map +1 -1
- package/dist/util/svg-editable-text.js +5 -7
- package/dist/util/svg-editable-text.js.map +1 -1
- package/dist/util/time.d.ts.map +1 -1
- package/dist/util/time.js +1 -1
- package/dist/util/time.js.map +1 -1
- package/dist/util/tooltip-controller.d.ts +10 -0
- package/dist/util/tooltip-controller.d.ts.map +1 -0
- package/dist/util/tooltip-controller.js +237 -0
- package/dist/util/tooltip-controller.js.map +1 -0
- package/dist/util/tooltip.d.ts +21 -0
- package/dist/util/tooltip.d.ts.map +1 -0
- package/dist/util/tooltip.js +98 -0
- package/dist/util/tooltip.js.map +1 -0
- package/dist/util/value-drag.d.ts +33 -0
- package/dist/util/value-drag.d.ts.map +1 -0
- package/dist/util/value-drag.js +154 -0
- package/dist/util/value-drag.js.map +1 -0
- package/dist/xy-pad.d.ts +117 -0
- package/dist/xy-pad.d.ts.map +1 -0
- package/dist/xy-pad.js +455 -0
- package/dist/xy-pad.js.map +1 -0
- package/package.json +47 -30
- package/README.md +0 -14
- package/dist/charts/frequency-histogram-plot.d.ts +0 -33
- package/dist/charts/frequency-histogram-plot.d.ts.map +0 -1
- package/dist/charts/frequency-histogram-plot.js +0 -54
- package/dist/charts/frequency-histogram-plot.js.map +0 -1
- package/dist/charts/histogram-vis.d.ts +0 -57
- package/dist/charts/histogram-vis.d.ts.map +0 -1
- package/dist/charts/histogram-vis.js +0 -222
- package/dist/charts/histogram-vis.js.map +0 -1
- package/dist/charts/plot.d.ts +0 -199
- package/dist/charts/plot.d.ts.map +0 -1
- package/dist/charts/plot.js +0 -916
- package/dist/charts/plot.js.map +0 -1
- package/dist/crumb-nav.d.ts +0 -41
- package/dist/crumb-nav.d.ts.map +0 -1
- package/dist/crumb-nav.js +0 -198
- package/dist/crumb-nav.js.map +0 -1
- package/dist/crumb-navigation.d.ts +0 -30
- package/dist/crumb-navigation.d.ts.map +0 -1
- package/dist/crumb-navigation.js +0 -307
- package/dist/crumb-navigation.js.map +0 -1
- package/dist/dial.d.ts +0 -89
- package/dist/dial.d.ts.map +0 -1
- package/dist/dial.js +0 -506
- package/dist/dial.js.map +0 -1
- package/dist/util/drag-controller.d.ts +0 -13
- package/dist/util/drag-controller.d.ts.map +0 -1
- package/dist/util/drag-controller.js +0 -21
- package/dist/util/drag-controller.js.map +0 -1
package/dist/charts/plot.js
DELETED
|
@@ -1,916 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { css, html, LitElement } from "lit";
|
|
8
|
-
import { customElement, property } from "lit/decorators.js";
|
|
9
|
-
import { createRef, ref } from "lit/directives/ref.js";
|
|
10
|
-
import { CanvasHelper } from "ixfx/visual.js";
|
|
11
|
-
import { Rects } from "ixfx/geometry.js";
|
|
12
|
-
import * as Arrays from 'ixfx/arrays.js';
|
|
13
|
-
import * as Numbers from 'ixfx/numbers.js';
|
|
14
|
-
import { getCssVariable } from 'ixfx/dom.js';
|
|
15
|
-
import { Drawing, Colour } from "ixfx/visual.js";
|
|
16
|
-
import { Flow, Pathed } from 'ixfx';
|
|
17
|
-
const rangeIsEqual = (a, b) => {
|
|
18
|
-
if (a === undefined || b === undefined)
|
|
19
|
-
return false;
|
|
20
|
-
return (a.max === b.max && a.min === b.min);
|
|
21
|
-
};
|
|
22
|
-
export class PlotAxis {
|
|
23
|
-
// units: Readonly<{ major: number, minor: number }> = { major: Number.NaN, minor: Number.NaN }
|
|
24
|
-
// altAxisCrossing: AxisCrossing<T> = { at: `min` }
|
|
25
|
-
// ticks: TickMarks = { major: `inside`, minor: `inside` }
|
|
26
|
-
// labels: AxisLabels = `axis`;
|
|
27
|
-
#currentScalerRange;
|
|
28
|
-
#persistentScale;
|
|
29
|
-
#currentScaler;
|
|
30
|
-
constructor(name) {
|
|
31
|
-
this.name = name;
|
|
32
|
-
this.bounds = `auto`;
|
|
33
|
-
this.#persistentScale = Numbers.rangeInit();
|
|
34
|
-
this.#currentScaler = (v) => v;
|
|
35
|
-
}
|
|
36
|
-
humanFormatValue(value) {
|
|
37
|
-
if (value.length === 0)
|
|
38
|
-
return ``;
|
|
39
|
-
const v = value[0];
|
|
40
|
-
if (v < 2)
|
|
41
|
-
return v.toFixed(2);
|
|
42
|
-
return v.toString();
|
|
43
|
-
}
|
|
44
|
-
getRange(series) {
|
|
45
|
-
if (this.bounds === `auto`)
|
|
46
|
-
return this.computeActualRange(series);
|
|
47
|
-
if (this.bounds === `auto-persistent`) {
|
|
48
|
-
const r = this.computeActualRange(series);
|
|
49
|
-
this.#persistentScale = Numbers.rangeMergeRange(r, this.#persistentScale);
|
|
50
|
-
return this.#persistentScale;
|
|
51
|
-
}
|
|
52
|
-
return this.bounds;
|
|
53
|
-
}
|
|
54
|
-
getCurrentRange() {
|
|
55
|
-
return this.#currentScalerRange;
|
|
56
|
-
}
|
|
57
|
-
getValueScaler(series) {
|
|
58
|
-
const r = this.getRange(series);
|
|
59
|
-
if (!rangeIsEqual(r, this.#currentScalerRange)) {
|
|
60
|
-
this.#currentScalerRange = r;
|
|
61
|
-
this.#currentScaler = Numbers.scaler(r.min, r.max, 0, 1);
|
|
62
|
-
}
|
|
63
|
-
return this.#currentScaler;
|
|
64
|
-
}
|
|
65
|
-
computeActualRange(seriesOnAxis, column = 0) {
|
|
66
|
-
let min = Number.MAX_SAFE_INTEGER;
|
|
67
|
-
let max = Number.MIN_SAFE_INTEGER;
|
|
68
|
-
let count = 0;
|
|
69
|
-
for (const s of seriesOnAxis) {
|
|
70
|
-
for (const [v, _index] of s.getValuesForColumn(column)) {
|
|
71
|
-
if (typeof v !== `number`)
|
|
72
|
-
continue;
|
|
73
|
-
if (Number.isNaN(v))
|
|
74
|
-
continue;
|
|
75
|
-
if (v < min)
|
|
76
|
-
min = v;
|
|
77
|
-
if (v > max)
|
|
78
|
-
max = v;
|
|
79
|
-
}
|
|
80
|
-
count++;
|
|
81
|
-
}
|
|
82
|
-
return { min, max };
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Attributes
|
|
87
|
-
* * streaming: true/false (default: true)
|
|
88
|
-
* * max-length: number (default: 500). How many data points per series to store
|
|
89
|
-
* * data-width: when streaming, how much horizontal width per point
|
|
90
|
-
* * fixed-max/fixed-min: global input scaling (default: NaN, ie. disabled)
|
|
91
|
-
*
|
|
92
|
-
* * line-width: stroke width of drawing line (default:2)
|
|
93
|
-
*
|
|
94
|
-
* * render: 'dot', 'line' or 'bar'(default: 'dot')
|
|
95
|
-
* * hide-legend: If added, legend is not shown
|
|
96
|
-
* * manual-draw: If added, automatic drawning is disabled
|
|
97
|
-
*
|
|
98
|
-
* Styling variables
|
|
99
|
-
* * --legend-fg: legend foreground text
|
|
100
|
-
*/
|
|
101
|
-
let PlotElement = class PlotElement extends LitElement {
|
|
102
|
-
constructor() {
|
|
103
|
-
//@property({ attribute: `streaming`, type: Boolean })
|
|
104
|
-
//streaming = true;
|
|
105
|
-
super(...arguments);
|
|
106
|
-
this.hideLegend = false;
|
|
107
|
-
//@property({ attribute: `max-length`, type: Number })
|
|
108
|
-
//maxLength = 500;
|
|
109
|
-
//@property({ attribute: `data-width`, type: Number })
|
|
110
|
-
//dataWidth = 5;
|
|
111
|
-
//@property({ attribute: `fixed-max`, type: Number })
|
|
112
|
-
//fixedMax = Number.NaN;
|
|
113
|
-
//@property({ attribute: `fixed-min`, type: Number })
|
|
114
|
-
//fixedMin = Number.NaN;
|
|
115
|
-
//@property({ attribute: `line-width`, type: Number })
|
|
116
|
-
//lineWidth = 2;
|
|
117
|
-
this.renderStyle = `dot`;
|
|
118
|
-
//@property({ attribute: `manual-draw`, type: Boolean })
|
|
119
|
-
//manualDraw = false;
|
|
120
|
-
this.padding = 5;
|
|
121
|
-
this.primaryAxis = new PlotAxis(`primary`);
|
|
122
|
-
this.secondaryAxis = new PlotAxis(`secondary`);
|
|
123
|
-
this.paused = false;
|
|
124
|
-
this.plotAreaFormat = {
|
|
125
|
-
fill: { type: `none` },
|
|
126
|
-
outline: { type: `none` }
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* Settings used for automatically generating series colour
|
|
130
|
-
*/
|
|
131
|
-
this.automaticSeriesColour = {
|
|
132
|
-
saturation: 1,
|
|
133
|
-
lightness: 0.5,
|
|
134
|
-
alpha: 1
|
|
135
|
-
};
|
|
136
|
-
this.seriesDefault = {};
|
|
137
|
-
this.#series = new Map();
|
|
138
|
-
this.#legendColour = ``;
|
|
139
|
-
this.#autoSeriesColour = 0;
|
|
140
|
-
this.#hitboxes = [];
|
|
141
|
-
this.#seriesFormatting = new Map();
|
|
142
|
-
this.#swatchSize = 10;
|
|
143
|
-
this.canvasEl = createRef();
|
|
144
|
-
this.tooltipEl = createRef();
|
|
145
|
-
this.#drawThrottled = Flow.throttle(() => this.#drawImpl(), 100);
|
|
146
|
-
this.seriesColourGenerate = (_seriesName) => {
|
|
147
|
-
const c = Colour.goldenAngleColour(this.#autoSeriesColour, this.automaticSeriesColour.saturation, this.automaticSeriesColour.lightness, this.automaticSeriesColour.alpha);
|
|
148
|
-
this.#autoSeriesColour++;
|
|
149
|
-
return c;
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
#series;
|
|
153
|
-
#canvas;
|
|
154
|
-
#drawing;
|
|
155
|
-
#legendColour;
|
|
156
|
-
#autoSeriesColour;
|
|
157
|
-
#hitboxes;
|
|
158
|
-
#seriesFormatting;
|
|
159
|
-
#swatchSize;
|
|
160
|
-
#drawThrottled;
|
|
161
|
-
setDrawDebounce(millis) {
|
|
162
|
-
this.#drawThrottled = Flow.throttle(() => this.#drawImpl(), millis);
|
|
163
|
-
}
|
|
164
|
-
get series() {
|
|
165
|
-
return [...this.#series.values()];
|
|
166
|
-
}
|
|
167
|
-
get seriesCount() {
|
|
168
|
-
return this.#series.size;
|
|
169
|
-
}
|
|
170
|
-
getSeriesFormatting(seriesName, createIfNeeded) {
|
|
171
|
-
let f = this.#seriesFormatting.get(seriesName);
|
|
172
|
-
if (!f && createIfNeeded) {
|
|
173
|
-
f = {
|
|
174
|
-
axis: `primary`,
|
|
175
|
-
fill: {
|
|
176
|
-
colour: this.seriesColourGenerate(seriesName),
|
|
177
|
-
type: `solid`
|
|
178
|
-
},
|
|
179
|
-
outline: {
|
|
180
|
-
type: `none`
|
|
181
|
-
},
|
|
182
|
-
bar: {
|
|
183
|
-
gapWidth: 3
|
|
184
|
-
},
|
|
185
|
-
dot: {
|
|
186
|
-
gapWidth: 0,
|
|
187
|
-
radius: `automatic`
|
|
188
|
-
},
|
|
189
|
-
line: {
|
|
190
|
-
width: 2,
|
|
191
|
-
cap: `round`,
|
|
192
|
-
join: `round`
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
this.#seriesFormatting.set(seriesName, f);
|
|
196
|
-
}
|
|
197
|
-
return f;
|
|
198
|
-
}
|
|
199
|
-
setSeriesFormatting(seriesName, formatting) {
|
|
200
|
-
let existing = this.getSeriesFormatting(seriesName, true);
|
|
201
|
-
const combined = {
|
|
202
|
-
...existing,
|
|
203
|
-
...formatting
|
|
204
|
-
};
|
|
205
|
-
combined.fill = resolveFillDrawStyle(combined.fill);
|
|
206
|
-
combined.outline = resolveOutlineDrawStyle(combined.outline);
|
|
207
|
-
this.#seriesFormatting.set(seriesName, combined);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Returns a `PlotElement` instance based on a query
|
|
211
|
-
* ```js
|
|
212
|
-
* PlotElement.fromQuery(`#someplot`); // PlotElement
|
|
213
|
-
* ```
|
|
214
|
-
*
|
|
215
|
-
* Throws an error if query does not match.
|
|
216
|
-
* @param query
|
|
217
|
-
* @returns
|
|
218
|
-
*/
|
|
219
|
-
static fromQuery(query) {
|
|
220
|
-
const el = document.querySelector(query);
|
|
221
|
-
if (!el)
|
|
222
|
-
throw new Error(`Query does not match an element`);
|
|
223
|
-
if (el.nodeName === 'IXFX-PLOT-ELEMENT')
|
|
224
|
-
return el;
|
|
225
|
-
throw new Error(`Element is not a PlotElement ('${el.nodeName}')`);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Delete a series.
|
|
229
|
-
* Returns _true_ if there was a series to delete
|
|
230
|
-
* @param name
|
|
231
|
-
* @returns
|
|
232
|
-
*/
|
|
233
|
-
deleteSeries(name) {
|
|
234
|
-
name = name.toLowerCase();
|
|
235
|
-
const s = this.#series.get(name);
|
|
236
|
-
if (!s)
|
|
237
|
-
return false;
|
|
238
|
-
this.#series.delete(name);
|
|
239
|
-
return true;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Keeps the series, but deletes its data
|
|
243
|
-
* @param name
|
|
244
|
-
* @returns
|
|
245
|
-
*/
|
|
246
|
-
clearSeries(name) {
|
|
247
|
-
name = name.toLowerCase();
|
|
248
|
-
const s = this.#series.get(name);
|
|
249
|
-
if (!s)
|
|
250
|
-
return false;
|
|
251
|
-
this.#series.clear();
|
|
252
|
-
return true;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Delete all data & series
|
|
256
|
-
*/
|
|
257
|
-
clear() {
|
|
258
|
-
this.#series.clear();
|
|
259
|
-
this.#autoSeriesColour = 0;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Keeps all series, but deletes their data
|
|
263
|
-
*/
|
|
264
|
-
clearData() {
|
|
265
|
-
for (const s of this.#series.values()) {
|
|
266
|
-
s.clear();
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
#lastPointerPosition;
|
|
270
|
-
#onPointerLeave() {
|
|
271
|
-
this.#lastPointerPosition = undefined;
|
|
272
|
-
this.#hideTooltip();
|
|
273
|
-
}
|
|
274
|
-
#onPointerMove(event) {
|
|
275
|
-
this.#lastPointerPosition = {
|
|
276
|
-
x: event.offsetX,
|
|
277
|
-
screenX: event.x,
|
|
278
|
-
y: event.offsetY,
|
|
279
|
-
screenY: event.y
|
|
280
|
-
};
|
|
281
|
-
this.#updateToolTip();
|
|
282
|
-
}
|
|
283
|
-
#updateToolTip() {
|
|
284
|
-
if (!this.#lastPointerPosition)
|
|
285
|
-
return;
|
|
286
|
-
for (const hb of this.#hitboxes) {
|
|
287
|
-
if (hb.width <= 0)
|
|
288
|
-
continue;
|
|
289
|
-
if (Rects.intersectsPoint(hb, this.#lastPointerPosition)) {
|
|
290
|
-
if (hb.value) {
|
|
291
|
-
this.#setTooltip(hb.series.humanFormatValue(hb.value));
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
this.#setTooltip(``);
|
|
295
|
-
}
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
this.#hideTooltip();
|
|
300
|
-
}
|
|
301
|
-
#hideTooltip() {
|
|
302
|
-
const v = this.tooltipEl.value;
|
|
303
|
-
if (!v)
|
|
304
|
-
return;
|
|
305
|
-
v.classList.add(`hidden`);
|
|
306
|
-
}
|
|
307
|
-
#setTooltip(innerHtml) {
|
|
308
|
-
const v = this.tooltipEl.value;
|
|
309
|
-
if (!v)
|
|
310
|
-
return;
|
|
311
|
-
const pos = this.#lastPointerPosition;
|
|
312
|
-
v.classList.remove(`hidden`);
|
|
313
|
-
const offset = 10;
|
|
314
|
-
v.innerHTML = innerHtml;
|
|
315
|
-
if (pos) {
|
|
316
|
-
v.style.left = `${pos.screenX + offset}px`;
|
|
317
|
-
v.style.top = `${pos.screenY + offset}px`;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
#setupCanvas() {
|
|
321
|
-
if (this.#canvas !== undefined)
|
|
322
|
-
return this.#canvas;
|
|
323
|
-
const canvas = this.canvasEl.value; // this.shadowRoot?.querySelector(`canvas`);
|
|
324
|
-
if (!canvas)
|
|
325
|
-
throw new Error(`canvas element not found`);
|
|
326
|
-
const c = new CanvasHelper(canvas);
|
|
327
|
-
this.#canvas = c;
|
|
328
|
-
this.#drawing = Drawing.makeHelper(c.ctx);
|
|
329
|
-
return c;
|
|
330
|
-
}
|
|
331
|
-
connectedCallback() {
|
|
332
|
-
super.connectedCallback();
|
|
333
|
-
}
|
|
334
|
-
firstUpdated(_changedProperties) {
|
|
335
|
-
const ro = new ResizeObserver((event) => {
|
|
336
|
-
const c = this.#setupCanvas();
|
|
337
|
-
if (!c)
|
|
338
|
-
return;
|
|
339
|
-
const entry = event[0];
|
|
340
|
-
c.setLogicalSize(entry.contentRect);
|
|
341
|
-
if (this.#hasDirty()) {
|
|
342
|
-
this.#drawImpl();
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
ro.observe(this);
|
|
346
|
-
this.updateColours();
|
|
347
|
-
//this.#setupCanvas();
|
|
348
|
-
}
|
|
349
|
-
#hasDirty() {
|
|
350
|
-
for (const s of this.series.values()) {
|
|
351
|
-
if (s.isDirty)
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
return false;
|
|
355
|
-
}
|
|
356
|
-
updateColours() {
|
|
357
|
-
this.#legendColour = getCssVariable(`legend-fg`, `black`);
|
|
358
|
-
}
|
|
359
|
-
setRawValues(values, seriesName, automaticallyDraw) {
|
|
360
|
-
if (!Array.isArray(values))
|
|
361
|
-
throw new TypeError(`Param 'values' is not an array`);
|
|
362
|
-
let s = this.getOrCreateSeries(seriesName);
|
|
363
|
-
s.setRawValues(values, automaticallyDraw);
|
|
364
|
-
return s;
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Treats each property of an object as the series name
|
|
368
|
-
* @param value
|
|
369
|
-
* @param automaticallyDraw
|
|
370
|
-
*/
|
|
371
|
-
appendObjectBySeries(value, automaticallyDraw) {
|
|
372
|
-
for (const p of Pathed.getPathsAndData(value, true)) {
|
|
373
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
374
|
-
const v = p.value;
|
|
375
|
-
if (typeof v === `number`) {
|
|
376
|
-
this.appendRawValues(v, p.path, false);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
if (automaticallyDraw)
|
|
380
|
-
this.draw();
|
|
381
|
-
}
|
|
382
|
-
appendRawValues(values, seriesName, automaticallyDraw) {
|
|
383
|
-
if (!Array.isArray(values))
|
|
384
|
-
values = [values];
|
|
385
|
-
let s = this.getOrCreateSeries(seriesName);
|
|
386
|
-
for (const v of values) {
|
|
387
|
-
s.pushValue(v, false);
|
|
388
|
-
}
|
|
389
|
-
if (automaticallyDraw)
|
|
390
|
-
this.draw();
|
|
391
|
-
}
|
|
392
|
-
draw(force = false) {
|
|
393
|
-
if (force) {
|
|
394
|
-
this.#drawImpl();
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
void this.#drawThrottled();
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
#drawImpl() {
|
|
401
|
-
if (this.paused)
|
|
402
|
-
return;
|
|
403
|
-
const c = this.#canvas;
|
|
404
|
-
const d = this.#drawing;
|
|
405
|
-
const padding = this.padding;
|
|
406
|
-
if (!d || !c) {
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
c.clear();
|
|
410
|
-
const ctx = d.ctx;
|
|
411
|
-
const axisYwidth = this.computeAxisYWidth(c);
|
|
412
|
-
const remainingWidth = c.width - axisYwidth;
|
|
413
|
-
const clLegend = this.computeLegend(c, remainingWidth, padding);
|
|
414
|
-
const plotHeight = c.height - clLegend.bounds.height - padding;
|
|
415
|
-
const cy = { width: axisYwidth, height: plotHeight };
|
|
416
|
-
const plotDataArea = this.calculatePlotDataArea(c, plotHeight, cy.width, padding);
|
|
417
|
-
const cl = { ...clLegend.bounds, x: cy.width, y: plotDataArea.y + plotDataArea.height + padding };
|
|
418
|
-
// Draw legend
|
|
419
|
-
if (!this.hideLegend) {
|
|
420
|
-
ctx.save();
|
|
421
|
-
ctx.translate(cl.x + padding, cl.y + padding);
|
|
422
|
-
this.drawLegend(cl, d);
|
|
423
|
-
ctx.restore();
|
|
424
|
-
}
|
|
425
|
-
ctx.save();
|
|
426
|
-
ctx.translate(plotDataArea.x + padding, plotDataArea.y + padding);
|
|
427
|
-
if (this.plotAreaFormat.fill.type === `solid`) {
|
|
428
|
-
ctx.fillStyle = Colour.resolveCss(this.plotAreaFormat.fill.colour);
|
|
429
|
-
ctx.fillRect(0, 0, plotDataArea.width, plotDataArea.height);
|
|
430
|
-
}
|
|
431
|
-
if (this.plotAreaFormat.outline.type === `solid`) {
|
|
432
|
-
ctx.strokeStyle = Colour.resolveCss(this.plotAreaFormat.outline.colour);
|
|
433
|
-
ctx.strokeRect(0, 0, plotDataArea.width, plotDataArea.height);
|
|
434
|
-
}
|
|
435
|
-
// Compute axis scaling
|
|
436
|
-
const primaryAxisS = this.primaryAxis.getValueScaler(this.#series.values().filter(s => s.onPrimaryAxis));
|
|
437
|
-
const secondaryAxisAxisS = this.secondaryAxis.getValueScaler(this.#series.values().filter(s => !s.onPrimaryAxis));
|
|
438
|
-
// Draw data
|
|
439
|
-
this.#hitboxes = [];
|
|
440
|
-
for (const series of this.#series.values()) {
|
|
441
|
-
switch (this.renderStyle) {
|
|
442
|
-
case `line`: {
|
|
443
|
-
this.#drawLineSeries(series, d, series.onPrimaryAxis ? primaryAxisS : secondaryAxisAxisS, plotDataArea, { x: padding, y: padding });
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
case `bar`: {
|
|
447
|
-
this.#drawBarSeries(series, d, series.onPrimaryAxis ? primaryAxisS : secondaryAxisAxisS, plotDataArea, { x: padding, y: padding });
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
default: {
|
|
451
|
-
this.#drawDotSeries(series, d, series.onPrimaryAxis ? primaryAxisS : secondaryAxisAxisS, plotDataArea, { x: padding, y: padding });
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
series.isDirty = false;
|
|
455
|
-
}
|
|
456
|
-
ctx.restore();
|
|
457
|
-
this.#updateToolTip();
|
|
458
|
-
}
|
|
459
|
-
drawLegend(cl, d) {
|
|
460
|
-
const textColour = this.#legendColour;
|
|
461
|
-
const padding = this.padding;
|
|
462
|
-
let x = 0;
|
|
463
|
-
let y = padding;
|
|
464
|
-
const swatchSize = 10;
|
|
465
|
-
const ctx = d.ctx;
|
|
466
|
-
for (const series of this.#series.values()) {
|
|
467
|
-
const f = series.getFormatting();
|
|
468
|
-
const colour = (f.fill.type === `solid`) ? f.fill.colour : `transparent`;
|
|
469
|
-
ctx.fillStyle = Colour.toCssColour(colour);
|
|
470
|
-
ctx.fillRect(x, y, swatchSize, swatchSize);
|
|
471
|
-
ctx.fillStyle = textColour;
|
|
472
|
-
x += swatchSize + padding;
|
|
473
|
-
const m = ctx.measureText(series.name);
|
|
474
|
-
ctx.textBaseline = `middle`;
|
|
475
|
-
ctx.fillText(series.name, x, y + swatchSize / 2);
|
|
476
|
-
x += m.width + padding;
|
|
477
|
-
if (x >= cl.width) {
|
|
478
|
-
y += 10 + padding;
|
|
479
|
-
x = 0;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
// #drawBarSeries(data: number[], cp: Rect, d: DrawingHelper, series: PlotSeries) {
|
|
484
|
-
// const barWidth = this.streaming ? this.dataWidth : (cp.width / data.length);
|
|
485
|
-
// const formatting = series.getFormatting();
|
|
486
|
-
// let x = 0;
|
|
487
|
-
// if (this.streaming) x = cp.width - (barWidth * data.length);
|
|
488
|
-
// const rects = data.map(d => {
|
|
489
|
-
// x += barWidth;
|
|
490
|
-
// const h = (d) * cp.height;
|
|
491
|
-
// return {
|
|
492
|
-
// x: x,
|
|
493
|
-
// y: cp.height - h,
|
|
494
|
-
// height: h,
|
|
495
|
-
// width: barWidth,
|
|
496
|
-
// value: d
|
|
497
|
-
// };
|
|
498
|
-
// })
|
|
499
|
-
// this.#hitboxes = rects.map(r => {
|
|
500
|
-
// return {
|
|
501
|
-
// ...r,
|
|
502
|
-
// series: series.name
|
|
503
|
-
// }
|
|
504
|
-
// })
|
|
505
|
-
// let drawOptions: { stroke: boolean, filled: boolean, strokeWidth?: number, strokeStyle?: string, fillStyle?: string } = {
|
|
506
|
-
// stroke: false,
|
|
507
|
-
// filled: false
|
|
508
|
-
// }
|
|
509
|
-
// if (formatting.outline.type === `solid`) {
|
|
510
|
-
// drawOptions.stroke = true;
|
|
511
|
-
// drawOptions.strokeStyle = formatting.outline.colour;
|
|
512
|
-
// drawOptions.strokeWidth = 1;
|
|
513
|
-
// }
|
|
514
|
-
// if (formatting.fill.type === `solid`) {
|
|
515
|
-
// drawOptions.filled = true;
|
|
516
|
-
// drawOptions.fillStyle = formatting.fill.colour;
|
|
517
|
-
// }
|
|
518
|
-
// d.rect(rects, drawOptions);
|
|
519
|
-
// }
|
|
520
|
-
#drawLineSeries(series, d, scaler, plotDataArea, plotDataAreaOffset) {
|
|
521
|
-
const formatting = series.getFormatting();
|
|
522
|
-
const lineFormatting = formatting.line;
|
|
523
|
-
const widthPerValue = plotDataArea.width / series.length;
|
|
524
|
-
const xOffset = widthPerValue / 2;
|
|
525
|
-
const lineThickness = lineFormatting.width;
|
|
526
|
-
const lineThicknessHalf = lineThickness / 2;
|
|
527
|
-
const h = plotDataArea.height;
|
|
528
|
-
let x = 0;
|
|
529
|
-
const dotsToDraw = [...series.getValuesForColumn(0)].map(d => {
|
|
530
|
-
const [value, index] = d;
|
|
531
|
-
x += widthPerValue;
|
|
532
|
-
const scaledValue = scaler(value);
|
|
533
|
-
if (Number.isNaN(value))
|
|
534
|
-
return undefined;
|
|
535
|
-
return {
|
|
536
|
-
x: x - xOffset,
|
|
537
|
-
y: (1 - scaledValue) * h,
|
|
538
|
-
value, index
|
|
539
|
-
};
|
|
540
|
-
});
|
|
541
|
-
const filtered = dotsToDraw.filter(f => f !== undefined);
|
|
542
|
-
const hitboxes = filtered.map(d => ({
|
|
543
|
-
height: lineThickness,
|
|
544
|
-
width: widthPerValue,
|
|
545
|
-
x: plotDataAreaOffset.x + d.x - lineThicknessHalf,
|
|
546
|
-
y: plotDataAreaOffset.y + d.y - lineThicknessHalf,
|
|
547
|
-
series,
|
|
548
|
-
index: d.index,
|
|
549
|
-
value: series.getValue(d.index),
|
|
550
|
-
}));
|
|
551
|
-
this.#hitboxes.push(...hitboxes);
|
|
552
|
-
const drawOpts = {
|
|
553
|
-
filled: false,
|
|
554
|
-
fillStyle: `transparent`,
|
|
555
|
-
stroked: true,
|
|
556
|
-
strokeStyle: `black`,
|
|
557
|
-
strokeWidth: lineFormatting.width
|
|
558
|
-
};
|
|
559
|
-
if (formatting.outline.type === `solid`) {
|
|
560
|
-
drawOpts.strokeStyle = formatting.outline.colour;
|
|
561
|
-
}
|
|
562
|
-
else if (formatting.fill.type === `solid`) {
|
|
563
|
-
drawOpts.strokeStyle = formatting.fill.colour;
|
|
564
|
-
}
|
|
565
|
-
d.ctx.lineWidth = lineFormatting.width;
|
|
566
|
-
d.ctx.lineCap = lineFormatting.cap;
|
|
567
|
-
d.ctx.lineJoin = lineFormatting.join;
|
|
568
|
-
d.connectedPoints(filtered, drawOpts);
|
|
569
|
-
//d.textBlock([ `hello` ], { fillStyle: `black`, anchor: { x: 1, y: 1 } })
|
|
570
|
-
}
|
|
571
|
-
#drawDotSeries(series, d, scaler, plotDataArea, plotDataAreaOffset) {
|
|
572
|
-
const formatting = series.getFormatting();
|
|
573
|
-
const dotFormatting = formatting.dot;
|
|
574
|
-
const widthPerValue = plotDataArea.width / series.length;
|
|
575
|
-
const radius = dotFormatting.radius === `automatic` ? widthPerValue * 0.3 : dotFormatting.radius;
|
|
576
|
-
const xOffset = widthPerValue / 2;
|
|
577
|
-
const h = plotDataArea.height;
|
|
578
|
-
let x = 0;
|
|
579
|
-
const dotsToDraw = [...series.getValuesForColumn(0)].map(d => {
|
|
580
|
-
const [value, index] = d;
|
|
581
|
-
x += widthPerValue;
|
|
582
|
-
const scaledValue = scaler(value);
|
|
583
|
-
if (Number.isNaN(value))
|
|
584
|
-
return undefined;
|
|
585
|
-
return {
|
|
586
|
-
x: x - xOffset,
|
|
587
|
-
y: (1 - scaledValue) * h,
|
|
588
|
-
radius: radius,
|
|
589
|
-
value, index
|
|
590
|
-
};
|
|
591
|
-
});
|
|
592
|
-
const filtered = dotsToDraw.filter(f => f !== undefined);
|
|
593
|
-
const hitboxes = filtered.map(d => ({
|
|
594
|
-
height: d.radius * 2,
|
|
595
|
-
width: d.radius * 2,
|
|
596
|
-
x: plotDataAreaOffset.x + d.x - d.radius,
|
|
597
|
-
y: plotDataAreaOffset.y + d.y - d.radius,
|
|
598
|
-
series,
|
|
599
|
-
index: d.index,
|
|
600
|
-
value: series.getValue(d.index),
|
|
601
|
-
}));
|
|
602
|
-
this.#hitboxes.push(...hitboxes);
|
|
603
|
-
const drawOpts = { filled: false, fillStyle: `transparent`, stroked: false, strokeStyle: `transparent` };
|
|
604
|
-
if (formatting.fill.type === `solid`) {
|
|
605
|
-
drawOpts.filled = true;
|
|
606
|
-
drawOpts.fillStyle = formatting.fill.colour;
|
|
607
|
-
}
|
|
608
|
-
if (formatting.outline.type === `solid`) {
|
|
609
|
-
drawOpts.stroked = true;
|
|
610
|
-
drawOpts.strokeStyle = formatting.outline.colour;
|
|
611
|
-
}
|
|
612
|
-
d.dot(filtered, drawOpts);
|
|
613
|
-
//d.textBlock([ `hello` ], { fillStyle: `black`, anchor: { x: 1, y: 1 } })
|
|
614
|
-
}
|
|
615
|
-
#drawBarSeries(series, d, scaler, plotDataArea, plotDataAreaOffset) {
|
|
616
|
-
const formatting = series.getFormatting();
|
|
617
|
-
const barFormatting = formatting.bar;
|
|
618
|
-
const widthPerValue = plotDataArea.width / series.length;
|
|
619
|
-
const rectWidth = widthPerValue - (barFormatting.gapWidth / 2);
|
|
620
|
-
const xOffset = widthPerValue / 2;
|
|
621
|
-
const h = plotDataArea.height;
|
|
622
|
-
let x = 0;
|
|
623
|
-
const rectsToDraw = [...series.getValuesForColumn(0)].map(d => {
|
|
624
|
-
const [value, index] = d;
|
|
625
|
-
x += widthPerValue;
|
|
626
|
-
const scaledValue = scaler(value);
|
|
627
|
-
if (Number.isNaN(value))
|
|
628
|
-
return undefined;
|
|
629
|
-
const barHeight = scaledValue * h;
|
|
630
|
-
return {
|
|
631
|
-
x: x - xOffset,
|
|
632
|
-
y: h - barHeight,
|
|
633
|
-
width: rectWidth,
|
|
634
|
-
height: barHeight,
|
|
635
|
-
value, index
|
|
636
|
-
};
|
|
637
|
-
});
|
|
638
|
-
const filtered = rectsToDraw.filter(f => f !== undefined);
|
|
639
|
-
const hitboxes = filtered.map(d => ({
|
|
640
|
-
height: Math.max(5, d.height),
|
|
641
|
-
width: d.width,
|
|
642
|
-
x: plotDataAreaOffset.x + d.x,
|
|
643
|
-
y: plotDataAreaOffset.y + d.y,
|
|
644
|
-
series,
|
|
645
|
-
index: d.index,
|
|
646
|
-
value: series.getValue(d.index),
|
|
647
|
-
}));
|
|
648
|
-
this.#hitboxes.push(...hitboxes);
|
|
649
|
-
const drawOpts = { filled: false, fillStyle: `transparent`, stroked: false, strokeStyle: `transparent` };
|
|
650
|
-
if (formatting.fill.type === `solid`) {
|
|
651
|
-
drawOpts.filled = true;
|
|
652
|
-
drawOpts.fillStyle = formatting.fill.colour;
|
|
653
|
-
}
|
|
654
|
-
if (formatting.outline.type === `solid`) {
|
|
655
|
-
drawOpts.stroked = true;
|
|
656
|
-
drawOpts.strokeStyle = formatting.outline.colour;
|
|
657
|
-
}
|
|
658
|
-
d.rect(filtered, drawOpts);
|
|
659
|
-
//d.textBlock([ `hello` ], { fillStyle: `black`, anchor: { x: 1, y: 1 } })
|
|
660
|
-
}
|
|
661
|
-
calculatePlotDataArea(c, plotHeight, axisYwidth, padding) {
|
|
662
|
-
return {
|
|
663
|
-
x: axisYwidth,
|
|
664
|
-
y: 0,
|
|
665
|
-
width: c.width - axisYwidth - padding - padding,
|
|
666
|
-
height: plotHeight - padding
|
|
667
|
-
};
|
|
668
|
-
}
|
|
669
|
-
computeAxisYWidth(_c) {
|
|
670
|
-
return 0;
|
|
671
|
-
}
|
|
672
|
-
computeLegend(c, maxWidth, padding) {
|
|
673
|
-
if (this.hideLegend) {
|
|
674
|
-
return {
|
|
675
|
-
bounds: { width: 0, height: 0 },
|
|
676
|
-
parts: []
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
const ctx = c.ctx;
|
|
680
|
-
const series = [...this.#series.values()];
|
|
681
|
-
let largestH = 0;
|
|
682
|
-
const sizes = series.map(s => {
|
|
683
|
-
let width = this.#swatchSize + padding;
|
|
684
|
-
const m = ctx.measureText(s.name);
|
|
685
|
-
width += m.width;
|
|
686
|
-
const height = m.emHeightAscent + m.emHeightDescent;
|
|
687
|
-
largestH = Math.max(height, largestH);
|
|
688
|
-
return {
|
|
689
|
-
width,
|
|
690
|
-
height
|
|
691
|
-
};
|
|
692
|
-
});
|
|
693
|
-
const parts = [];
|
|
694
|
-
let x = padding;
|
|
695
|
-
let y = padding;
|
|
696
|
-
let usedWidthMax = 0;
|
|
697
|
-
for (const s of sizes) {
|
|
698
|
-
parts.push({
|
|
699
|
-
x, y, ...s
|
|
700
|
-
});
|
|
701
|
-
x += s.width;
|
|
702
|
-
usedWidthMax = Math.max(x, usedWidthMax);
|
|
703
|
-
if (x >= maxWidth) {
|
|
704
|
-
x = padding;
|
|
705
|
-
y += largestH + padding;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
const bounds = { width: usedWidthMax, height: y + largestH + padding };
|
|
709
|
-
return {
|
|
710
|
-
bounds, parts
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
getOrCreateSeries(name) {
|
|
714
|
-
let s = this.#series.get(name.toLowerCase());
|
|
715
|
-
if (s)
|
|
716
|
-
return s;
|
|
717
|
-
s = new PlotSeries(name, this);
|
|
718
|
-
const seriesDefault = {
|
|
719
|
-
limit: Number.NaN,
|
|
720
|
-
...this.seriesDefault
|
|
721
|
-
};
|
|
722
|
-
if (!Number.isNaN(seriesDefault.limit)) {
|
|
723
|
-
s.setCapacityLimit(seriesDefault.limit);
|
|
724
|
-
}
|
|
725
|
-
this.#series.set(name.toLowerCase(), s);
|
|
726
|
-
return s;
|
|
727
|
-
}
|
|
728
|
-
getSeries(name) {
|
|
729
|
-
return this.#series.get(name);
|
|
730
|
-
}
|
|
731
|
-
render() {
|
|
732
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
733
|
-
return html `<canvas @pointerleave="${this.#onPointerLeave}" @pointermove="${this.#onPointerMove}" ${ref(this.canvasEl)}></canvas><div class="hidden" ${ref(this.tooltipEl)} id="tooltip"></div>`;
|
|
734
|
-
}
|
|
735
|
-
static { this.styles = css `
|
|
736
|
-
:host {
|
|
737
|
-
width: 100%;
|
|
738
|
-
height: 100%;
|
|
739
|
-
display: block;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
#tooltip {
|
|
743
|
-
border: 1px solid black;
|
|
744
|
-
background: white;
|
|
745
|
-
color: black;
|
|
746
|
-
padding: 0.3em;
|
|
747
|
-
font-size: 10px;
|
|
748
|
-
display: inline-block;
|
|
749
|
-
position: absolute;
|
|
750
|
-
left: 0px;
|
|
751
|
-
top: 0px;
|
|
752
|
-
opacity:1;
|
|
753
|
-
pointer-events: none;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
.hidden {
|
|
757
|
-
opacity:0 !important;
|
|
758
|
-
}
|
|
759
|
-
`; }
|
|
760
|
-
};
|
|
761
|
-
__decorate([
|
|
762
|
-
property({ attribute: `hide-legend`, type: Boolean })
|
|
763
|
-
], PlotElement.prototype, "hideLegend", void 0);
|
|
764
|
-
__decorate([
|
|
765
|
-
property({ attribute: `render`, type: String })
|
|
766
|
-
], PlotElement.prototype, "renderStyle", void 0);
|
|
767
|
-
__decorate([
|
|
768
|
-
property({ attribute: `padding`, type: Number })
|
|
769
|
-
], PlotElement.prototype, "padding", void 0);
|
|
770
|
-
PlotElement = __decorate([
|
|
771
|
-
customElement(`ixfx-plot-element`)
|
|
772
|
-
], PlotElement);
|
|
773
|
-
export { PlotElement };
|
|
774
|
-
const resolveFillDrawStyle = (s) => {
|
|
775
|
-
if (s.type === `none`)
|
|
776
|
-
return s;
|
|
777
|
-
const c = Colour.resolveCss(s.colour);
|
|
778
|
-
return {
|
|
779
|
-
type: `solid`,
|
|
780
|
-
colour: c
|
|
781
|
-
};
|
|
782
|
-
};
|
|
783
|
-
const resolveOutlineDrawStyle = (s) => {
|
|
784
|
-
if (s.type === `none`)
|
|
785
|
-
return s;
|
|
786
|
-
const c = Colour.resolveCss(s.colour);
|
|
787
|
-
return {
|
|
788
|
-
...s,
|
|
789
|
-
colour: c
|
|
790
|
-
};
|
|
791
|
-
};
|
|
792
|
-
//export type Range = { min: number, max: number }
|
|
793
|
-
// const initRange = (): Range => ({ min: Number.MAX_SAFE_INTEGER, max: Number.MIN_SAFE_INTEGER });
|
|
794
|
-
// function computeRangeWithNewValue(v: number | undefined, prev: Range): Range {
|
|
795
|
-
// if (typeof v === `number`) {
|
|
796
|
-
// // Skip creating an object if it's in range
|
|
797
|
-
// if (v >= prev.min && v <= prev.max) return prev;
|
|
798
|
-
// return {
|
|
799
|
-
// min: Math.min(v, prev.min),
|
|
800
|
-
// max: Math.max(v, prev.max),
|
|
801
|
-
// }
|
|
802
|
-
// }
|
|
803
|
-
// return prev;
|
|
804
|
-
// }
|
|
805
|
-
// function computeMergedRange(newRange: Range, existingRange: Range): Range {
|
|
806
|
-
// if (newRange.max <= existingRange.max && newRange.min >= existingRange.min) return existingRange;
|
|
807
|
-
// return {
|
|
808
|
-
// min: Math.min(newRange.min, existingRange.min),
|
|
809
|
-
// max: Math.max(newRange.max, existingRange.max)
|
|
810
|
-
// }
|
|
811
|
-
// }
|
|
812
|
-
export class PlotSeries {
|
|
813
|
-
#data = [];
|
|
814
|
-
#capacityLimit = Number.NaN;
|
|
815
|
-
#dirty = false;
|
|
816
|
-
#onPrimaryAxis = true;
|
|
817
|
-
constructor(name, plot) {
|
|
818
|
-
this.name = name;
|
|
819
|
-
this.plot = plot;
|
|
820
|
-
}
|
|
821
|
-
get length() {
|
|
822
|
-
return this.#data.length;
|
|
823
|
-
}
|
|
824
|
-
*getValuesForColumn(column) {
|
|
825
|
-
let index = 0;
|
|
826
|
-
for (const dv of this.#data) {
|
|
827
|
-
if (dv && column in dv) {
|
|
828
|
-
yield [dv[column], index];
|
|
829
|
-
}
|
|
830
|
-
else {
|
|
831
|
-
yield [Number.NaN, index];
|
|
832
|
-
}
|
|
833
|
-
index++;
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
getValue(index) {
|
|
837
|
-
return this.#data[index];
|
|
838
|
-
}
|
|
839
|
-
pushValue(value, automaticallyDraw) {
|
|
840
|
-
if (!Array.isArray(value)) {
|
|
841
|
-
value = [value];
|
|
842
|
-
}
|
|
843
|
-
if (value.length === 0)
|
|
844
|
-
throw new Error(`Param 'value' is empty. Expected a value or array of value components`);
|
|
845
|
-
this.#data.push(value);
|
|
846
|
-
if (!Number.isNaN(this.#capacityLimit)) {
|
|
847
|
-
this.#data = Arrays.ensureLength(this.#data, this.#capacityLimit, `undefined`, `from-start`);
|
|
848
|
-
}
|
|
849
|
-
this.#dirty = true;
|
|
850
|
-
if (automaticallyDraw)
|
|
851
|
-
this.plot.draw();
|
|
852
|
-
}
|
|
853
|
-
setValues(values, automaticallyDraw) {
|
|
854
|
-
if (!Array.isArray(values))
|
|
855
|
-
throw new TypeError(`Param 'values' is not an array`);
|
|
856
|
-
this.#data = Arrays.ensureLength(values, this.#capacityLimit, `undefined`);
|
|
857
|
-
//this.#updateRanges();
|
|
858
|
-
this.#dirty = true;
|
|
859
|
-
if (automaticallyDraw)
|
|
860
|
-
this.plot.draw();
|
|
861
|
-
}
|
|
862
|
-
humanFormatValue(value) {
|
|
863
|
-
let v = `${this.name} `;
|
|
864
|
-
if (this.onPrimaryAxis) {
|
|
865
|
-
v += this.plot.primaryAxis.humanFormatValue(value);
|
|
866
|
-
}
|
|
867
|
-
else {
|
|
868
|
-
v += this.plot.secondaryAxis.humanFormatValue(value);
|
|
869
|
-
}
|
|
870
|
-
return v;
|
|
871
|
-
}
|
|
872
|
-
setRawValues(values, automaticallyDraw) {
|
|
873
|
-
this.setValues(values.map(v => [v]), automaticallyDraw);
|
|
874
|
-
}
|
|
875
|
-
setCapacityLimit(v) {
|
|
876
|
-
if (typeof v !== `number`)
|
|
877
|
-
throw new TypeError(`Expect type number. Got: ${typeof v}`);
|
|
878
|
-
if (!Number.isFinite(v)) {
|
|
879
|
-
throw new TypeError(`Param 'v' is not finite`);
|
|
880
|
-
}
|
|
881
|
-
if (Number.isNaN(v)) {
|
|
882
|
-
throw new TypeError(`Param 'v' is NaN`);
|
|
883
|
-
}
|
|
884
|
-
this.#capacityLimit = v;
|
|
885
|
-
this.#data = Arrays.ensureLength(this.#data, this.#capacityLimit, `undefined`);
|
|
886
|
-
}
|
|
887
|
-
unsetCapacityLimit() {
|
|
888
|
-
this.#capacityLimit = Number.NaN;
|
|
889
|
-
}
|
|
890
|
-
setFormatting(formatting) {
|
|
891
|
-
this.plot.setSeriesFormatting(this.name, formatting);
|
|
892
|
-
}
|
|
893
|
-
getFormatting() {
|
|
894
|
-
return this.plot.getSeriesFormatting(this.name, true);
|
|
895
|
-
}
|
|
896
|
-
get isDirty() {
|
|
897
|
-
return this.#dirty;
|
|
898
|
-
}
|
|
899
|
-
set isDirty(value) {
|
|
900
|
-
this.#dirty = value;
|
|
901
|
-
}
|
|
902
|
-
get onPrimaryAxis() {
|
|
903
|
-
return this.#onPrimaryAxis;
|
|
904
|
-
}
|
|
905
|
-
set onPrimaryAxis(value) {
|
|
906
|
-
if (value === this.#onPrimaryAxis)
|
|
907
|
-
return;
|
|
908
|
-
this.#onPrimaryAxis = value;
|
|
909
|
-
this.#dirty = true;
|
|
910
|
-
}
|
|
911
|
-
clear() {
|
|
912
|
-
this.#data = [];
|
|
913
|
-
this.#dirty = true;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
//# sourceMappingURL=plot.js.map
|