Skip to content
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

✨ Add a plot component to the Radial theme #12

Merged
merged 18 commits into from
Jan 17, 2024
Merged

Conversation

BattleCh1cken
Copy link
Contributor

@BattleCh1cken BattleCh1cken commented Jan 15, 2024

Summary

This feature adds a basic wrapper around Cetz's plotting library with a relatively simple API.

Checklist

  • I have fully tested all of the added features
  • I have fully documented all of the relevant code

@BattleCh1cken BattleCh1cken changed the title Feature plot ✨ Add a plot component to the Radial theme Jan 15, 2024
@BattleCh1cken BattleCh1cken marked this pull request as ready for review January 15, 2024 17:14
@BattleCh1cken
Copy link
Contributor Author

Message to reviewers: review #13 before reviewing this.

Copy link
Collaborator

@dblaufuss dblaufuss left a comment

Choose a reason for hiding this comment

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

It looks pretty clean and is easy to use


plot.plot(
name: "plot",
plot-style: plot-style,
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a huge issue, but as it is I don't really think the stoke used in the grid looks good. It creates a lot of weird overlaps and looks a little messy, if possible could you change it to something like this:
stroke: (dash: none, thickness: .2pt, paint: black)
(This is the same grid style I used in the gantt chart, maybe we should use some sort of consistent grid style for charts)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I'll look into it.

#let plot(
title: "",
x-label: "",
y-label: "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a way to change the variables so it's not always x and y, but just have it so those are defaults? like if I'm plotting a velocity time graph, it would make sense to have v and t axis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The API is meant to be as simple as possible. If people want something more advanced they can just use the underlying library.

(also I have no idea how to do this)

Copy link
Collaborator

@BestUsernamEver BestUsernamEver left a comment

Choose a reason for hiding this comment

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

Everything looks good to me, I like changing the directions to north, south, east, and west

import cetz.palette

// Style for the data lines
let plot-colors = (blue, red, green, yellow, pink, orange)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Boo no rainbow order
let plot-colors = (red, orange, yellow, green, blue, pink)

@BattleCh1cken BattleCh1cken merged commit e27524c into main Jan 17, 2024
2 checks passed
@BattleCh1cken BattleCh1cken deleted the feature-plot branch January 24, 2024 19:25
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.

3 participants