Git Product home page Git Product logo

elementalist's People

Contributors

teunbrand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elementalist's Issues

Compound units fail

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

Elemental Geoms

Should make some geoms that take grob building from the element.

Line elements

  • geom_line()
  • geom_path()
  • geom_segments()

Rectangle elements

  • geom_rect()
  • geom_tile()
  • geom_bar()/geom_col()

Element Ideas

Here is a collection of ideas for this package. If you have a good idea for theme elements, feel free to comment.

General Ideas

Shadow

Copy-paste the element at an angle and an offset in a (by default) dark gray colour.

Blur

Either copy the element at varying levels of alpha, or render as raster first, blur the raster, use raster as element.

Rectangle ideas

Image rectangles

An element_rect-class that displays a raster image in the rectangle.

Rounded rectangles

An element_rect-class that will draw rectangles with rounded corners.

Inverted rounded rectangles

An element_rect-class that has quarter-circle 'bites' from the corners

Line ideas

Zigzag

An element_line-class that will show sawtooth/zigzag pattern.

Sine-wave

An element_line-class that will show sine waves.

Ambient noise

An element_line-class that has noise based on the ambient package (simplex, perlin).

Raster lines

An element_line-class that will plot a raster image along a line.

Text ideas

Jiggle

An element_text-class that adds noisy rotation to letters.
Don't even know how to begin with this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.