Skip to content

Fix chart command#13

Open
S0rax wants to merge 3 commits into
pop4959:masterfrom
S0rax:fix/chart-command
Open

Fix chart command#13
S0rax wants to merge 3 commits into
pop4959:masterfrom
S0rax:fix/chart-command

Conversation

@S0rax

@S0rax S0rax commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

some ai slop that works after review. didn't test the java bot since no way im running that
example:
image

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the /chart command by changing the Java bot to execute the chart generator via Yarn, and refactors the scripts/ chart generator from a Plotly-based approach to a QuickChart-based approach (removing Plotly credentials/config).

Changes:

  • Update the bot’s chart command to run the script via yarn start instead of node chart.js.
  • Replace Plotly image generation with QuickChart (Chart.js) rendering and adjust the TS script accordingly.
  • Remove Plotly-related config/types and update Node dependencies/lockfile to match the new approach.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/com/github/pop4959/srbot/commands/Chart.java Runs the chart generator via Yarn; still needs safer handling of script output vs. file paths.
scripts/chart.ts Migrates chart rendering to QuickChart; adds annotation-based rank lines and offseason shading.
scripts/package.json Switches to a start script using tsx and updates dependencies for the new chart pipeline.
scripts/yarn.lock Updates dependency lockfile for new/updated packages.
scripts/types/config.ts Removes Plotly config shape and adjusts type definitions accordingly.
scripts/types/shape.ts Removes Plotly-specific Shape type (no longer needed).
scripts/config.json Removes Plotly credentials section from config.
scripts/tsconfig.json Re-formats TS config (no functional change apparent).
.gitignore Ignores generated charts/ output directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/chart.ts
@@ -1,20 +1,25 @@
import * as fs from 'fs';
import * as fs from 'fs';
Comment thread scripts/chart.ts
Comment on lines +104 to +105
xMin: new Date(boundaries.at(0)!).toISOString(),
xMax: new Date(boundaries.at(-1)!).toISOString(),
Comment on lines 60 to 64
String output;
try {
ProcessBuilder chartProcessBuilder = new ProcessBuilder("node", "chart.js", steamId, season.toString());
ProcessBuilder chartProcessBuilder = new ProcessBuilder("yarn", "-s", "start", "--", steamId, season.toString());
chartProcessBuilder.directory(new File("./scripts"));
Process chartProcess = chartProcessBuilder.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants