Skip to content
Back to skills

Sizing

ASecurity

Node sizing strategies that automatically compute node sizes based on graph metrics or custom attributes.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 27, 2026
data-ainode

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill sizing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sizing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sizing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-sizing/badge)](https://www.skillsdirectory.com/skills/reaviz-sizing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Sizing

Node sizing strategies that automatically compute node sizes based on graph metrics or custom attributes.

## Configuration

Set `sizingType` on `GraphCanvas`:

```tsx
<GraphCanvas
  nodes={nodes}
  edges={edges}
  sizingType="pagerank"
  minNodeSize={5}
  maxNodeSize={20}
/>
```

## SizingType

| Type | Description |
|------|-------------|
| `'default'` | Use node's own `size` property (default) |
| `'none'` | All nodes use `defaultNodeSize` |
| `'pagerank'` | Size by PageRank score |
| `'centrality'` | Size by degree centrality |
| `'attribute'` | Size by a custom node attribute |

## GraphCanvas Sizing Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `sizingType` | `SizingType` | `'default'` | Sizing strategy |
| `defaultNodeSize` | `number` | `7` | Default node size |
| `minNodeSize` | `number` | `5` | Min size for auto-sizing |
| `maxNodeSize` | `number` | `15` | Max size for auto-sizing |
| `sizingAttribute` | `string` | — | Attribute name for `'attribute'` sizing |

## Default Sizing

Uses each node's `size` property, falls back to `defaultNodeSize`:

```tsx
const nodes = [
  { id: '1', label: 'Small', size: 5 },
  { id: '2', label: 'Large', size: 15 },
  { id: '3', label: 'Default' }, // uses defaultNodeSize
];

<GraphCanvas nodes={nodes} edges={edges} sizingType="default" />
```

## PageRank Sizing

Nodes with more important connections appear larger:

```tsx
<GraphCanvas
  nodes={nodes}
  edges={edges}
  sizingType="pagerank"
  minNodeSize={3}
  maxNodeSize={25}
/>
```

## Centrality Sizing

Nodes with more connections appear larger:

```tsx
<GraphCanvas
  nodes={nodes}
  edges={edges}
  sizingType="centrality"
/>
```

## Attribute Sizing

Size nodes by a custom data attribute:

```tsx
const nodes = [
  { id: '1', label: 'Low', data: { severity: 2 } },
  { id: '2', label: 'Medium', data: { severity: 5 } },
  { id: '3', label: 'High', data: { severity: 9 } },
];

<GraphCanvas
  nodes={nodes}
  edges={edges}
  sizingType="attribute"
  sizingAttribute="severity"
  minNodeSize={5}
  maxNodeSize={20}
/>
```

## Uniform Sizing

All nodes the same size:

```tsx
<GraphCanvas
  nodes={nodes}
  edges={edges}
  sizingType="none"
  defaultNodeSize={10}
/>
```

## Notes

- `minNodeSize` and `maxNodeSize` bound the auto-computed sizes for `pagerank`, `centrality`, and `attribute`
- PageRank formula: `rank * 80`, then clamped to min/max
- Centrality formula: `rank * 20`, then clamped to min/max
- `'attribute'` requires `sizingAttribute` to specify which node property to use
- Per-node `size` in data always takes precedence when `sizingType="default"`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.