← Back to Yappy
Yappy Documentation

Geometric Shapes

Extended geometric shapes for creating visually interesting diagrams, technical illustrations, and decorative elements.

Available Shapes

ShapeDescriptionCommon Uses
Pentagon5-sided polygonSecurity badges, home icons
Hexagon6-sided polygonHoneycomb patterns, tech diagrams, microservices
Septagon7-sided polygon (heptagon)Decorative elements
Octagon8-sided polygonStop signs, attention indicators
StarConfigurable star shapeRatings, highlights, favorites
PolygonN-sided regular polygonCustom geometric patterns
ParallelogramSlanted rectangleData input/output in flowcharts
Trapezoid4-sided with parallel top/bottomManual operations, funnels
CrossPlus or X shapeAdd buttons, close icons, markers
HeartHeart shapeFavorites, likes, love indicators
CloudCloud shapeCloud services, thoughts, storage
CapsulePill/rounded rectangleTags, buttons, node containers

Star Shape

Stars are highly configurable - adjust the number of points and inner radius to create different star styles.

Properties

PropertyRangeDescription
Points3-12Number of star points
Inner Radius0.1-0.9Depth of points (lower = sharper)
Star Variations

5 points, 0.4 inner - Classic star
6 points, 0.5 inner - Star of David
4 points, 0.2 inner - Sparkle/twinkle

Custom Polygon

Create regular polygons with any number of sides. Great for creating consistent geometric patterns.

Properties

PropertyDescription
SidesNumber of polygon sides (3-20)
RotationRotate the polygon orientation

Hexagons

Hexagons are popular in modern design, especially for representing interconnected systems, microservices, and modular architectures.

Use Cases

  • Architecture diagrams - Microservices, modules
  • Honeycomb patterns - Visual groupings
  • Tech iconography - Modern tech stack representations
  • Game design - Hex-based maps and grids
Tip: Hexagon Grids

Enable grid snapping to align hexagons perfectly when creating honeycomb patterns or hex-based layouts.

3D Shapes

Yappy includes several pseudo-3D shapes for creating depth in diagrams:

ShapeDescription
Isometric Cube3D cube in isometric projection
Solid Block3D rectangular block with depth
Perspective BlockBox with perspective vanishing point
Cylinder3D cylinder (databases, storage)

Styling Options

All geometric shapes support these styling options:

  • Fill Color - Background fill color
  • Stroke Color - Border/outline color
  • Fill Style - Solid, hachure, cross-hatch, or none
  • Stroke Style - Solid, dashed, or dotted
  • Stroke Width - Border thickness
  • Roughness - Hand-drawn appearance intensity
  • Opacity - Transparency level

Keyboard Shortcuts

Shift + Drag
Constrain proportions
S
Cycle stroke style
F
Cycle fill style

Scripting (API)

Geometric shapes are created through the global window.Yappy (usable as Yappy). Most use the generic Yappy.createElement(type, x, y, w, h, opts) with the shape's type string; stars have a dedicated helper.

// Polygons & badges (type string = the shape name)
Yappy.createElement('hexagon', 80, 80, 120, 120);
Yappy.createElement('pentagon', 220, 80, 120, 120);
Yappy.createElement('octagon', 360, 80, 120, 120, { backgroundColor: '#ffc9c9' });
Yappy.createElement('cylinder', 80, 240, 120, 150);   // pseudo-3D
Yappy.createElement('isometricCube', 240, 240, 120, 120);

// Star: dedicated helper takes a point count
const star = Yappy.createStar(400, 240, 120, 120, 5, { starPoints: 5 });
ShapeType string
Pentagon / Hexagon / Septagon / Octagon'pentagon', 'hexagon', 'septagon', 'octagon'
Star'star' (or createStar(...))
Polygon'polygon'
Parallelogram / Trapezoid'parallelogram', 'trapezoid'
Cross / Heart / Cloud / Capsule'cross', 'heart', 'cloud', 'capsule'
3D blocks / Cylinder'isometricCube', 'solidBlock', 'perspectiveBlock', 'cylinder'

Tune a star with opts.starPoints, and restyle any shape afterwards with Yappy.updateElement(id, { backgroundColor, strokeColor, fillStyle, opacity }).