Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-annotator

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-annotator

Vue Component for drawing annotation (box, etc)

  • 0.10.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
238
decreased by-16.2%
Maintainers
1
Weekly downloads
 
Created
Source

vue-annotator

CircleCI

Create annotation using SVG and HTML element.

Props

* : must be set if no background

ParametersDescriptionTypeMust SpecifyDefault value
widthwidth of drawing canvasNumber*optionalwidth of background
heightwidth of drawing canvasNumber*optionalheight of background
gridset grid for sanpping. :grid="[w,h]" for setting width and height. :grid="w" for setting grid in squareArray[2] or Numberoptionalnull
minSizeset minimum size of annotation. :minSize="[w,h]" for set minimum width and height of annotation size. :grid="w" for set minimum width and height of annotation size equal to wArray[2] or Numberoptionalfalse
drawingswitch to drawing modeBooleanoptionalfalse
multipleSelectenable multiple selectBooleanoptionalfalse

Slots

* : will error when more than 1 element to be provided

Method nameDescriptionAccepted Element
defaultbackground element of annotationAny HTML element
annotationannotation element (accept SVG element)<rect>, <ellipse>, <circle>, <polygon>, <path>, <foreignObject>
drawing*draw element via mouse click&drag<rect>, <ellipse>, <circle>
select (not yet implemented)*texture element to apply when annotation is selected<defs>

Events

Event nameDescriptionParameters
selectemit when element is click/selectelement: SVG.Element
drawdone (not yet implemented)emit when drawing element is finishelement: DOM.Element
drawcancel (not yet implemented)emit when drawing element is canceled (via right click)element: DOM.Element

Tips: use element.node.isSameNode(this.$refs.myAnnotation) for identifying the element.

Style CSS

Vue-Annotator use svg.select.js with this predefined style that can be override

Class nameDescriptionNotes
.svg_select_boundingRectdefine style of rectangle in selected elementonly applicable on <rect>, <circle>, <ellipse>
.svg_select_pointsdefine style of edge circles in selected element

default style

.svg_select_points {
  stroke-width: 1;
  fill: black;
  stroke-dasharray: 10 10;
  stroke: black;
  stroke-opacity: 0.8;
  pointer-events: none; /* This ons is needed if you want to deselect or drag the shape*/
}

.svg_select_boundingRect {
  display: none;
}

FAQs

Package last updated on 01 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc