Coder Social home page Coder Social logo

shalevy1 / svg-overlay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openseadragon/svg-overlay

0.0 0.0 0.0 874 KB

An OpenSeadragon plugin that adds SVG overlay capability.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 52.91% HTML 47.09%

svg-overlay's Introduction

SVG Overlay for OpenSeadragon

An OpenSeadragon plugin that adds SVG overlay capability.

Compatible with OpenSeadragon 2.0.0 or greater.

Documentation

To use, include the openseadragon-svg-overlay.js file after openseadragon.js on your web page.

To add SVG overlay capability to your OpenSeadragon Viewer, call svgOverlay() on it. This will return a new object with the following methods:

  • node(): Returns the SVG g element that you should add all of your SVG elements to. As the user zooms and pans, the g element will transform to match. Add your elements according to the OpenSeadragon Viewport coordinate system.
  • resize(): If your viewer changes size, you'll need to resize the SVG overlay by calling this method.
  • onClick(node, handler): If you want to accept click events on a sub-node, use this method. It takes care of making sure the click isn't also handled by the Viewer. The handler you provide is called when the click occurs and given a single argument, an OpenSeadragon.MouseTracker click event.

See demo.html for an example of it in use. You can see it in action at http://openseadragon.github.io/svg-overlay/demo.html.

This plugin is also used on the desktop versions of:

svg-overlay's People

Contributors

iangilman avatar roof12 avatar lk-jeffpeck avatar crswll avatar illyamoskvin avatar petk avatar leesei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.