Giter Club home page Giter Club logo

spiralize's Introduction

Visualize Data on Spirals

R-CMD-check CRAN CRAN

Features

The package spiralize visualizes data along an Archimedean spiral. It has two major advantages for visualization:

  1. It is able to visualize data with very long axis with high resolution.
  2. It is efficient for time series data to reveal periodic patterns.

Citation

Zuguang Gu, et al., spiralize: an R package for Visualizing Data on Spirals, Bioinformatics, 2021. https://doi.org/10.1093/bioinformatics/btab778

Install

The package is available on CRAN and can be installed by:

install.packages("spiralize")

If you want the latest version, install it directly from GitHub:

library(devtools)
install_github("jokergoo/spiralize")

Usage

It includes three steps:

  1. initialize the spiral,
  2. add a track,
  3. add graphics in the track.

Step 2 and 3 can be applied multiple times to allow multiple-track visualization along the spiral.

The code for making spiral plot looks like follows:

library(spiralize)
spiral_initialize(...)
spiral_track(...)
spiral_points(...)
...

Graphics

Complex plots are baiscally constructed from simple graphics. Here there are following low-level graphics functions:

  • spiral_points()
  • spiral_lines()
  • spiral_rect()
  • spiral_segments()
  • spiral_polygon()
  • spiral_bars()
  • spiral_text()
  • spiral_axis()
  • spiral_yaxis()
  • spiral_raster()

Particularlly, horizon chart is very suitable to put on the spiral, thus there is one function for this:

  • spiral_horizon()

Spiral plot can also visualize dendrograms with large number of leaves, thus there are following two functions:

  • spiral_dendrogram()
  • spiral_phylo()

Vignettes

There are the following vignettes:

Examples

  1. Difference of ggplot2 daily downloads to the mean of the current year (2015-2021). Each loop contains 52 weeks so that same weeks in different years locate at the same angle in the polar coordinates.

image

  1. The same data as the first one, but horizon chart is used. Also title and legends are added.

image

  1. A phylogenetic life tree with 50645 species.

download

  1. The spiral COVID-19 Shiny app

https://jokergoooo.shinyapps.io/covid19/

covid19_spiral

License

MIT @ Zuguang Gu

spiralize's People

Contributors

jokergoo avatar

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.