• Stars
    star
    106
  • Rank 315,617 (Top 7 %)
  • Language
    R
  • License
    Other
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

miscellaneous functions for Danielle's art

jasmines

The jasmines package is what I use to make a lot of my generative artwork with R. Internally it relies heavily on the ambient package, and you may need to install the developer version of ambient to make it work:

# install.packages("remotes")
# remotes::install_github("thomasp85/ambient")
remotes::install_github("djnavarro/jasmines")

Functions in the jasmines package are designed to work with the dplyr pipe, so you will likely want to have dplyr loaded:

library(dplyr)
library(jasmines)

Example 1

A typical jasmines pipeline looks like this:

use_seed(1) %>%
  entity_circle(grain = 1000) %>%
  unfold_tempest(iterations = 10) %>%
  style_ribbon(background = "wheat")

The use_seed() function is a convenience function that sets the random number generator seed, and stores that value for later use. The seed is then piped to an entity_ function (or a scene_ function) that creates the initial object that will be operated upon. In this case this initial object is a circle of diameter 2 rendered using 1000 points. This is then passed to an unfold_ function, that iteratively applies some operation (in this case the β€œwarp”) operation for some number of steps (in this case 100). The object is converted to a ggplot2 image using one of the style_ functions. In this and most cases the style_ribbon() is used and has several customisable finctions.

Example 2

use_seed(1) %>%
  entity_circle(grain = 1000, size = 2) %>%
  unfold_warp(iterations = 100) %>%
  style_ribbon(palette = "rainbow")

Example 3

An example where the initial object is created with entity_heart(), the unfolding performed by unfold_slice() and the styling is more elaborate.

use_seed(1) %>%
  entity_heart(grain = 1000) %>%
  unfold_slice(iterations = 10) %>%
  style_ribbon(
    palette = "base", 
    colour = "ind", 
    background = "mistyrose"
  ) %>%
  style_overlay(border = "white")

Example 4

It is possible to create β€œscenes” comprised of multiple entities as the initial starting point, apply multiple unfolding operations, and modify the way transparency and colouring is done.

use_seed(1) %>%
  scene_discs(
    rings = 3, points = 5000, size = 5
  ) %>%
  mutate(ind = 1:n()) %>%
  unfold_warp(
    iterations = 1,
    scale = .5, 
    output = "layer" 
  ) %>%
  unfold_tempest(
    iterations = 20,
    scale = .01
  ) %>%
  style_ribbon(
    palette = palette_named("vik"),
    colour = "ind",
    alpha = c(.1,.1),
    background = "oldlace"
  )

More Repositories

1

rbook

Source files for "Learning Statistics with R"
PostScript
458
star
2

flametree

Generative artwork that looks a bit like trees
R
161
star
3

psyr

R for Psychological Science
HTML
48
star
4

jaysire

Build jsPsych Experiments in R
R
43
star
5

workbch

A "work bench" for light weight project tracking in R
R
43
star
6

bs4cards

Generate Bootstrap 4 Cards
HTML
41
star
7

arrow-user2022

Larger-Than-Memory Data Workflows with Apache Arrow
HTML
41
star
8

xprmntr

Build browser-based behavioural experiments in R
JavaScript
33
star
9

asciify

Package to create ASCII artwork
HTML
32
star
10

newproject

Template for a new research project
31
star
11

quarto-blog

HTML
30
star
12

caladown

R package designed to work with the "calade" theme for Hugo
R
26
star
13

robust-tools

Course materials for my "Robust Tools" class
HTML
23
star
14

rainbowr

Makes LGBT hexes and flags using R
R
22
star
15

rosemary

Generative Artwork by Danielle Navarro
R
21
star
16

voronoise

Makes Artwork From Voronoi Tesselations
R
15
star
17

tidylsrbook

Source code for a tidy revision to LSR
R
14
star
18

brownianbridge

Brownian bridge animations using gganimate
R
13
star
19

blankex

Blank experiment using jsPsych and google app engine
JavaScript
12
star
20

lsr

R package associated with "Learning Statistics with R"
R
12
star
21

tidylsr

A tidy revision to the lsr package
R
10
star
22

rstudiopostcard

R
10
star
23

arrow-nyc-taxi-scatter

R
9
star
24

webr-automata

R
9
star
25

series-water-colours

R
8
star
26

compcogsci-3016

Danielle Navarro & Andrew Perfors' class on "Computational Cognitive Science"
8
star
27

damage

Create Generative Art
R
7
star
28

ashtree

R
7
star
29

slides-starting-rmarkdown

HTML
6
star
30

refinery

Reproducibility Tools For Distill Sites
R
6
star
31

minds-machines-4103

Danielle Navarro's class "Minds and Machines"
HTML
6
star
32

blankshiny

Simple template for running psychology experiments with Shiny
R
5
star
33

tweetart

R
5
star
34

slides-project-structure

HTML
5
star
35

votives

Each image is a voronoi tesselation constructed from points sampled with an iterated function system, shaded in a limited colour palette
R
5
star
36

shepard-theory

Paper submitted for PoPS special issue on theory
TeX
4
star
37

series-love-in-the-lightning

R
4
star
38

ohno

Breaks an R closure for no good reason
R
4
star
39

queue

Simple Multi-Threaded Task Queuing
R
4
star
40

genuary2021

R
4
star
41

perlin-circles

R
4
star
42

distill-blog

HTML
4
star
43

hugo-diziet

SCSS
4
star
44

slides-arrow-latinr-2022

HTML
3
star
45

turmite59

makes heartbleed images
R
3
star
46

colorir

Aesthetic Colour Palettes
R
3
star
47

slides-data-thread-2022

HTML
3
star
48

sampling-differences

Materials associated with the Wen, Desai, Navarro & Hayes "Who is sensitive to selection biases in inductive reasoning?" paper
R
3
star
49

talks

HTML
3
star
50

scrawl

Generates Scrawl Plots
R
3
star
51

slides

HTML
3
star
52

hugo-calade

A Hugo theme for R users
CSS
3
star
53

series-grid-graphics

R
2
star
54

donut

Minimal kubernetes app rendering generative art with R
R
2
star
55

stoneskip

Creates Stoneskip Images
R
2
star
56

pkgdowngirl

A Minimal Pkgdown Template
CSS
2
star
57

exhibit_user2021

2
star
58

satrdayjoburg

Content for my data visualisation workshop for satRday Johannesburg
CSS
2
star
59

hexify

Create Hex Stickers
R
2
star
60

series-pollen

2
star
61

series-perlin-hearts

2
star
62

scopes

makes scopes plots
R
2
star
63

thorn03

Makes a Thorns Image
R
2
star
64

series-dreamlike

R
2
star
65

papers

CSS
2
star
66

bayes-factor-essay

https://psyarxiv.com/nujy6
TeX
2
star
67

series-silhouettes

2
star
68

cognitive-science-3211

Danielle Navarro's lectures for "Cognitive Science"
2
star
69

hugo-llum

CSS
2
star
70

twitterapi

Provides Low Level Twitter API Access
R
2
star
71

twittersafe

Manage Twitter Mutes and Blocks
R
2
star
72

slides-installing-r

R
2
star
73

summerschool

Danielle's very exciting summer school repo
HTML
1
star
74

slides-template

HTML
1
star
75

series-dancers

R
1
star
76

data-vis-2021

CSS
1
star
77

series-damage

R
1
star
78

cell2text

R
1
star
79

series-scrawl

1
star
80

perception-cognition-2071

Danielle Navarro's lectures for "Perception and Cognition"
1
star
81

manuscripts

Repository containing PDF versions of selected manuscripts, PsyArXiv links, source code and DOI links to version of record
TeX
1
star
82

draft-arrow-docs

1
star
83

torch-toys

R
1
star
84

noneoftheabove

Experiments, models and data for the "novel categories" paper.
HTML
1
star
85

slides-starting-functions

HTML
1
star
86

slides-starting-programming

HTML
1
star
87

newblog

Template for a simple blogdown site
HTML
1
star
88

series-broken-symmetry

R
1
star
89

mixedchains

Code and data associated with "When extremists win"
TeX
1
star
90

rtistry

R
1
star
91

art-template

R
1
star
92

2017-unsw-psych-women

1
star
93

s7-shapes

R
1
star