# circuitsvis

> Mechanistic Interpretability Visualizations

Latest version **1.43.3** (published 2024-12-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install circuitsvis
pnpm add circuitsvis
yarn add circuitsvis
bun add circuitsvis
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; large bundle.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.43.3 |
| Published | 2024-12-18 |
| First published | 2022-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 23.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 378 |
| Author | Alan Cooney |
| Maintainers | alan-cooney |

## Links

- npm: https://www.npmjs.com/package/circuitsvis
- Repository: https://github.com/TransformerLensOrg/CircuitsVis
- Homepage: https://github.com/TransformerLensOrg/CircuitsVis#readme
- Issues: https://github.com/TransformerLensOrg/CircuitsVis/issues
- npm.io page: https://npm.io/package/circuitsvis

## Dependencies (8)

- [colord](https://npm.io/package/colord.md) ^2.9.3
- [chart.js](https://npm.io/package/chart.js.md) ^4.0.1
- [tinycolor2](https://npm.io/package/tinycolor2.md) ^1.4.2
- [react-chartjs-2](https://npm.io/package/react-chartjs-2.md) ^5.0.1
- [@tensorflow/tfjs](https://npm.io/package/@tensorflow/tfjs.md) ^4.1.0
- [react-grid-system](https://npm.io/package/react-grid-system.md) ^8.1.6
- [chartjs-chart-matrix](https://npm.io/package/chartjs-chart-matrix.md) ^1.3.0
- [react-popper-tooltip](https://npm.io/package/react-popper-tooltip.md) ^4.4.2

## Recent versions

- 1.43.3 (latest) — 2024-12-18
- 1.43.2 — 2023-11-01
- 1.43.1 — 2023-10-24
- 1.43.0 — 2023-10-23
- 1.42.0 — 2023-10-19
- 1.41.0 — 2023-08-22
- 1.40.1 — 2023-08-01
- 1.40.0 — 2023-06-16
- 1.39.1 — 2023-02-20
- 1.39.0 — 2023-02-09
- 1.38.1 — 2023-01-16
- 1.38.0 — 2023-01-10
- 1.37.0 — 2023-01-09
- 1.36.0 — 2023-01-07
- 1.35.0 — 2023-01-03
- … 37 more at https://npm.io/package/circuitsvis/versions

## README

# CircuitsVis

Mechanistic Interpretability visualizations in React.

View all available components in Storybook at
https://TransformerLensOrg.github.io/CircuitsVis .

## Use

### Within a React Project

First install the package:

```shell
yarn add circuitsvis
```

Then import and use the visualizations directly:

```tsx
import { Hello } from "circuitsvis";

export function Demo() {
  return <Hello name="Bob" />;
}
```

### Standalone

You can use this package directly from a CDN (e.g. unpkg) to render visualizations.

#### Modern ES Modules Approach

```html
<div id="my-div-id" />

<script crossorigin type="module">
  import { render, Hello } from "https://unpkg.com/circuitsvis/dist/cdn/esm.js";

  render(
    "my-div-id", // Div to render into
    Hello, // Visualization function
    { name: "Bob" } // Props (arguments) for visualisation
  );
</script>
```

#### ES6 Approach (supports more legacy browsers)

```html
<div id="my-div-id" />

<script
  crossorigin
  src="https://unpkg.com/circuitsvis/dist/cdn/iife.js"
  onload="onCircuitsVisLoad()"
></script>

<script>
  function onCircuitsVisLoad() {
    "{";
  }
  CircuitsVis.render(
    "{uuid}", // Div to render into
    CircuitsVis.Hello, // Visualization function
    { name: "Bob" } // Props (arguments) for visualisation
  );
  {
    ("}");
  }
</script>
```

### Within a Python project

See https://github.com/TransformerLensOrg/CircuitsVis for details of how to use this
library within a Python project.

---
_Source: https://npm.io/package/circuitsvis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
