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-scale

v2.1.5

Published

Angular plugin for building a scale of items. Chart ruler completely on HTML/CSS/JS. Inspired by kinopoisk.ru chart. Feel free for contribute.

Downloads

23

Readme

Scale

NPM Version Download Month Download Total

alt text

Angular plugin for building scale of items. Chart ruler completely on HTML/CSS/JS. Bar chart, line chart, calendar view visualisation. Diagram, graph, pyramid visualisation of large datasets. Showreel. The source for this module is in the main repo. Please create issues and pull requests.

alt text

Inspired by kinopoisk.ru chart written using Adobe Flash. But this chart is just on HTML/CSS without using libraries. Feel free for contribute.

alt text

Install

bower install angular-scale 
npm install angular-scale 

Use

<!DOCTYPE html>
<html ng-app="myApp">
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="../scale.css">
	</head>
	<body ng-controller="main">
		<scale data="data" 
			   width="50" 
			   height="10"
			   box-size="14"
			   line="true"
			   theme="default">
		</scale>

		<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
		<script src="../scale.js"></script>
		<script src="./index.js"></script>
	</body>
</html>
angular.module('myApp', ['scale']).controller('main', ['$scope', function($scope) {
	$scope.data = [];

	var SCALE_WIDTH = 50,
	    SCALE_HEIGHT = 10;

	for (var i=0; i < SCALE_WIDTH; i++) {
		var value = Math.floor(Math.random() * SCALE_HEIGHT + 1);

		$scope.data.push({
			value: value, //Value from 1 to SCALE_HEIGHT
			title: (i + 1) + " item" //Description
		});
	}
}]);

Options

<scale data="data" 
	   width="50" 
	   height="10"
	   box-size="14"
	   line="true"
	   theme="default">
</scale>
  • data is an array of objects [{value: 0}, ... , {value: 10}]. This is the dataset of the chart.
  • width is the horizontal length of the data array. If width param is less than the length of the data array then user will see the last values of the data array.
  • height is the vertical length.
  • box-size is size of each box in pixels.

alt text

  • line is param that determines if this is a line-chart.

alt text

  • theme is color scheme of the chart.

alt text

Please check the example folder to see how it's going on practice.

Themes

  • default
  • purple
  • grey

alt text

Changelog

  • 10/02/2016 Implemented tooltips.
  • 10/01/2016 Implemented different color schemes.
  • 09/20/2016 Rewriting the project as an Angular.js plugin.
  • 06/05/2016 Finished writing function for calculating angle of the line that connects the points of the chart. Rendering chart.

License

Copyright (c) 2016 Kirill Stepkin

Inspired by kinopoisk.ru chart.

npm