Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

README.md

Outline

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:

yarn add circuitsvis

Then import and use the visualizations directly:

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

<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)

<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.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.