Package 'obsplot'

Title: Create Charts with 'Observable Plot'
Description: Creation of charts with the 'Observable Plot' 'JavaScript' library.
Authors: Julien Barnier [aut, cre], Observable, Inc. [cph] (Observable Plot library, https://observablehq.com/@observablehq/plot)
Maintainer: Julien Barnier <[email protected]>
License: GPL (>=3)
Version: 0.0.2.9000
Built: 2024-11-10 05:31:11 UTC
Source: https://github.com/juba/obsplot

Help Index


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

aapl

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1260 rows and 7 columns.

Source

https://observablehq.com/@observablehq/plot-area


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

alphabet

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 26 rows and 2 columns.

Source

https://observablehq.com/@observablehq/plot-dot


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

anscombe_obs

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 44 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-facets


Tells obsplot that a single value is a vector channel, and must be converted to an Array in JavaScript

Description

Tells obsplot that a single value is a vector channel, and must be converted to an Array in JavaScript

Usage

as_data(x)

Arguments

x

the object to be considered as a vector channel


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

athletes

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 11538 rows and 12 columns.

Source

https://observablehq.com/@observablehq/plot-bin


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

barley

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 120 rows and 4 columns.

Source

https://observablehq.com/@observablehq/plot-facets


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

bls

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1708 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-area


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

bls_unemployment

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 7470 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-line


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

caltrain

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 78 rows and 7 columns.

Source

https://observablehq.com/@observablehq/plot-text


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

civilizations

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 51 rows and 7 columns.

Source

https://observablehq.com/@observablehq/plot-bar


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

congress

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 887 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-stack


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

crimea

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 72 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-stack


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

diamonds_obs

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 53940 rows and 2 columns.

Source

https://observablehq.com/@observablehq/plot-dot


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

dji

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 5080 rows and 7 columns.

Source

https://observablehq.com/@observablehq/plot-cell


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

driving

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 55 rows and 4 columns.

Source

https://observablehq.com/@observablehq/plot-dot


Add a facet to an obsplot

Description

Add a facet to an obsplot

Usage

facet(g, data = NULL, ...)

Arguments

g

an obsplot object

data

optional data

...

options passed to define the facet


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

gistemp

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1644 rows and 2 columns.

Source

https://observablehq.com/@observablehq/plot-dot


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

income

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 49 rows and 4 columns.

Source

https://observablehq.com/@observablehq/plot-link


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

iowa

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 171 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-stack


Add a mark to an obsplot

Description

Add a mark to an obsplot

Usage

mark_area(g, ...)

mark_areaX(g, ...)

mark_areaY(g, ...)

mark_barX(g, ...)

mark_barY(g, ...)

mark_cell(g, ...)

mark_cellX(g, ...)

mark_cellY(g, ...)

mark_dot(g, ...)

mark_dotX(g, ...)

mark_dotY(g, ...)

mark_line(g, ...)

mark_lineX(g, ...)

mark_lineY(g, ...)

mark_link(g, ...)

mark_rect(g, ...)

mark_rectX(g, ...)

mark_rectY(g, ...)

mark_ruleX(g, ...)

mark_ruleY(g, ...)

mark_text(g, ...)

mark_textX(g, ...)

mark_textY(g, ...)

mark_tickX(g, ...)

mark_tickY(g, ...)

mark_image(g, ...)

Arguments

g

an obsplot object

...

named options passed to define the mark

... arguments can accept at most two unnamed arguments : a data object and a call to a transform function.


Add a decoration mark to an obsplot

Description

Add a decoration mark to an obsplot

Usage

mark_frame(g, fill = "none", ...)

Arguments

g

an obsplot object

fill

fill CSS color

...

options passed to define the mark


Add a render function mark to an obsplot

Description

Add a render function mark to an obsplot

Usage

mark_function(g, f, ...)

Arguments

g

an obsplot object

f

render function, defined with htmlwidgets::JS()

...

options passed to define the mark


Add an SVG element to an obsplot

Description

Add an SVG element to an obsplot

Usage

mark_svg(g, svg, ...)

Arguments

g

an obsplot object

svg

SVG to add, as a character string

...

options passed to define the mark


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

metros

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 195 rows and 10 columns.

Source

https://observablehq.com/@observablehq/plot-link


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

mobydick1

Format

An object of class character of length 9622.

Source

https://observablehq.com/@observablehq/plot-group


Create a new obsplot

Description

Create a new obsplot

Usage

obsplot(
  data = NULL,
  width = "auto",
  height = "auto",
  menu = getOption("obsplot_menu"),
  elementId = NULL,
  ...
)

Arguments

data

optional data.frame as primary data source

width

plot width. Use NULL to let Plot decide, or "auto" to let htmlwidgets decide

height

plot height. Use NULL to let Plot decide, or "auto" to let htmlwidgets decide

menu

if TRUE, display a gear menu aside the plot with additional features. Can be set globally with options("obsplot_menu")

elementId

optional custom element id, passed to createWidget()

...

named options passed to Observable Plot


Shiny bindings for obsplot

Description

Output and render functions for using obsplot within Shiny applications and interactive Rmd documents.

Usage

obsplotOutput(outputId, width = "100%", height = "400px")

renderObsplot(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

expr

An expression that generates a obsplot

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.


Define an obsplot options

Description

Define an obsplot options

Usage

opts(g, ...)

Arguments

g

an obsplot object

...

named options


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

popchange

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 52 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-bar


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

povcalnet

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 173 rows and 32 columns.

Source

https://observablehq.com/@observablehq/plot-rect


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

riaa

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1081 rows and 4 columns.

Source

https://observablehq.com/@observablehq/plot-stack


Define an obsplot scale options

Description

Define an obsplot scale options

Usage

scale_color(g, ...)

scale_opacity(g, ...)

scale_r(g, ...)

scale_x(g, ...)

scale_y(g, ...)

scale_fx(g, ...)

scale_fy(g, ...)

Arguments

g

an obsplot object

...

named scale options


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

seattle

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1461 rows and 6 columns.

Source

https://observablehq.com/@observablehq/plot-cell


Sample data from Observable Plot changelog

Description

Sample data from Observable Plot changelog

Usage

sfcases

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1797 rows and 5 columns.

Source

https://observablehq.com/@visnup/sf-covid-data


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

sftemp

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 732 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-area


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

simpsons

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 600 rows and 13 columns.

Source

https://observablehq.com/@observablehq/plot-cell


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

stateage

Format

An object of class tbl_df (inherits from tbl, data.frame) with 468 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-dot


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

stocks

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 5040 rows and 8 columns.

Source

https://observablehq.com/@observablehq/plot-line


Define an obsplot style options

Description

Define an obsplot style options

Usage

style(g, ...)

Arguments

g

an obsplot object

...

named style options


Convert a Date or POSIXt object to a JS Date format

Description

Convert a Date or POSIXt object to a JS Date format

Usage

to_js_date(date)

Arguments

date

object to be converted

Value

Numeric value representing the number of milliseconds between Unix Epoch (1 January 1970 UTC) and date.


Define an Observable Plot transform with outputs and options

Description

Define an Observable Plot transform with outputs and options

Usage

transform_bin(...)

transform_binX(...)

transform_binY(...)

transform_group(...)

transform_groupX(...)

transform_groupY(...)

transform_groupZ(...)

transform_map(...)

Arguments

...

transform outputs and options

Details

the first argument passed to the function is passed as outputs to the JavaScript transform. It can be a single value or a list.


Define an Observable Plot transform with map and options

Description

Define an Observable Plot transform with map and options

Usage

transform_mapX(map, ...)

transform_mapY(map, ...)

Arguments

map

a map method name

...

transform options


Define an Observable Plot transform with basis and options

Description

Define an Observable Plot transform with basis and options

Usage

transform_normalizeX(basis = NULL, ...)

transform_normalizeY(basis = NULL, ...)

Arguments

basis

a basis method name

...

transform options


Define an Observable Plot transform options only

Description

Define an Observable Plot transform options only

Usage

transform_selectFirst(...)

transform_selectLast(...)

transform_selectMinX(...)

transform_selectMaxX(...)

transform_selectMinY(...)

transform_selectMaxY(...)

Arguments

...

transform options


Define an Observable Plot transform with two options objects

Description

Define an Observable Plot transform with two options objects

Usage

transform_windowX(spec = NULL, ...)

transform_windowY(spec = NULL, ...)

transform_stackY(spec = NULL, ...)

transform_stackY1(spec = NULL, ...)

transform_stackY2(spec = NULL, ...)

transform_stackX(spec = NULL, ...)

transform_stackX1(spec = NULL, ...)

transform_stackX2(spec = NULL, ...)

Arguments

spec

specific options

...

transform options


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

travelers

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 300 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-text


Sample data from Observable Plot changelog

Description

Sample data from Observable Plot changelog

Usage

trends2020

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 3392 rows and 7 columns.

Source

https://observablehq.com/@ben-tanen/the-relentless-2020-news-cycle-in-one-chart


Sample data from Observable Plot documentation examples

Description

Sample data from Observable Plot documentation examples

Usage

unemployment

Format

An object of class spec_tbl_df (inherits from tbl_df, tbl, data.frame) with 1708 rows and 3 columns.

Source

https://observablehq.com/@observablehq/plot-stack