Fix broken canvas dependency #3
Open
J053Fabi0 wants to merge 14 commits into
Open
Conversation
This label is what is shown at the top of each bar. It can be null or left empty for the default value.
…alues This fixes the option for not giving titles to axis or graph
Ciaxur
requested changes
Aug 13, 2024
Owner
Ciaxur
left a comment
There was a problem hiding this comment.
These changes look good to me, aside from opting to use your jsr@deno-canvas instead of just bumping the version of the official one (https://deno.land/x/canvas@v1.4.1).
| @@ -1,4 +1,4 @@ | |||
| import Canvas from 'https://deno.land/x/canvas@v1.2.2/mod.ts'; | |||
| import Canvas from "@josefabio/deno-canvas"; | |||
Owner
There was a problem hiding this comment.
Why not just update this and deps.ts#L4 to https://deno.land/x/canvas@v1.4.1/mod.ts'?
That works for me:
➜ DenoChart git:(main) ✗ gd deps.ts
diff --git a/deps.ts b/deps.ts
index f8e3dcf..c3d47c2 100644
--- a/deps.ts
+++ b/deps.ts
@@ -1,4 +1,4 @@
-import Canvas from 'https://deno.land/x/canvas@v1.2.2/mod.ts';
+import Canvas from 'https://deno.land/x/canvas@v1.4.1/mod.ts';
export default Canvas;
-export * from 'https://deno.land/x/canvas@v1.2.2/mod.ts';
\ No newline at end of file
+export * from 'https://deno.land/x/canvas@v1.4.1/mod.ts';
➜ DenoChart git:(main) ✗ deno --version
deno 1.33.2 (release, x86_64-unknown-linux-gnu)
v8 11.4.183.1
typescript 5.0.3
➜ DenoChart git:(main) ✗ deno run ../main.ts
Initialized Canvas Instance W[720] H[480]
Create Graph with Options: {
height: 480,
width: 720,
backgroundColor: { r: 0, g: 0, b: 0, a: 0.75 },
titleText: "Uptime",
xAxisText: "Hours",
yAxisText: "Day",
yMax: 50,
yPadding: 0,
xPadding: 0,
bar_width: 25,
bar_spacing: 5,
graphSegments_X: 18,
graphSegments_Y: 10,
titleColor: "rgb(255,255,255)",
xTextColor: "rgba(255,255,255,1)",
yTextColor: "rgba(255,255,255,1)",
xSegmentColor: "rgba(255,255,255,0.5)",
ySegmentColor: "rgba(255,255,255,0.5)",
graphValuePrecision: 2,
verbose: true
}
yMax Evaluated to: 50
✅ Granted write access to "image.png".
Graph save to 'image.png'
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.
The current code throws this error:
Updating the canvas dependency to the latest version solves the problem.
I have tested using
import Graph from "https://raw.githubusercontent.com/J053Fabi0/DenoChart/main/mod.ts";and it works.