open-index/open-npm huggingface dataset:
npm package: @opensankey/core
Description: Zero-dependency Sankey chart engine for the browser. Layout algorithm, SVG renderer, interactions, and journey analytics — all in one CSP-safe package.
Latest version: 0.1.0

# @opensankey/core

Zero-dependency Sankey chart engine for the browser. Layout algorithm, SVG renderer, interactions, and journey analytics — all in one CSP-safe package.

## Install

```bash
npm install @opensankey/core
```

## Usage

```typescript
import { SankeyChart } from '@opensankey/core';

const chart = new SankeyChart(document.getElementById('chart')!, {
  width: 900,
  height: 500,
});

chart.setData(
  {
    rows: [
      { from: 'Ads', to: 'Landing', count: 5000 },
      { from: 'Landing', to: 'Signup', count: 3000 },
      { from: 'Landing', to: 'Bounce', count: 2000 },
    ],
  },
  { sourceField: 'from', targetField: 'to', valueField: 'count' },
);

// Journey analytics
const metrics = chart.getJourneyMetrics();
// [{ nodeId: 'Landing', conversionRate: 0.6, dropOff: 2000, ... }, ...]
```

## Browser (IIFE)

```html
<script src="https://unpkg.com/@opensankey/core/dist/index.global.js"></script>
<script>
  const chart = new OpenSankey.SankeyChart(container, config);
</script>
```

## Advanced: Direct Layout + Renderer

```typescript
import { SankeyLayout, SankeyRenderer, TabularTransform } from '@opensankey/core';
import type { SankeyConfig } from '@opensankey/core';

const config: SankeyConfig = { /* ... */ };
const graph = TabularTransform.transform(data, transformConfig, config);
new SankeyLayout(config).compute(graph);

const renderer = new SankeyRenderer(container, config);
renderer.render(graph);
```

See the [main README](../../README.md) for full API docs.

## License

MIT
npm package: @opensankey/looker
Description: Looker custom visualization adapter for OpenSankey. Renders interactive Sankey charts inside Looker dashboards.
Latest version: 0.1.0

# @opensankey/looker

Looker custom visualization adapter for OpenSankey. Renders interactive Sankey charts inside Looker dashboards.

## Setup

1. Build the adapter:

```bash
pnpm build
```

2. Upload `dist/index.global.js` and `manifest.lkml` to your Looker instance as a custom visualization.

3. In your Looker Explore, select at least **2 dimensions** (source, target) and **1 measure** (value).

4. Choose "Sankey Chart" from the visualization picker.

## Configurable Options

These appear in Looker's visualization config panel under the "Style" section:

| Option | Default | Description |
|--------|---------|-------------|
| Node Width | 20 | Width of node rectangles in pixels |
| Node Padding | 12 | Vertical spacing between nodes |
| Link Opacity | 0.4 | Opacity of link ribbons (0-1) |
| Highlight Mode | Both | Hover highlight direction: both, forward, backward, none |

## CSP Safety

This adapter uses no injected `<style>` tags and no CSS `@keyframes`. All styling is applied via inline `style` attributes and animations use `requestAnimationFrame`. This is designed to work within Looker's Content Security Policy.

## License

MIT
npm package: @opensankey/powerbi
Description: Power BI custom visual adapter for OpenSankey. Renders interactive Sankey charts inside Power BI reports and dashboards.
Latest version: 0.1.0

# @opensankey/powerbi

Power BI custom visual adapter for OpenSankey. Renders interactive Sankey charts inside Power BI reports and dashboards.

## Setup

1. Build the visual:

```bash
pnpm build
```

2. Package as a `.pbiviz` file using the Power BI visuals CLI (`pbiviz package`), or import the built JS directly into a Power BI custom visual project.

3. In Power BI, drag **2 category fields** (source, target) and **1 value field** (measure) into the visual.

## Data Mapping

| Role | Type | Description |
|------|------|-------------|
| Source | Grouping (Category) | Source node dimension |
| Target | Grouping (Category) | Target node dimension |
| Value | Measure | Flow value / weight |

## Formatting Options

Available in the Power BI formatting pane under "Sankey Settings":

| Option | Default | Description |
|--------|---------|-------------|
| Node Width | 18 | Width of node rectangles in pixels |
| Node Spacing | 14 | Vertical spacing between nodes |
| Link Opacity | 0.18 | Opacity of link ribbons (0-1) |
| Highlight Mode | Both | Hover highlight: both, forward, backward, none |

## License

MIT
npm package: @opensankey/sigma
Description: Sigma Computing plugin for OpenSankey. Renders interactive Sankey charts inside Sigma workbooks.
Latest version: 0.1.0

# @opensankey/sigma

Sigma Computing plugin for OpenSankey. Renders interactive Sankey charts inside Sigma workbooks.

## Setup

1. Build the plugin:

```bash
pnpm build
```

2. Host the built `dist/index.global.js` in an HTML page accessible via URL.

3. In Sigma, add a Plugin element to your workbook and point it to your hosted URL.

4. Configure the plugin in the Sigma editor panel:
   - **Data Source**: Select the Sigma table/element to pull data from
   - **Source Column**: The dimension for source nodes
   - **Target Column**: The dimension for target nodes
   - **Value Column**: The numeric measure for flow weight
   - **Highlight Mode**: Hover highlight direction (both, forward, backward, none)

## How It Works

The plugin uses the `@sigmacomputing/plugin` client API to:

- Register configuration options via `configureEditorPanel`
- Subscribe to element data via `subscribeToElementData`
- Subscribe to column metadata via `subscribeToElementColumns`
- React to config changes via `config.subscribe`

Data flows from Sigma to the plugin as column arrays, which are converted to tabular rows and passed to `@opensankey/core`.

## License

MIT
npm package: @opensankey/tableau
Description: Tableau dashboard extension for OpenSankey. Renders interactive Sankey charts inside Tableau dashboards.
Latest version: 0.1.0

# @opensankey/tableau

Tableau dashboard extension for OpenSankey. Renders interactive Sankey charts inside Tableau dashboards.

## Setup

1. Build the extension:

```bash
pnpm build
```

2. Host the built `dist/index.global.js` and an `index.html` on a web server (HTTPS in production, localhost for development).

3. Create an `index.html` that loads the Tableau Extensions API and the built bundle:

```html
<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.jsdelivr.net/npm/@anthropic-ai/tableau-ext-api/lib/tableau.extensions.1.latest.js"></script>
  <script src="./dist/index.global.js"></script>
</head>
<body></body>
</html>
```

4. Update the `source-location` URL in `opensankey.trex` to point to your hosted `index.html`.

5. In Tableau Desktop, drag the extension onto your dashboard. The extension reads from the first worksheet and auto-detects dimensions (source, target) and measures (value).

## Data Requirements

The worksheet should contain at least:
- **2 dimension columns** (text) — source and target nodes
- **1 measure column** (numeric) — flow value

The extension auto-detects column types and maps the first two text columns as source/target and the first numeric column as value.

## Events

The extension automatically re-renders when:
- Filters change
- Mark selection changes
- The browser window resizes

## License

MIT