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

angular-value-flash

v1.0.5

Published

Flash on value change. Perfect for financial applicaitons.

Downloads

5

Readme

angular-value-flash

github action status npm version code style: prettier Contributor Covenant

angular-value-flash will display a flashed value on screen based on some value change. This pattern is extremely common in financial applications, and at Lab49, we're focused on the finance industry.

Incorporate this component into your application and pass along a number. As that number changes, this component will briefly flash a color, letting the user know the number has changed. By default, this component will flash green when the value changes up, or red when the value changes down.

Not only are these colors configurable, but the properties of the flash itself and the formatting of the value are configurable as well.

Furthermore, this component doesn't come with any styles, but does provide plenty of hooks to add your own styles. Even though flash color and transition properties are configurable as props, you can still use the generated classnames (which are also configurable) to add your own unique styles.

This component is perfect for:

  • Trading platforms
  • Analytics dashboards
  • Monitoring dashboards

Features

  • Small, simple, configurable, performant
  • Maintained by a team of finance industry professionals
  • Includes linting, prettier & unit test validations

Table of contents

Compodoc Documentation

Full documentation, generated using Compodoc: https://lab49.github.io/angular-value-flash

Demo

Hosted Storybook demo: https://main--60be66a91843f400393d1747.chromatic.com/

You can also run the demo locally. To get started:

git clone [email protected]:lab49/angular-value-flash.git
npm install
npm run storybook
⇡ Top

Installation

npm install angular-value-flash
⇡ Top

Usage

// Include in a module:
import { ValueFlashModule } from 'angular-value-flash';
...
@NgModule({
  imports: [
    ValueFlashModule
  ],
  ...
<!-- Use in a component template: -->
<value-flash
  [value]="20000">
</value-flash>

There are a number of classnames you can use to add your own styles. This Storybook example demonstrates a potential custom styling. Find the story source code here and the SCSS used here. Below is a list of all the available classnames, with the default .rvf_Flash prefix.

Note that due to view encapsulation, these styles will need to be included in global CSS/SCSS files, so be sure to properly scope the styles using wrapper div elements or by using specific prefixes as input to the value-flash component.

| Class | Description | | --- | --- | | .rvf_Flash | Root DOM node | | .rvf_Flash__value | Rendered value, direct (and only) child of the root node. | | .rvf_Flash--flashing | Applied only when the component is in the flashing state. | | .rvf_Flash--flashing-up | Applied when flashing 'up'. | | .rvf_Flash--flashing-down | Applied when flashing 'down'. | | .rvf_Flash--positive | Applied when the value is positive. | | .rvf_Flash--negative | Applied when the value is negative. |

⇡ Top

API

Directives

ValueFlashComponent

Selector: value-flash

Exported As: ValueFlashComponent

Properties

| Name | Default | Description | | --- | --- | --- | | @Input() downColor: string | 'red' | Color value when the component flashes 'down'. | | @Input() formatter: FormatterType | 'default' | Value display formatter type. Options are: 'currency', 'percentage', 'number', 'default'. See formatter definititions here. | | @Input() formatterFn: Formatter | | Custom formatter to use. Overrides formatter input. | | @Input() stylePrefix: string | 'rvf_Flash' | Class for root DOM node and prefix for flashing states, positive/negative states, and value node. | | @Input() timeout: number | 200 | Amount of time the flashed state is visible for, in milliseconds. | | @Input() transition: string | | Custom CSS transition property. | | @Input() transitionLength: number | 100 | Transition length, in milliseconds. | | @Input() upColor: string | 'green' | Color value when the component flashes 'up'. | | @Input() value: number | 0 | Value to display. |

License

MIT @ Lab49

⇡ Top

TODO

These items are very high level right now. Further discussion and proper roadmap planning will happen in GitHub issues and projects.

  • [ ] Finalize CI process for publishing.
  • [ ] Add a contributing guide.
  • [ ] Create a feature roadmap.
  • [ ] Publish code coverage to codecov.io.
  • [ ] Finanlize README.md (logo, coverage info).
  • [ ] Expand Storybook demos.
  • [ ] Expand unit tests.

Sponsored by Lab49