Fix chart command#13
Open
S0rax wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
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 startinstead ofnode 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.
| @@ -1,20 +1,25 @@ | |||
| import * as fs from 'fs'; | |||
| import * as fs from 'fs'; | |||
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
some ai slop that works after review. didn't test the java bot since no way im running that

example: