@rian8337/osu-strain-graph-generator 4.0.0-beta.9 → 4.0.0-beta.90

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/index.js CHANGED
@@ -3,55 +3,56 @@
3
3
  var osuBase = require('@rian8337/osu-base');
4
4
  var canvas = require('canvas');
5
5
 
6
+ /******************************************************************************
7
+ Copyright (c) Microsoft Corporation.
8
+
9
+ Permission to use, copy, modify, and/or distribute this software for any
10
+ purpose with or without fee is hereby granted.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
+ PERFORMANCE OF THIS SOFTWARE.
19
+ ***************************************************************************** */
20
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
21
+
22
+
23
+ function __awaiter(thisArg, _arguments, P, generator) {
24
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
+ return new (P || (P = Promise))(function (resolve, reject) {
26
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ }
32
+
33
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
34
+ var e = new Error(message);
35
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
36
+ };
37
+
6
38
  /**
7
39
  * Utility to draw a graph with only node-canvas.
8
40
  *
9
41
  * Used for creating strain graph of beatmaps.
10
42
  */
11
43
  class Chart {
12
- /**
13
- * The canvas instance of this chart.
14
- */
15
- canvas;
16
- /**
17
- * The 2D rendering surface for the drawing surface of this chart.
18
- */
19
- context;
20
- graphWidth;
21
- graphHeight;
22
- minX;
23
- minY;
24
- maxX;
25
- maxY;
26
- unitsPerTickX;
27
- unitsPerTickY;
28
- background;
29
- xLabel;
30
- yLabel;
31
- xValueType;
32
- yValueType;
33
- pointRadius;
34
- padding = 10;
35
- tickSize = 10;
36
- axisColor = "#555";
37
- font = "12pt Calibri";
38
- axisLabelFont = "bold 11pt Calibri";
39
- fontHeight = 12;
40
- baseLabelOffset = 15;
41
- rangeX;
42
- rangeY;
43
- numXTicks;
44
- numYTicks;
45
- x;
46
- y;
47
- width;
48
- height;
49
- scaleX;
50
- scaleY;
51
44
  /**
52
45
  * @param values Initializer options for the graph.
53
46
  */
54
47
  constructor(values) {
48
+ var _a;
49
+ this.padding = 10;
50
+ this.tickSize = 10;
51
+ this.axisColor = "#424242";
52
+ this.font = "12pt Calibri";
53
+ this.axisLabelFont = "bold 11pt Calibri";
54
+ this.fontHeight = 12;
55
+ this.baseLabelOffset = 15;
55
56
  this.graphWidth = values.graphWidth;
56
57
  this.graphHeight = values.graphHeight;
57
58
  this.canvas = canvas.createCanvas(this.graphWidth, this.graphHeight);
@@ -67,7 +68,7 @@ class Chart {
67
68
  this.yLabel = values.yLabel;
68
69
  this.xValueType = values.xValueType;
69
70
  this.yValueType = values.yValueType;
70
- this.pointRadius = Math.max(0, values.pointRadius ?? 1);
71
+ this.pointRadius = Math.max(0, (_a = values.pointRadius) !== null && _a !== void 0 ? _a : 1);
71
72
  // Relationships
72
73
  this.rangeX = this.maxX - this.minX;
73
74
  this.rangeY = this.maxY - this.minY;
@@ -86,8 +87,12 @@ class Chart {
86
87
  this.rangeY;
87
88
  // Draw background and X and Y axis tick marks
88
89
  this.setBackground();
89
- this.drawXAxis(true);
90
- this.drawYAxis(true);
90
+ if (this.xLabel !== undefined) {
91
+ this.drawXAxis();
92
+ }
93
+ if (this.yLabel !== undefined) {
94
+ this.drawYAxis();
95
+ }
91
96
  }
92
97
  /**
93
98
  * Draws a line graph with specified data, color, and line width.
@@ -104,8 +109,7 @@ class Chart {
104
109
  c.strokeStyle = c.fillStyle = color;
105
110
  c.beginPath();
106
111
  c.moveTo(data[0].x * this.scaleX, data[0].y * this.scaleY);
107
- for (let n = 0; n < data.length; ++n) {
108
- const point = data[n];
112
+ for (const point of data) {
109
113
  // Data segment
110
114
  c.lineTo(point.x * this.scaleX, point.y * this.scaleY);
111
115
  c.stroke();
@@ -134,17 +138,22 @@ class Chart {
134
138
  this.transformContext();
135
139
  c.strokeStyle = c.fillStyle = color;
136
140
  c.beginPath();
137
- data.forEach((d) => c.lineTo(d.x * this.scaleX, d.y * this.scaleY));
141
+ data.forEach((d) => {
142
+ c.lineTo(d.x * this.scaleX, d.y * this.scaleY);
143
+ });
138
144
  c.stroke();
139
145
  c.lineTo(data.at(-1).x * this.scaleX, 0);
140
146
  c.lineTo(0, 0);
141
147
  c.fill();
142
148
  c.restore();
143
- // Redraw axes since it gets
144
- // overlapped by chart area
149
+ // Redraw axes since it gets overlapped by chart area.
145
150
  if (color !== this.axisColor) {
146
- this.drawXAxis();
147
- this.drawYAxis();
151
+ if (this.xLabel !== undefined) {
152
+ this.drawXAxis();
153
+ }
154
+ if (this.yLabel !== undefined) {
155
+ this.drawYAxis();
156
+ }
148
157
  }
149
158
  }
150
159
  /**
@@ -155,15 +164,13 @@ class Chart {
155
164
  }
156
165
  /**
157
166
  * Draws the X axis of the graph.
158
- *
159
- * @param drawLabel Whether or not to draw the axis label.
160
167
  */
161
- drawXAxis(drawLabel) {
168
+ drawXAxis() {
162
169
  const c = this.context;
163
170
  const labelOffset = this.xLabel ? this.baseLabelOffset : 0;
164
171
  const yLabelOffset = this.yLabel ? this.baseLabelOffset : 0;
165
172
  c.save();
166
- if (this.xLabel && drawLabel) {
173
+ if (this.xLabel) {
167
174
  c.textAlign = "center";
168
175
  c.font = this.axisLabelFont;
169
176
  c.fillText(this.xLabel, this.x + this.width / 2, this.y + this.height + labelOffset);
@@ -176,12 +183,12 @@ class Chart {
176
183
  c.lineWidth = 2;
177
184
  c.stroke();
178
185
  // Draw tick marks
179
- for (let n = 0; n < this.numXTicks; ++n) {
186
+ for (let n = 0; n <= this.numXTicks; ++n) {
180
187
  c.beginPath();
181
- c.moveTo(((n + 1) * (this.width - yLabelOffset)) / this.numXTicks +
188
+ c.moveTo((n * (this.width - yLabelOffset)) / this.numXTicks +
182
189
  this.x +
183
190
  yLabelOffset, this.y + this.height - labelOffset);
184
- c.lineTo(((n + 1) * (this.width - yLabelOffset)) / this.numXTicks +
191
+ c.lineTo((n * (this.width - yLabelOffset)) / this.numXTicks +
185
192
  this.x +
186
193
  yLabelOffset, this.y + this.height - labelOffset - this.tickSize);
187
194
  c.stroke();
@@ -191,20 +198,22 @@ class Chart {
191
198
  c.fillStyle = "black";
192
199
  c.textAlign = "center";
193
200
  c.textBaseline = "middle";
194
- for (let n = 0; n < this.numXTicks; ++n) {
195
- const label = Math.round(((n + 1) * this.maxX) / this.numXTicks);
196
- let stringLabel = label.toString();
197
- switch (this.xValueType) {
198
- case "time":
199
- stringLabel = this.timeString(label);
200
- break;
201
+ if (this.xLabel !== undefined) {
202
+ for (let n = 0; n <= this.numXTicks; ++n) {
203
+ const label = Math.round((n * this.maxX) / this.numXTicks);
204
+ let stringLabel = label.toString();
205
+ switch (this.xValueType) {
206
+ case "time":
207
+ stringLabel = this.timeString(label);
208
+ break;
209
+ }
210
+ c.save();
211
+ c.translate((n * (this.width - yLabelOffset)) / this.numXTicks +
212
+ this.x +
213
+ yLabelOffset, this.y + this.height + this.padding - labelOffset);
214
+ c.fillText(stringLabel, 0, 0);
215
+ c.restore();
201
216
  }
202
- c.save();
203
- c.translate(((n + 1) * (this.width - yLabelOffset)) / this.numXTicks +
204
- this.x +
205
- yLabelOffset, this.y + this.height + this.padding - labelOffset);
206
- c.fillText(stringLabel, 0, 0);
207
- c.restore();
208
217
  }
209
218
  c.restore();
210
219
  }
@@ -213,12 +222,12 @@ class Chart {
213
222
  *
214
223
  * @param drawLabel Whether or not to draw the axis label.
215
224
  */
216
- drawYAxis(drawLabel) {
225
+ drawYAxis() {
217
226
  const c = this.context;
218
227
  const labelOffset = this.yLabel ? this.baseLabelOffset : 0;
219
228
  const xLabelOffset = this.xLabel ? this.baseLabelOffset : 0;
220
229
  c.save();
221
- if (this.yLabel && drawLabel) {
230
+ if (this.yLabel) {
222
231
  c.textAlign = "center";
223
232
  c.font = this.axisLabelFont;
224
233
  c.translate(0, this.graphHeight);
@@ -234,11 +243,15 @@ class Chart {
234
243
  c.stroke();
235
244
  c.restore();
236
245
  // Draw tick marks
237
- for (let n = 0; n < this.numYTicks; ++n) {
238
- c.beginPath();
239
- c.moveTo(this.x + labelOffset, (n * (this.height - xLabelOffset)) / this.numYTicks + this.y);
240
- c.lineTo(this.x + labelOffset + this.tickSize, (n * (this.height - xLabelOffset)) / this.numYTicks + this.y);
241
- c.stroke();
246
+ if (this.yLabel !== undefined) {
247
+ for (let n = 0; n < this.numYTicks; ++n) {
248
+ c.beginPath();
249
+ c.moveTo(this.x + labelOffset, (n * (this.height - xLabelOffset)) / this.numYTicks +
250
+ this.y);
251
+ c.lineTo(this.x + labelOffset + this.tickSize, (n * (this.height - xLabelOffset)) / this.numYTicks +
252
+ this.y);
253
+ c.stroke();
254
+ }
242
255
  }
243
256
  // Draw values
244
257
  c.font = this.font;
@@ -261,14 +274,16 @@ class Chart {
261
274
  const c = this.context;
262
275
  // Move context to point (0, 0) in graph
263
276
  c.translate(this.x + (this.yLabel ? this.baseLabelOffset : 0), this.y + this.height - (this.xLabel ? this.baseLabelOffset : 0));
264
- // Invert the Y scale so that it
265
- // increments as we go upwards
277
+ // Invert the Y scale so that it increments as we go upwards
266
278
  c.scale(1, -1);
267
279
  }
268
280
  /**
269
281
  * Gets the longest width from each label text in Y axis.
270
282
  */
271
283
  getLongestValueWidth() {
284
+ if (this.yLabel === undefined) {
285
+ return 0;
286
+ }
272
287
  this.context.font = this.font;
273
288
  let longestValueWidth = 0;
274
289
  for (let n = 0; n < this.numYTicks; ++n) {
@@ -305,73 +320,94 @@ class Chart {
305
320
  /**
306
321
  * Time string parsing function for axis labels.
307
322
  */
308
- timeString(second) {
309
- return new Date(1000 * Math.ceil(second))
310
- .toISOString()
311
- .substr(11, 8)
312
- .replace(/^[0:]+/, "");
323
+ timeString(seconds) {
324
+ seconds = Math.trunc(seconds);
325
+ const days = Math.floor(seconds / 86400);
326
+ seconds -= days * 86400;
327
+ const hours = Math.floor(seconds / 3600);
328
+ seconds -= hours * 3600;
329
+ const minutes = Math.floor(seconds / 60);
330
+ seconds -= minutes * 60;
331
+ const final = [minutes.toString(), seconds.toString().padStart(2, "0")];
332
+ if (hours > 0) {
333
+ final.unshift(hours.toString());
334
+ }
335
+ if (days > 0) {
336
+ final.unshift(days.toString());
337
+ }
338
+ return final.join(":");
313
339
  }
314
340
  }
315
341
 
316
342
  /**
317
- * Generates the strain chart of a difficulty calculator and returns the chart as a buffer.
343
+ * Generates the strain chart of a beatmap and returns the chart as a buffer.
318
344
  *
319
- * @param calculator The difficulty calculator to generate the strain graph for.
320
- * @param beatmapsetID The beatmapset ID to get background image from. If omitted, the background will be plain white.
321
- * @param color The color of the graph.
345
+ * @param beatmap The beatmap to generate the strain graph for.
346
+ * @param strainPeaks The strain peaks of the beatmap.
347
+ * @param clockRate The clock rate of the beatmap.
348
+ * @param options The options for the canvas.
322
349
  */
323
- async function getStrainChart(calculator, beatmapsetID, color = "#000000") {
324
- if ([
325
- calculator.strainPeaks.aimWithSliders.length,
326
- calculator.strainPeaks.aimWithoutSliders.length,
327
- calculator.strainPeaks.speed.length,
328
- calculator.strainPeaks.flashlight.length,
329
- ].some((v) => v === 0)) {
330
- return null;
331
- }
332
- const sectionLength = 400;
333
- const currentSectionEnd = Math.ceil(calculator.beatmap.hitObjects.objects[0].startTime / sectionLength) * sectionLength;
334
- const strainInformations = new Array(Math.max(calculator.strainPeaks.aimWithSliders.length, calculator.strainPeaks.speed.length, calculator.strainPeaks.flashlight.length));
335
- for (let i = 0; i < strainInformations.length; ++i) {
336
- const aimStrain = calculator.strainPeaks.aimWithSliders[i] ?? 0;
337
- const speedStrain = calculator.strainPeaks.speed[i] ?? 0;
338
- const flashlightStrain = calculator.strainPeaks.flashlight[i] ?? 0;
339
- strainInformations[i] = {
340
- time: (currentSectionEnd + sectionLength * i) / 1000,
341
- strain: calculator.mods.some((m) => m instanceof osuBase.ModFlashlight)
342
- ? (aimStrain + speedStrain + flashlightStrain) / 3
343
- : (aimStrain + speedStrain) / 2,
350
+ function index (beatmap, strainPeaks, clockRate, options) {
351
+ return __awaiter(this, void 0, void 0, function* () {
352
+ var _a, _b, _c, _d, _e, _f, _g, _h;
353
+ const sectionLength = 400;
354
+ const currentSectionEnd = Math.ceil(beatmap.hitObjects.objects[0].startTime / sectionLength) *
355
+ sectionLength;
356
+ const strainInformations = new Array(Math.max(strainPeaks.aimWithSliders.length, strainPeaks.speed.length, strainPeaks.flashlight.length) + 1);
357
+ // Intentionally insert a 0 strain at 400ms less than the beginning
358
+ // of the first object to smoothen the end curve.
359
+ strainInformations[0] = {
360
+ strain: 0,
361
+ time: (currentSectionEnd - sectionLength) / 1000,
344
362
  };
345
- }
346
- const maxTime = strainInformations.at(-1).time ??
347
- calculator.objects.at(-1).object.endTime / 1000;
348
- const maxStrain = Math.max(...strainInformations.map((v) => {
349
- return v.strain;
350
- }), 1);
351
- const maxXUnits = 10;
352
- const maxYUnits = 10;
353
- const unitsPerTickX = Math.ceil(maxTime / maxXUnits / 10) * 10;
354
- const unitsPerTickY = Math.ceil(maxStrain / maxYUnits / 20) * 20;
355
- const chart = new Chart({
356
- graphWidth: 900,
357
- graphHeight: 250,
358
- minX: 0,
359
- minY: 0,
360
- maxX: Math.ceil(maxTime / unitsPerTickX) * unitsPerTickX,
361
- maxY: Math.ceil(maxStrain / unitsPerTickY) * unitsPerTickY,
362
- unitsPerTickX,
363
- unitsPerTickY,
364
- background: await canvas.loadImage(`https://assets.ppy.sh/beatmaps/${beatmapsetID}/covers/cover.jpg`).catch(() => {
365
- return undefined;
366
- }),
367
- xLabel: "Time",
368
- yLabel: "Strain",
369
- pointRadius: 0,
370
- xValueType: "time",
363
+ for (let i = 1; i < strainInformations.length; ++i) {
364
+ const aimStrain = (_a = strainPeaks.aimWithSliders[i]) !== null && _a !== void 0 ? _a : 0;
365
+ const speedStrain = (_b = strainPeaks.speed[i]) !== null && _b !== void 0 ? _b : 0;
366
+ const flashlightStrain = (_c = strainPeaks.flashlight[i]) !== null && _c !== void 0 ? _c : 0;
367
+ strainInformations[i] = {
368
+ time: (currentSectionEnd + sectionLength * (i - 1)) / 1000,
369
+ strain: strainPeaks.flashlight.length > 0
370
+ ? (aimStrain + speedStrain + flashlightStrain) / 3
371
+ : (aimStrain + speedStrain) / 2,
372
+ };
373
+ }
374
+ const maxTime = (_e = (_d = strainInformations.at(-1)) === null || _d === void 0 ? void 0 : _d.time) !== null && _e !== void 0 ? _e : beatmap.hitObjects.objects.at(-1).endTime / 1000 / clockRate;
375
+ const maxStrain = Math.max(osuBase.MathUtils.max(strainInformations.map((v) => v.strain)), 1);
376
+ const maxXUnits = 10;
377
+ const maxYUnits = 10;
378
+ const unitsPerTickX = Math.ceil(maxTime / maxXUnits / 10) * 10;
379
+ const unitsPerTickY = maxStrain / maxYUnits / 20;
380
+ const chart = new Chart({
381
+ graphWidth: (_f = options === null || options === void 0 ? void 0 : options.width) !== null && _f !== void 0 ? _f : 600,
382
+ graphHeight: (_g = options === null || options === void 0 ? void 0 : options.height) !== null && _g !== void 0 ? _g : 150,
383
+ minX: 0,
384
+ minY: 0,
385
+ maxX: Math.ceil(maxTime / unitsPerTickX) * unitsPerTickX,
386
+ maxY: (options === null || options === void 0 ? void 0 : options.drawStrainAxis)
387
+ ? Math.ceil(maxStrain / Math.ceil(unitsPerTickY) / 20) *
388
+ Math.ceil(unitsPerTickY) *
389
+ 20
390
+ : maxStrain,
391
+ unitsPerTickX,
392
+ unitsPerTickY: (options === null || options === void 0 ? void 0 : options.drawStrainAxis)
393
+ ? Math.ceil(unitsPerTickY) * 20
394
+ : unitsPerTickY,
395
+ background: (options === null || options === void 0 ? void 0 : options.beatmapsetID) !== undefined
396
+ ? yield canvas.loadImage(`https://assets.ppy.sh/beatmaps/${options.beatmapsetID.toString()}/covers/cover.jpg`).catch(() => undefined)
397
+ : undefined,
398
+ xLabel: (options === null || options === void 0 ? void 0 : options.showTimeLabel) ? "Time" : "",
399
+ yLabel: (options === null || options === void 0 ? void 0 : options.drawStrainAxis)
400
+ ? options.showStrainLabel
401
+ ? "Strain"
402
+ : ""
403
+ : undefined,
404
+ pointRadius: 0,
405
+ xValueType: "time",
406
+ });
407
+ chart.drawArea(strainInformations.map((v) => new osuBase.Vector2(v.time, v.strain)), (_h = options === null || options === void 0 ? void 0 : options.color) !== null && _h !== void 0 ? _h : "#000000");
408
+ return chart.getBuffer();
371
409
  });
372
- chart.drawArea(strainInformations.map((v) => new osuBase.Vector2(v.time, v.strain)), color);
373
- return chart.getBuffer();
374
410
  }
375
411
 
376
- module.exports = getStrainChart;
412
+ module.exports = index;
377
413
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-strain-graph-generator",
3
- "version": "4.0.0-beta.9",
3
+ "version": "4.0.0-beta.90",
4
4
  "description": "A module for generating strain graph of an osu!standard beatmap.",
5
5
  "keywords": [
6
6
  "osu",
@@ -12,9 +12,12 @@
12
12
  "main": "dist/index.js",
13
13
  "types": "typings/index.d.ts",
14
14
  "typedocMain": "src/index.ts",
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
15
18
  "files": [
16
- "dist/**",
17
- "typings/**"
19
+ "dist/index.js",
20
+ "typings/index.d.ts"
18
21
  ],
19
22
  "repository": {
20
23
  "type": "git",
@@ -22,21 +25,21 @@
22
25
  },
23
26
  "scripts": {
24
27
  "build": "rollup -c ../../rollup.config.mjs",
25
- "lint": "eslint --ext ts",
26
- "prepare": "npm run build",
28
+ "lint": "eslint 'src/**/*.ts'",
29
+ "prepublishOnly": "pnpm build",
27
30
  "test": "echo \"No tests for this module\""
28
31
  },
29
32
  "bugs": {
30
33
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
31
34
  },
32
35
  "dependencies": {
33
- "@rian8337/osu-base": "^4.0.0-beta.9",
34
- "@rian8337/osu-difficulty-calculator": "^4.0.0-beta.9",
35
- "@rian8337/osu-rebalance-difficulty-calculator": "^4.0.0-beta.9",
36
- "canvas": "^2.9.0"
36
+ "@rian8337/osu-base": "4.0.0-beta.90",
37
+ "@rian8337/osu-difficulty-calculator": "4.0.0-beta.90",
38
+ "@rian8337/osu-rebalance-difficulty-calculator": "4.0.0-beta.90",
39
+ "canvas": "^3.1.0"
37
40
  },
38
41
  "publishConfig": {
39
42
  "access": "public"
40
43
  },
41
- "gitHead": "35702aa327055e3d8edb13c038b9d9ae00eadf48"
44
+ "gitHead": "3fe8f54f39183d5a42041d0fc48d8bd58e71fe41"
42
45
  }
@@ -1,13 +1,49 @@
1
- import { DifficultyCalculator } from '@rian8337/osu-difficulty-calculator';
2
- import { DifficultyCalculator as DifficultyCalculator$1 } from '@rian8337/osu-rebalance-difficulty-calculator';
1
+ import { Beatmap } from '@rian8337/osu-base';
2
+ import { StrainPeaks } from '@rian8337/osu-difficulty-calculator';
3
+ import { StrainPeaks as StrainPeaks$1 } from '@rian8337/osu-rebalance-difficulty-calculator';
3
4
 
4
5
  /**
5
- * Generates the strain chart of a difficulty calculator and returns the chart as a buffer.
6
+ * Options for initializing the canvas.
7
+ */
8
+ interface CanvasOptions {
9
+ /**
10
+ * The beatmapset ID to get background image from. If omitted, the background will be plain white.
11
+ */
12
+ readonly beatmapsetID?: number;
13
+ /**
14
+ * The width of the canvas. Defaults to 600.
15
+ */
16
+ readonly width?: number;
17
+ /**
18
+ * The height of the canvas. Defaults to 150.
19
+ */
20
+ readonly height?: number;
21
+ /**
22
+ * The color of the graph. Defaults to black.
23
+ */
24
+ readonly color?: string;
25
+ /**
26
+ * Whether to show the time label. Defaults to `false`.
27
+ */
28
+ readonly showTimeLabel?: boolean;
29
+ /**
30
+ * Whether to show the strain axis. Defaults to `false`.
31
+ */
32
+ readonly drawStrainAxis?: boolean;
33
+ /**
34
+ * Whether to show the strain label. Only active when `drawStrainAxis` is set to `true`. Defaults to `false`.
35
+ */
36
+ readonly showStrainLabel?: boolean;
37
+ }
38
+ /**
39
+ * Generates the strain chart of a beatmap and returns the chart as a buffer.
6
40
  *
7
- * @param calculator The difficulty calculator to generate the strain graph for.
8
- * @param beatmapsetID The beatmapset ID to get background image from. If omitted, the background will be plain white.
9
- * @param color The color of the graph.
41
+ * @param beatmap The beatmap to generate the strain graph for.
42
+ * @param strainPeaks The strain peaks of the beatmap.
43
+ * @param clockRate The clock rate of the beatmap.
44
+ * @param options The options for the canvas.
10
45
  */
11
- declare function getStrainChart(calculator: DifficultyCalculator | DifficultyCalculator$1, beatmapsetID?: number, color?: string): Promise<Buffer | null>;
46
+ declare function export_default(beatmap: Beatmap, strainPeaks: StrainPeaks | StrainPeaks$1, clockRate: number, options?: CanvasOptions): Promise<Buffer>;
12
47
 
13
- export { getStrainChart as default };
48
+ export { export_default as default };
49
+ export type { CanvasOptions };
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/Chart.ts","../src/index.ts"],"sourcesContent":[null,null],"names":["createCanvas","ModFlashlight","loadImage","Vector2"],"mappings":";;;;;AA6EA;;;;AAIG;MACU,KAAK,CAAA;AACd;;AAEG;AACM,IAAA,MAAM,CAAS;AAExB;;AAEG;AACM,IAAA,OAAO,CAA2B;AA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