@deephaven/chart 0.43.0 → 0.44.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.
@@ -0,0 +1,186 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-nocheck
6
+ import ChartModel from "./ChartModel.js";
7
+ import ChartTheme from "./ChartTheme.js";
8
+ import ChartUtils from "./ChartUtils.js";
9
+ /** Displays a basic random chart */
10
+ class MockChartModel extends ChartModel {
11
+ static makeRandomSeries(offset) {
12
+ var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
13
+ var steps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
14
+ var dates = [];
15
+ var values = [];
16
+ var smooth = [];
17
+ var linear = [];
18
+ var startDate = new Date();
19
+ for (var i = 0; i < steps; i += 1) {
20
+ var date = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate() + i - steps);
21
+ dates.push("".concat(date.getFullYear(), "-").concat(date.getMonth() + 1, "-").concat(date.getDate()));
22
+ var v = (Math.sin(i / steps * offset) * steps / 3 + Math.cos(i * 0.2) * steps / 6 + Math.sin(i * 0.5) * steps / 10 + Math.random() * steps / 5 + i * MockChartModel.smoothing) * scale;
23
+ v = Math.round(v * 100) / 100; // 2 decimals only
24
+ // using steps acts as amplititude scaling based on value
25
+ // large sine wave for course shape + small sine waves for bumpiness +
26
+ // general randomness noise + index to be constantly up and to the right + smoothing factor
27
+ values.push(v);
28
+ linear.push(40 + i * MockChartModel.smoothing);
29
+ smooth.push(Math.sin(i / steps * offset) * steps / 3 + Math.random() * steps / 10 + i * MockChartModel.smoothing); // push a smoother version of the same thing
30
+ }
31
+
32
+ return {
33
+ x: dates,
34
+ y: values,
35
+ s: smooth,
36
+ l: linear
37
+ };
38
+ }
39
+ static makeScatter(series) {
40
+ return {
41
+ name: 'SCTR',
42
+ x: series.x,
43
+ y: series.y,
44
+ type: 'scattergl',
45
+ mode: 'markers',
46
+ hoverinfo: 'skip',
47
+ marker: {
48
+ size: 5
49
+ }
50
+ };
51
+ }
52
+ static makeArea(series) {
53
+ return {
54
+ name: 'AREA',
55
+ x: series.x,
56
+ y: series.s,
57
+ type: 'scatter',
58
+ mode: 'line',
59
+ fill: 'tozeroy',
60
+ hoverinfo: 'all',
61
+ line: {
62
+ color: ChartTheme.area_color,
63
+ width: 3
64
+ // area patten gets applied as hack in post render plot.ly callback + css
65
+ }
66
+ };
67
+ }
68
+
69
+ static makeTrendline(series) {
70
+ return {
71
+ // we probably want to toss the line formula in legend I guess? either that or render it as text manually on plot
72
+ name: 'Trendline <br>R<sup>2</sup> = 0.91',
73
+ x: series.x,
74
+ y: series.l,
75
+ type: 'scattergl',
76
+ mode: 'line',
77
+ hoverinfo: 'skip',
78
+ line: {
79
+ width: 3,
80
+ dash: 'dot',
81
+ // trendlines should follow some sort of color convention + dots/dashed. Remember there can multiple
82
+ color: ChartTheme.trend_color
83
+ // chroma(c.$green).brighten(1.2).hex()
84
+ }
85
+ };
86
+ }
87
+
88
+ static makeErrorBand(series) {
89
+ // generate continouous error bands values and text
90
+ var erroryforward = [];
91
+ var errorybackward = [];
92
+ for (var i = 0; i < series.y.length; i += 1) {
93
+ var value = series.y[i];
94
+ erroryforward[i] = Math.round((value + 18) * 100) / 100;
95
+ errorybackward[i] = Math.round((value - 18) * 100) / 100;
96
+ }
97
+
98
+ // makes a closed shape of points winding clockwise for y values
99
+ var errory = erroryforward.concat(errorybackward.reverse());
100
+ return {
101
+ name: 'error',
102
+ x: series.x.concat(series.x.slice().reverse()),
103
+ // winding for x values, that slice just clones so reverse doesn't apply inplace
104
+ y: errory,
105
+ type: 'scattergl',
106
+ mode: 'line',
107
+ hoverinfo: 'skip',
108
+ fill: 'toself',
109
+ // there's some ordering bug with scattergl where if the areas traces are ordered after the lines they don't render
110
+ fillcolor: ChartTheme.error_band_fill_color,
111
+ line: {
112
+ width: 0,
113
+ color: ChartTheme.error_band_line_color,
114
+ shape: 'spline'
115
+ }
116
+ };
117
+ }
118
+ static makeLine(series) {
119
+ return {
120
+ name: 'LINE',
121
+ x: series.x,
122
+ y: series.y,
123
+ type: 'scattergl',
124
+ mode: 'line',
125
+ hoverinfo: 'x+y+text+name',
126
+ line: {
127
+ color: ChartTheme.line_color,
128
+ width: 3
129
+ }
130
+ };
131
+ }
132
+ static makeRandomData() {
133
+ var series1 = MockChartModel.makeRandomSeries(6);
134
+ var areaPattern = MockChartModel.makeArea(series1);
135
+ var trendLine = MockChartModel.makeTrendline(series1);
136
+ var series2 = MockChartModel.makeRandomSeries(2);
137
+ var line = MockChartModel.makeLine(series2);
138
+ var errorBand = MockChartModel.makeErrorBand(series2);
139
+ return [areaPattern, trendLine, line, errorBand];
140
+ }
141
+ static makeDefaultLayout(dh) {
142
+ var layout = new ChartUtils(dh).makeDefaultLayout(ChartTheme);
143
+ layout.title = 'Chart';
144
+ layout.xaxis.title = 'Datestamp';
145
+ layout.yaxis.title = 'Price';
146
+ return layout;
147
+ }
148
+ constructor(dh) {
149
+ var {
150
+ data = MockChartModel.makeRandomData(),
151
+ layout = MockChartModel.makeDefaultLayout(dh),
152
+ filterFields = []
153
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
154
+ super(dh);
155
+ this.data = data;
156
+ this.layout = layout;
157
+ this.filterFields = filterFields;
158
+ }
159
+ getData() {
160
+ return this.data;
161
+ }
162
+ getLayout() {
163
+ return this.layout;
164
+ }
165
+ getFilterColumnMap() {
166
+ var map = new Map();
167
+ for (var i = 0; i < this.filterFields.length; i += 1) {
168
+ var name = this.filterFields[i];
169
+ var type = 'java.lang.String';
170
+ map.set(name, {
171
+ name,
172
+ type
173
+ });
174
+ }
175
+ return map;
176
+ }
177
+ isFilterRequired() {
178
+ return this.filterFields.length > 0;
179
+ }
180
+ setFilter() {
181
+ this.fireUpdate(this.data);
182
+ }
183
+ }
184
+ _defineProperty(MockChartModel, "smoothing", 1.5);
185
+ export default MockChartModel;
186
+ //# sourceMappingURL=MockChartModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockChartModel.js","names":["ChartModel","ChartTheme","ChartUtils","MockChartModel","makeRandomSeries","offset","scale","steps","dates","values","smooth","linear","startDate","Date","i","date","getFullYear","getMonth","getDate","push","v","Math","sin","cos","random","smoothing","round","x","y","s","l","makeScatter","series","name","type","mode","hoverinfo","marker","size","makeArea","fill","line","color","area_color","width","makeTrendline","dash","trend_color","makeErrorBand","erroryforward","errorybackward","length","value","errory","concat","reverse","slice","fillcolor","error_band_fill_color","error_band_line_color","shape","makeLine","line_color","makeRandomData","series1","areaPattern","trendLine","series2","errorBand","makeDefaultLayout","dh","layout","title","xaxis","yaxis","constructor","data","filterFields","getData","getLayout","getFilterColumnMap","map","Map","set","isFilterRequired","setFilter","fireUpdate"],"sources":["../src/MockChartModel.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n\nimport ChartModel from './ChartModel';\nimport ChartTheme from './ChartTheme';\nimport ChartUtils from './ChartUtils';\n\n/** Displays a basic random chart */\nclass MockChartModel extends ChartModel {\n static smoothing = 1.5;\n\n static makeRandomSeries(offset, scale = 1, steps = 100) {\n const dates = [];\n const values = [];\n const smooth = [];\n const linear = [];\n const startDate = new Date();\n\n for (let i = 0; i < steps; i += 1) {\n const date = new Date(\n startDate.getFullYear(),\n startDate.getMonth(),\n startDate.getDate() + i - steps\n );\n dates.push(\n `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`\n );\n let v =\n ((Math.sin((i / steps) * offset) * steps) / 3 +\n (Math.cos(i * 0.2) * steps) / 6 +\n (Math.sin(i * 0.5) * steps) / 10 +\n (Math.random() * steps) / 5 +\n i * MockChartModel.smoothing) *\n scale;\n v = Math.round(v * 100) / 100; // 2 decimals only\n // using steps acts as amplititude scaling based on value\n // large sine wave for course shape + small sine waves for bumpiness +\n // general randomness noise + index to be constantly up and to the right + smoothing factor\n values.push(v);\n linear.push(40 + i * MockChartModel.smoothing);\n smooth.push(\n (Math.sin((i / steps) * offset) * steps) / 3 +\n (Math.random() * steps) / 10 +\n i * MockChartModel.smoothing\n ); // push a smoother version of the same thing\n }\n\n return { x: dates, y: values, s: smooth, l: linear };\n }\n\n static makeScatter(series) {\n return {\n name: 'SCTR',\n x: series.x,\n y: series.y,\n type: 'scattergl',\n mode: 'markers',\n hoverinfo: 'skip',\n marker: {\n size: 5,\n },\n };\n }\n\n static makeArea(series) {\n return {\n name: 'AREA',\n x: series.x,\n y: series.s,\n type: 'scatter',\n mode: 'line',\n fill: 'tozeroy',\n hoverinfo: 'all',\n line: {\n color: ChartTheme.area_color,\n width: 3,\n // area patten gets applied as hack in post render plot.ly callback + css\n },\n };\n }\n\n static makeTrendline(series) {\n return {\n // we probably want to toss the line formula in legend I guess? either that or render it as text manually on plot\n name: 'Trendline <br>R<sup>2</sup> = 0.91',\n x: series.x,\n y: series.l,\n type: 'scattergl',\n mode: 'line',\n hoverinfo: 'skip',\n line: {\n width: 3,\n dash: 'dot', // trendlines should follow some sort of color convention + dots/dashed. Remember there can multiple\n color: ChartTheme.trend_color,\n // chroma(c.$green).brighten(1.2).hex()\n },\n };\n }\n\n static makeErrorBand(series) {\n // generate continouous error bands values and text\n const erroryforward = [];\n const errorybackward = [];\n for (let i = 0; i < series.y.length; i += 1) {\n const value = series.y[i];\n erroryforward[i] = Math.round((value + 18) * 100) / 100;\n errorybackward[i] = Math.round((value - 18) * 100) / 100;\n }\n\n // makes a closed shape of points winding clockwise for y values\n const errory = erroryforward.concat(errorybackward.reverse());\n\n return {\n name: 'error',\n x: series.x.concat(series.x.slice().reverse()), // winding for x values, that slice just clones so reverse doesn't apply inplace\n y: errory,\n type: 'scattergl',\n mode: 'line',\n hoverinfo: 'skip',\n fill: 'toself', // there's some ordering bug with scattergl where if the areas traces are ordered after the lines they don't render\n fillcolor: ChartTheme.error_band_fill_color,\n line: {\n width: 0,\n color: ChartTheme.error_band_line_color,\n shape: 'spline',\n },\n };\n }\n\n static makeLine(series) {\n return {\n name: 'LINE',\n x: series.x,\n y: series.y,\n type: 'scattergl',\n mode: 'line',\n hoverinfo: 'x+y+text+name',\n line: {\n color: ChartTheme.line_color,\n width: 3,\n },\n };\n }\n\n static makeRandomData() {\n const series1 = MockChartModel.makeRandomSeries(6);\n const areaPattern = MockChartModel.makeArea(series1);\n const trendLine = MockChartModel.makeTrendline(series1);\n\n const series2 = MockChartModel.makeRandomSeries(2);\n const line = MockChartModel.makeLine(series2);\n const errorBand = MockChartModel.makeErrorBand(series2);\n\n return [areaPattern, trendLine, line, errorBand];\n }\n\n static makeDefaultLayout(dh) {\n const layout = new ChartUtils(dh).makeDefaultLayout(ChartTheme);\n layout.title = 'Chart';\n layout.xaxis.title = 'Datestamp';\n layout.yaxis.title = 'Price';\n return layout;\n }\n\n constructor(\n dh,\n {\n data = MockChartModel.makeRandomData(),\n layout = MockChartModel.makeDefaultLayout(dh),\n filterFields = [],\n } = {}\n ) {\n super(dh);\n\n this.data = data;\n this.layout = layout;\n this.filterFields = filterFields;\n }\n\n getData() {\n return this.data;\n }\n\n getLayout() {\n return this.layout;\n }\n\n getFilterColumnMap() {\n const map = new Map();\n\n for (let i = 0; i < this.filterFields.length; i += 1) {\n const name = this.filterFields[i];\n const type = 'java.lang.String';\n map.set(name, { name, type });\n }\n\n return map;\n }\n\n isFilterRequired() {\n return this.filterFields.length > 0;\n }\n\n setFilter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AAAC,gBAtMKzE,cAAc,eACC,GAAG;AAuMxB,eAAeA,cAAc"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=declaration.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.d.js","names":[],"sources":["../src/declaration.d.ts"],"sourcesContent":["declare module '*.module.scss' {\n const content: Record<string, string>;\n export default content;\n}\n\ndeclare module '*.scss';\n"],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ export { default as Chart } from "./Chart.js";
2
+ export { default as ChartModelFactory } from "./ChartModelFactory.js";
3
+ export { default as ChartModel } from "./ChartModel.js";
4
+ export { default as ChartUtils } from "./ChartUtils.js";
5
+ export * from "./ChartUtils.js";
6
+ export { default as FigureChartModel } from "./FigureChartModel.js";
7
+ export { default as MockChartModel } from "./MockChartModel.js";
8
+ export { default as Plot } from "./plotly/Plot.js";
9
+ export { default as ChartTheme } from "./ChartTheme.js";
10
+ export { default as isFigureChartModel } from "./isFigureChartModel.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["default","Chart","ChartModelFactory","ChartModel","ChartUtils","FigureChartModel","MockChartModel","Plot","ChartTheme","isFigureChartModel"],"sources":["../src/index.ts"],"sourcesContent":["export { default as Chart } from './Chart';\nexport { default as ChartModelFactory } from './ChartModelFactory';\nexport { default as ChartModel } from './ChartModel';\nexport { default as ChartUtils } from './ChartUtils';\nexport * from './ChartUtils';\nexport { default as FigureChartModel } from './FigureChartModel';\nexport { default as MockChartModel } from './MockChartModel';\nexport { default as Plot } from './plotly/Plot';\nexport { default as ChartTheme } from './ChartTheme';\nexport { default as isFigureChartModel } from './isFigureChartModel';\n"],"mappings":"SAASA,OAAO,IAAIC,KAAK;AAAA,SAChBD,OAAO,IAAIE,iBAAiB;AAAA,SAC5BF,OAAO,IAAIG,UAAU;AAAA,SACrBH,OAAO,IAAII,UAAU;AAAA;AAAA,SAErBJ,OAAO,IAAIK,gBAAgB;AAAA,SAC3BL,OAAO,IAAIM,cAAc;AAAA,SACzBN,OAAO,IAAIO,IAAI;AAAA,SACfP,OAAO,IAAIQ,UAAU;AAAA,SACrBR,OAAO,IAAIS,kBAAkB"}
@@ -0,0 +1,4 @@
1
+ export default function isFigureChartModel(model) {
2
+ return model.setFigure !== undefined;
3
+ }
4
+ //# sourceMappingURL=isFigureChartModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFigureChartModel.js","names":["isFigureChartModel","model","setFigure","undefined"],"sources":["../src/isFigureChartModel.ts"],"sourcesContent":["import ChartModel from './ChartModel';\nimport FigureChartModel from './FigureChartModel';\n\nexport default function isFigureChartModel(\n model: ChartModel\n): model is FigureChartModel {\n return (model as FigureChartModel).setFigure !== undefined;\n}\n"],"mappings":"AAGA,eAAe,SAASA,kBAAkB,CACxCC,KAAiB,EACU;EAC3B,OAAQA,KAAK,CAAsBC,SAAS,KAAKC,SAAS;AAC5D"}
@@ -0,0 +1,12 @@
1
+ // Import the react customizable bundle for building, only pull in the modules we need
2
+ // This reduces the build size. Plotly has a lot of modules we don't need/use.
3
+ // https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle
4
+ import createPlotlyComponent from 'react-plotly.js/factory.js';
5
+ import Plotly from "./Plotly.js"; // Webpack 5 (used in docusaurus) gives an object w/ a default key
6
+ // This is probably something on react-plotly.js's side
7
+ // Or because we lazy load this and Docusaurus ends up w/ some complications between ESM and CJS
8
+ export default typeof createPlotlyComponent === 'function' ? createPlotlyComponent(Plotly) :
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
+ // @ts-ignore
11
+ createPlotlyComponent.default(Plotly);
12
+ //# sourceMappingURL=Plot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plot.js","names":["createPlotlyComponent","Plotly","default"],"sources":["../../src/plotly/Plot.ts"],"sourcesContent":["// Import the react customizable bundle for building, only pull in the modules we need\n// This reduces the build size. Plotly has a lot of modules we don't need/use.\n// https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle\nimport createPlotlyComponent from 'react-plotly.js/factory.js';\nimport Plotly from './Plotly';\n\n// Webpack 5 (used in docusaurus) gives an object w/ a default key\n// This is probably something on react-plotly.js's side\n// Or because we lazy load this and Docusaurus ends up w/ some complications between ESM and CJS\nexport default typeof createPlotlyComponent === 'function'\n ? createPlotlyComponent(Plotly)\n : // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (createPlotlyComponent.default(Plotly) as ReturnType<\n typeof createPlotlyComponent\n >);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,qBAAqB,MAAM,4BAA4B;AAAC,OACxDC,MAAM,qBAEb;AACA;AACA;AACA,eAAe,OAAOD,qBAAqB,KAAK,UAAU,GACtDA,qBAAqB,CAACC,MAAM,CAAC;AAC7B;AACA;AACCD,qBAAqB,CAACE,OAAO,CAACD,MAAM,CAEnC"}
@@ -0,0 +1,24 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
+ /* eslint-disable global-require */
3
+ // Create a partial plot with only the kinds of charts we need
4
+ // https://github.com/plotly/plotly.js/#modules
5
+
6
+ // Plotly types don't export anything other than core, so ignore the import type errors
7
+ import Plotly from 'plotly.js/lib/core.js';
8
+ // @ts-ignore
9
+ import bar from 'plotly.js/lib/bar.js';
10
+ // @ts-ignore
11
+ import histogram from 'plotly.js/lib/histogram.js';
12
+ // @ts-ignore
13
+ import pie from 'plotly.js/lib/pie.js';
14
+ // @ts-ignore
15
+ import ohlc from 'plotly.js/lib/ohlc.js';
16
+ // @ts-ignore
17
+ import scattergl from 'plotly.js/lib/scattergl.js';
18
+ // @ts-ignore
19
+ import treemap from 'plotly.js/lib/treemap.js';
20
+
21
+ // Load in the trace types we need/support
22
+ Plotly.register([bar, histogram, pie, ohlc, scattergl, treemap]);
23
+ export default Plotly;
24
+ //# sourceMappingURL=Plotly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plotly.js","names":["Plotly","bar","histogram","pie","ohlc","scattergl","treemap","register"],"sources":["../../src/plotly/Plotly.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable global-require */\n// Create a partial plot with only the kinds of charts we need\n// https://github.com/plotly/plotly.js/#modules\n\n// Plotly types don't export anything other than core, so ignore the import type errors\nimport Plotly from 'plotly.js/lib/core.js';\n// @ts-ignore\nimport bar from 'plotly.js/lib/bar.js';\n// @ts-ignore\nimport histogram from 'plotly.js/lib/histogram.js';\n// @ts-ignore\nimport pie from 'plotly.js/lib/pie.js';\n// @ts-ignore\nimport ohlc from 'plotly.js/lib/ohlc.js';\n// @ts-ignore\nimport scattergl from 'plotly.js/lib/scattergl.js';\n// @ts-ignore\nimport treemap from 'plotly.js/lib/treemap.js';\n\n// Load in the trace types we need/support\nPlotly.register([bar, histogram, pie, ohlc, scattergl, treemap]);\n\nexport default Plotly;\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA,OAAOA,MAAM,MAAM,uBAAuB;AAC1C;AACA,OAAOC,GAAG,MAAM,sBAAsB;AACtC;AACA,OAAOC,SAAS,MAAM,4BAA4B;AAClD;AACA,OAAOC,GAAG,MAAM,sBAAsB;AACtC;AACA,OAAOC,IAAI,MAAM,uBAAuB;AACxC;AACA,OAAOC,SAAS,MAAM,4BAA4B;AAClD;AACA,OAAOC,OAAO,MAAM,0BAA0B;;AAE9C;AACAN,MAAM,CAACO,QAAQ,CAAC,CAACN,GAAG,EAAEC,SAAS,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,CAAC,CAAC;AAEhE,eAAeN,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/chart",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "Deephaven Chart",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -22,11 +22,11 @@
22
22
  "build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
23
23
  },
24
24
  "dependencies": {
25
- "@deephaven/icons": "^0.43.0",
26
- "@deephaven/jsapi-types": "^0.43.0",
27
- "@deephaven/jsapi-utils": "^0.43.0",
28
- "@deephaven/log": "^0.43.0",
29
- "@deephaven/utils": "^0.43.0",
25
+ "@deephaven/icons": "^0.44.0",
26
+ "@deephaven/jsapi-types": "^0.44.0",
27
+ "@deephaven/jsapi-utils": "^0.44.0",
28
+ "@deephaven/log": "^0.44.0",
29
+ "@deephaven/utils": "^0.44.0",
30
30
  "deep-equal": "^2.0.5",
31
31
  "lodash.debounce": "^4.0.8",
32
32
  "lodash.set": "^4.3.2",
@@ -40,8 +40,8 @@
40
40
  "react": "^17.x"
41
41
  },
42
42
  "devDependencies": {
43
- "@deephaven/jsapi-shim": "^0.43.0",
44
- "@deephaven/mocks": "^0.43.0",
43
+ "@deephaven/jsapi-shim": "^0.44.0",
44
+ "@deephaven/mocks": "^0.44.0",
45
45
  "@types/plotly.js": "^2.12.11"
46
46
  },
47
47
  "files": [
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "b16776b5bdc15a02cd2897cd79d562ea38c60ed8"
56
+ "gitHead": "ba13c9139b3b7a5f5d64d79069f1de9d4727eeb6"
57
57
  }