teunbrand / elementalist Goto Github PK
View Code? Open in Web Editor NEWThis repository provides extra theme elements as an extension of ggplot2.
Home Page: https://teunbrand.github.io/elementalist/
License: Other
This repository provides extra theme elements as an extension of ggplot2.
Home Page: https://teunbrand.github.io/elementalist/
License: Other
The following fails
library(ggplot2)
library(elementalist)
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
theme(axis.ticks = element_line_wiggle(1))
#> Error in xy[-nxy, , drop = FALSE] - xy[-1, , drop = FALSE]: non-numeric argument to binary operator
Most likely because I've been ignoring the existence of compound units, such as arithmetic units (e.g. unit(1, "cm") + unit(0.2, "npc")
). I've checked this through the debug system. I don't know what the optimal solution is, but here are some thoughts:
Delay evaluating line manipulations until draw time. This allows me to convert to absolute units first and then apply manipulations. Downside is that there is no consistency in line manipulations anymore as the plot window is resized and it makes resizing slower.
If this is an edge case for the axis guide ticks, we could probably get away with solving this in the particular case of axis guides instead of solving the general case. The only other 'ticks'-case I can think of are the guide_colourbar()
ticks, but these don't appear to be under the control of the theme system.
Get advice from someone smarter than me on how this can be solved best.
Error more gracefully
Should make some geoms that take grob building from the element.
Here is a collection of ideas for this package. If you have a good idea for theme elements, feel free to comment.
Copy-paste the element at an angle and an offset in a (by default) dark gray colour.
Either copy the element at varying levels of alpha, or render as raster first, blur the raster, use raster as element.
An element_rect
-class that displays a raster image in the rectangle.
An element_rect
-class that will draw rectangles with rounded corners.
An element_rect
-class that has quarter-circle 'bites' from the corners
An element_line
-class that will show sawtooth/zigzag pattern.
An element_line
-class that will show sine waves.
An element_line
-class that has noise based on the ambient package (simplex, perlin).
An element_line
-class that will plot a raster image along a line.
An element_text
-class that adds noisy rotation to letters.
Don't even know how to begin with this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.