d3_point: Create a new D3 scatter plot

View source: R/d3_point.R

d3_pointR Documentation

Create a new D3 scatter plot

Description

d3_point creates a D3 scatter plot. It takes data either directly or passed to it from d3plot function.

Usage

d3_point(data, ...)

Arguments

data

data in JSON format, created by d3plot() or from another source

...

additional, optional arguments

radius

(optional) Affects the size of the dots, numerical scale

opacity

(optional) Affects the opacity of the dot works best with larger radius, 0-1 scale

stroke

(optional) Adds an outline to the point works best with larger radius, specify css color

strokeMatch

(optional) Matches the outline of the point to the color of the point looks best when opacity >1, boolean

Title

(optional) Gives graph a title, string ""

yTitle

(optional) Gives y axis a title, string ""

xTitle

(optional) Gives x axis a title, string ""

yGrid

(optional) Gives graph gridlines from the y ticks, boolean

xGrid

(optional) Gives graph gridlines from the x ticks, boolean

gridColor

(optional) Affects the color of the gridlines, specify css color

gridOpacity

(optional) Affects the opacity of the gridlines, 0-1 scale

browser

(mandatory/optional) If code editor has viewer browser is optional if not browser opens visual in a browser window

See Also

d3plot

Examples

## Not run: 
# OK
d3_point(d3plot(x = mpg, y = cyl, color = cyl, id = rownames(mtcars), data = mtcars))
# Better
d3plot(x = Sepal.Length, y = Petal.Length, color = Species, data = iris) %>% d3_point(radius = 5)
# With more arguments
 d3_point(d3plot(x = mpg, y = cyl, color = cyl, id = rownames(mtcars), data = mtcars ),radius = 15,opacity = .25,stroke = "black",strokeMatch = 1,yTitle = "Im confused by effect vs affect", Title = "MTCars", xTitle = "MPG",gridColor = "#30c5FF",yGrid = T,xGrid = T, gridOpacity = 1, browser = T)

## End(Not run)

cddesja/D3plot documentation built on Aug. 3, 2022, 7:39 p.m.