GithubHelp home page GithubHelp logo

coffeewheel's Introduction

An R Interface to D3-based Coffee Wheel

This is an htmlwidgets-based visualization tool for hierarchical data. It is zoomable, meaning that you can interact with the hierarchy and zoom in/out accordingly. The visualization is D3-based and the actual wheel visualization code is adapted from:

https://www.jasondavies.com/coffee-wheel/

Enjoy!

Install

This package is currently not on CRAN, but you can install it from GitHub via devtools:

library("devtools");
devtools::install_github("armish/coffeewheel");

Sample Plotting

library("coffeewheel");
coffeewheel(sampleWheelData, width=500, height=500, main="Sample Wheel Title", partitionAttribute="value");

Zoomable Wheel

Sample Data Structure

sampleWheelData <- list(
	list(
		name="R",
		children=list(
			list(name="R_1", colour="#110000"),
			list(name="R_3", colour="#330000"),
			list(name="R_5", colour="#550000"),
			list(name="R_7", colour="#770000"),
			list(name="R_9", colour="#990000"),
			list(name="R_b", colour="#bb0000"),
			list(name="R_d", colour="#dd0000"),
			list(name="R_f", colour="#ff0000")
		)
	),
	list(
		name="G",
		children=list(
			list(name="G_1", colour="#001100"),
			list(name="G_3", colour="#003300"),
			list(name="G_5", colour="#005500"),
			list(name="G_7", colour="#007700"),
			list(name="G_9", colour="#009900"),
			list(name="G_b", colour="#00bb00"),
			list(name="G_d", colour="#00dd00"),
			list(name="G_f", colour="#00ff00")
		)
	),
	list(
		name="B",
		children=list(
			list(name="B_1", colour="#000011"),
			list(name="B_3", colour="#000033"),
			list(name="B_5", colour="#000055"),
			list(name="B_7", colour="#000077"),
			list(name="B_9", colour="#000099"),
			list(name="B_b", colour="#0000bb"),
			list(name="B_d", colour="#0000dd"),
			list(name="B_f", colour="#0000ff")
		)
	)
);

Credits

This version of the wheel was adapted from Jason Davies's Coffee Wheel example. Built with D3.js. Sunburst zooming based on an example by Mike Bostock.

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.