npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jquery.rsRefPointer

v1.0.7

Published

SVG arrows between two DOM elements

Downloads

3

Readme

#jquery-rsRefPointer Build Status Eases web navigation, through the use of visual relationships (arrows) between page elements.

Can be usefull to help the user cross-reference content that might not be noticeable at first sight.

rsrefpointerdemo Demo available at src/demo/dragonfly.html

#Key Features

  • Arrows makes a visual connection from a start element to an end element, even when the position/size of these elements change;
  • Non intrusive. The arrows are hidden by default and only appear when the mouse overs the start element (or when the start element receives focus for mobile devices). Alternatively they can be always visible;
  • Shapes available: Line, Polyline, Quadratic Bezier curves and Cubic Bezier curves;
  • Powerfull design-time mode that provides a Photoshop alike GUI. The tool generates JS code with all the parameters filled for you;
  • Small footprint, excluding the design-time mode file, that should never be used in production anyway.

#Installation

You can install from npm:

npm install jquery.rsRefPointer --save

or directly from git:

<script src="http://rawgit.com/ruisoftware/jquery-rsRefPointer/master/src/jquery.rsRefPointer.js"></script>

or you can download the Zip archive from github, clone or fork this repository and include jquery.rsRefPointer.js from your local machine.

You also need to download jQuery. In the example below, jQuery is downloaded from Google cdn.

Usage

<!doctype html>
<html>
<head>
  <title>jquery-rsRefPointer plug-in</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="http://rawgit.com/ruisoftware/jquery-rsRefPointer/master/src/jquery.rsRefPointer.js"></script>
  <script>
    $(document).ready(function () {
      $('.source').rsRefPointer();
    });
  </script>
  
  <style>
    .source {
      background-color: cyan;
    }
  </style>
</head>
<body>
  Mouse over
  <span class="source">here</span>
  to see two arrows pointing to
  <span class="target">[this target]</span>
  and this image
  <img width="400" height="200" class="target" src="http://lorempixel.com/400/200/sports">
    
  <p>Shrink your browser width to cause a line break on the image.<br>Watch how the arrow follows the target new location.</p>
<body>
</html>

You can check it out here on CodePen. In this example, you can see two arrows, one for each .target element. Because there is one .source element, only one instance of the plug-in is binded to the .source element. If there was three .source elements and two .target elements, then three instances of the plug-in would be created (one for each .source) and each instance would show 2 arrows. You can test this, by adding more .source elements in the CodePen link.

#Design-time mode This mode is nothing more than a tool to help you configure the arrows the way you wish. The workflow is:

  1. Enter Design-time mode
  2. Edit your arrows
  3. Generate code and copy it
  4. Paste the new code into your page
  5. Exit Design-time mode

Enter Design-time mode

Add the jquery.rsRefPointer-design.js script after the jquery.rsRefPointer.js script:

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="http://rawgit.com/ruisoftware/jquery-rsrefPointer/master/src/jquery.rsRefPointer.js"></script>
  <script src="http://rawgit.com/ruisoftware/jquery-rsrefPointer/master/src/jquery.rsRefPointer-design.js"></script>

Save your html and refresh your page. Now, you have entered Design-time mode. Sample on CodePen.

Edit your arrows

You can add new arrows, add middle points to the selected arrow, delete arrows or points and drag points to new positions. You might change several arrow style properties, as well. screen shot 2016-04-05 at 01 00 20

Generate code and copy it

When you are done, click on "Generate Code", click on "Select all" and copy it. screen shot 2016-04-05 at 01 03 47

Paste the new code into your page

Back to your editor, replace your old code screen shot 2016-04-05 at 01 31 43 with the new one screen shot 2016-04-05 at 01 05 57

Exit Design-time mode

Remove the jquery.rsRefPointer-design.js script.

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="http://rawgit.com/ruisoftware/jquery-rsrefPointer/master/src/jquery.rsRefPointer.js"></script>

Refresh your page. Design-time is gone and now you have your fancy arrows running.Check it out here

As you can see, design-time is a temporary tool that should be used to fecth the correct parameters. It is not intended to be deployed into production.

License

This project is licensed under the terms of the MIT license

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Contributing

Please refer to the Contribution page from more information.