@mcpher/gas-fakes 2.3.3 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -184,6 +184,8 @@ As I mentioned earlier, to take this further, I'm going to need a lot of help to
184
184
  - [getting started](GETTING_STARTED.md) - how to handle authentication for Workspace scopes.
185
185
  - [readme](README.md)
186
186
  - [gas fakes cli](gas-fakes-cli.md)
187
+ - [github actions using adc](https://github.com/brucemcpherson/gas-fakes-actions-adc)
188
+ - [github actions using dwd and wif](https://github.com/brucemcpherson/gas-fakes-actions-dwd)
187
189
  - [ksuite as a back end](ksuite_poc.md)
188
190
  - [msgraph as a back end](msgraph.md)
189
191
  - [gas-fakes in serverless containers](https://docs.google.com/presentation/d/1JlXF9T--DD4ERHopyP3WyAMhjRCxxHblgCP5ynxaJ3k/edit?usp=sharing)
@@ -193,6 +195,7 @@ As I mentioned earlier, to take this further, I'm going to need a lot of help to
193
195
  - [running gas-fakes on google kubernetes engine](https://github.com/brucemcpherson/gas-fakes-containers)
194
196
  - [running gas-fakes on Amazon AWS lambda](https://github.com/brucemcpherson/gas-fakes-containers)
195
197
  - [running gas-fakes on Azure ACA](https://github.com/brucemcpherson/gas-fakes-containers)
198
+ - [running gas-fakes on Github actions](https://github.com/brucemcpherson/gas-fakes-containers)
196
199
  - [Yes – you can run native apps script code on Azure ACA as well!](https://ramblings.mcpher.com/yes-you-can-run-native-apps-script-code-on-azure-aca-as-well/)
197
200
  - [Yes – you can run native apps script code on AWS Lambda!](https://ramblings.mcpher.com/apps-script-on-aws-lambda/)
198
201
  - [initial idea and thoughts](https://ramblings.mcpher.com/a-proof-of-concept-implementation-of-apps-script-environment-on-node/)
package/package.json CHANGED
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "name": "@mcpher/gas-fakes",
37
37
  "author": "bruce mcpherson",
38
- "version": "2.3.3",
38
+ "version": "2.3.4",
39
39
  "license": "MIT",
40
40
  "main": "main.js",
41
41
  "description": "An implementation of the Google Workspace Apps Script runtime: Run native App Script Code on Node and Cloud Run",
@@ -40,6 +40,86 @@ export class FakeEmbeddedChart {
40
40
  return newFakeContainerInfo(this.__apiChart.position?.overlayPosition);
41
41
  }
42
42
 
43
+ /**
44
+ * Returns the ranges that this chart uses for its source data.
45
+ * @returns {FakeSheetRange[]}
46
+ */
47
+ getRanges() {
48
+ const { nargs, matchThrow } = signatureArgs(arguments, "EmbeddedChart.getRanges");
49
+ if (nargs !== 0) matchThrow();
50
+
51
+ const ranges = [];
52
+ const spec = this.__apiChart.spec;
53
+
54
+ const extractRanges = (chartData) => {
55
+ if (chartData?.sourceRange?.sources) {
56
+ chartData.sourceRange.sources.forEach((gridRange) => {
57
+ const sheet = this.__sheet.getParent().getSheetById(gridRange.sheetId);
58
+ if (sheet) {
59
+ const numRows = (gridRange.endRowIndex !== undefined ? gridRange.endRowIndex : sheet.getMaxRows()) - gridRange.startRowIndex;
60
+ const numCols = (gridRange.endColumnIndex !== undefined ? gridRange.endColumnIndex : sheet.getMaxColumns()) - gridRange.startColumnIndex;
61
+ ranges.push(
62
+ sheet.getRange(
63
+ gridRange.startRowIndex + 1,
64
+ gridRange.startColumnIndex + 1,
65
+ numRows,
66
+ numCols
67
+ )
68
+ );
69
+ }
70
+ });
71
+ }
72
+ };
73
+
74
+ if (spec.basicChart) {
75
+ spec.basicChart.domains?.forEach((d) => extractRanges(d.domain));
76
+ spec.basicChart.series?.forEach((s) => extractRanges(s.series));
77
+ }
78
+ if (spec.pieChart) {
79
+ extractRanges(spec.pieChart.domain);
80
+ spec.pieChart.series?.forEach((s) => extractRanges(s.series));
81
+ }
82
+ if (spec.bubbleChart) {
83
+ extractRanges(spec.bubbleChart.domain);
84
+ extractRanges(spec.bubbleChart.series);
85
+ extractRanges(spec.bubbleChart.ids);
86
+ extractRanges(spec.bubbleChart.labels);
87
+ extractRanges(spec.bubbleChart.sizes);
88
+ }
89
+ if (spec.candlestickChart) {
90
+ spec.candlestickChart.data?.forEach((d) => {
91
+ extractRanges(d.highSeries?.series);
92
+ extractRanges(d.lowSeries?.series);
93
+ extractRanges(d.openSeries?.series);
94
+ extractRanges(d.closeSeries?.series);
95
+ });
96
+ }
97
+ if (spec.histogramChart) {
98
+ spec.histogramChart.series?.forEach((s) => extractRanges(s.data));
99
+ }
100
+ if (spec.orgChart) {
101
+ extractRanges(spec.orgChart.labels);
102
+ extractRanges(spec.orgChart.parentLabels);
103
+ extractRanges(spec.orgChart.tooltips);
104
+ }
105
+ if (spec.scorecardChart) {
106
+ extractRanges(spec.scorecardChart.keyValueData);
107
+ extractRanges(spec.scorecardChart.baselineValueData);
108
+ }
109
+ if (spec.treemapChart) {
110
+ extractRanges(spec.treemapChart.labels);
111
+ extractRanges(spec.treemapChart.parentLabels);
112
+ extractRanges(spec.treemapChart.sizeData);
113
+ extractRanges(spec.treemapChart.colorData);
114
+ }
115
+ if (spec.waterfallChart) {
116
+ extractRanges(spec.waterfallChart.domain?.domain);
117
+ spec.waterfallChart.series?.forEach((s) => extractRanges(s.data));
118
+ }
119
+
120
+ return ranges;
121
+ }
122
+
43
123
  /**
44
124
  * Returns the ID of this chart.
45
125
  * @returns {number}