@rian8337/osu-strain-graph-generator 1.0.0 → 1.0.5

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
@@ -1,11 +1,51 @@
1
- # `osu-strain-graph-generator`
1
+ # About
2
2
 
3
- > TODO: description
3
+ The strain graph generator portion of my osu! module.
4
4
 
5
- ## Usage
5
+ # Features
6
6
 
7
+ This module provides a strain graph generator for osu!standard gamemode.
8
+
9
+ # Specific Requirements
10
+
11
+ This module has no specific requirements, however installed modules in installation may have specific requirements. It's advised to check them.
12
+
13
+ # Installation
14
+
15
+ ```
16
+ npm i @rian8337/osu-base @rian8337/osu-difficulty-calculator @rian8337/osu-rebalance-difficulty-calculator
17
+ ```
18
+
19
+ or
20
+
21
+ ```
22
+ yarn add @rian8337/osu-base @rian8337/osu-difficulty-calculator @rian8337/osu-rebalance-difficulty-calculator
7
23
  ```
8
- const osuStrainGraphGenerator = require('osu-strain-graph-generator');
9
24
 
10
- // TODO: DEMONSTRATE API
25
+ You can exclude a difficulty module that you don't plan to use.
26
+
27
+ # Usage
28
+
29
+ The usage below works for rebalance difficulty calculator as well.
30
+
31
+ ```js
32
+ import { MapInfo } from "@rian8337/osu-base";
33
+ import { OsuStarRating } from "@rian8337/osu-difficulty-calculator";
34
+ import { default as getStrainChart } from "@rian8337/osu-strain-graph-generator";
35
+
36
+ (async () => {
37
+ const beatmapInfo = await MapInfo.getInformation({ beatmapID: 901854 });
38
+
39
+ if (!beatmapInfo.title) {
40
+ return console.log("Beatmap not found");
41
+ }
42
+
43
+ const rating = new OsuStarRating().calculate({
44
+ map: beatmapInfo.map,
45
+ });
46
+
47
+ const chart = await getStrainChart(rating);
48
+
49
+ console.log(chart);
50
+ })();
11
51
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-strain-graph-generator",
3
- "version": "1.0.0",
3
+ "version": "1.0.5",
4
4
  "description": "A module for generating strain graph of an osu!standard beatmap.",
5
5
  "keywords": [
6
6
  "osu",
@@ -21,6 +21,8 @@
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsc",
24
+ "lint": "eslint --ext ts",
25
+ "generate-docs": "typedoc src/index.ts",
24
26
  "prepare": "npm run build",
25
27
  "test": "echo \"No tests for this module\""
26
28
  },
@@ -28,13 +30,13 @@
28
30
  "url": "https://github.com/Rian8337/osu-droid-module/issues"
29
31
  },
30
32
  "dependencies": {
31
- "@rian8337/osu-base": "^1.0.0",
32
- "@rian8337/osu-difficulty-calculator": "^1.0.0",
33
- "@rian8337/osu-rebalance-difficulty-calculator": "^1.0.0",
33
+ "@rian8337/osu-base": "^1.0.5",
34
+ "@rian8337/osu-difficulty-calculator": "^1.0.5",
35
+ "@rian8337/osu-rebalance-difficulty-calculator": "^1.0.5",
34
36
  "canvas": "^2.9.0"
35
37
  },
36
38
  "publishConfig": {
37
39
  "access": "public"
38
40
  },
39
- "gitHead": "e4fdb9c1ed6f90e70651c1aedfdb964b61cb240d"
41
+ "gitHead": "c8c092485a5ae3be16f2bfa0a3defb00163918d7"
40
42
  }
@@ -1,21 +1,21 @@
1
- declare module "@rian8337/osu-strain-graph-generator" {
2
- import { StarRating } from "@rian8337/osu-difficulty-calculator";
3
- import { StarRating as RebalanceStarRating } from "@rian8337/osu-rebalance-difficulty-calculator";
4
-
5
- //#region Functions
6
-
7
- /**
8
- * Generates the strain chart of beatmap beatmap and returns the chart as a buffer.
9
- *
10
- * @param beatmap The beatmap to generate the strain graph for.
11
- * @param beatmapsetID The beatmapset ID to get background image from. If omitted, the background will be plain white.
12
- * @param color The color of the graph.
13
- */
14
- export default function getStrainChart(
15
- beatmap: StarRating | RebalanceStarRating,
16
- beatmapsetID?: number,
17
- color?: string
18
- ): Promise<Buffer | null>;
19
-
20
- //#endregion
21
- }
1
+ declare module "@rian8337/osu-strain-graph-generator" {
2
+ import { StarRating } from "@rian8337/osu-difficulty-calculator";
3
+ import { StarRating as RebalanceStarRating } from "@rian8337/osu-rebalance-difficulty-calculator";
4
+
5
+ //#region Functions
6
+
7
+ /**
8
+ * Generates the strain chart of beatmap beatmap and returns the chart as a buffer.
9
+ *
10
+ * @param beatmap The beatmap to generate the strain graph for.
11
+ * @param beatmapsetID The beatmapset ID to get background image from. If omitted, the background will be plain white.
12
+ * @param color The color of the graph.
13
+ */
14
+ export default function getStrainChart(
15
+ beatmap: StarRating | RebalanceStarRating,
16
+ beatmapsetID?: number,
17
+ color?: string
18
+ ): Promise<Buffer | null>;
19
+
20
+ //#endregion
21
+ }