@deephaven/chart 0.53.1-layout-manager.4 → 0.54.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.
Files changed (60) hide show
  1. package/dist/Chart.css +4 -0
  2. package/dist/Chart.css.map +1 -1
  3. package/dist/Chart.d.ts +12 -1
  4. package/dist/Chart.d.ts.map +1 -1
  5. package/dist/Chart.js +96 -9
  6. package/dist/Chart.js.map +1 -1
  7. package/dist/ChartModel.d.ts +2 -0
  8. package/dist/ChartModel.d.ts.map +1 -1
  9. package/dist/ChartModel.js +6 -0
  10. package/dist/ChartModel.js.map +1 -1
  11. package/dist/ChartModelFactory.d.ts +5 -38
  12. package/dist/ChartModelFactory.d.ts.map +1 -1
  13. package/dist/ChartModelFactory.js +6 -11
  14. package/dist/ChartModelFactory.js.map +1 -1
  15. package/dist/ChartTestUtils.d.ts +2 -1
  16. package/dist/ChartTestUtils.d.ts.map +1 -1
  17. package/dist/ChartTestUtils.js +4 -2
  18. package/dist/ChartTestUtils.js.map +1 -1
  19. package/dist/ChartTheme.d.ts +4 -3
  20. package/dist/ChartTheme.d.ts.map +1 -1
  21. package/dist/ChartTheme.js +38 -19
  22. package/dist/ChartTheme.js.map +1 -1
  23. package/dist/ChartTheme.module.css +16 -16
  24. package/dist/ChartTheme.module.css.map +1 -1
  25. package/dist/ChartThemeProvider.d.ts +9 -0
  26. package/dist/ChartThemeProvider.d.ts.map +1 -0
  27. package/dist/ChartThemeProvider.js +35 -0
  28. package/dist/ChartThemeProvider.js.map +1 -0
  29. package/dist/ChartUtils.d.ts +12 -129
  30. package/dist/ChartUtils.d.ts.map +1 -1
  31. package/dist/ChartUtils.js +19 -26
  32. package/dist/ChartUtils.js.map +1 -1
  33. package/dist/DownsamplingError.d.ts +5 -0
  34. package/dist/DownsamplingError.d.ts.map +1 -0
  35. package/dist/DownsamplingError.js +11 -0
  36. package/dist/DownsamplingError.js.map +1 -0
  37. package/dist/FigureChartModel.d.ts +4 -3
  38. package/dist/FigureChartModel.d.ts.map +1 -1
  39. package/dist/FigureChartModel.js +15 -11
  40. package/dist/FigureChartModel.js.map +1 -1
  41. package/dist/MockChartModel.d.ts +3 -0
  42. package/dist/MockChartModel.d.ts.map +1 -1
  43. package/dist/MockChartModel.js +21 -11
  44. package/dist/MockChartModel.js.map +1 -1
  45. package/dist/index.d.ts +4 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/plotly/Plot.d.ts.map +1 -1
  50. package/dist/plotly/Plot.js +3 -8
  51. package/dist/plotly/Plot.js.map +1 -1
  52. package/dist/plotly/createPlotlyComponent.d.ts +4 -0
  53. package/dist/plotly/createPlotlyComponent.d.ts.map +1 -0
  54. package/dist/plotly/createPlotlyComponent.js +13 -0
  55. package/dist/plotly/createPlotlyComponent.js.map +1 -0
  56. package/dist/useChartTheme.d.ts +7 -0
  57. package/dist/useChartTheme.d.ts.map +1 -0
  58. package/dist/useChartTheme.js +10 -0
  59. package/dist/useChartTheme.js.map +1 -0
  60. package/package.json +11 -9
package/dist/Chart.css CHANGED
@@ -68,4 +68,8 @@
68
68
  fill: #f37e3f !important;
69
69
  }
70
70
 
71
+ .chart-error-popper .popper-content {
72
+ padding: 0.25rem;
73
+ }
74
+
71
75
  /*# sourceMappingURL=Chart.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../src/Chart.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAAA;ACQA;EACE,cAN6B;;;AAS/B;EAIE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;AACA;EACE;;;AAIJ;EACE,YCxBc;;AD2BZ;EACE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE,MC5CW;ED6CX,QC/BK;;ADoCT;EACE;EAGA;;AAGF;EACE,eCyDY;EDxDZ,YChDO;EDiDP,OC5Da;ED6Db;EACA,YCiHiB;ED9GjB;;AAGF;EAEE;;AAII;EACE;;AAMA;EACE;;AAOF;EACE","file":"Chart.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '@deephaven/components/scss/custom.scss';\n\n$chart-bg: $content-bg;\n$plotly-notifier-margin-right: 15px;\n$plotly-notifier-note-bg: $gray-600;\n$plotly-notifier-note-border-radius: 2px;\n$plotly-color-btn-active: rgba(255, 255, 255, 70%);\n\n.plotly-notifier {\n margin-right: $plotly-notifier-margin-right;\n}\n\n.plotly-notifier .notifier-note {\n // Mark these properties as !important because plotly css can be loaded in a different order in production\n // See comments on IDS-4808\n // https://illumon.aha.io/comments/6737799632463662636\n color: $foreground !important;\n border: 0 !important;\n border-radius: $plotly-notifier-note-border-radius !important;\n background: $plotly-notifier-note-bg !important;\n overflow-wrap: normal !important;\n hyphens: unset !important;\n margin-bottom: $spacer-2 !important;\n box-shadow: $box-shadow !important;\n}\n\n.plotly-notifier .notifier-close {\n color: $gray-400 !important;\n transition: $transition-base !important;\n &:hover {\n color: $foreground !important;\n }\n}\n\n.chart-wrapper {\n background: $chart-bg;\n\n .plot-container {\n .cartesianlayer text {\n user-select: none;\n }\n\n .hovertext path,\n .axistext path {\n stroke: none !important;\n }\n\n .axistext path {\n fill: $gray-600 !important;\n box-shadow: 4px 4px $black;\n }\n\n .zoomlayer .zoombox {\n fill: rgba(0, 0, 0, 50%) !important;\n }\n\n .zoomlayer .zoombox-corners {\n fill: $white;\n stroke: $gray-900;\n }\n }\n\n // Tooltip arrow\n .js-plotly-plot .plotly [data-title]::before {\n border-color: transparent transparent $tooltip-bg;\n\n // Make the arrow appear above the box shadow of the body\n z-index: 1002;\n }\n // Tooltip body\n .js-plotly-plot .plotly [data-title]::after {\n border-radius: $border-radius;\n background: $tooltip-bg;\n color: $tooltip-color;\n padding: $tooltip-padding-y $tooltip-padding-x;\n box-shadow: $tooltip-box-shadow;\n\n // Already set by plotly, just setting again in case it changes in the future so body shadow appears under arrow tip\n z-index: 1001;\n }\n\n .js-plotly-plot .plotly .modebar {\n //aggressive set as 1001 by plotly, no need for it to be explicitly above anything\n z-index: auto;\n\n .modebar-btn {\n &[data-attr='animation-spin'] {\n svg {\n animation: fa-spin 2s infinite linear;\n }\n }\n\n &[data-attr='fill-active'] {\n svg {\n path {\n fill: $plotly-color-btn-active !important;\n }\n }\n }\n\n &[data-attr='fill-warning'] {\n svg {\n path {\n fill: $warning !important;\n }\n }\n }\n }\n }\n}\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n"]}
1
+ {"version":3,"sourceRoot":"","sources":["../../../node_modules/@deephaven/components/scss/custom.scss","../src/Chart.scss","../../../node_modules/@deephaven/components/scss/bootstrap_overrides.scss","../../../node_modules/@deephaven/components/scss/new_variables.scss"],"names":[],"mappings":"AAAA;ACQA;EACE,cAN6B;;;AAS/B;EAIE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;AACA;EACE;;;AAIJ;EACE,YCxBc;;AD2BZ;EACE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE,MC5CW;ED6CX,QC/BK;;ADoCT;EACE;EAGA;;AAGF;EACE,eCyDY;EDxDZ,YChDO;EDiDP,OC5Da;ED6Db;EACA,YCiHiB;ED9GjB;;AAGF;EAEE;;AAII;EACE;;AAMA;EACE;;AAOF;EACE;;;AAQZ;EACE,SE9GS","file":"Chart.css","sourcesContent":["/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n","@import '@deephaven/components/scss/custom.scss';\n\n$chart-bg: $content-bg;\n$plotly-notifier-margin-right: 15px;\n$plotly-notifier-note-bg: $gray-600;\n$plotly-notifier-note-border-radius: 2px;\n$plotly-color-btn-active: rgba(255, 255, 255, 70%);\n\n.plotly-notifier {\n margin-right: $plotly-notifier-margin-right;\n}\n\n.plotly-notifier .notifier-note {\n // Mark these properties as !important because plotly css can be loaded in a different order in production\n // See comments on IDS-4808\n // https://illumon.aha.io/comments/6737799632463662636\n color: $foreground !important;\n border: 0 !important;\n border-radius: $plotly-notifier-note-border-radius !important;\n background: $plotly-notifier-note-bg !important;\n overflow-wrap: normal !important;\n hyphens: unset !important;\n margin-bottom: $spacer-2 !important;\n box-shadow: $box-shadow !important;\n}\n\n.plotly-notifier .notifier-close {\n color: $gray-400 !important;\n transition: $transition-base !important;\n &:hover {\n color: $foreground !important;\n }\n}\n\n.chart-wrapper {\n background: $chart-bg;\n\n .plot-container {\n .cartesianlayer text {\n user-select: none;\n }\n\n .hovertext path,\n .axistext path {\n stroke: none !important;\n }\n\n .axistext path {\n fill: $gray-600 !important;\n box-shadow: 4px 4px $black;\n }\n\n .zoomlayer .zoombox {\n fill: rgba(0, 0, 0, 50%) !important;\n }\n\n .zoomlayer .zoombox-corners {\n fill: $white;\n stroke: $gray-900;\n }\n }\n\n // Tooltip arrow\n .js-plotly-plot .plotly [data-title]::before {\n border-color: transparent transparent $tooltip-bg;\n\n // Make the arrow appear above the box shadow of the body\n z-index: 1002;\n }\n // Tooltip body\n .js-plotly-plot .plotly [data-title]::after {\n border-radius: $border-radius;\n background: $tooltip-bg;\n color: $tooltip-color;\n padding: $tooltip-padding-y $tooltip-padding-x;\n box-shadow: $tooltip-box-shadow;\n\n // Already set by plotly, just setting again in case it changes in the future so body shadow appears under arrow tip\n z-index: 1001;\n }\n\n .js-plotly-plot .plotly .modebar {\n //aggressive set as 1001 by plotly, no need for it to be explicitly above anything\n z-index: auto;\n\n .modebar-btn {\n &[data-attr='animation-spin'] {\n svg {\n animation: fa-spin 2s infinite linear;\n }\n }\n\n &[data-attr='fill-active'] {\n svg {\n path {\n fill: $plotly-color-btn-active !important;\n }\n }\n }\n\n &[data-attr='fill-warning'] {\n svg {\n path {\n fill: $warning !important;\n }\n }\n }\n }\n }\n}\n\n.chart-error-popper .popper-content {\n padding: $spacer-1;\n}\n","// Styling overrides for bootstrap\n\n// Override / set color variables\n$red: #f95d84;\n$orange: #f37e3f;\n$yellow: #fcd65b;\n$green: #9edc6f;\n$blue: #76d9e4;\n$purple: #aa9af4;\n\n//Define some UI colors\n$interfacegray: #2d2a2e;\n$interfaceblue: #4878ea;\n$interfacewhite: #f0f0ee; //same as gray-200\n$interfaceblack: #1a171a;\n\n//Define our Gray scale\n$white: $interfacewhite;\n$gray-100: #fcfcfa;\n$gray-200: $interfacewhite;\n$gray-300: #c0bfbf;\n$gray-400: #929192;\n$gray-500: #5b5a5c;\n$gray-600: #555356;\n$gray-700: #403e41;\n$gray-800: #373438;\n$gray-850: #322f33;\n$gray-900: #211f22;\n$black: $interfaceblack;\n$content-bg: $interfacegray;\n$background: $interfaceblack;\n$foreground: $interfacewhite;\n\n//Load colors into map\n$colors: ();\n$colors: map-merge(\n (\n 'red': $red,\n 'orange': $orange,\n 'yellow': $yellow,\n 'green': $green,\n 'blue': $blue,\n 'purple': $purple,\n 'white': $white,\n 'black': $black,\n ),\n $colors\n);\n\n//Set default colors\n$body-bg: $black;\n$body-color: $interfacewhite;\n\n// Set brand colors\n$primary: $interfaceblue;\n$primary-hover: darken($primary, 8%);\n$primary-dark: mix($primary, $content-bg, 25%);\n$primary-light: scale-color($primary, $lightness: -25%);\n$secondary: $gray-500;\n$secondary-hover: darken($secondary, 8%);\n$success: $green;\n$info: $yellow;\n$warning: $orange;\n$danger: $red;\n$danger-hover: darken($danger, 8%);\n$light: $gray-100;\n$mid: $gray-400; //Added a mid color, useful for input styling\n$dark: $gray-800;\n$green-dark: scale-color($green, $lightness: -45%, $saturation: -10%);\n\n$theme-colors: () !default;\n$theme-colors: map-merge(\n (\n 'primary': $primary,\n 'primary-hover': $primary-hover,\n 'primary-light': $primary-light,\n 'primary-dark': $primary-dark,\n 'secondary': $secondary,\n 'success': $success,\n 'info': $info,\n 'warning': $warning,\n 'danger': $danger,\n 'light': $light,\n 'dark': $dark,\n 'mid': $mid,\n 'content-bg': $interfacegray,\n 'background': $interfaceblack,\n 'foreground': $interfacewhite,\n ),\n $theme-colors\n);\n\n$component-active-bg: $primary;\n$theme-color-interval: 9%;\n$yiq-contrasted-threshold: 180;\n\n// Override fonts\n$font-family-sans-serif:\n 'Fira Sans',\n -apple-system,\n blinkmacsystemfont,\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n arial,\n sans-serif; //fira sans then native system ui fallbacks\n$font-family-monospace: 'Fira Mono', menlo, monaco, consolas, 'Liberation Mono',\n 'Courier New', monospace;\n$font-family-base: $font-family-sans-serif;\n\n$headings-font-weight: 400;\n\n//Text overides\n$text-muted: $gray-400;\n\n//Style Selection highlight color\n//so browsers add alpha to your color by default, ignoring opacity 1\n//by setting rgba with 0.99 it tricks browser into thinking there is alpha applied\n$text-select-color: $primary-hover;\n$text-select-color-editor: lighten(\n $gray-700,\n 15%\n); //we lighten it abit to account for that 0.01 loss, and because it needs some anyways.\n\n//Grid variables, same value as default just making easily accessible\n$grid-gutter-width: 30px;\n\n//Visual Overrides\n$border-radius: 4px;\n$box-shadow: 0 0.1rem 1rem rgba($black, 45%); //because our UI is so dark, we need darker default shadows\n$box-shadow-900: 0 0.1rem 1rem rgba(0, 0, 0, 45%); //darkest shadow for $black popups over $black UI\n\n//Override Btn\n$btn-border-radius: 4rem;\n$btn-padding-x: 1.5rem;\n$btn-transition:\n color 0.12s ease-in-out,\n background-color 0.12s ease-in-out,\n border-color 0.12s ease-in-out,\n box-shadow 0.12s ease-in-out; //default 0.15 is too long\n$btn-border-width: 2px;\n\n//Override Inputs\n$input-bg: $gray-600;\n$input-disabled-bg: $gray-800;\n$input-color: $foreground;\n$input-border-color: $gray-400;\n$input-placeholder-color: $gray-400;\n$input-focus-border-color: rgba($primary, 85%);\n\n$input-btn-focus-width: 0.2rem;\n$input-btn-focus-color: rgba($component-active-bg, 35%);\n$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color;\n\n//checkbox\n$custom-control-indicator-bg: $gray-600;\n$custom-control-indicator-bg-size: 75% 75%;\n$custom-control-indicator-disabled-bg: $gray-800;\n$custom-control-indicator-checked-disabled-bg: $gray-800;\n$custom-control-label-disabled-color: $gray-400;\n\n//Custom Select\n$custom-select-indicator-color: $gray-400;\n$custom-select-bg-size: 16px 16px;\n//dhSort icon encoded\n$custom-select-indicator: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M4 7l-.4-.8 4-3.7h.8l4 3.7-.4.8H4zm0 2l-.4.8 4 3.7h.8l4-3.7L12 9H4z'/%3E%3C/svg%3E\"),\n '#',\n '%23'\n);\n$custom-select-focus-box-shadow: $input-btn-focus-box-shadow;\n$custom-select-disabled-color: darken($gray-400, 5%);\n$custom-select-disabled-bg: $gray-800;\n\n//modal\n$modal-content-bg: $gray-200;\n$modal-content-border-width: 0;\n$modal-md: 550px;\n\n// Toast notification\n$toast-bg: $primary-dark;\n$toast-color: $foreground;\n$toast-error-bg: mix($danger, $content-bg, 15%);\n$toast-error-color: $foreground;\n\n//tooltips\n$tooltip-bg: $gray-700;\n$tooltip-color: $foreground;\n$tooltip-box-shadow: 0 0.1rem 1.5rem 0.1rem rgba($black, 80%);\n\n//drowdowns\n$dropdown-bg: $gray-600;\n$dropdown-link-color: $foreground;\n$dropdown-link-hover-color: $foreground;\n$dropdown-link-hover-bg: $primary;\n$dropdown-divider-bg: $gray-700;\n\n//context menus\n$contextmenu-bg: $gray-600;\n$contextmenu-color: $foreground;\n$contextmenu-disabled-color: $text-muted;\n$contextmenu-keyboard-selected-bg: rgba($primary, 50%);\n$contextmenu-selected-bg: $primary;\n$contextmenu-selected-color: $foreground;\n\n//links\n$link-color: $gray-400;\n$link-hover-color: $foreground;\n\n//progress-bar\n$progress-bg: $gray-600;\n$progress-border-radius: 1rem;\n\n// Set global options\n$enable-shadows: false;\n$enable-gradients: false;\n$enable-print-styles: false; //I don't think anyone should expect to \"print\" this app.\n\n// Transition times\n$transition: 0.15s;\n$transition-mid: 0.2s;\n$transition-long: 0.3s;\n$transition-slow: 0.6s;\n\n//form-validation icon, uses vsWarning icon encoded here as svg\n$form-feedback-icon-invalid-color: theme-color('danger');\n$form-feedback-icon-invalid: str-replace(\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none'%3E%3Cg fill='#{$form-feedback-icon-invalid-color}'%3E%3Cpath d='M7.56 1h.88l6.54 12.26-.44.74H1.44L1 13.26 7.56 1zM8 2.28 2.28 13H13.7L8 2.28zM8.625 12v-1h-1.25v1h1.25zm-1.25-2V6h1.25v4h-1.25z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E \"),\n '#',\n '%23'\n);\n","//Set of spacer variables from the spacer map\n$spacer-0: map-get($spacers, 0); //0\n$spacer-1: map-get($spacers, 1);\n$spacer-2: map-get($spacers, 2);\n$spacer-3: map-get($spacers, 3);\n$spacer-4: map-get($spacers, 4);\n$spacer-5: map-get($spacers, 5);\n\n//Marching Ants for golden layout dropzone and drag and drop\n//top bottom, left right.\n//create 4 background images that are 50% color 1, 50% color 2 using graidents, two veritical, two horizontal\n//size them to ant-size and thickness\n//position those images along the egdes and make top/bottom repeat-x and left/right repeat-y\n//then offest each of those background positions by ant-size in animation to make them march.\n$ant-size: 8px;\n$ant-thickness: 1px;\n\n@mixin ants-base($color-1: black, $color-2: white) {\n background-image: linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to right, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%),\n linear-gradient(to bottom, $color-2 50%, $color-1 50%);\n background-size:\n $ant-size $ant-thickness,\n $ant-size $ant-thickness,\n $ant-thickness $ant-size,\n $ant-thickness $ant-size;\n background-position:\n 0 top,\n 0 bottom,\n left 0,\n right 0;\n background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;\n animation: march 0.5s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n}\n\n@mixin drag-stack($pseudo-element) {\n &::#{$pseudo-element} {\n content: ' ';\n background: $primary;\n box-shadow: $box-shadow;\n border-radius: $border-radius;\n position: absolute;\n height: 100%;\n width: 100%;\n @content;\n }\n}\n\n$focus-bg-transparency: 0.12;\n$hover-bg-transparency: 0.14;\n$active-bg-transparency: 0.28;\n$exception-transparency: 0.13;\n"]}
package/dist/Chart.d.ts CHANGED
@@ -26,10 +26,14 @@ interface ChartProps {
26
26
  }
27
27
  interface ChartState {
28
28
  data: Partial<Data>[] | null;
29
+ /** An error specific to downsampling */
29
30
  downsamplingError: unknown;
30
31
  isDownsampleFinished: boolean;
31
32
  isDownsampleInProgress: boolean;
32
33
  isDownsamplingDisabled: boolean;
34
+ /** Any other kind of error */
35
+ error: unknown;
36
+ shownError: string | null;
33
37
  layout: Partial<Layout>;
34
38
  revision: number;
35
39
  }
@@ -73,13 +77,15 @@ export declare class Chart extends Component<ChartProps, ChartState> {
73
77
  ranges?: unknown;
74
78
  isSubscribed: boolean;
75
79
  isLoadedFired: boolean;
76
- getCachedConfig: (downsamplingError: unknown, isDownsampleFinished: boolean, isDownsampleInProgress: boolean, isDownsamplingDisabled: boolean, data: Partial<Data>[]) => Partial<PlotlyConfig>;
80
+ resizeObserver: ResizeObserver;
81
+ getCachedConfig: (downsamplingError: unknown, isDownsampleFinished: boolean, isDownsampleInProgress: boolean, isDownsamplingDisabled: boolean, data: Partial<Data>[], error: unknown) => Partial<PlotlyConfig>;
77
82
  getPlotRect(): DOMRect | null;
78
83
  initData(): void;
79
84
  subscribe(model: ChartModel): void;
80
85
  unsubscribe(model: ChartModel): void;
81
86
  handleAfterPlot(): void;
82
87
  handleDownsampleClick(): void;
88
+ handleErrorClose(): void;
83
89
  handleModelEvent(event: CustomEvent): void;
84
90
  handlePlotUpdate(figure: Readonly<{
85
91
  layout: Partial<Layout>;
@@ -87,10 +93,15 @@ export declare class Chart extends Component<ChartProps, ChartState> {
87
93
  handleRelayout(changes: {
88
94
  hiddenlabels?: string[];
89
95
  }): void;
96
+ handleResize(): void;
90
97
  handleRestyle([changes, seriesIndexes]: readonly [
91
98
  Record<string, unknown>,
92
99
  number[]
93
100
  ]): void;
101
+ /**
102
+ * Toggle the error message. If it is already being displayed, then hide it.
103
+ */
104
+ toggleErrorMessage(error: string): void;
94
105
  /**
95
106
  * Update the models dimensions and ranges.
96
107
  * Note that this will update it all whether the plot size changes OR the range
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../src/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAIL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIL,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,MAAM,IAAI,YAAY,EACtB,MAAM,EACN,IAAI,EACJ,IAAI,EAGL,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,cAAc,CAAC;AAItB,KAAK,iBAAiB,GAAG,oBAAoB,GAC3C,sBAAsB,GAAG;IACvB,oBAAoB,CAAC,EAAE,6BAA6B,CAAC;IACrD,oBAAoB,CAAC,EAAE,6BAA6B,CAAC;CACtD,CAAC;AAEJ,UAAU,UAAU;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,EAAE,CAAC,GAAG,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAChD,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,iBAAiB,EAAE,CAA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IAwB1C,aAAa,IAAI,IAAI;IAKrB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAoB1D,eAAe,IAAI,IAAI;IAYvB,gBAAgB,IAAI,IAAI;IAsBxB,MAAM,IAAI,YAAY;CA8DvB;AAED,eAAe,KAAK,CAAC"}
package/dist/Chart.js CHANGED
@@ -6,15 +6,19 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
6
6
  import React, { Component } from 'react';
7
7
  import deepEqual from 'deep-equal';
8
8
  import memoize from 'memoize-one';
9
+ import { CopyButton, Popper } from '@deephaven/components';
9
10
  import { vsLoading, dhGraphLineDown, dhWarningFilled } from '@deephaven/icons';
10
11
  import { Formatter, FormatterUtils, DateUtils } from '@deephaven/jsapi-utils';
11
12
  import Log from '@deephaven/log';
12
- import createPlotlyComponent from 'react-plotly.js/factory.js';
13
+ import createPlotlyComponent from "./plotly/createPlotlyComponent.js";
13
14
  import Plotly from "./plotly/Plotly.js";
14
15
  import ChartModel from "./ChartModel.js";
15
16
  import ChartUtils from "./ChartUtils.js";
16
17
  import "./Chart.css";
18
+ import DownsamplingError from "./DownsamplingError.js";
17
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { Fragment as _Fragment } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
18
22
  var log = Log.module('Chart');
19
23
  export class Chart extends Component {
20
24
  /**
@@ -60,14 +64,29 @@ export class Chart extends Component {
60
64
  _defineProperty(this, "ranges", void 0);
61
65
  _defineProperty(this, "isSubscribed", void 0);
62
66
  _defineProperty(this, "isLoadedFired", void 0);
63
- _defineProperty(this, "getCachedConfig", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data) => {
67
+ _defineProperty(this, "resizeObserver", void 0);
68
+ _defineProperty(this, "getCachedConfig", memoize((downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data, error) => {
64
69
  var customButtons = [];
65
70
  var hasDownsampleError = Boolean(downsamplingError);
66
71
  if (hasDownsampleError) {
67
72
  customButtons.push({
68
73
  name: "Downsampling failed: ".concat(downsamplingError),
69
74
  title: 'Downsampling failed',
70
- click: () => undefined,
75
+ click: () => {
76
+ this.toggleErrorMessage("".concat(downsamplingError));
77
+ },
78
+ icon: Chart.convertIcon(dhWarningFilled),
79
+ attr: 'fill-warning'
80
+ });
81
+ }
82
+ var hasError = Boolean(error);
83
+ if (hasError) {
84
+ customButtons.push({
85
+ name: "Error: ".concat(error),
86
+ title: "Error",
87
+ click: () => {
88
+ this.toggleErrorMessage("".concat(error));
89
+ },
71
90
  icon: Chart.convertIcon(dhWarningFilled),
72
91
  attr: 'fill-warning'
73
92
  });
@@ -104,7 +123,7 @@ export class Chart extends Component {
104
123
  // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249
105
124
  displayModeBar:
106
125
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
107
- isDownsampleInProgress || hasDownsampleError ? true : 'hover',
126
+ isDownsampleInProgress || hasDownsampleError || hasError ? true : 'hover',
108
127
  // Each array gets grouped together in the mode bar
109
128
  modeBarButtons: [customButtons, ['toImage'], ['zoom2d', 'pan2d'],
110
129
  // These work the same for both 2d and 3d
@@ -113,9 +132,11 @@ export class Chart extends Component {
113
132
  }));
114
133
  this.handleAfterPlot = this.handleAfterPlot.bind(this);
115
134
  this.handleDownsampleClick = this.handleDownsampleClick.bind(this);
135
+ this.handleErrorClose = this.handleErrorClose.bind(this);
116
136
  this.handleModelEvent = this.handleModelEvent.bind(this);
117
137
  this.handlePlotUpdate = this.handlePlotUpdate.bind(this);
118
138
  this.handleRelayout = this.handleRelayout.bind(this);
139
+ this.handleResize = this.handleResize.bind(this);
119
140
  this.handleRestyle = this.handleRestyle.bind(this);
120
141
  this.PlotComponent = createPlotlyComponent(props.Plotly);
121
142
  this.plot = /*#__PURE__*/React.createRef();
@@ -127,12 +148,15 @@ export class Chart extends Component {
127
148
  this.isSubscribed = false;
128
149
  this.isLoadedFired = false;
129
150
  this.currentSeries = 0;
151
+ this.resizeObserver = new window.ResizeObserver(this.handleResize);
130
152
  this.state = {
131
153
  data: null,
132
154
  downsamplingError: null,
133
155
  isDownsampleFinished: false,
134
156
  isDownsampleInProgress: false,
135
157
  isDownsamplingDisabled: false,
158
+ error: null,
159
+ shownError: null,
136
160
  layout: {
137
161
  datarevision: 0
138
162
  },
@@ -152,6 +176,9 @@ export class Chart extends Component {
152
176
  if (isActive) {
153
177
  this.subscribe(model);
154
178
  }
179
+ if (this.plotWrapper.current != null) {
180
+ this.resizeObserver.observe(this.plotWrapper.current);
181
+ }
155
182
  }
156
183
  componentDidUpdate(prevProps) {
157
184
  var {
@@ -166,6 +193,7 @@ export class Chart extends Component {
166
193
  }
167
194
  if (isActive !== prevProps.isActive) {
168
195
  if (isActive) {
196
+ this.updateDimensions();
169
197
  this.subscribe(model);
170
198
  } else {
171
199
  this.unsubscribe(model);
@@ -177,7 +205,11 @@ export class Chart extends Component {
177
205
  model
178
206
  } = this.props;
179
207
  this.unsubscribe(model);
208
+ this.resizeObserver.disconnect();
180
209
  }
210
+
211
+ // Listen for resizing of the element and update the canvas appropriately
212
+
181
213
  getPlotRect() {
182
214
  var _this$plotWrapper$cur, _this$plotWrapper$cur2;
183
215
  return (_this$plotWrapper$cur = (_this$plotWrapper$cur2 = this.plotWrapper.current) === null || _this$plotWrapper$cur2 === void 0 ? void 0 : _this$plotWrapper$cur2.getBoundingClientRect()) !== null && _this$plotWrapper$cur !== void 0 ? _this$plotWrapper$cur : null;
@@ -238,6 +270,11 @@ export class Chart extends Component {
238
270
  model.setDownsamplingDisabled(isDownsamplingDisabled);
239
271
  });
240
272
  }
273
+ handleErrorClose() {
274
+ this.setState({
275
+ shownError: null
276
+ });
277
+ }
241
278
  handleModelEvent(event) {
242
279
  var {
243
280
  type,
@@ -329,7 +366,19 @@ export class Chart extends Component {
329
366
  var {
330
367
  onError
331
368
  } = this.props;
332
- onError(new Error(downsamplingError));
369
+ onError(new DownsamplingError(downsamplingError));
370
+ break;
371
+ }
372
+ case ChartModel.EVENT_ERROR:
373
+ {
374
+ var _error = "".concat(detail);
375
+ this.setState({
376
+ error: _error
377
+ });
378
+ var {
379
+ onError: _onError
380
+ } = this.props;
381
+ _onError(new Error(_error));
333
382
  break;
334
383
  }
335
384
  default:
@@ -365,6 +414,9 @@ export class Chart extends Component {
365
414
  }
366
415
  this.updateModelDimensions();
367
416
  }
417
+ handleResize() {
418
+ this.updateDimensions();
419
+ }
368
420
  handleRestyle(_ref4) {
369
421
  var [changes, seriesIndexes] = _ref4;
370
422
  log.debug('handleRestyle', changes, seriesIndexes);
@@ -390,6 +442,20 @@ export class Chart extends Component {
390
442
  }
391
443
  }
392
444
 
445
+ /**
446
+ * Toggle the error message. If it is already being displayed, then hide it.
447
+ */
448
+ toggleErrorMessage(error) {
449
+ this.setState(_ref6 => {
450
+ var {
451
+ shownError
452
+ } = _ref6;
453
+ return {
454
+ shownError: shownError === error ? null : error
455
+ };
456
+ });
457
+ }
458
+
393
459
  /**
394
460
  * Update the models dimensions and ranges.
395
461
  * Note that this will update it all whether the plot size changes OR the range
@@ -472,15 +538,17 @@ export class Chart extends Component {
472
538
  isDownsampleFinished,
473
539
  isDownsampleInProgress,
474
540
  isDownsamplingDisabled,
541
+ error,
542
+ shownError,
475
543
  layout,
476
544
  revision
477
545
  } = this.state;
478
- var config = this.getCachedConfig(downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data !== null && data !== void 0 ? data : []);
546
+ var config = this.getCachedConfig(downsamplingError, isDownsampleFinished, isDownsampleInProgress, isDownsamplingDisabled, data !== null && data !== void 0 ? data : [], error);
479
547
  var isPlotShown = data != null;
480
- return /*#__PURE__*/_jsx("div", {
548
+ return /*#__PURE__*/_jsxs("div", {
481
549
  className: "h-100 w-100 chart-wrapper",
482
550
  ref: this.plotWrapper,
483
- children: isPlotShown && /*#__PURE__*/_jsx(PlotComponent
551
+ children: [isPlotShown && /*#__PURE__*/_jsx(PlotComponent
484
552
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
485
553
  // @ts-ignore
486
554
  , {
@@ -499,7 +567,26 @@ export class Chart extends Component {
499
567
  height: '100%',
500
568
  width: '100%'
501
569
  }
502
- })
570
+ }), /*#__PURE__*/_jsx(Popper, {
571
+ className: "chart-error-popper",
572
+ options: {
573
+ placement: 'top'
574
+ },
575
+ isShown: shownError != null,
576
+ onExited: this.handleErrorClose,
577
+ closeOnBlur: true,
578
+ interactive: true,
579
+ children: shownError != null && /*#__PURE__*/_jsxs(_Fragment, {
580
+ children: [/*#__PURE__*/_jsx("div", {
581
+ className: "chart-error",
582
+ children: shownError
583
+ }), /*#__PURE__*/_jsx(CopyButton, {
584
+ tooltip: "Copy Error",
585
+ copy: shownError,
586
+ children: "Copy Error"
587
+ })]
588
+ })
589
+ })]
503
590
  });
504
591
  }
505
592
  }
package/dist/Chart.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","createPlotlyComponent","Plotly","ChartModel","ChartUtils","jsx","_jsx","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","concat","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","_defineProperty","downsamplingError","isDownsampleFinished","data","customButtons","hasDownsampleError","Boolean","push","name","title","click","attr","handleDownsampleClick","has2D","some","_ref","type","includes","has3D","_ref2","buttons2D","buttons3D","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","PlotComponent","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","state","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","model","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","_this$plotWrapper$cur","_this$plotWrapper$cur2","current","getBoundingClientRect","setState","getData","_objectSpread","getLayout","rect","height","debug2","_ref3","setDownsamplingDisabled","event","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","_detail$message","message","onError","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","_ref4","seriesIndexes","Object","keys","reduce","acc","_ref5","visible","force","arguments","length","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","PlotlyProp","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","className","ref","children","onAfterPlot","error","onRelayout","onRestyle","useResizeHandler","style","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"sources":["../src/Chart.tsx"],"sourcesContent":["import React, { Component, ReactElement, RefObject } from 'react';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport {\n vsLoading,\n dhGraphLineDown,\n dhWarningFilled,\n IconDefinition,\n} from '@deephaven/icons';\nimport {\n Formatter,\n FormatterUtils,\n DateUtils,\n DateTimeColumnFormatterOptions,\n DecimalColumnFormatterOptions,\n IntegerColumnFormatterOptions,\n FormattingRule,\n ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport {\n Config as PlotlyConfig,\n Layout,\n Icon,\n Data,\n PlotData,\n ModeBarButtonAny,\n} from 'plotly.js';\nimport type { PlotParams } from 'react-plotly.js';\nimport createPlotlyComponent from 'react-plotly.js/factory.js';\nimport Plotly from './plotly/Plotly';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n Plotly: typeof Plotly;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<Data>[] | null;\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n Plotly,\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.PlotComponent = createPlotlyComponent(props.Plotly);\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive, model } = this.props;\n if (isActive) {\n this.subscribe(model);\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, model, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (model !== prevProps.model) {\n this.unsubscribe(prevProps.model);\n this.subscribe(model);\n }\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe(model);\n } else {\n this.unsubscribe(model);\n }\n }\n }\n\n componentWillUnmount(): void {\n const { model } = this.props;\n this.unsubscribe(model);\n }\n\n currentSeries: number;\n\n PlotComponent: React.ComponentType<PlotParams>;\n\n plot: RefObject<typeof this.PlotComponent>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean,\n data: Partial<Data>[]\n ): Partial<PlotlyConfig> => {\n const customButtons: ModeBarButtonAny[] = [];\n const hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n title: 'Downsampling failed',\n click: () => undefined,\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n hasDownsampleError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const attr = Chart.downsampleButtonAttr(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n title: 'Downsampling status',\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\n\n const has2D = data.some(\n ({ type }) => type != null && !type.includes('3d')\n );\n const has3D = data.some(\n ({ type }) => type != null && type.includes('3d')\n );\n\n const buttons2D = [\n 'zoomIn2d',\n 'zoomOut2d',\n 'autoScale2d',\n 'resetScale2d',\n ] as const;\n const buttons3D = [\n 'orbitRotation',\n 'tableRotation',\n 'resetCameraDefault3d',\n ] as const;\n\n return {\n displaylogo: false,\n\n // Display the mode bar if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n displayModeBar:\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError\n ? true\n : ('hover' as const),\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'], // These work the same for both 2d and 3d\n [...(has2D ? buttons2D : []), ...(has3D ? buttons3D : [])],\n ],\n };\n }\n );\n\n getPlotRect(): DOMRect | null {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData(): void {\n const { model } = this.props;\n const { layout } = this.state;\n this.setState({\n data: model.getData(),\n layout: {\n ...layout,\n ...model.getLayout(),\n },\n });\n }\n\n subscribe(model: ChartModel): void {\n if (this.isSubscribed) {\n return;\n }\n\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n\n unsubscribe(model: ChartModel): void {\n if (!this.isSubscribed) {\n return;\n }\n\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot(): void {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n\n handleDownsampleClick(): void {\n this.setState(\n ({ isDownsamplingDisabled }) => ({\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled,\n }),\n () => {\n const { model } = this.props;\n const { isDownsamplingDisabled } = this.state;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n }\n );\n }\n\n handleModelEvent(event: CustomEvent): void {\n const { type, detail } = event;\n log.debug2('Received data update', type, detail);\n\n switch (type) {\n case ChartModel.EVENT_UPDATED: {\n this.currentSeries += 1;\n this.setState(state => {\n const { layout, revision } = state;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1,\n };\n });\n\n const { onUpdate } = this.props;\n onUpdate({ isLoading: !this.isLoadedFired });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED: {\n const { onUpdate } = this.props;\n this.isLoadedFired = true;\n onUpdate({ isLoading: false });\n break;\n }\n case ChartModel.EVENT_DISCONNECT: {\n const { onDisconnect } = this.props;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT: {\n const { onReconnect } = this.props;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED: {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED: {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED: {\n const downsamplingError = detail.message ?? detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError,\n });\n\n const { onError } = this.props;\n onError(new Error(downsamplingError));\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n\n handlePlotUpdate(figure: Readonly<{ layout: Partial<Layout> }>): void {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n const { layout } = figure;\n const ranges = ChartUtils.getLayoutRanges(layout);\n\n const isRangesChanged = !deepEqual(ranges, this.ranges);\n\n if (isRangesChanged) {\n this.ranges = ranges;\n\n this.updateModelDimensions(true);\n }\n }\n\n handleRelayout(changes: { hiddenlabels?: string[] }): void {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n const { onSettingsChanged } = this.props;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n const hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({ hiddenSeries });\n }\n\n this.updateModelDimensions();\n }\n\n handleRestyle([changes, seriesIndexes]: readonly [\n Record<string, unknown>,\n number[],\n ]): void {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n if (data != null) {\n const hiddenSeries = (data as Partial<PlotData>[]).reduce(\n (acc: string[], { name, visible }) =>\n name != null && visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\n }\n }\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false): void {\n const rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n\n const isRectChanged =\n !this.rect ||\n this.rect.width !== rect.width ||\n this.rect.height !== rect.height;\n\n if (isRectChanged || force) {\n this.rect = rect;\n\n const { isActive, model } = this.props;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe(model);\n }\n }\n }\n\n initFormatter(): void {\n const { settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n }\n\n updateFormatterSettings(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions =\n FormatterUtils.getDateTimeFormatterOptions(settings);\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const { model } = this.props;\n const formatter = new Formatter(\n model.dh,\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n model.setFormatter(formatter);\n }\n\n updateDimensions(): void {\n const rect = this.getPlotRect();\n const { Plotly: PlotlyProp } = this.props;\n if (\n this.plot.current != null &&\n rect != null &&\n rect.width > 0 &&\n rect.height > 0\n ) {\n // Call relayout to resize avoiding the debouncing plotly does\n // https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552\n PlotlyProp.relayout(\n (this.plot.current as unknown as { el: HTMLElement }).el,\n {\n autosize: true,\n }\n ).catch((e: unknown) => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n\n render(): ReactElement {\n const { PlotComponent } = this;\n const {\n data,\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n layout,\n revision,\n } = this.state;\n const config = this.getCachedConfig(\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n data ?? []\n );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <PlotComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\n onError={log.error}\n onRelayout={this.handleRelayout}\n onUpdate={this.handlePlotUpdate}\n onRestyle={this.handleRestyle}\n useResizeHandler\n style={{ height: '100%', width: '100%' }}\n />\n )}\n </div>\n );\n }\n}\n\nexport default Chart;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAiC,OAAO;AACjE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,a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,SAAS,EAAE;EACb,CAAC;EACD/I,MAAM;EACN0G,YAAY,EAAEA,CAAA,KAAYpF,SAAS;EACnCsF,WAAW,EAAEA,CAAA,KAAYtF,SAAS;EAClCgF,QAAQ,EAAEA,CAAA,KAAYhF,SAAS;EAC/B6F,OAAO,EAAEA,CAAA,KAAY7F,SAAS;EAC9BsG,iBAAiB,EAAEA,CAAA,KAAYtG;AACjC,CAAC;AA8hBH,eAAef,KAAK"}
1
+ {"version":3,"file":"Chart.js","names":["React","Component","deepEqual","memoize","CopyButton","Popper","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","createPlotlyComponent","Plotly","ChartModel","ChartUtils","DownsamplingError","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","log","module","Chart","convertIcon","faIcon","width","path","icon","stringPath","concat","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","_defineProperty","downsamplingError","isDownsampleFinished","data","error","customButtons","hasDownsampleError","Boolean","push","name","title","click","toggleErrorMessage","attr","hasError","handleDownsampleClick","has2D","some","_ref","type","includes","has3D","_ref2","buttons2D","buttons3D","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleErrorClose","handleModelEvent","handlePlotUpdate","handleRelayout","handleResize","handleRestyle","PlotComponent","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","isSubscribed","isLoadedFired","currentSeries","resizeObserver","window","ResizeObserver","state","shownError","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","model","subscribe","current","observe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","disconnect","getPlotRect","_this$plotWrapper$cur","_this$plotWrapper$cur2","getBoundingClientRect","setState","getData","_objectSpread","getLayout","rect","height","debug2","_ref3","setDownsamplingDisabled","event","detail","EVENT_UPDATED","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","_detail$message","message","onError","EVENT_ERROR","Error","debug","figure","ranges","getLayoutRanges","isRangesChanged","changes","hiddenlabels","onSettingsChanged","hiddenSeries","_ref4","seriesIndexes","Object","keys","reduce","acc","_ref5","visible","_ref6","force","arguments","length","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","dh","setFormatter","PlotlyProp","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","className","ref","children","onAfterPlot","onRelayout","onRestyle","useResizeHandler","style","options","placement","isShown","onExited","closeOnBlur","interactive","tooltip","copy","timeZone","defaultDateTimeFormat","FULL_DATE_FORMAT","showTimeZone","showTSeparator"],"sources":["../src/Chart.tsx"],"sourcesContent":["import React, { Component, ReactElement, RefObject } from 'react';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport { CopyButton, Popper } from '@deephaven/components';\nimport {\n vsLoading,\n dhGraphLineDown,\n dhWarningFilled,\n IconDefinition,\n} from '@deephaven/icons';\nimport {\n Formatter,\n FormatterUtils,\n DateUtils,\n DateTimeColumnFormatterOptions,\n DecimalColumnFormatterOptions,\n IntegerColumnFormatterOptions,\n FormattingRule,\n ColumnFormatSettings,\n DateTimeFormatSettings,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport {\n Config as PlotlyConfig,\n Layout,\n Icon,\n Data,\n PlotData,\n ModeBarButtonAny,\n} from 'plotly.js';\nimport type { PlotParams } from 'react-plotly.js';\nimport createPlotlyComponent from './plotly/createPlotlyComponent';\nimport Plotly from './plotly/Plotly';\nimport ChartModel from './ChartModel';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport './Chart.scss';\nimport DownsamplingError from './DownsamplingError';\n\nconst log = Log.module('Chart');\n\ntype FormatterSettings = ColumnFormatSettings &\n DateTimeFormatSettings & {\n decimalFormatOptions?: DecimalColumnFormatterOptions;\n integerFormatOptions?: IntegerColumnFormatterOptions;\n };\n\ninterface ChartProps {\n model: ChartModel;\n settings: FormatterSettings;\n isActive: boolean;\n Plotly: typeof Plotly;\n onDisconnect: () => void;\n onReconnect: () => void;\n onUpdate: (obj: { isLoading: boolean }) => void;\n onError: (error: Error) => void;\n onSettingsChanged: (settings: Partial<ChartModelSettings>) => void;\n}\n\ninterface ChartState {\n data: Partial<Data>[] | null;\n /** An error specific to downsampling */\n downsamplingError: unknown;\n isDownsampleFinished: boolean;\n isDownsampleInProgress: boolean;\n isDownsamplingDisabled: boolean;\n\n /** Any other kind of error */\n error: unknown;\n shownError: string | null;\n layout: Partial<Layout>;\n revision: number;\n}\n\nexport class Chart extends Component<ChartProps, ChartState> {\n static defaultProps = {\n isActive: true,\n settings: {\n timeZone: 'America/New_York',\n defaultDateTimeFormat: DateUtils.FULL_DATE_FORMAT,\n showTimeZone: false,\n showTSeparator: true,\n formatter: [],\n },\n Plotly,\n onDisconnect: (): void => undefined,\n onReconnect: (): void => undefined,\n onUpdate: (): void => undefined,\n onError: (): void => undefined,\n onSettingsChanged: (): void => undefined,\n };\n\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param faIcon The icon to convert\n */\n static convertIcon(faIcon: IconDefinition): Icon {\n const [width, , , , path] = faIcon.icon;\n // By default the icons are flipped upside down, so we need to add our own transform\n // https://github.com/plotly/plotly.js/issues/1335\n const stringPath = `${path}`;\n return {\n width,\n path: stringPath,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string {\n if (isDownsampleInProgress) {\n return 'Downsampling in progress...';\n }\n\n return isDownsamplingDisabled\n ? 'Downsampling disabled, click to enable'\n : 'Downsampling enabled, click to disable';\n }\n\n static downsampleButtonAttr(\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean\n ): string | undefined {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props: ChartProps) {\n super(props);\n\n this.handleAfterPlot = this.handleAfterPlot.bind(this);\n this.handleDownsampleClick = this.handleDownsampleClick.bind(this);\n this.handleErrorClose = this.handleErrorClose.bind(this);\n this.handleModelEvent = this.handleModelEvent.bind(this);\n this.handlePlotUpdate = this.handlePlotUpdate.bind(this);\n this.handleRelayout = this.handleRelayout.bind(this);\n this.handleResize = this.handleResize.bind(this);\n this.handleRestyle = this.handleRestyle.bind(this);\n\n this.PlotComponent = createPlotlyComponent(props.Plotly);\n this.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.isSubscribed = false;\n this.isLoadedFired = false;\n this.currentSeries = 0;\n this.resizeObserver = new window.ResizeObserver(this.handleResize);\n\n this.state = {\n data: null,\n downsamplingError: null,\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n error: null,\n shownError: null,\n layout: {\n datarevision: 0,\n },\n revision: 0,\n };\n }\n\n componentDidMount(): void {\n // Need to make sure the model dimensions are up to date before initializing the data\n this.updateDimensions();\n this.updateModelDimensions();\n\n this.initData();\n this.initFormatter();\n\n const { isActive, model } = this.props;\n if (isActive) {\n this.subscribe(model);\n }\n if (this.plotWrapper.current != null) {\n this.resizeObserver.observe(this.plotWrapper.current);\n }\n }\n\n componentDidUpdate(prevProps: ChartProps): void {\n const { isActive, model, settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n\n if (model !== prevProps.model) {\n this.unsubscribe(prevProps.model);\n this.subscribe(model);\n }\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.updateDimensions();\n this.subscribe(model);\n } else {\n this.unsubscribe(model);\n }\n }\n }\n\n componentWillUnmount(): void {\n const { model } = this.props;\n this.unsubscribe(model);\n\n this.resizeObserver.disconnect();\n }\n\n currentSeries: number;\n\n PlotComponent: React.ComponentType<PlotParams>;\n\n plot: RefObject<typeof this.PlotComponent>;\n\n plotWrapper: RefObject<HTMLDivElement>;\n\n columnFormats?: FormattingRule[];\n\n dateTimeFormatterOptions?: DateTimeColumnFormatterOptions;\n\n decimalFormatOptions: DecimalColumnFormatterOptions;\n\n integerFormatOptions: IntegerColumnFormatterOptions;\n\n rect?: DOMRect;\n\n ranges?: unknown;\n\n isSubscribed: boolean;\n\n isLoadedFired: boolean;\n\n // Listen for resizing of the element and update the canvas appropriately\n resizeObserver: ResizeObserver;\n\n getCachedConfig = memoize(\n (\n downsamplingError: unknown,\n isDownsampleFinished: boolean,\n isDownsampleInProgress: boolean,\n isDownsamplingDisabled: boolean,\n data: Partial<Data>[],\n error: unknown\n ): Partial<PlotlyConfig> => {\n const customButtons: ModeBarButtonAny[] = [];\n const hasDownsampleError = Boolean(downsamplingError);\n if (hasDownsampleError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n title: 'Downsampling failed',\n click: () => {\n this.toggleErrorMessage(`${downsamplingError}`);\n },\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n const hasError = Boolean(error);\n if (hasError) {\n customButtons.push({\n name: `Error: ${error}`,\n title: `Error`,\n click: () => {\n this.toggleErrorMessage(`${error}`);\n },\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n hasDownsampleError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const attr = Chart.downsampleButtonAttr(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n title: 'Downsampling status',\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\n\n const has2D = data.some(\n ({ type }) => type != null && !type.includes('3d')\n );\n const has3D = data.some(\n ({ type }) => type != null && type.includes('3d')\n );\n\n const buttons2D = [\n 'zoomIn2d',\n 'zoomOut2d',\n 'autoScale2d',\n 'resetScale2d',\n ] as const;\n const buttons3D = [\n 'orbitRotation',\n 'tableRotation',\n 'resetCameraDefault3d',\n ] as const;\n\n return {\n displaylogo: false,\n\n // Display the mode bar if there's an error or downsampling so user can see progress\n // Yes, the value is a boolean or the string 'hover': https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js#L249\n displayModeBar:\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n isDownsampleInProgress || hasDownsampleError || hasError\n ? true\n : ('hover' as const),\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'], // These work the same for both 2d and 3d\n [...(has2D ? buttons2D : []), ...(has3D ? buttons3D : [])],\n ],\n };\n }\n );\n\n getPlotRect(): DOMRect | null {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData(): void {\n const { model } = this.props;\n const { layout } = this.state;\n this.setState({\n data: model.getData(),\n layout: {\n ...layout,\n ...model.getLayout(),\n },\n });\n }\n\n subscribe(model: ChartModel): void {\n if (this.isSubscribed) {\n return;\n }\n\n if (!this.rect || this.rect.width === 0 || this.rect.height === 0) {\n log.debug2('Delaying subscription until model dimensions are set');\n return;\n }\n model.subscribe(this.handleModelEvent);\n this.isSubscribed = true;\n }\n\n unsubscribe(model: ChartModel): void {\n if (!this.isSubscribed) {\n return;\n }\n\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot(): void {\n if (this.plot.current != null) {\n // TODO: Translate whatever Don was doing in plotting.js in the afterplot here so that area graphs show up properly\n }\n }\n\n handleDownsampleClick(): void {\n this.setState(\n ({ isDownsamplingDisabled }) => ({\n downsamplingError: null,\n isDownsampleInProgress: false,\n isDownsampleFinished: false,\n isDownsamplingDisabled: !isDownsamplingDisabled,\n }),\n () => {\n const { model } = this.props;\n const { isDownsamplingDisabled } = this.state;\n model.setDownsamplingDisabled(isDownsamplingDisabled);\n }\n );\n }\n\n handleErrorClose(): void {\n this.setState({ shownError: null });\n }\n\n handleModelEvent(event: CustomEvent): void {\n const { type, detail } = event;\n log.debug2('Received data update', type, detail);\n\n switch (type) {\n case ChartModel.EVENT_UPDATED: {\n this.currentSeries += 1;\n this.setState(state => {\n const { layout, revision } = state;\n if (typeof layout.datarevision === 'number') {\n layout.datarevision += 1;\n }\n return {\n data: detail,\n layout,\n revision: revision + 1,\n };\n });\n\n const { onUpdate } = this.props;\n onUpdate({ isLoading: !this.isLoadedFired });\n break;\n }\n case ChartModel.EVENT_LOADFINISHED: {\n const { onUpdate } = this.props;\n this.isLoadedFired = true;\n onUpdate({ isLoading: false });\n break;\n }\n case ChartModel.EVENT_DISCONNECT: {\n const { onDisconnect } = this.props;\n onDisconnect();\n break;\n }\n case ChartModel.EVENT_RECONNECT: {\n const { onReconnect } = this.props;\n onReconnect();\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLESTARTED: {\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: true,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLEFINISHED: {\n this.setState({\n isDownsampleFinished: true,\n isDownsampleInProgress: false,\n downsamplingError: null,\n });\n break;\n }\n case ChartModel.EVENT_DOWNSAMPLENEEDED:\n case ChartModel.EVENT_DOWNSAMPLEFAILED: {\n const downsamplingError = detail.message ?? detail;\n this.setState({\n isDownsampleFinished: false,\n isDownsampleInProgress: false,\n isDownsamplingDisabled: false,\n downsamplingError,\n });\n\n const { onError } = this.props;\n onError(new DownsamplingError(downsamplingError));\n break;\n }\n case ChartModel.EVENT_ERROR: {\n const error = `${detail}`;\n this.setState({ error });\n const { onError } = this.props;\n onError(new Error(error));\n break;\n }\n default:\n log.debug('Unknown event type', type, event);\n }\n }\n\n handlePlotUpdate(figure: Readonly<{ layout: Partial<Layout> }>): void {\n // User could have modified zoom/pan here, update the model dimensions\n // We don't need to update the datarevision, as we don't have any data changes\n // until an update comes back from the server anyway\n const { layout } = figure;\n const ranges = ChartUtils.getLayoutRanges(layout);\n\n const isRangesChanged = !deepEqual(ranges, this.ranges);\n\n if (isRangesChanged) {\n this.ranges = ranges;\n\n this.updateModelDimensions(true);\n }\n }\n\n handleRelayout(changes: { hiddenlabels?: string[] }): void {\n log.debug('handleRelayout', changes);\n if (changes.hiddenlabels != null) {\n const { onSettingsChanged } = this.props;\n // Pie charts store series visibility in layout.hiddenlabels and trigger relayout on changes\n // Series visibility for other types of charts is handled in handleRestyle\n const hiddenSeries = [...changes.hiddenlabels];\n onSettingsChanged({ hiddenSeries });\n }\n\n this.updateModelDimensions();\n }\n\n handleResize(): void {\n this.updateDimensions();\n }\n\n handleRestyle([changes, seriesIndexes]: readonly [\n Record<string, unknown>,\n number[],\n ]): void {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n if (data != null) {\n const hiddenSeries = (data as Partial<PlotData>[]).reduce(\n (acc: string[], { name, visible }) =>\n name != null && visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\n }\n }\n }\n\n /**\n * Toggle the error message. If it is already being displayed, then hide it.\n */\n toggleErrorMessage(error: string): void {\n this.setState(({ shownError }) => ({\n shownError: shownError === error ? null : error,\n }));\n }\n\n /**\n * Update the models dimensions and ranges.\n * Note that this will update it all whether the plot size changes OR the range\n * the user is looking at has changed (eg. panning/zooming).\n * Could update each independently, but doing them at the same time keeps the\n * ChartModel API a bit cleaner.\n * @param force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false): void {\n const rect = this.getPlotRect();\n if (!rect) {\n log.warn('Unable to get plotting rect');\n return;\n }\n\n const isRectChanged =\n !this.rect ||\n this.rect.width !== rect.width ||\n this.rect.height !== rect.height;\n\n if (isRectChanged || force) {\n this.rect = rect;\n\n const { isActive, model } = this.props;\n model.setDimensions(rect);\n // We may need to resubscribe if dimensions were too small before\n if (isActive) {\n this.subscribe(model);\n }\n }\n }\n\n initFormatter(): void {\n const { settings } = this.props;\n this.updateFormatterSettings(settings as FormatterSettings);\n }\n\n updateFormatterSettings(settings: FormatterSettings): void {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions =\n FormatterUtils.getDateTimeFormatterOptions(settings);\n const { decimalFormatOptions = {}, integerFormatOptions = {} } = settings;\n\n if (\n !deepEqual(this.columnFormats, columnFormats) ||\n !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions) ||\n !deepEqual(this.decimalFormatOptions, decimalFormatOptions) ||\n !deepEqual(this.integerFormatOptions, integerFormatOptions)\n ) {\n this.columnFormats = FormatterUtils.getColumnFormats(settings);\n this.dateTimeFormatterOptions = dateTimeFormatterOptions;\n this.decimalFormatOptions = decimalFormatOptions;\n this.integerFormatOptions = integerFormatOptions;\n this.updateFormatter();\n }\n }\n\n updateFormatter(): void {\n const { model } = this.props;\n const formatter = new Formatter(\n model.dh,\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n model.setFormatter(formatter);\n }\n\n updateDimensions(): void {\n const rect = this.getPlotRect();\n const { Plotly: PlotlyProp } = this.props;\n if (\n this.plot.current != null &&\n rect != null &&\n rect.width > 0 &&\n rect.height > 0\n ) {\n // Call relayout to resize avoiding the debouncing plotly does\n // https://github.com/plotly/plotly.js/issues/2769#issuecomment-402099552\n PlotlyProp.relayout(\n (this.plot.current as unknown as { el: HTMLElement }).el,\n {\n autosize: true,\n }\n ).catch((e: unknown) => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n\n render(): ReactElement {\n const { PlotComponent } = this;\n const {\n data,\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n error,\n shownError,\n layout,\n revision,\n } = this.state;\n const config = this.getCachedConfig(\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled,\n data ?? [],\n error\n );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <PlotComponent\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\n onError={log.error}\n onRelayout={this.handleRelayout}\n onUpdate={this.handlePlotUpdate}\n onRestyle={this.handleRestyle}\n useResizeHandler\n style={{ height: '100%', width: '100%' }}\n />\n )}\n <Popper\n className=\"chart-error-popper\"\n options={{ placement: 'top' }}\n isShown={shownError != null}\n onExited={this.handleErrorClose}\n closeOnBlur\n interactive\n >\n {shownError != null && (\n <>\n <div className=\"chart-error\">{shownError}</div>\n <CopyButton tooltip=\"Copy Error\" copy={shownError}>\n Copy Error\n </CopyButton>\n </>\n )}\n </Popper>\n </div>\n );\n }\n}\n\nexport default Chart;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAiC,OAAO;AACjE,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,OAAO,MAAM,aAAa;AACjC,SAASC,UAAU,EAAEC,MAAM,QAAQ,uBAAuB;AAC1D,SACEC,SAAS,EACTC,eAAe,EACfC,eAAe,QAEV,kBAAkB;AACzB,SACEC,SAAS,EACTC,cAAc,EACdC,SAAS,QAOJ,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAU1BC,qBAAqB;AAAA,OACrBC,MAAM;AAAA,OACNC,UAAU;AAAA,OACVC,UAAU;AAAA;AAAA,OAEVC,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAA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VENT_DOWNSAMPLEFAILED: string;
18
18
  static EVENT_DOWNSAMPLENEEDED: string;
19
19
  static EVENT_LOADFINISHED: string;
20
+ static EVENT_ERROR: string;
20
21
  constructor(dh: DhType);
21
22
  dh: DhType;
22
23
  listeners: ((event: ChartEvent) => void)[];
@@ -65,6 +66,7 @@ declare class ChartModel {
65
66
  fireDownsampleFail(detail: unknown): void;
66
67
  fireDownsampleNeeded(detail: unknown): void;
67
68
  fireLoadFinished(): void;
69
+ fireError(detail: string[]): void;
68
70
  }
69
71
  export default ChartModel;
70
72
  //# sourceMappingURL=ChartModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModel.d.ts","sourceRoot":"","sources":["../src/ChartModel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC;;;;GAIG;AACH,cAAM,UAAU;IACd,MAAM,CAAC,aAAa,SAA8B;IAElD,MAAM,CAAC,gBAAgB,SAAiC;IAExD,MAAM,CAAC,eAAe,SAAgC;IAEtD,MAAM,CAAC,uBAAuB,SAAwC;IAEtE,MAAM,CAAC,wBAAwB,SAAyC;IAExE,MAAM,CAAC,sBAAsB,SAAuC;IAEpE,MAAM,CAAC,sBAAsB,SAAuC;IAEpE,MAAM,CAAC,kBAAkB,SAAmC;gBAEhD,EAAE,EAAE,MAAM;IAMtB,EAAE,EAAE,MAAM,CAAC;IAEX,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC,EAAE,CAAC;IAE3C,SAAS,CAAC,EAAE,SAAS,CAAC;IAE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S,EAAE,SAAS,GAAG,IAAI;IAIxC;;;OAGG;IACH,uBAAuB,CAAC,sBAAsB,EAAE,OAAO,GAAG,IAAI;IAI9D;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAIlC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAItD,WAAW,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAIxD,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMlC,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAI/B,cAAc,IAAI,IAAI;IAItB,aAAa,IAAI,IAAI;IAIrB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM1C,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM3C,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAMzC,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAM3C,gBAAgB,IAAI,IAAI;IAIxB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;CAGlC;AAED,eAAe,UAAU,CAAC"}
@@ -122,6 +122,11 @@ class ChartModel {
122
122
  fireLoadFinished() {
123
123
  this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));
124
124
  }
125
+ fireError(detail) {
126
+ this.fireEvent(new CustomEvent(ChartModel.EVENT_ERROR, {
127
+ detail
128
+ }));
129
+ }
125
130
  }
126
131
  _defineProperty(ChartModel, "EVENT_UPDATED", 'ChartModel.EVENT_UPDATED');
127
132
  _defineProperty(ChartModel, "EVENT_DISCONNECT", 'ChartModel.EVENT_DISCONNECT');
@@ -131,5 +136,6 @@ _defineProperty(ChartModel, "EVENT_DOWNSAMPLEFINISHED", 'ChartModel.EVENT_DOWNSA
131
136
  _defineProperty(ChartModel, "EVENT_DOWNSAMPLEFAILED", 'ChartModel.EVENT_DOWNSAMPLEFAILED');
132
137
  _defineProperty(ChartModel, "EVENT_DOWNSAMPLENEEDED", 'ChartModel.EVENT_DOWNSAMPLENEEDED');
133
138
  _defineProperty(ChartModel, "EVENT_LOADFINISHED", 'ChartModel.EVENT_LOADFINISHED');
139
+ _defineProperty(ChartModel, "EVENT_ERROR", 'ChartModel.EVENT_ERROR');
134
140
  export default ChartModel;
135
141
  //# sourceMappingURL=ChartModel.js.map