# carlosrivera1212/datacraftr architecture

> Architecture diagram of the GitHub repository carlosrivera1212/datacraftr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carlosrivera1212/datacraftr
- Repository: https://github.com/carlosrivera1212/datacraftr

## Overview

DataCraftR is an R package for interactively generating datasets by drawing or manipulating plots in Shiny addins. The documented user workflow is to launch a visualization from R or RStudio, edit it through D3, and save generated data to a temporary RDS file. The graph includes documented visualization capabilities and the sampled count and density JavaScript modules; unsampled implementation details are represented only where the README establishes the relationship.

Main entry points: [`R`](https://github.com/carlosrivera1212/datacraftr/tree/main/R) (Shiny addins), [`R/boxplot.R`](https://github.com/carlosrivera1212/datacraftr/blob/main/R/boxplot.R) (Boxplot generator), [`R/histogram.R`](https://github.com/carlosrivera1212/datacraftr/blob/main/R/histogram.R) (Histogram generator), [`R/scatter.R`](https://github.com/carlosrivera1212/datacraftr/blob/main/R/scatter.R) (Scatter generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Addin entry points"]
  node_addin["Shiny addins"]
end

subgraph group_visuals["Data visualizations"]
  node_boxplot["Boxplot generator<br/>[boxplot.R]"]
  node_histogram["Histogram generator<br/>[histogram.R]"]
  node_scatter["Scatter generator<br/>[scatter.R]"]
  node_count["Count tool<br/>[count.R]"]
end

subgraph group_interaction["Interactive UI"]
  node_boxplot_js["Boxplot interaction<br/>[boxplot.js]"]
  node_histogram_js["Histogram interaction<br/>[histogram.js]"]
  node_scatter_js["Scatter interaction<br/>[scatter.js]"]
  node_count_js["Count interaction<br/>[count.js]"]
  node_density_js["Density interaction<br/>[density.js]"]
end

subgraph group_export["Data export"]
  node_save["RDS save helper<br/>[save_data_dcr.R]"]
  node_rds[("Temporary RDS file")]
end

node_user(("R user"))
node_shiny["Shiny runtime"]
node_d3["D3.js"]

node_user -->|"launches"| node_addin
node_addin -->|"opens"| node_boxplot
node_addin -->|"opens"| node_histogram
node_addin -->|"opens"| node_scatter
node_addin -.->|"opens"| node_count
node_boxplot -.->|"loads UI"| node_boxplot_js
node_histogram -.->|"loads UI"| node_histogram_js
node_scatter -.->|"loads UI"| node_scatter_js
node_count -.->|"loads UI"| node_count_js
node_count_js -->|"sends data"| node_shiny
node_density_js -->|"sends data"| node_shiny
node_shiny -->|"renders UI"| node_d3
node_shiny -->|"saves generated data"| node_save
node_save -->|"writes RDS"| node_rds

click node_addin "https://github.com/carlosrivera1212/datacraftr/tree/main/R"
click node_boxplot "https://github.com/carlosrivera1212/datacraftr/blob/main/R/boxplot.R"
click node_histogram "https://github.com/carlosrivera1212/datacraftr/blob/main/R/histogram.R"
click node_scatter "https://github.com/carlosrivera1212/datacraftr/blob/main/R/scatter.R"
click node_count "https://github.com/carlosrivera1212/datacraftr/blob/main/R/count.R"
click node_boxplot_js "https://github.com/carlosrivera1212/datacraftr/blob/main/inst/assets/js/boxplot.js"
click node_histogram_js "https://github.com/carlosrivera1212/datacraftr/blob/main/inst/assets/js/histogram.js"
click node_scatter_js "https://github.com/carlosrivera1212/datacraftr/blob/main/inst/assets/js/scatter.js"
click node_count_js "https://github.com/carlosrivera1212/datacraftr/blob/main/my_test/www/count.js"
click node_density_js "https://github.com/carlosrivera1212/datacraftr/blob/main/my_test/www/density.js"
click node_save "https://github.com/carlosrivera1212/datacraftr/blob/main/R/save_data_dcr.R"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_addin,node_user toneBlue
class node_boxplot,node_histogram,node_scatter,node_count toneAmber
class node_boxplot_js,node_histogram_js,node_scatter_js,node_count_js,node_density_js toneMint
class node_save,node_rds toneRose
class node_shiny,node_d3 toneIndigo
```

## Components

### Addin entry points

- [Shiny addins](https://github.com/carlosrivera1212/datacraftr/tree/main/R): `R`

### Data visualizations

- [Boxplot generator](https://github.com/carlosrivera1212/datacraftr/blob/main/R/boxplot.R): `R/boxplot.R`
- [Histogram generator](https://github.com/carlosrivera1212/datacraftr/blob/main/R/histogram.R): `R/histogram.R`
- [Scatter generator](https://github.com/carlosrivera1212/datacraftr/blob/main/R/scatter.R): `R/scatter.R`
- [Count tool](https://github.com/carlosrivera1212/datacraftr/blob/main/R/count.R): `R/count.R`

### Interactive UI

- [Boxplot interaction](https://github.com/carlosrivera1212/datacraftr/blob/main/inst/assets/js/boxplot.js): `inst/assets/js/boxplot.js`
- [Histogram interaction](https://github.com/carlosrivera1212/datacraftr/blob/main/inst/assets/js/histogram.js): `inst/assets/js/histogram.js`
- [Scatter interaction](https://github.com/carlosrivera1212/datacraftr/blob/main/inst/assets/js/scatter.js): `inst/assets/js/scatter.js`
- [Count interaction](https://github.com/carlosrivera1212/datacraftr/blob/main/my_test/www/count.js): `my_test/www/count.js`
- [Density interaction](https://github.com/carlosrivera1212/datacraftr/blob/main/my_test/www/density.js): `my_test/www/density.js`

### Data export

- [RDS save helper](https://github.com/carlosrivera1212/datacraftr/blob/main/R/save_data_dcr.R): `R/save_data_dcr.R`
- **Temporary RDS file**

### Other components

- **R user**
- **Shiny runtime**
- **D3.js**

## Connections

- R user → Shiny addins: launches (evidence: `README.md`)
- Shiny addins → Boxplot generator: opens (evidence: `README.md`)
- Shiny addins → Histogram generator: opens (evidence: `README.md`)
- Shiny addins → Scatter generator: opens (evidence: `README.md`)
- Shiny addins → Count tool: opens
- Boxplot generator → Boxplot interaction: loads UI
- Histogram generator → Histogram interaction: loads UI
- Scatter generator → Scatter interaction: loads UI
- Count tool → Count interaction: loads UI
- Count interaction → Shiny runtime: sends data (evidence: `my_test/www/count.js`)
- Density interaction → Shiny runtime: sends data (evidence: `my_test/www/density.js`)
- Shiny runtime → D3.js: renders UI (evidence: `README.md`)
- Shiny runtime → RDS save helper: saves generated data (evidence: `README.md`)
- RDS save helper → Temporary RDS file: writes RDS (evidence: `README.md`)
