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

ptr-window

v0.0.3

Published

A responsive canvas based text renderer.

Downloads

41

Readme

Window Pixel Text Renderer

Because why use the things that already exist when you can build them from scratch yourself?

  • It's a canvas based responsive display. Text is reflowed when the container size changes. Overflowing content is handled with scrolling.

Demo

https://visible-radio.github.io/windowPTR/

See also

  • NodePTR: https://github.com/Visible-Radio/NodePTR
  • react-pixel-character-editor: https://visible-radio.github.io/react-pixel-character-editor/

Markup Language

  • The plan is to implement a minimal markup languag.
  • Plain text can be passed in, or segments of text wrapped in <span></span>, to which various attributes can be applied.

Attributes

  • <span highlight=true></span>

    • The wrapped text will be highlighted by inverting each character cell.
  • <span outline=true></span>

    • The wrapped text will be outlined.
  • <span color=rgb(200,200,0)></span>

    • The wrapped text will be rendered in with the specified color instead of the default color.
  • Attributes can be combined

    • <span highlight=true color=rgb(0,200,190)></span>

Newlines

  • The display respects \n characters.

Word wrap

  • The display places words that won't fit on a line in the next line. If the word is wider than the display itself, it breaks the word at the character that would overflow.

Scrolling

  • Content outside of the display is handled with x-axis scrolling.

Character set

Characters are encoded as a one dimensional array. Custom character definitions can be loaded. Defs can be built with https://visible-radio.github.io/react-pixel-character-editor/

Current API

  • The project isn't currently packaged for use. This demo can be manipluated using the API temporarily exposed on window._PTR via the javascript console.

  • Scroll up / down, and home / end functionallity is currently bound to the arrow keys as a development-time stopgap.

Future features:

  • Tree based (as opposed to list based) layout.

  • A <blink></blink> tag or blink attribute that can be customized by providing a blink function

  • Teletype like drawing of characters when a message is rendered for the first time.

  • Simple document manipulation - append elements to document.

  • Custom animations by passing an onFirstDraw animation function to an element.

  • Custom looped animations for drawn elements.

  • Scroll bar

  • Hover styles on elements

  • onClick on elements