Skip to content

Symatem/WiredPanels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm Build Status semantic-release GitHub Issues Dependency Status devDependency Status downloads Greenkeeper badge

Features

  • Framework to build an Editor or Visualizer
  • No dependencies / no bloatware
  • Elements: Panels, sockets and wires
  • Configure: Many customizable options & parameters
  • Rendering
    • SVG
    • CSS animations
    • Automatic layout inside panels (depending on text width)
    • Force layout and overlap avoidance between panels
  • Mouse controls
    • Touch event handlers for mobile use
    • Move panels
    • Drag / draw wires
    • Selection: Click, Shift Invert, Box
  • Keyboard controls
    • Enter: Use / Activate
    • Backspace: Delete
    • Meta (+ Shift) + Z: Undo & Redo
    • Meta + A: Select all panels

API

Table of Contents

Wire

Type: Object

Properties

Panel

Type: Object

Properties

Socket

Type: Object

Properties

WireDragCallback

Type: Function

Parameters

Returns boolean true if drag action should start

WireConnectCallback

Type: Function

Parameters

Returns boolean true if connect action should succeed

ActivateCallback

Type: Function

Parameters

  • selection Set

RemoveCallback

Type: Function

Parameters

  • selection Set wires and panels to be removed

Returns void

CopyCallback

Type: Function

Parameters

Returns boolean true if data was copied

PasteCallback

Type: Function

Parameters

Returns boolean true if data was accepted and can be pasted

WiredPanels

Container holding the graph of panels and wires

Parameters

Properties

createWire

Create a new wire

Parameters

  • wire Object skeleton wire (optional, default {})

Returns Wire wire

createPanel

Create a new panel

Parameters

  • panel Object skeleton panel (optional, default {})

Returns Panel panel

createSocket

Create a new socket

Parameters

  • socket Object skeleton socket (optional, default {})

Returns Socket socket

updatePanelSockets

Parameters

updatePanelGeometry

Parameters

Examples

Try online with source code