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

dom-vertical-mini-map

v0.0.1

Published

Build vertical mini map of elements in DOM.

Downloads

27

Readme

License NPM version

Component for creating vertical mini-map on html-page for document.body element.

Component inject in DOM of page and has position: fixed.

npm install dom-vertical-mini-map
<link rel="stylesheet" href="dom-vertical-mini-map.css">
<script src="dom-vertical-mini-map.js"></script>

MapElement - root HTMLElement of DomVerticalMiniMap.

ScrollMapElement - HTMLElement represented Window on MapElement.

MapPointElement - HTMLElement represented founded HTMLElement on MapElement.

Schema

Styles of MapElement.

Type: Object
Required: false

Value of CSS property background-color of MapElement.

Type: String
Default: rgba(248, 249, 250, 1)

Value of CSS property background-color of MapElement.

Type: String
Default: rgba(108, 117, 125, 1)

Position of MapElement on page.

Type: String
Values: left, right
Default: right

Value of CSS property background-color of MapElement.

Type: String
Default: 1rem

Value of CSS property background-color of MapElement.

Type: Number
Default: 1000

Options of ScrollMapElement.

Type: Object
Required: false

Enables ScrollMapElement.

Type: Boolean
Default: true

Styles of ScrollMapElement.

Type: Object Required: false

Value of CSS property background-color of ScrollMapElement. Use 'alpha' for opacity.

Type: String
Default: rgba(108, 117, 125, 0.3)

Array of objects. Every object configure one MapPointElement.

Type: Array Required: true

Configure drawing of MapPointElement.

Type: Object
Required: True

CSS selector for searching HTMLElements on page by document.querySelectorAll().

Type: String
Required: true

CSS selector for searching by querySelector() HTMLElement in element.
Filter elements founded by draw.selector if specified.

Type: String
Required: false

Styles of MapPointElement.

Type: Object
Required: false

Value of CSS property background-color of MapPointElement.

Type: String
Default: rgba(220, 53, 69, 1)

Value of CSS property background-color on hover of MapPointElement.

Type: String
Default: value of styles.borderColor of MapElement

Configure focus for MapPointElement.

Type: Object
Required: false

Enables focus element on MapPointElement click.

Type: Boolean
Default: false

CSS selector for searching by querySelector() HTMLElement (for focus) in element founded by draw.selector.

Type: String
Default: element founded by draw.selector

Configure scroll for MapPointElement.

Type: Object
Required: false

Enables scroll on MapPointElement click.

Type: Boolean
Default: true

CSS selector for searching by querySelector() HTMLElement (for scroll) in element founded by draw.selector.

Type: String
Default: element founded by draw.selector

Scrolls the Window to element (top/bottom/middle of Window) in the Document.

Type: String
Values: top, bottom, middle
Default: top

Array of objects. Every object concat text for title attribute of MapPointElement. Text separates by \n.
Priorities for concat of one object: text, textContent, attribute.

Type: Array
Required: false

Custom text.

Type: String
Required: false

CSS selector for searching by querySelector() HTMLElement for analyze.

Type: String
Required: false

Take value from attribute of element founded by selector.

Type: String
Required: false

Take string from textContent of element founded by selector.

Type: String
Required: false

Return MapElement.

Return version of DomVerticalMiniMap.

Create and inject DomVerticalMiniMap component in DOM.

Reset DomVerticalMiniMap component and remove it from DOM.

Reinitialize MapPointElements and refresh styles of #scrollElement and MapPointElements.

See examples.

Live examples: