-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken canvas dependency #3
base: main
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/[email protected]).
deps.ts
Outdated
@@ -1,4 +1,4 @@ | |||
import Canvas from 'https://deno.land/x/canvas@v1.2.2/mod.ts'; | |||
import Canvas from "@josefabio/deno-canvas"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just update this and deps.ts#L4 to https://deno.land/x/[email protected]/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/[email protected]/mod.ts';
+import Canvas from 'https://deno.land/x/[email protected]/mod.ts';
export default Canvas;
-export * from 'https://deno.land/x/[email protected]/mod.ts';
\ No newline at end of file
+export * from 'https://deno.land/x/[email protected]/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'
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.