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

feat: Add option for graph drawing direction #1113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lenianiva
Copy link

@lenianiva lenianiva commented Jun 7, 2024

Description

This adds 3 boolean flags to the graph widget. flip-x, flip-y, vertical. By default, both x and y axes are flipped (the old behaviour), and the x, y axes follow the same directions as the screen. The flip-x and flip-y flags toggle the direction of x and y axes and vertical swaps the two axes, so you could have a graph that goes (time-axis) from left to right, bottom to top, etc.

Usage

(defwindow vbar
	:exclusive true
	:monitor 0
	:windowtype "dock"
	:geometry (geometry
		:x "0%"
		:y "0%"
		:width "25px"
		:height "99%"
		:anchor "center left"
	)
	:reserve (struts :side "left" :distance "20px")
	(widget-memory))

(defwidget widget-memory []
				(graph
					:width 20
					:height 100
					:vertical true
					:flip-y false
					:value {EWW_RAM.used_mem_perc}
					:time-range "30s"
					:dynamic false
					:max 100
					:min 0))

shows the memory graph on the left side of the screen going from bottom to top.

Showcase

This is taken from my own configurations
vertical-graph

Additional Notes

There are other ways to arrange the flags, but in total there are 8 possible combinations

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

@lenianiva lenianiva changed the title feat: Add option for vertical graph feat: Add option for graph drawing direction Jun 9, 2024
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.

None yet

1 participant