@deephaven/chart 0.9.0 → 0.9.1-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Chart.css CHANGED
@@ -44,13 +44,13 @@
44
44
  .chart-wrapper .js-plotly-plot .plotly .modebar {
45
45
  z-index: auto;
46
46
  }
47
- .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-title="Downsampling in progress..."] svg {
47
+ .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-attr=animation-spin] svg {
48
48
  animation: fa-spin 2s infinite linear;
49
49
  }
50
- .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-title="Downsampling enabled, click to disable"] svg path {
50
+ .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-attr=fill-active] svg path {
51
51
  fill: rgba(255, 255, 255, 0.7) !important;
52
52
  }
53
- .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-title^="Downsampling failed"] svg path {
53
+ .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-attr=fill-warning] svg path {
54
54
  fill: #f37e3f !important;
55
55
  }
56
56
 
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../src/Chart.scss","../../components/scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAYA;EACE,cAV6B;;;AAa/B;EAIE;EACA;EACA;;;AAGF;EACE,YCfc;;ADkBZ;EACE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE,MCnCW;EDoCX,QCtBK;;AD2BT;EACE;EAGA;;AAGF;EACE,eC2DY;ED1DZ,YCvCO;EDwCP,OCnDa;EDoDb;EACA,YCgHiB;ED7GjB;;AAGF;EAEE;;AAKI;EACE;;AAMA;EACE;;AAOF;EACE","file":"Chart.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../src/Chart.scss","../../components/scss/bootstrap_overrides.scss"],"names":[],"mappings":"AAQA;EACE,cAN6B;;;AAS/B;EAIE;EACA;EACA;;;AAGF;EACE,YCXc;;ADcZ;EACE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE,MC/BW;EDgCX,QClBK;;ADuBT;EACE;EAGA;;AAGF;EACE,eC+DY;ED9DZ,YCnCO;EDoCP,OC/Ca;EDgDb;EACA,YCoHiB;EDjHjB;;AAGF;EAEE;;AAII;EACE;;AAMA;EACE;;AAOF;EACE","file":"Chart.css"}
package/dist/Chart.d.ts CHANGED
@@ -3,14 +3,15 @@ export class Chart extends React.Component<any, any, any> {
3
3
  * Convert a font awesome icon definition to a plotly icon definition
4
4
  * @param {FontAwesome.IconDefinition} faIcon The icon to convert
5
5
  */
6
- static convertIcon(faIcon: any): {
6
+ static convertIcon(faIcon: FontAwesome.IconDefinition): {
7
7
  width: any;
8
8
  path: any;
9
9
  ascent: any;
10
10
  descent: number;
11
11
  transform: string;
12
12
  };
13
- static downsampleButtonTitle(isDownsampleInProgress: any, isDownsamplingDisabled: any): any;
13
+ static downsampleButtonTitle(isDownsampleInProgress: any, isDownsamplingDisabled: any): "Downsampling in progress..." | "Downsampling disabled, click to enable" | "Downsampling enabled, click to disable";
14
+ static downsampleButtonAttr(isDownsampleInProgress: any, isDownsamplingDisabled: any): "animation-spin" | "fill-active" | undefined;
14
15
  constructor(props: any);
15
16
  handleAfterPlot(): void;
16
17
  handleDownsampleClick(): void;
@@ -32,7 +33,7 @@ export class Chart extends React.Component<any, any, any> {
32
33
  displaylogo: boolean;
33
34
  displayModeBar: string | boolean;
34
35
  modeBarButtons: (string[] | {
35
- name: any;
36
+ name: string;
36
37
  icon: {
37
38
  width: any;
38
39
  path: any;
@@ -41,6 +42,7 @@ export class Chart extends React.Component<any, any, any> {
41
42
  transform: string;
42
43
  };
43
44
  click: () => void;
45
+ attr: string | undefined;
44
46
  }[])[];
45
47
  };
46
48
  getPlotRect(): any;
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../src/Chart.jsx"],"names":[],"mappings":"AAiBA;IACE;;;OAGG;IACH;;;;;;MAWC;IAED,4FAQC;IAED,wBAgCC;IA8HD,wBAIC;IAED,8BAcC;IAED,mCAsEC;IAED,oCAcC;IAED,mCAWC;IAED,0DAYC;IA3RC,2BAA6B;IAC7B,kCAAoC;IACpC,qBAAuB;IACvB,6BAAkC;IAClC,yBAA8B;IAC9B,yBAA8B;IAC9B,UAAgB;IAChB,sBAAkB;IAClB,sBAAyB;IACzB,uBAA0B;IA8C5B;;;;;;;;;;;;;;MAmDE;IAEF,mBAEC;IAED,iBAUC;IAED,kBAYC;IAED,oBAQC;IA2ID;;;;;;;OAOG;IACH,8BAFW,OAAO,QAwBjB;IAED,sBAGC;IAED,6CAmBC;IAED,wBAUC;IAED,yBAcC;CAuCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmCe,uCAAQ;;QACT,sCAAQ;;QACX,mCAAQ;;QACT,kCAAQ;;QACE,4CAAQ"}
1
+ {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../src/Chart.jsx"],"names":[],"mappings":"AAgBA;IACE;;;OAGG;IACH;;;;;;MAWC;IAED,4MAQC;IAED,oIAMC;IAED,wBAgCC;IAqID,wBAIC;IAED,8BAcC;IAED,mCAsEC;IAED,oCAcC;IAED,mCAWC;IAED,0DAYC;IAlSC,2BAA6B;IAC7B,kCAAoC;IACpC,qBAAuB;IACvB,6BAAkC;IAClC,yBAA8B;IAC9B,yBAA8B;IAC9B,UAAgB;IAChB,sBAAkB;IAClB,sBAAyB;IACzB,uBAA0B;IA8C5B;;;;;;;;;;;;;;;MA0DE;IAEF,mBAEC;IAED,iBAUC;IAED,kBAYC;IAED,oBAQC;IA2ID;;;;;;;OAOG;IACH,8BAFW,OAAO,QAwBjB;IAED,sBAGC;IAED,6CAmBC;IAED,wBAUC;IAED,yBAcC;CAuCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAmCe,uCAAQ;;QACT,sCAAQ;;QACX,mCAAQ;;QACT,kCAAQ;;QACE,4CAAQ"}
package/dist/Chart.js CHANGED
@@ -15,7 +15,6 @@ import Plotly from "./plotly/Plotly.js";
15
15
  import Plot from "./plotly/Plot.js";
16
16
  import ChartModel from "./ChartModel.js";
17
17
  import ChartUtils from "./ChartUtils.js";
18
- import ChartConstants from "./Chart.module.css";
19
18
  import "./Chart.css";
20
19
  var log = Log.module('Chart');
21
20
  export class Chart extends Component {
@@ -38,10 +37,18 @@ export class Chart extends Component {
38
37
 
39
38
  static downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled) {
40
39
  if (isDownsampleInProgress) {
41
- return ChartConstants['title-downsampling-in-progress'];
40
+ return 'Downsampling in progress...';
42
41
  }
43
42
 
44
- return isDownsamplingDisabled ? ChartConstants['title-downsampling-disabled'] : ChartConstants['title-downsampling-enabled'];
43
+ return isDownsamplingDisabled ? 'Downsampling disabled, click to enable' : 'Downsampling enabled, click to disable';
44
+ }
45
+
46
+ static downsampleButtonAttr(isDownsampleInProgress, isDownsamplingDisabled) {
47
+ if (isDownsampleInProgress) {
48
+ return 'animation-spin';
49
+ }
50
+
51
+ return isDownsamplingDisabled ? undefined : 'fill-active';
45
52
  }
46
53
 
47
54
  constructor(props) {
@@ -52,19 +59,22 @@ export class Chart extends Component {
52
59
 
53
60
  if (downsamplingError) {
54
61
  customButtons.push({
55
- name: "".concat(ChartConstants['title-downsampling-failed'], ": ").concat(downsamplingError),
62
+ name: "Downsampling failed: ".concat(downsamplingError),
56
63
  click: () => {},
57
- icon: Chart.convertIcon(dhWarningFilled)
64
+ icon: Chart.convertIcon(dhWarningFilled),
65
+ attr: 'fill-warning'
58
66
  });
59
67
  }
60
68
 
61
69
  if (isDownsampleFinished || isDownsampleInProgress || isDownsamplingDisabled || downsamplingError) {
62
70
  var name = Chart.downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled);
71
+ var attr = Chart.downsampleButtonAttr(isDownsampleInProgress, isDownsamplingDisabled);
63
72
  var icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;
64
73
  customButtons.push({
65
74
  name,
66
75
  icon: Chart.convertIcon(icon),
67
- click: this.handleDownsampleClick
76
+ click: this.handleDownsampleClick,
77
+ attr
68
78
  });
69
79
  }
70
80
 
package/dist/Chart.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Chart.jsx"],"names":["React","Component","PropTypes","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","Plotly","Plot","ChartModel","ChartUtils","ChartConstants","log","module","Chart","convertIcon","faIcon","width","path","icon","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","constructor","props","downsamplingError","isDownsampleFinished","customButtons","push","name","click","handleDownsampleClick","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","rect","ranges","isSubscribed","isLoadedFired","state","data","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","current","getBoundingClientRect","model","setState","getData","getLayout","height","debug2","setDownsamplingDisabled","event","type","detail","EVENT_UPDATED","currentSeries","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","message","onError","Error","debug","figure","getLayoutRanges","isRangesChanged","changes","Object","keys","includes","onSettingsChanged","hiddenSeries","hiddenlabels","seriesIndexes","reduce","acc","visible","force","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","setFormatter","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","propTypes","instanceOf","isRequired","shape","timeZone","string","defaultDateTimeFormat","showTimeZone","bool","showTSeparator","arrayOf","defaultFormatString","func","defaultProps","FULL_DATE_FORMAT"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SAASC,SAAT,EAAoBC,eAApB,EAAqCC,eAArC,QAA4D,kBAA5D;AACA,SAASC,SAAT,EAAoBC,cAApB,EAAoCC,SAApC,QAAqD,sBAArD;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,M;OACAC,I;OAEAC,U;OACAC,U;OACAC,c;;AAGP,IAAMC,GAAG,GAAGN,GAAG,CAACO,MAAJ,CAAW,OAAX,CAAZ;AAEA,OAAO,MAAMC,KAAN,SAAoBlB,SAApB,CAA8B;AACnC;AACF;AACA;AACA;AACoB,SAAXmB,WAAW,CAACC,MAAD,EAAS;AACzB,QAAM,CAACC,KAAD,KAAcC,IAAd,IAAsBF,MAAM,CAACG,IAAnC,CADyB,CAEzB;AACA;;AACA,WAAO;AACLF,MAAAA,KADK;AAELC,MAAAA,IAFK;AAGLE,MAAAA,MAAM,EAAEH,KAHH;AAILI,MAAAA,OAAO,EAAE,CAJJ;AAKLC,MAAAA,SAAS;AALJ,KAAP;AAOD;;AAE2B,SAArBC,qBAAqB,CAACC,sBAAD,EAAyBC,sBAAzB,EAAiD;AAC3E,QAAID,sBAAJ,EAA4B;AAC1B,aAAOb,cAAc,CAAC,gCAAD,CAArB;AACD;;AAED,WAAOc,sBAAsB,GACzBd,cAAc,CAAC,6BAAD,CADW,GAEzBA,cAAc,CAAC,4BAAD,CAFlB;AAGD;;AAEDe,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,UAAMA,KAAN;;AADiB,6CAiED5B,OAAO,C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AAkBhBrD,EAAAA,WAAW,EAAEjG,SAAS,CAACsJ,IAlBP;AAmBhB3D,EAAAA,QAAQ,EAAE3F,SAAS,CAACsJ,IAnBJ;AAoBhB/C,EAAAA,OAAO,EAAEvG,SAAS,CAACsJ,IApBH;AAqBhBrC,EAAAA,iBAAiB,EAAEjH,SAAS,CAACsJ;AArBb,CAAlB;AAwBArI,KAAK,CAACsI,YAAN,GAAqB;AACnBnF,EAAAA,QAAQ,EAAE,IADS;AAEnBI,EAAAA,QAAQ,EAAE;AACRsE,IAAAA,QAAQ,EAAE,kBADF;AAERE,IAAAA,qBAAqB,EAAExI,SAAS,CAACgJ,gBAFzB;AAGRP,IAAAA,YAAY,EAAE,KAHN;AAIRE,IAAAA,cAAc,EAAE,IAJR;AAKRpB,IAAAA,SAAS,EAAE;AALH,GAFS;AASnBhC,EAAAA,YAAY,EAAE,MAAM,CAAE,CATH;AAUnBE,EAAAA,WAAW,EAAE,MAAM,CAAE,CAVF;AAWnBN,EAAAA,QAAQ,EAAE,MAAM,CAAE,CAXC;AAYnBY,EAAAA,OAAO,EAAE,MAAM,CAAE,CAZE;AAanBU,EAAAA,iBAAiB,EAAE,MAAM,CAAE;AAbR,CAArB;AAgBA,eAAehG,KAAf","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport { vsLoading, dhGraphLineDown, dhWarningFilled } from '@deephaven/icons';\nimport { Formatter, FormatterUtils, DateUtils } from '@deephaven/iris-grid';\nimport Log from '@deephaven/log';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\n\nimport ChartModel from './ChartModel';\nimport ChartUtils from './ChartUtils';\nimport ChartConstants from './Chart.module.scss';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\nexport class Chart extends Component {\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param {FontAwesome.IconDefinition} faIcon The icon to convert\n */\n static convertIcon(faIcon) {\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 return {\n width,\n path,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled) {\n if (isDownsampleInProgress) {\n return ChartConstants['title-downsampling-in-progress'];\n }\n\n return isDownsamplingDisabled\n ? ChartConstants['title-downsampling-disabled']\n : ChartConstants['title-downsampling-enabled'];\n }\n\n constructor(props) {\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.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.rect = null;\n this.ranges = null;\n this.isSubscribed = false;\n this.isLoadedFired = false;\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() {\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 } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps) {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount() {\n this.unsubscribe();\n }\n\n getCachedConfig = memoize(\n (\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled\n ) => {\n const customButtons = [];\n if (downsamplingError) {\n customButtons.push({\n name: `${ChartConstants['title-downsampling-failed']}: ${downsamplingError}`,\n click: () => {},\n icon: Chart.convertIcon(dhWarningFilled),\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n downsamplingError\n ) {\n const name = Chart.downsampleButtonTitle(\n isDownsampleInProgress,\n isDownsamplingDisabled\n );\n const icon = isDownsampleInProgress ? vsLoading : dhGraphLineDown;\n customButtons.push({\n name,\n icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n });\n }\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 isDownsampleInProgress || downsamplingError ? true : 'hover',\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'],\n ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'],\n ],\n };\n }\n );\n\n getPlotRect() {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData() {\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() {\n if (this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\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() {\n if (!this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot() {\n if (this.plot.current) {\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() {\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) {\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 layout.datarevision += 1;\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.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) {\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) {\n log.debug('handleRelayout', changes);\n if (Object.keys(changes).includes('hiddenlabels')) {\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]) {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n const hiddenSeries = data.reduce(\n (acc, { name, visible }) =>\n visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\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 {boolean} force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false) {\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();\n }\n }\n }\n\n initFormatter() {\n const { settings } = this.props;\n this.updateFormatterSettings(settings);\n }\n\n updateFormatterSettings(settings) {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\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() {\n const formatter = new Formatter(\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n\n const { model } = this.props;\n model.setFormatter(formatter);\n }\n\n updateDimensions() {\n const rect = this.getPlotRect();\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 Plotly.relayout(this.plot.current.el, { autosize: true }).catch(e => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n\n render() {\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 );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <Plot\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\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\nChart.propTypes = {\n model: PropTypes.instanceOf(ChartModel).isRequired,\n // These settings come from the redux store\n settings: PropTypes.shape({\n timeZone: PropTypes.string.isRequired,\n defaultDateTimeFormat: PropTypes.string.isRequired,\n showTimeZone: PropTypes.bool.isRequired,\n showTSeparator: PropTypes.bool.isRequired,\n formatter: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n decimalFormatOptions: PropTypes.shape({\n defaultFormatString: PropTypes.string,\n }),\n integerFormatOptions: PropTypes.shape({\n defaultFormatString: PropTypes.string,\n }),\n }),\n isActive: PropTypes.bool,\n onDisconnect: PropTypes.func,\n onReconnect: PropTypes.func,\n onUpdate: PropTypes.func,\n onError: PropTypes.func,\n onSettingsChanged: PropTypes.func,\n};\n\nChart.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 onDisconnect: () => {},\n onReconnect: () => {},\n onUpdate: () => {},\n onError: () => {},\n onSettingsChanged: () => {},\n};\n\nexport default Chart;\n"],"file":"Chart.js"}
1
+ {"version":3,"sources":["../src/Chart.jsx"],"names":["React","Component","PropTypes","deepEqual","memoize","vsLoading","dhGraphLineDown","dhWarningFilled","Formatter","FormatterUtils","DateUtils","Log","Plotly","Plot","ChartModel","ChartUtils","log","module","Chart","convertIcon","faIcon","width","path","icon","ascent","descent","transform","downsampleButtonTitle","isDownsampleInProgress","isDownsamplingDisabled","downsampleButtonAttr","undefined","constructor","props","downsamplingError","isDownsampleFinished","customButtons","push","name","click","attr","handleDownsampleClick","displaylogo","displayModeBar","modeBarButtons","handleAfterPlot","bind","handleModelEvent","handlePlotUpdate","handleRelayout","handleRestyle","plot","createRef","plotWrapper","columnFormats","dateTimeFormatterOptions","decimalFormatOptions","integerFormatOptions","rect","ranges","isSubscribed","isLoadedFired","state","data","layout","datarevision","revision","componentDidMount","updateDimensions","updateModelDimensions","initData","initFormatter","isActive","subscribe","componentDidUpdate","prevProps","settings","updateFormatterSettings","unsubscribe","componentWillUnmount","getPlotRect","current","getBoundingClientRect","model","setState","getData","getLayout","height","debug2","setDownsamplingDisabled","event","type","detail","EVENT_UPDATED","currentSeries","onUpdate","isLoading","EVENT_LOADFINISHED","EVENT_DISCONNECT","onDisconnect","EVENT_RECONNECT","onReconnect","EVENT_DOWNSAMPLESTARTED","EVENT_DOWNSAMPLEFINISHED","EVENT_DOWNSAMPLENEEDED","EVENT_DOWNSAMPLEFAILED","message","onError","Error","debug","figure","getLayoutRanges","isRangesChanged","changes","Object","keys","includes","onSettingsChanged","hiddenSeries","hiddenlabels","seriesIndexes","reduce","acc","visible","force","warn","isRectChanged","setDimensions","getColumnFormats","getDateTimeFormatterOptions","updateFormatter","formatter","setFormatter","relayout","el","autosize","catch","e","render","config","getCachedConfig","isPlotShown","propTypes","instanceOf","isRequired","shape","timeZone","string","defaultDateTimeFormat","showTimeZone","bool","showTSeparator","arrayOf","defaultFormatString","func","defaultProps","FULL_DATE_FORMAT"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,aAApB;AACA,SAASC,SAAT,EAAoBC,eAApB,EAAqCC,eAArC,QAA4D,kBAA5D;AACA,SAASC,SAAT,EAAoBC,cAApB,EAAoCC,SAApC,QAAqD,sBAArD;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,M;OACAC,I;OAEAC,U;OACAC,U;;AAGP,IAAMC,GAAG,GAAGL,GAAG,CAACM,MAAJ,CAAW,OAAX,CAAZ;AAEA,OAAO,MAAMC,KAAN,SAAoBjB,SAApB,CAA8B;AACnC;AACF;AACA;AACA;AACoB,SAAXkB,WAAW,CAACC,MAAD,EAAS;AACzB,QAAM,CAACC,KAAD,KAAcC,IAAd,IAAsBF,MAAM,CAACG,IAAnC,CADyB,CAEzB;AACA;;AACA,WAAO;AACLF,MAAAA,KADK;AAELC,MAAAA,IAF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AM,CAAE,CAVF;AAWnBN,EAAAA,QAAQ,EAAE,MAAM,CAAE,CAXC;AAYnBY,EAAAA,OAAO,EAAE,MAAM,CAAE,CAZE;AAanBU,EAAAA,iBAAiB,EAAE,MAAM,CAAE;AAbR,CAArB;AAgBA,eAAenG,KAAf","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport deepEqual from 'deep-equal';\nimport memoize from 'memoize-one';\nimport { vsLoading, dhGraphLineDown, dhWarningFilled } from '@deephaven/icons';\nimport { Formatter, FormatterUtils, DateUtils } from '@deephaven/iris-grid';\nimport Log from '@deephaven/log';\nimport Plotly from './plotly/Plotly';\nimport Plot from './plotly/Plot';\n\nimport ChartModel from './ChartModel';\nimport ChartUtils from './ChartUtils';\nimport './Chart.scss';\n\nconst log = Log.module('Chart');\n\nexport class Chart extends Component {\n /**\n * Convert a font awesome icon definition to a plotly icon definition\n * @param {FontAwesome.IconDefinition} faIcon The icon to convert\n */\n static convertIcon(faIcon) {\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 return {\n width,\n path,\n ascent: width,\n descent: 0,\n transform: `matrix(1, 0, 0, 1, 0, 0)`,\n };\n }\n\n static downsampleButtonTitle(isDownsampleInProgress, isDownsamplingDisabled) {\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(isDownsampleInProgress, isDownsamplingDisabled) {\n if (isDownsampleInProgress) {\n return 'animation-spin';\n }\n\n return isDownsamplingDisabled ? undefined : 'fill-active';\n }\n\n constructor(props) {\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.plot = React.createRef();\n this.plotWrapper = React.createRef();\n this.columnFormats = [];\n this.dateTimeFormatterOptions = {};\n this.decimalFormatOptions = {};\n this.integerFormatOptions = {};\n this.rect = null;\n this.ranges = null;\n this.isSubscribed = false;\n this.isLoadedFired = false;\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() {\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 } = this.props;\n if (isActive) {\n this.subscribe();\n }\n }\n\n componentDidUpdate(prevProps) {\n const { isActive, settings } = this.props;\n this.updateFormatterSettings(settings);\n\n if (isActive !== prevProps.isActive) {\n if (isActive) {\n this.subscribe();\n } else {\n this.unsubscribe();\n }\n }\n }\n\n componentWillUnmount() {\n this.unsubscribe();\n }\n\n getCachedConfig = memoize(\n (\n downsamplingError,\n isDownsampleFinished,\n isDownsampleInProgress,\n isDownsamplingDisabled\n ) => {\n const customButtons = [];\n if (downsamplingError) {\n customButtons.push({\n name: `Downsampling failed: ${downsamplingError}`,\n click: () => {},\n icon: Chart.convertIcon(dhWarningFilled),\n attr: 'fill-warning',\n });\n }\n\n if (\n isDownsampleFinished ||\n isDownsampleInProgress ||\n isDownsamplingDisabled ||\n downsamplingError\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 icon: Chart.convertIcon(icon),\n click: this.handleDownsampleClick,\n attr,\n });\n }\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 isDownsampleInProgress || downsamplingError ? true : 'hover',\n\n // Each array gets grouped together in the mode bar\n modeBarButtons: [\n customButtons,\n ['toImage'],\n ['zoom2d', 'pan2d'],\n ['zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d'],\n ],\n };\n }\n );\n\n getPlotRect() {\n return this.plotWrapper.current?.getBoundingClientRect() ?? null;\n }\n\n initData() {\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() {\n if (this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\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() {\n if (!this.isSubscribed) {\n return;\n }\n\n const { model } = this.props;\n model.unsubscribe(this.handleModelEvent);\n this.isSubscribed = false;\n }\n\n handleAfterPlot() {\n if (this.plot.current) {\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() {\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) {\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 layout.datarevision += 1;\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.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) {\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) {\n log.debug('handleRelayout', changes);\n if (Object.keys(changes).includes('hiddenlabels')) {\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]) {\n log.debug('handleRestyle', changes, seriesIndexes);\n if (Object.keys(changes).includes('visible')) {\n const { data } = this.state;\n const { onSettingsChanged } = this.props;\n const hiddenSeries = data.reduce(\n (acc, { name, visible }) =>\n visible === 'legendonly' ? [...acc, name] : acc,\n []\n );\n onSettingsChanged({ hiddenSeries });\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 {boolean} force Force a change even if the chart dimensions haven't changed (eg. after pan/zoom)\n */\n updateModelDimensions(force = false) {\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();\n }\n }\n }\n\n initFormatter() {\n const { settings } = this.props;\n this.updateFormatterSettings(settings);\n }\n\n updateFormatterSettings(settings) {\n const columnFormats = FormatterUtils.getColumnFormats(settings);\n const dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(\n settings\n );\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() {\n const formatter = new Formatter(\n this.columnFormats,\n this.dateTimeFormatterOptions,\n this.decimalFormatOptions,\n this.integerFormatOptions\n );\n\n const { model } = this.props;\n model.setFormatter(formatter);\n }\n\n updateDimensions() {\n const rect = this.getPlotRect();\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 Plotly.relayout(this.plot.current.el, { autosize: true }).catch(e => {\n log.debug('Unable to resize, promise rejected', e);\n });\n }\n }\n\n render() {\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 );\n const isPlotShown = data != null;\n return (\n <div className=\"h-100 w-100 chart-wrapper\" ref={this.plotWrapper}>\n {isPlotShown && (\n <Plot\n ref={this.plot}\n data={data}\n layout={layout}\n revision={revision}\n config={config}\n onAfterPlot={this.handleAfterPlot}\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\nChart.propTypes = {\n model: PropTypes.instanceOf(ChartModel).isRequired,\n // These settings come from the redux store\n settings: PropTypes.shape({\n timeZone: PropTypes.string.isRequired,\n defaultDateTimeFormat: PropTypes.string.isRequired,\n showTimeZone: PropTypes.bool.isRequired,\n showTSeparator: PropTypes.bool.isRequired,\n formatter: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n decimalFormatOptions: PropTypes.shape({\n defaultFormatString: PropTypes.string,\n }),\n integerFormatOptions: PropTypes.shape({\n defaultFormatString: PropTypes.string,\n }),\n }),\n isActive: PropTypes.bool,\n onDisconnect: PropTypes.func,\n onReconnect: PropTypes.func,\n onUpdate: PropTypes.func,\n onError: PropTypes.func,\n onSettingsChanged: PropTypes.func,\n};\n\nChart.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 onDisconnect: () => {},\n onReconnect: () => {},\n onUpdate: () => {},\n onError: () => {},\n onSettingsChanged: () => {},\n};\n\nexport default Chart;\n"],"file":"Chart.js"}
@@ -32,7 +32,7 @@ declare class ChartModel {
32
32
  * Set the formatter to use when charting the data.
33
33
  * @param {Formatter} formatter The formatter to use to format the charting data
34
34
  */
35
- setFormatter(formatter: any): void;
35
+ setFormatter(formatter: Formatter): void;
36
36
  /**
37
37
  * Disable downsampling
38
38
  * @param {boolean} isDownsamplingDisabled True if downsampling should be disabled
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModel.d.ts","sourceRoot":"","sources":["../src/ChartModel.js"],"names":[],"mappings":";AAEA;;;;GAIG;AACH;IACE,6BAAkD;IAElD,gCAAwD;IAExD,+BAAsD;IAEtD,uCAAsE;IAEtE,wCAAwE;IAExE,sCAAoE;IAEpE,sCAAoE;IAEpE,kCAA4D;IAG1D,iBAAmB;IACnB,eAAqB;IACrB,qBAAgB;IAChB,gCAAmC;IACnC,WAAiB;IAGnB,mBAEC;IAED,0BAEC;IAED,gBAEC;IAED,oCAEC;IAED,4BAEC;IAED,kBAAc;IAEd;;OAEG;IACH,cAAU;IAEV;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,gDAFW,OAAO,QAIjB;IAED;;;OAGG;IACH,oBAFW,OAAO,QAIjB;IAED,2BAEC;IAED;;;OAGG;IACH,oCAEC;IAED,iCAEC;IAED,4BAIC;IAED,4BAEC;IAED,uBAEC;IAED,sBAEC;IAED,uCAIC;IAED,wCAIC;IAED,sCAIC;IAED,wCAIC;IAED,yBAEC;CACF"}
1
+ {"version":3,"file":"ChartModel.d.ts","sourceRoot":"","sources":["../src/ChartModel.js"],"names":[],"mappings":";AAEA;;;;GAIG;AACH;IACE,6BAAkD;IAElD,gCAAwD;IAExD,+BAAsD;IAEtD,uCAAsE;IAEtE,wCAAwE;IAExE,sCAAoE;IAEpE,sCAAoE;IAEpE,kCAA4D;IAG1D,iBAAmB;IACnB,eAAqB;IACrB,qBAAgB;IAChB,gCAAmC;IACnC,WAAiB;IAGnB,mBAEC;IAED,0BAEC;IAED,gBAEC;IAED,oCAEC;IAED,4BAEC;IAED,kBAAc;IAEd;;OAEG;IACH,cAAU;IAEV;;;OAGG;IACH,yCAEC;IAED;;;OAGG;IACH,gDAFW,OAAO,QAIjB;IAED;;;OAGG;IACH,oBAFW,OAAO,QAIjB;IAED,2BAEC;IAED;;;OAGG;IACH,oCAEC;IAED,iCAEC;IAED,4BAIC;IAED,4BAEC;IAED,uBAEC;IAED,sBAEC;IAED,uCAIC;IAED,wCAIC;IAED,sCAIC;IAED,wCAIC;IAED,yBAEC;CACF"}
@@ -12,7 +12,9 @@ declare class ChartModelFactory {
12
12
  * @param {string[]} settings.hiddenSeries Array of hidden series names
13
13
  * @param {dh.Table} table The table to build the model for
14
14
  * @param {Object} theme The theme for the figure. Defaults to ChartTheme
15
- * @returns {Promise<FigureChartModel>} The FigureChartModel representing the figure
15
+ * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
16
+ * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
17
+ * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
16
18
  */
17
19
  static makeModelFromSettings(settings: {
18
20
  isLinked: boolean;
@@ -21,7 +23,7 @@ declare class ChartModelFactory {
21
23
  type: string;
22
24
  xAxis: string;
23
25
  hiddenSeries: string[];
24
- }, table: any, theme?: Object): Promise<FigureChartModel>;
26
+ }, table: dh.Table, theme?: Object): Promise<ChartModel | FigureChartModel>;
25
27
  /**
26
28
  * Creates a model from the settings provided.
27
29
  * Tries to create a Figure in the API with it.
@@ -34,7 +36,9 @@ declare class ChartModelFactory {
34
36
  * @param {string[]} settings.hiddenSeries Array of hidden series names
35
37
  * @param {dh.Figure} figure The figure to build the model for
36
38
  * @param {Object} theme The theme for the figure. Defaults to ChartTheme
37
- * @returns {Promise<FigureChartModel>} The FigureChartModel representing the figure
39
+ * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
40
+ * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
41
+ * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
38
42
  */
39
43
  static makeModel(settings: {
40
44
  isLinked: boolean;
@@ -43,7 +47,7 @@ declare class ChartModelFactory {
43
47
  type: string;
44
48
  xAxis: string;
45
49
  hiddenSeries: string[];
46
- }, figure: any, theme?: Object): Promise<FigureChartModel>;
50
+ }, figure: dh.Figure, theme?: Object): Promise<ChartModel | FigureChartModel>;
47
51
  }
48
52
  import FigureChartModel from "./FigureChartModel";
49
53
  //# sourceMappingURL=ChartModelFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.js"],"names":[],"mappings":";AAKA;IACE;;;;;;;;;;;;;OAaG;IACH;QAV6B,QAAQ,EAA1B,OAAO;QACY,MAAM,EAAzB,MAAM,EAAE;QACS,aAAa,EAA9B,MAAM;QACW,IAAI,EAArB,MAAM;QACW,KAAK,EAAtB,MAAM;QACa,YAAY,EAA/B,MAAM,EAAE;2BAER,MAAM,GACJ,QAAQ,gBAAgB,CAAC,CAgBrC;IAED;;;;;;;;;;;;;OAaG;IACH;QAV6B,QAAQ,EAA1B,OAAO;QACY,MAAM,EAAzB,MAAM,EAAE;QACS,aAAa,EAA9B,MAAM;QACW,IAAI,EAArB,MAAM;QACW,KAAK,EAAtB,MAAM;QACa,YAAY,EAA/B,MAAM,EAAE;4BAER,MAAM,GACJ,QAAQ,gBAAgB,CAAC,CAIrC;CACF"}
1
+ {"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.js"],"names":[],"mappings":";AAKA;IACE;;;;;;;;;;;;;;;OAeG;IACH;QAZ6B,QAAQ,EAA1B,OAAO;QACY,MAAM,EAAzB,MAAM,EAAE;QACS,aAAa,EAA9B,MAAM;QACW,IAAI,EAArB,MAAM;QACW,KAAK,EAAtB,MAAM;QACa,YAAY,EAA/B,MAAM,EAAE;gCAER,MAAM,GACJ,QAAQ,aAAa,gBAAgB,CAAC,CAkBlD;IAED;;;;;;;;;;;;;;;OAeG;IACH;QAZ6B,QAAQ,EAA1B,OAAO;QACY,MAAM,EAAzB,MAAM,EAAE;QACS,aAAa,EAA9B,MAAM;QACW,IAAI,EAArB,MAAM;QACW,KAAK,EAAtB,MAAM;QACa,YAAY,EAA/B,MAAM,EAAE;kCAER,MAAM,GACJ,QAAQ,aAAa,gBAAgB,CAAC,CAMlD;CACF"}
@@ -20,7 +20,9 @@ class ChartModelFactory {
20
20
  * @param {string[]} settings.hiddenSeries Array of hidden series names
21
21
  * @param {dh.Table} table The table to build the model for
22
22
  * @param {Object} theme The theme for the figure. Defaults to ChartTheme
23
- * @returns {Promise<FigureChartModel>} The FigureChartModel representing the figure
23
+ * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
24
+ * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
25
+ * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
24
26
  */
25
27
  static makeModelFromSettings(settings, table) {
26
28
  var _arguments = arguments;
@@ -50,7 +52,9 @@ class ChartModelFactory {
50
52
  * @param {string[]} settings.hiddenSeries Array of hidden series names
51
53
  * @param {dh.Figure} figure The figure to build the model for
52
54
  * @param {Object} theme The theme for the figure. Defaults to ChartTheme
53
- * @returns {Promise<FigureChartModel>} The FigureChartModel representing the figure
55
+ * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
56
+ * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
57
+ * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
54
58
  */
55
59
 
56
60
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ChartModelFactory.js"],"names":["dh","ChartUtils","FigureChartModel","ChartTheme","ChartModelFactory","makeModelFromSettings","settings","table","theme","copy","then","tableCopy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","figure","makeModel"],"mappings":";;;;AAAA,OAAOA,EAAP,MAAe,uBAAf;OACOC,U;OACAC,gB;OACAC,U;;AAEP,MAAMC,iBAAN,CAAwB;AACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACoC,SAArBC,qBAAqB,CAACC,QAAD,EAAWC,KAAX,EAAsC;AAAA;AAAA;AAAA,UAApBC,KAAoB,0EAAZL,UAAY;AACtE;AACA;AACA;AACA;AACA,aAAOI,KAAK,CAACE,IAAN,GAAaC,IAAb,CAAkBC,SAAS,IAAI;AACpCA,QAAAA,SAAS,CAACC,kBAAV,CAA6BL,KAAK,CAACM,aAAnC;AACAF,QAAAA,SAAS,CAACG,WAAV,CAAsBP,KAAK,CAACQ,MAA5B;AACAJ,QAAAA,SAAS,CAACK,SAAV,CAAoBT,KAAK,CAACU,IAA1B;AAEA,eAAOjB,EAAE,CAACkB,IAAH,CAAQC,MAAR,CAAeC,MAAf,CACLnB,UAAU,CAACoB,kBAAX,CAA8Bf,QAA9B,EAAwCK,SAAxC,CADK,EAELD,IAFK,CAEAY,MAAM,IAAI,IAAIpB,gBAAJ,CAAqBoB,MAArB,EAA6BhB,QAA7B,EAAuCE,KAAvC,CAFV,CAAP;AAGD,OARM,CAAP;AALsE;AAcvE;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACwB,SAATe,SAAS,CAACjB,QAAD,EAAWgB,MAAX,EAAuC;AAAA;AAAA;AAAA,UAApBd,KAAoB,6EAAZL,UAAY;AAC3D,aAAO,IAAID,gBAAJ,CAAqBoB,MAArB,EAA6BhB,QAA7B,EAAuCE,KAAvC,CAAP;AAD2D;AAE5D;;AA/CqB;;AAkDxB,eAAeJ,iBAAf","sourcesContent":["import dh from '@deephaven/jsapi-shim';\nimport ChartUtils from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param {Object} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.sourcePanelId The panel ID the chart was created from\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} settings.hiddenSeries Array of hidden series names\n * @param {dh.Table} table The table to build the model for\n * @param {Object} theme The theme for the figure. Defaults to ChartTheme\n * @returns {Promise<FigureChartModel>} The FigureChartModel representing the figure\n */\n static async makeModelFromSettings(settings, table, theme = ChartTheme) {\n // Copy the table first and then re-apply the filters from the original table\n // When we add table linking we'll want to listen to the original table and update\n // the copied table with any changes that occur.\n // The table gets owned by the Figure that gets created, which closes the table\n return table.copy().then(tableCopy => {\n tableCopy.applyCustomColumns(table.customColumns);\n tableCopy.applyFilter(table.filter);\n tableCopy.applySort(table.sort);\n\n return dh.plot.Figure.create(\n ChartUtils.makeFigureSettings(settings, tableCopy)\n ).then(figure => new FigureChartModel(figure, settings, theme));\n });\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param {Object} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.sourcePanelId The panel ID the chart was created from\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} settings.hiddenSeries Array of hidden series names\n * @param {dh.Figure} figure The figure to build the model for\n * @param {Object} theme The theme for the figure. Defaults to ChartTheme\n * @returns {Promise<FigureChartModel>} The FigureChartModel representing the figure\n */\n static async makeModel(settings, figure, theme = ChartTheme) {\n return new FigureChartModel(figure, settings, theme);\n }\n}\n\nexport default ChartModelFactory;\n"],"file":"ChartModelFactory.js"}
1
+ {"version":3,"sources":["../src/ChartModelFactory.js"],"names":["dh","ChartUtils","FigureChartModel","ChartTheme","ChartModelFactory","makeModelFromSettings","settings","table","theme","copy","then","tableCopy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","figure","makeModel"],"mappings":";;;;AAAA,OAAOA,EAAP,MAAe,uBAAf;OACOC,U;OACAC,gB;OACAC,U;;AAEP,MAAMC,iBAAN,CAAwB;AACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACoC,SAArBC,qBAAqB,CAACC,QAAD,EAAWC,KAAX,EAAsC;AAAA;AAAA;AAAA,UAApBC,KAAoB,0EAAZL,UAAY;AACtE;AACA;AACA;AACA;AACA,aAAOI,KAAK,CAACE,IAAN,GAAaC,IAAb,CAAkBC,SAAS,IAAI;AACpCA,QAAAA,SAAS,CAACC,kBAAV,CAA6BL,KAAK,CAACM,aAAnC;AACAF,QAAAA,SAAS,CAACG,WAAV,CAAsBP,KAAK,CAACQ,MAA5B;AACAJ,QAAAA,SAAS,CAACK,SAAV,CAAoBT,KAAK,CAACU,IAA1B;AAEA,eAAOjB,EAAE,CAACkB,IAAH,CAAQC,MAAR,CAAeC,MAAf,CACLnB,UAAU,CAACoB,kBAAX,CAA8Bf,QAA9B,EAAwCK,SAAxC,CADK,EAELD,IAFK,CAEAY,MAAM,IAAI,IAAIpB,gBAAJ,CAAqBoB,MAArB,EAA6BhB,QAA7B,EAAuCE,KAAvC,CAFV,CAAP;AAGD,OARM,CAAP;AALsE;AAcvE;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACwB,SAATe,SAAS,CAACjB,QAAD,EAAWgB,MAAX,EAAuC;AAAA;AAAA;AAAA,UAApBd,KAAoB,6EAAZL,UAAY;AAC3D,aAAO,IAAID,gBAAJ,CAAqBoB,MAArB,EAA6BhB,QAA7B,EAAuCE,KAAvC,CAAP;AAD2D;AAE5D;;AAnDqB;;AAsDxB,eAAeJ,iBAAf","sourcesContent":["import dh from '@deephaven/jsapi-shim';\nimport ChartUtils from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param {Object} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.sourcePanelId The panel ID the chart was created from\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} settings.hiddenSeries Array of hidden series names\n * @param {dh.Table} table The table to build the model for\n * @param {Object} theme The theme for the figure. Defaults to ChartTheme\n * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModelFromSettings(settings, table, theme = ChartTheme) {\n // Copy the table first and then re-apply the filters from the original table\n // When we add table linking we'll want to listen to the original table and update\n // the copied table with any changes that occur.\n // The table gets owned by the Figure that gets created, which closes the table\n return table.copy().then(tableCopy => {\n tableCopy.applyCustomColumns(table.customColumns);\n tableCopy.applyFilter(table.filter);\n tableCopy.applySort(table.sort);\n\n return dh.plot.Figure.create(\n ChartUtils.makeFigureSettings(settings, tableCopy)\n ).then(figure => new FigureChartModel(figure, settings, theme));\n });\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param {Object} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.sourcePanelId The panel ID the chart was created from\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} settings.hiddenSeries Array of hidden series names\n * @param {dh.Figure} figure The figure to build the model for\n * @param {Object} theme The theme for the figure. Defaults to ChartTheme\n * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModel(settings, figure, theme = ChartTheme) {\n return new FigureChartModel(figure, settings, theme);\n }\n}\n\nexport default ChartModelFactory;\n"],"file":"ChartModelFactory.js"}
@@ -21,8 +21,8 @@ declare class ChartTestUtils {
21
21
  name?: string | undefined;
22
22
  plotStyle?: import("@deephaven/jsapi-shim").SeriesPlotStyle | undefined;
23
23
  sources?: any[] | undefined;
24
- lineColor?: any;
25
- shapeColor?: any;
24
+ lineColor?: null | undefined;
25
+ shapeColor?: null | undefined;
26
26
  }): any;
27
27
  static makeChart({ title, series, axes, }?: {
28
28
  title?: string | undefined;
@@ -38,7 +38,7 @@ declare class ChartUtils {
38
38
  * @param {dh.plot.SeriesPlotStyle} plotStyle The plot style of the series
39
39
  * @param {dh.plot.SourceType} sourceType The source type for the series
40
40
  */
41
- static getPlotlyProperty(plotStyle: any, sourceType: any): "labels" | "values" | "x" | "y" | "z" | "xLow" | "xHigh" | "yLow" | "yHigh" | "time" | "open" | "high" | "low" | "close" | "shape" | "size" | "label" | "color";
41
+ static getPlotlyProperty(plotStyle: dh.plot.SeriesPlotStyle, sourceType: dh.plot.SourceType): "labels" | "values" | "x" | "y" | "z" | "xLow" | "xHigh" | "yLow" | "yHigh" | "time" | "open" | "high" | "low" | "close" | "shape" | "size" | "label" | "color";
42
42
  static getPlotlySeriesOrientation(series: any): string;
43
43
  /**
44
44
  * Generate the plotly error bar data from the passed in data.
@@ -67,7 +67,7 @@ declare class ChartUtils {
67
67
  * @param {dh.plot.Source} source The Source to get the formatter information from
68
68
  * @param {Formatter} formatter The current formatter for formatting data
69
69
  */
70
- static getPlotlyAxisFormat(source: any, formatter?: any): object | null;
70
+ static getPlotlyAxisFormat(source: dh.plot.Source, formatter?: Formatter): object | null;
71
71
  /**
72
72
  * Adds tick spacing for an axis that has gapBetweenMajorTicks defined.
73
73
  *
@@ -82,7 +82,7 @@ declare class ChartUtils {
82
82
  * @param {dh.plot.Axis} axis The axis to find the source for
83
83
  * @returns {dh.plot.Source} The first source matching this axis
84
84
  */
85
- static getSourceForAxis(chart: any, axis: any): any;
85
+ static getSourceForAxis(chart: dh.plot.Chart, axis: dh.plot.Axis): dh.plot.Source;
86
86
  /**
87
87
  * Get visibility setting for the series object
88
88
  * @param {string} name The series name to get the visibility for
@@ -109,9 +109,9 @@ declare class ChartUtils {
109
109
  * @param {Object} theme The theme properties for the plot. See ChartTheme.js for an example
110
110
  * @returns {Object} The series data (trace) object for use with plotly.
111
111
  */
112
- static makeSeriesDataFromSeries(series: any, axisTypeMap: Map<any, any[]>, seriesVisibility: boolean | string, theme: Object): Object;
112
+ static makeSeriesDataFromSeries(series: dh.plot.Series, axisTypeMap: Map<dh.plot.AxisType, dh.plot.Axis[]>, seriesVisibility: boolean | string, theme: Object): Object;
113
113
  static addSourcesToSeriesData(seriesDataParam: any, plotStyle: any, sources: any, axisTypeMap: any): void;
114
- static addStylingToSeriesData(seriesDataParam: any, plotStyle: any, theme?: {}, lineColor?: any, shapeColor?: any, seriesVisibility?: any): void;
114
+ static addStylingToSeriesData(seriesDataParam: any, plotStyle: any, theme?: {}, lineColor?: null, shapeColor?: null, seriesVisibility?: null): void;
115
115
  /**
116
116
  * Retrieve the axis formats from the provided figure.
117
117
  * Currently defaults to just the x/y axes.
@@ -119,24 +119,24 @@ declare class ChartUtils {
119
119
  * @param {Formatter} formatter The formatter to use when getting the axis format
120
120
  * @returns {Map<string, object>} A map of axis layout property names to axis formats
121
121
  */
122
- static getAxisFormats(figure: any, formatter: any): Map<string, object>;
122
+ static getAxisFormats(figure: dh.plot.Figure, formatter: Formatter): Map<string, object>;
123
123
  static getChartType(plotStyle: any, isBusinessTime: any): "scattergl" | "scatter" | "bar" | "pie" | "histogram" | "ohlc" | null;
124
124
  /**
125
125
  * Return the plotly axis property name
126
126
  * @param {dh.plot.AxisType} axisType The axis type to get the property name for
127
127
  */
128
- static getAxisPropertyName(axisType: any): "x" | "y" | null;
128
+ static getAxisPropertyName(axisType: dh.plot.AxisType): "x" | "y" | null;
129
129
  /**
130
130
  * Returns the plotly "side" value for the provided axis position
131
131
  * @param {dh.plot.AxisPosition} axisPosition The Iris AxisPosition of the axis
132
132
  */
133
- static getAxisSide(axisPosition: any): "bottom" | "top" | "left" | "right" | null;
133
+ static getAxisSide(axisPosition: dh.plot.AxisPosition): "bottom" | "top" | "left" | "right" | null;
134
134
  /**
135
135
  * Retrieve the chart that contains the passed in series from the figure
136
136
  * @param {dh.plot.Figure} figure The figure to retrieve the chart from
137
137
  * @param {dh.plot.Series} series The series to get the chart for
138
138
  */
139
- static getChartForSeries(figure: any, series: any): any;
139
+ static getChartForSeries(figure: dh.plot.Figure, series: dh.plot.Series): any;
140
140
  /**
141
141
  * Get an object mapping axis to their ranges
142
142
  * @param {object} layout The plotly layout object to get the ranges from
@@ -154,7 +154,7 @@ declare class ChartUtils {
154
154
  * @param {number} plotHeight The height of the plot to calculate the axis sizes for
155
155
  * @param {func} getRangeParser A function to retrieve the range parser for a given axis
156
156
  */
157
- static updateLayoutAxes(layoutParam: object, axes: any[], plotWidth?: number, plotHeight?: number, getRangeParser?: any, theme?: {}): void;
157
+ static updateLayoutAxes(layoutParam: object, axes: dh.plot.Axis[], plotWidth?: number, plotHeight?: number, getRangeParser?: func, theme?: {}): void;
158
158
  static getAxisLayoutProperty(axisProperty: any, axisIndex: any): string;
159
159
  /**
160
160
  * Updates the layout axis object in place
@@ -165,7 +165,7 @@ declare class ChartUtils {
165
165
  * @param {number} axisSize The size of each axis in percent
166
166
  * @param {object} bounds The bounds of the axes domains
167
167
  */
168
- static updateLayoutAxis(layoutAxisParam: object, axis: any, axisIndex: number, axisPositionMap: Map<any, any>, xAxisSize: any, yAxisSize: any, bounds: object): void;
168
+ static updateLayoutAxis(layoutAxisParam: object, axis: dh.plot.Axis, axisIndex: number, axisPositionMap: Map<dh.plot.AxisPosition, dh.plot.Axis>, xAxisSize: any, yAxisSize: any, bounds: object): void;
169
169
  /**
170
170
  * Converts an open or close period to a declimal. e.g '09:30" to 9.5
171
171
  *
@@ -188,7 +188,7 @@ declare class ChartUtils {
188
188
  * @param {TimeZone} calendarTimeZone the time zone for the business calendar
189
189
  * @param {TimeZone} formatterTimeZone the time zone for the formatter
190
190
  */
191
- static createRangeBreakValuesFromHolidays(holidays: any[], calendarTimeZone: any, formatterTimeZone: any): any[];
191
+ static createRangeBreakValuesFromHolidays(holidays: any[], calendarTimeZone: TimeZone, formatterTimeZone: TimeZone): any[];
192
192
  /**
193
193
  * Creates the range break value for a full holiday. A full holiday is day that has no business periods.
194
194
  *
@@ -196,7 +196,7 @@ declare class ChartUtils {
196
196
  * @param {TimeZone} calendarTimeZone the time zone for the business calendar
197
197
  * @param {TimeZone} formatterTimeZone the time zone for the formatter
198
198
  */
199
- static createFullHoliday(holiday: any, calendarTimeZone: any, formatterTimeZone: any): any;
199
+ static createFullHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone: TimeZone): any;
200
200
  /**
201
201
  * Creates the range break for a partial holiday. A partial holiday is holiday with business periods
202
202
  * that are different than the default business periods.
@@ -205,7 +205,7 @@ declare class ChartUtils {
205
205
  * @param {TimeZone} calendarTimeZone the time zone for the business calendar
206
206
  * @param {TimeZone} formatterTimeZone the time zone for the formatter
207
207
  */
208
- static createPartialHoliday(holiday: any, calendarTimeZone: any, formatterTimeZone: any): {
208
+ static createPartialHoliday(holiday: Holiday, calendarTimeZone: TimeZone, formatterTimeZone: TimeZone): {
209
209
  values: any[];
210
210
  dvalue: number;
211
211
  }[];
@@ -216,7 +216,7 @@ declare class ChartUtils {
216
216
  * @param {TimeZone} calendarTimeZone the time zone for the business calendar
217
217
  * @param {TimeZone} formatterTimeZone the time zone for the formatter
218
218
  */
219
- static adjustDateForTimeZone(dateString: string, calendarTimeZone: any, formatterTimeZone: any): any;
219
+ static adjustDateForTimeZone(dateString: string, calendarTimeZone: TimeZone, formatterTimeZone: TimeZone): any;
220
220
  /**
221
221
  * Groups an array and returns a map
222
222
  * @param {object[]} array The object to group
@@ -232,14 +232,14 @@ declare class ChartUtils {
232
232
  * Unwraps a value provided from API to a value plotly can understand
233
233
  * Eg. Unwraps DateWrapper, LongWrapper objects.
234
234
  */
235
- static unwrapValue(value: any, timeZone?: any): any;
235
+ static unwrapValue(value: any, timeZone?: null): any;
236
236
  /**
237
237
  *
238
238
  * @param {any} value The value to wrap up
239
239
  * @param {string} columnType The type of column this value is from
240
240
  * @param {dh.i18n.TimeZone} timeZone The time zone if applicable
241
241
  */
242
- static wrapValue(value: any, columnType: string, timeZone?: any): any;
242
+ static wrapValue(value: any, columnType: string, timeZone?: dh.i18n.TimeZone): any;
243
243
  static makeLayoutAxis(type: any, theme?: {}): {
244
244
  automargin: boolean;
245
245
  gridcolor: any;
@@ -265,7 +265,7 @@ declare class ChartUtils {
265
265
  * @param {ChartTheme} theme The theme to get colorway from
266
266
  * @returns {string[]} Colorway array for the theme
267
267
  */
268
- static getColorwayFromTheme(theme: any): string[];
268
+ static getColorwayFromTheme(theme: ChartTheme): string[];
269
269
  static makeDefaultLayout(theme?: {}): {
270
270
  autosize: boolean;
271
271
  colorway: string[];
@@ -364,7 +364,7 @@ declare class ChartUtils {
364
364
  title: string;
365
365
  xAxis: string;
366
366
  series: string[];
367
- type: any;
367
+ type: dh.plot.SeriesPlotStyle;
368
368
  }, table: any): {
369
369
  charts: {
370
370
  chartType: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ChartUtils.d.ts","sourceRoot":"","sources":["../src/ChartUtils.js"],"names":[],"mappings":";AAcA;IACE,iCAAgC;IAEhC,6BAA6B;IAE7B,6BAA2B;IAE3B,4BAAyB;IAEzB,+BAA4B;IAE5B,+BAA8B;IAE9B;;;OAGG;IAEH,2BAAkD;IAElD;;;;;;OAA8E;IAE9E;;OAAuD;IAEvD,oCAAiC;IAEjC;;;;OAIG;IACH,6DAFW,OAAO,yEA4BjB;IAED;;;OAGG;IACH,yEASC;IAED;;;;OAIG;IACH,2NA4DC;IAED,uDAOC;IAED;;;;;;;;OAQG;IACH,6BANW,aAAa,QACb,aAAa,SACb,aAAa,GAEX,MAAM,CAWlB;IAED;;;;MA4CC;IAED,6CAEC;IAED;;;;;aA2CC;IAED;;;;OAIG;IACH,wEA8BC;IAED;;;;;;OAMG;IACH,kCAJW,MAAM,QACN,MAAM,cACN,OAAO,UAqBjB;IAED;;;;;OAKG;IACH,oDAYC;IAED;;;;;OAKG;IACH,iCAJW,MAAM,YACN,MAAM,GACJ,OAAO,GAAC,MAAM,CAO1B;IAED;;;;OAIG;IACH,iCAHW,MAAM,GACJ,MAAM,EAAE,CAOpB;IAED;;;OAGG;IACH,8EAFa,MAAM,CASlB;IAED;;;;;;;OAOG;IACH,0DALW,SAAsB,KAAc,CAAC,oBACrC,OAAO,GAAC,MAAM,SACd,MAAM,GACJ,MAAM,CAkClB;IAED,0GAyBC;IAED,iJA0DC;IAED;;;;;;OAMG;IACH,oDAFa,IAAI,MAAM,EAAE,MAAM,CAAC,CAkG/B;IAED,gIASC;IAED;;;OAGG;IACH,4DASC;IAED;;;OAGG;IACH,kFAaC;IAED;;;;OAIG;IACH,wDAaC;IAED;;;;OAIG;IACH,+BAHW,MAAM,GACJ,MAAM,CAclB;IAED;;;;;;;;;;OAUG;IACH,qCANW,MAAM,QACN,KAAc,cACd,MAAM,eACN,MAAM,0CA6HhB;IAED,wEAGC;IAED;;;;;;;;OAQG;IACH,yCAPW,MAAM,wBAEN,MAAM,mBACN,aAAuC,0CAEvC,MAAM,QAkEhB;IAED;;;;OAIG;IACH,+CAGC;IAED;;;;;;;OAOG;IACH,wDA6BC;IAED;;;;;;OAMG;IACH,iHA2BC;IAED;;;;;;OAMG;IACH,2FAMC;IAED;;;;;;;OAOG;IACH;;;QAoCC;IAED;;;;;;OAMG;IACH,yCAJW,MAAM,sDAuBhB;IAED;;;;;OAKG;IACH,yBAJW,MAAM,EAAE,YACR,MAAM,GACJ,IAAI,MAAM,EAAE,MAAM,CAAC,CAU/B;IAED;;OAEG;IACH,4BAAwB;IAExB;;;OAGG;IACH,oDAgBC;IAED;;;;;OAKG;IACH,wBAJW,GAAG,cACH,MAAM,uBAqChB;IAED;;;;;;;;;;;;;;;;;;MA+BC;IAED;;;;;OAKG;IACH,yCAFa,MAAM,EAAE,CAepB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2BC;IAED;;;OAGG;IACH,mCAFW,MAAM;;MAOhB;IAED;;;OAGG;IACH,iCAFW,MAAM;;MAOhB;IAED,6CAQC;IAED;;;;;;;;;;;OAWG;IACH;QAL4B,KAAK,EAAtB,MAAM;QACW,KAAK,EAAtB,MAAM;QACa,MAAM,EAAzB,MAAM,EAAE;QAC0B,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;MA2ChD;CACF"}
1
+ {"version":3,"file":"ChartUtils.d.ts","sourceRoot":"","sources":["../src/ChartUtils.js"],"names":[],"mappings":";AAcA;IACE,iCAAgC;IAEhC,6BAA6B;IAE7B,6BAA2B;IAE3B,4BAAyB;IAEzB,+BAA4B;IAE5B,+BAA8B;IAE9B;;;OAGG;IAEH,2BAAkD;IAElD;;;;;;OAA8E;IAE9E;;OAAuD;IAEvD,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AuBhB;IAED;;;;;OAKG;IACH,yBAJW,MAAM,EAAE,YACR,MAAM,GACJ,IAAI,MAAM,EAAE,MAAM,CAAC,CAU/B;IAED;;OAEG;IACH,4BAAwB;IAExB;;;OAGG;IACH,qDAgBC;IAED;;;;;OAKG;IACH,wBAJW,GAAG,cACH,MAAM,oCAqChB;IAED;;;;;;;;;;;;;;;;;;MA+BC;IAED;;;;;OAKG;IACH,gDAFa,MAAM,EAAE,CAepB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2BC;IAED;;;OAGG;IACH,mCAFW,MAAM;;MAOhB;IAED;;;OAGG;IACH,iCAFW,MAAM;;MAOhB;IAED,6CAQC;IAED;;;;;;;;;;;OAWG;IACH;QAL4B,KAAK,EAAtB,MAAM;QACW,KAAK,EAAtB,MAAM;QACa,MAAM,EAAzB,MAAM,EAAE;QAC0B,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;MA2ChD;CACF"}
@@ -8,7 +8,7 @@ declare class FigureChartModel extends ChartModel {
8
8
  * @param {dh.plot.Figure} figure The figure object created by the API
9
9
  * @param {Object} settings Chart settings
10
10
  */
11
- constructor(figure: any, settings?: Object, theme?: {});
11
+ constructor(figure: dh.plot.Figure, settings?: Object, theme?: {});
12
12
  handleFigureUpdated(event: any): void;
13
13
  handleFigureDisconnected(event: any): void;
14
14
  handleFigureReconnected(event: any): void;
@@ -19,7 +19,7 @@ declare class FigureChartModel extends ChartModel {
19
19
  handleDownsampleNeeded(event: any): void;
20
20
  handleRequestFailed(event: any): void;
21
21
  addPendingSeries(): void;
22
- figure: any;
22
+ figure: dh.plot.Figure;
23
23
  settings: Object;
24
24
  theme: {};
25
25
  data: any[];
@@ -132,14 +132,14 @@ declare class FigureChartModel extends ChartModel {
132
132
  * @param {dh.plot.SourceType} sourceType The source type within that series to set the data for.
133
133
  * @param {Any[]} dataArray The array to use for the data for this series source.
134
134
  */
135
- setDataArrayForSeries(series: any, sourceType: any, dataArray: any[]): void;
135
+ setDataArrayForSeries(series: dh.Series, sourceType: dh.plot.SourceType, dataArray: Any[]): void;
136
136
  /**
137
137
  * After setting all the data in the series data, we may need to adjust some other properties
138
138
  * Eg. Calculating the width from the xLow/xHigh values; Plot.ly uses `width` instead of a low/high
139
139
  * value for x.
140
140
  * @param {dh.Series} series The series to clean the data for
141
141
  */
142
- cleanSeries(series: any): void;
142
+ cleanSeries(series: dh.Series): void;
143
143
  setFigure(figure: any): void;
144
144
  updateSettings(settings: any): void;
145
145
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FigureChartModel.d.ts","sourceRoot":"","sources":["../src/FigureChartModel.js"],"names":[],"mappings":";AAUA;;GAEG;AACH;IACE,mCAAgC;IAEhC;;;OAGG;IACH,oCAFW,MAAM,cAuChB;IAyRD,sCAqCC;IAgCD,2CAUC;IAED,0CAaC;IAED,0CAOC;IA/HD,wCAIC;IAED,yCAIC;IAED,uCAIC;IAED,yCAIC;IAyCD,sCAEC;IA3OD,yBAWC;IAnHC,YAAoB;IACpB,iBAAwB;IACxB,UAAkB;IAClB,YAAc;IACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAiD;IACjD,6BAA8B;IAC9B,qBAAuB;IACvB,iBAAmB;IACnB,+BAAgC;IAChC,0BAA2B;IAC3B,qBAAuB;IACvB,0BAAgC;IAuBlC,sBA0BC;IAED,6BAwCC;IAiCD,wBAWC;IAED,0BAEC;IAED,6BAqCC;IAED,4BAqCC;IAED,qHAQG;IAEH,4JAGG;IAEH,gEAAgE;IAChE,wJAGG;IAEH;;OAEG;IACH,4JAMG;IAEH;;OAEG;IACH,gLAOG;IAqEH;;OAEG;IACH,oBAKC;IA2ED,uBASC;IAED,wBASC;IAED,4BAgBC;IAED;;OAEG;IACH,4BAkBC;IAED;;;;;OAKG;IACH,+DAFW,KAAK,QAQf;IAED;;;;;OAKG;IACH,+BAqBC;IAoDD,6BAYC;IAED,oCAEC;CACF"}
1
+ {"version":3,"file":"FigureChartModel.d.ts","sourceRoot":"","sources":["../src/FigureChartModel.js"],"names":[],"mappings":";AAUA;;GAEG;AACH;IACE,mCAAgC;IAEhC;;;OAGG;IACH,+CAFW,MAAM,cAuChB;IAyRD,sCAqCC;IAgCD,2CAUC;IAED,0CAaC;IAED,0CAOC;IA/HD,wCAIC;IAED,yCAIC;IAED,uCAIC;IAED,yCAIC;IAyCD,sCAEC;IA3OD,yBAWC;IAnHC,uBAAoB;IACpB,iBAAwB;IACxB,UAAkB;IAClB,YAAc;IACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAiD;IACjD,6BAA8B;IAC9B,qBAAuB;IACvB,iBAAmB;IACnB,+BAAgC;IAChC,0BAA2B;IAC3B,qBAAuB;IACvB,0BAAgC;IAuBlC,sBA0BC;IAED,6BAwCC;IAiCD,wBAWC;IAED,0BAEC;IAED,6BAqCC;IAED,4BAqCC;IAED,qHAQG;IAEH,4JAGG;IAEH,gEAAgE;IAChE,wJAGG;IAEH;;OAEG;IACH,4JAMG;IAEH;;OAEG;IACH,gLAOG;IAqEH;;OAEG;IACH,oBAKC;IA2ED,uBASC;IAED,wBASC;IAED,4BAgBC;IAED;;OAEG;IACH,4BAkBC;IAED;;;;;OAKG;IACH,oFAFW,KAAK,QAQf;IAED;;;;;OAKG;IACH,qCAqBC;IAoDD,6BAYC;IAED,oCAEC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/chart",
3
- "version": "0.9.0",
3
+ "version": "0.9.1-beta.10+8a6f7d2",
4
4
  "description": "Deephaven Chart",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -16,27 +16,22 @@
16
16
  "node": ">=10"
17
17
  },
18
18
  "scripts": {
19
- "build": "cross-env NODE_ENV=production run-s clean build-steps",
20
- "build-dev": "cross-env NODE_ENV=development run-s clean build-steps",
21
- "build-steps": "run-p build:*",
22
- "babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward --verbose",
19
+ "build": "cross-env NODE_ENV=production run-p build:*",
20
+ "build-dev": "cross-env NODE_ENV=development run-p build:*",
21
+ "babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward",
23
22
  "sass": "sass ./src:./dist",
24
- "types": "tsc",
25
23
  "build:babel": "npm run babel",
26
24
  "build:sass": "npm run sass",
27
- "build:types": "npm run types -- --incremental",
28
25
  "watch": "run-p watch:*",
29
26
  "watch:babel": "npm run babel -- -w --skip-initial-build",
30
27
  "watch:sass": "npm run sass -- --watch --update",
31
- "watch:types": "npm run types -- -w --incremental --preserveWatchOutput",
32
- "clean": "rimraf ./dist tsconfig.tsbuildinfo",
33
28
  "prestart": "npm run build-dev",
34
29
  "start": "cross-env NODE_ENV=development npm run watch"
35
30
  },
36
31
  "dependencies": {
37
- "@deephaven/icons": "^0.9.0",
38
- "@deephaven/iris-grid": "^0.9.0",
39
- "@deephaven/jsapi-shim": "^0.9.0",
32
+ "@deephaven/icons": "^0.9.1-beta.10+8a6f7d2",
33
+ "@deephaven/iris-grid": "^0.9.1-beta.10+8a6f7d2",
34
+ "@deephaven/jsapi-shim": "^0.9.1-beta.10+8a6f7d2",
40
35
  "deep-equal": "^2.0.4",
41
36
  "lodash.debounce": "^4.0.8",
42
37
  "memoize-one": "^5.1.1",
@@ -51,9 +46,9 @@
51
46
  },
52
47
  "devDependencies": {
53
48
  "@babel/cli": "^7.16.0",
54
- "@deephaven/log": "^0.9.0",
55
- "@deephaven/mocks": "^0.9.0",
56
- "@deephaven/tsconfig": "^0.9.0",
49
+ "@deephaven/log": "^0.9.1-beta.10+8a6f7d2",
50
+ "@deephaven/mocks": "^0.9.1-beta.10+8a6f7d2",
51
+ "@deephaven/tsconfig": "^0.9.1-beta.10+8a6f7d2",
57
52
  "@types/react": "^16.14.8",
58
53
  "@types/react-dom": "^16.9.13",
59
54
  "cross-env": "^7.0.2",
@@ -61,8 +56,7 @@
61
56
  "npm-run-all": "^4.1.5",
62
57
  "react": "^16.14.0",
63
58
  "rimraf": "^3.0.2",
64
- "sass": "1.32.13",
65
- "typescript": "~4.3.2"
59
+ "sass": "1.32.13"
66
60
  },
67
61
  "files": [
68
62
  "dist"
@@ -73,5 +67,5 @@
73
67
  "publishConfig": {
74
68
  "access": "public"
75
69
  },
76
- "gitHead": "559f166018ce6e882a57351526fba18153912503"
70
+ "gitHead": "8a6f7d21a06c9b590682684844fb169153ee8340"
77
71
  }
@@ -1,65 +0,0 @@
1
- .plotly-notifier {
2
- margin-right: 15px;
3
- }
4
-
5
- .plotly-notifier .notifier-note {
6
- border: 0 !important;
7
- border-radius: 2px !important;
8
- background: #555356 !important;
9
- }
10
-
11
- .chart-wrapper {
12
- background: #2d2a2e;
13
- }
14
- .chart-wrapper .plot-container .cartesianlayer text {
15
- user-select: none;
16
- }
17
- .chart-wrapper .plot-container .hovertext path,
18
- .chart-wrapper .plot-container .axistext path {
19
- stroke: none !important;
20
- }
21
- .chart-wrapper .plot-container .axistext path {
22
- fill: #555356 !important;
23
- box-shadow: 4px 4px #1a171a;
24
- }
25
- .chart-wrapper .plot-container .zoomlayer .zoombox {
26
- fill: rgba(0, 0, 0, 0.5) !important;
27
- }
28
- .chart-wrapper .plot-container .zoomlayer .zoombox-corners {
29
- fill: #f0f0ee;
30
- stroke: #211f22;
31
- }
32
- .chart-wrapper .js-plotly-plot .plotly [data-title]::before {
33
- border-color: transparent transparent #403e41;
34
- z-index: 1002;
35
- }
36
- .chart-wrapper .js-plotly-plot .plotly [data-title]::after {
37
- border-radius: 4px;
38
- background: #403e41;
39
- color: #f0f0ee;
40
- padding: 0.25rem 0.5rem;
41
- box-shadow: 0 0.1rem 1.5rem 0.1rem rgba(26, 23, 26, 0.8);
42
- z-index: 1001;
43
- }
44
- .chart-wrapper .js-plotly-plot .plotly .modebar {
45
- z-index: auto;
46
- }
47
- .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-title="Downsampling in progress..."] svg {
48
- animation: fa-spin 2s infinite linear;
49
- }
50
- .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-title="Downsampling enabled, click to disable"] svg path {
51
- fill: rgba(255, 255, 255, 0.7) !important;
52
- }
53
- .chart-wrapper .js-plotly-plot .plotly .modebar .modebar-btn[data-title^="Downsampling failed"] svg path {
54
- fill: #f37e3f !important;
55
- }
56
-
57
- /* stylelint-disable property-no-unknown */
58
- :export {
59
- title-downsampling-in-progress: Downsampling in progress...;
60
- title-downsampling-failed: Downsampling failed;
61
- title-downsampling-enabled: Downsampling enabled, click to disable;
62
- title-downsampling-disabled: Downsampling disabled, click to enable;
63
- }
64
-
65
- /*# sourceMappingURL=Chart.module.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sourceRoot":"","sources":["../src/Chart.scss","../../components/scss/bootstrap_overrides.scss","../src/Chart.module.scss"],"names":[],"mappings":"AAYA;EACE,cAV6B;;;AAa/B;EAIE;EACA;EACA;;;AAGF;EACE,YCfc;;ADkBZ;EACE;;AAGF;AAAA;EAEE;;AAGF;EACE;EACA;;AAGF;EACE;;AAGF;EACE,MCnCW;EDoCX,QCtBK;;AD2BT;EACE;EAGA;;AAGF;EACE,eC2DY;ED1DZ,YCvCO;EDwCP,OCnDa;EDoDb;EACA,YCgHiB;ED7GjB;;AAGF;EAEE;;AAKI;EACE;;AAMA;EACE;;AAOF;EACE;;;AE5FZ;AACA;EACE;EACA;EACA;EACA","file":"Chart.module.css"}