Skip to content
Back to skills

Paperjsx

ASecurity

Develop interactive PaperJS applications for visual drawing, animation, and vector graphics. Create canvas-based experiences with JavaScript and PaperJS framework.

  • 16 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 12, 2026
ai-agentsjavascriptjavabashtesting

Works with

  • cli

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add manu14357/zskills --skill paperjsx --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Paperjsx?

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

Security grade badge for Paperjsx
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/manu14357-paperjsx/badge)](https://www.skillsdirectory.com/skills/manu14357-paperjsx)

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
---
name: paperjsx
description: Develop interactive PaperJS applications for visual drawing, animation, and vector graphics. Create canvas-based experiences with JavaScript and PaperJS framework.
compatibility:
  use-case: Vector graphics, interactive drawing, canvas animation
  frameworks: PaperJS, HTML5 Canvas, SVG
---

# PaperJS Development

## Use This Skill When

- Building interactive drawing or sketching applications
- Creating vector graphic visualizations
- Developing canvas-based animations
- Building tools for visual content creation
- Creating geometric visualization tools
- Developing interactive graphic editors

## When NOT to Use

- Simple 2D games (consider Phaser or Three.js)
- Complex 3D graphics (use Three.js)
- Non-interactive vector graphics (use SVG directly)

## Context: PaperJS Development Maturity

**Undeveloped**: Canvas basics; difficult coordinate math.

**Target**: Using PaperJS vector operations, handling paths and shapes, basic interaction.

**Optimized**: Complex interactive tools, optimized rendering, efficient event handling.

## Core Principle

**PaperJS simplifies vector graphics.** Instead of manual canvas drawing and math, PaperJS provides high-level abstractions for paths, shapes, and transformations—enabling faster interactive graphics development.

## Instructions

### Step 1: Setup and Initialization

**Install PaperJS:**

```bash
npm install paper
# or via CDN in HTML:
<script src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.15/paper-full.min.js"></script>
```

**Create canvas:**

```html
<canvas id="myCanvas"></canvas>

<script>
  // Get paper ready
  paper.setup('myCanvas');
  
  // Create a simple circle
  const circle = new paper.Path.Circle({
    center: [100, 100],
    radius: 50,
    fillColor: 'blue'
  });
  
  // Render
  paper.view.draw();
</script>
```

### Step 2: Basic Shapes and Paths

**Create and manipulate shapes:**

```javascript
// Circle
const circle = new paper.Path.Circle({
  center: [100, 100],
  radius: 50,
  fillColor: 'blue'
});

// Rectangle
const rect = new paper.Path.Rectangle({
  point: [50, 50],
  size: [100, 50],
  fillColor: 'green'
});

// Custom path
const path = new paper.Path();
path.add([10, 10]);
path.add([20, 20]);
path.add([30, 10]);
path.closed = true;
path.fillColor = 'red';
```

### Step 3: Interactive Drawing

**Handle mouse events:**

```javascript
const path = new paper.Path();

paper.tool.onMouseDown = (event) => {
  path.add(event.point);
  path.strokeColor = 'black';
  path.strokeWidth = 2;
};

paper.tool.onMouseDrag = (event) => {
  path.add(event.point);
  path.smooth();  // Smooth the path
};

paper.tool.onMouseUp = () => {
  // Path is complete
  console.log('Draw complete');
};
```

### Step 4: Transformations

**Transform shapes:**

```javascript
const circle = new paper.Path.Circle({
  center: [100, 100],
  radius: 50,
  fillColor: 'blue'
});

// Rotate
circle.rotate(45);

// Scale
circle.scale(2);

// Move
circle.position.x += 50;
```

### Step 5: Animation

**Create animated effects:**

```javascript
let angle = 0;

paper.view.onFrame = (event) => {
  angle += 1;
  
  // Update position based on angle
  circle.position.x = 100 + Math.cos(angle * Math.PI / 180) * 50;
  circle.position.y = 100 + Math.sin(angle * Math.PI / 180) * 50;
};
```

### Step 6: Hit Testing and Selection

**Detect clicks on shapes:**

```javascript
paper.tool.onMouseDown = (event) => {
  // Find item at point
  const hitResult = paper.project.hitTest(event.point);
  
  if (hitResult) {
    console.log('Clicked:', hitResult.item.name);
    hitResult.item.selected = true;
  }
};
```

## Output

**Deliver:**

1. **PaperJS Setup** (HTML canvas, initialization)
2. **Basic Shapes** (circles, rectangles, paths)
3. **Interactive Drawing** (mouse event handlers)
4. **Transformations** (rotate, scale, move)
5. **Animation Loop** (frame-based updates)
6. **Hit Testing** (click detection on shapes)

Files in this skill

  • SKILL.md3.8 KB
  • references/json-schema.md13.2 KB

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.