Learn R Programming

myIO

An R package for creating interactive d3.js visualizations using htmlwidgets. Supports 17 chart types including scatter plots, line charts, bar charts, treemaps, and more — all composable through a piped API.

Live Demo

Installation

# install.packages("devtools")
devtools::install_github("mortonanalytics/myIO")

Usage

Build plots by piping layers together with myIO() and addIoLayer():

library(myIO)

myIO() |>
  addIoLayer(
    type = "point",
    color = "#E69F00",
    label = "points",
    data = mtcars,
    mapping = list(x_var = "wt", y_var = "mpg")
  ) |>
  addIoLayer(
    type = "line",
    transform = "lm",
    color = "red",
    label = "trend",
    data = mtcars,
    mapping = list(x_var = "wt", y_var = "mpg")
  )

Supported Chart Types

Typetype value
Scatter plot"point"
Line chart"line"
Bar chart"bar"
Grouped bar chart"groupedBar"
Area chart"area"
Histogram"histogram"
Heatmap"heatmap"
Candlestick"candlestick"
Waterfall"waterfall"
Sankey"sankey"
Boxplot"boxplot"
Violin"violin"
Ridgeline"ridgeline"
Donut chart"donut"
Gauge chart"gauge"
Hexbin plot"hexbin"
Treemap"treemap"

addIoLayer()

ArgumentDescription
typeChart type (see table above)
colorAny CSS color string
labelUnique identifier for the layer
dataA data frame
mappingList mapping variables, e.g. list(x_var = "wt", y_var = "mpg")
transformOptional derived-data transform, e.g. "identity" or "lm"

Interactions

myIO charts are bidirectional — user actions flow back as structured data:

  • setBrush() — Rectangle select returns selected rows as data
  • setAnnotation() — Click to label data points; export annotations as CSV
  • setLinked() — Crosstalk linked brushing across multiple charts
  • setSlider() — Parameter sliders that trigger Shiny recomputation

Customization

Customize plots by chaining additional functions:

  • setAxisFormat() — Set d3.js axis formats and labels
  • setAxisLimits() — Set axis ranges
  • defineCategoricalAxis() — Define a categorical axis
  • setMargin() — Adjust chart margins
  • setColorScheme() — Apply a custom color palette
  • setTheme() — Set theme tokens (colors, font, background)
  • setTransitionSpeed() — Control animation duration
  • setToolTipOptions() — Configure tooltip behavior
  • setToggle() — Enable layer toggle controls
  • flipAxis() — Swap x and y axes
  • suppressAxis() — Hide axes
  • suppressLegend() — Hide the legend
  • dragPoints() — Enable draggable points
  • setReferenceLines() — Add reference lines

See the Getting Started, Chart Types, Shiny Integration, and Transforms & Theming vignettes for full examples.

Copy Link

Version

Install

install.packages('myIO')

Version

1.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ryan Morton

Last Published

June 11th, 2026

Functions in myIO (1.2.0)

setFacet

Set Faceting (Small Multiples)
myio_function_signature

Get a myIO Function Signature for LLM Tool Calling
setTitle

Set Chart Title
setToggle

Set Toggle Interaction
myio_list_chart_types

List myIO Chart Types for LLM Tool Calling
setLayerOpacity

Set Layer Opacity
stop_duckdb_wasm_missing

Raise a DuckDB-WASM missing-runtime condition
suppressAxis

Suppress Axis Display
setExportOptions

Configure Export Options
setTransitionSpeed

Set Transition Speed
setToolTipOptions

Set Tooltip Options
suppressLegend

Suppress Legend Display
transform_survfit

Kaplan-Meier survival transform
setAxisLimits

Set Axis Limits
setAxisFormat

Set Axis Format
myio_list_functions

List myIO Functions for LLM Tool Calling
myio_validate_call

Validate a myIO Function Call
setLinked

Enable Linked Brushing via Crosstalk
setLinkedCursor

Toggle Linked Cursor Sync on a myIO Widget
setReferenceLines

Set Reference Lines
setMargin

Set Chart Margins
setBrush

Enable Brush Selection
setTheme

Set Chart Theme
setSlider

Add a Parameter Slider (Shiny Only)
linkCharts

Link Charts for Cross-Selection
duckdb_wasm_status

DuckDB-WASM cache status
expand_grouped_df

Expand a grouped data frame into per-group layers
addIoLayer

Add a Layer to a myIO Chart
clear_duckdb_wasm_cache

Remove DuckDB-WASM cache entries
defineCategoricalAxis

Define Categorical Axis
flipAxis

Flip Chart Axes
install_duckdb_wasm

Install the DuckDB-WASM binary for large-dataset virtualization
dragPoints

Enable Draggable Points
myIO-shiny

Shiny Bindings for myIO
myIO

Create a myIO Chart Widget
myio_validate_spec

Validate a myIO Chart Specification
myio_chart_schema

Get myIO Chart Schema for LLM Tool Calling
myIO_last_error

Diagnose myIO Rendering Errors
setAnnotation

Enable Click-to-Annotate
setBigData

Attach a big-data source to a myIO widget
setColorScheme

Set Color Scheme
myIO-package

myIO: Interactive Data Visualizations Using d3.js