
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
angular-clock
Advanced tools
Beautiful, reactive, responsive Clock widgets for Angular.JS using SVG.
bower install angular-clock --save
or copy the files from dist/
. Then add the sources to your code (adjust paths as needed) after
adding the dependencies for Angular first:
<script src="../bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-clock/dist/angular-clock.js"></script>
There are 6 types of charts so 6 directives: chart-line
, chart-bar
, chart-radar
, chart-pie
,
chart-polar-area
, chart-doughnut
.
They all use mostly the same API:
data
: series datalabels
: x axis labels (line, bar, radar) or series labels (pie, doughnut, polar area)options
: chart options (as from Chart.js documentation)series
: (default: []
): series labels (line, bar, radar)colours
: data colours (will use default colours if not specified)getColour
: function that returns a colour in case there are not enough (will use random colours if not specified)click
: onclick event handlerhover
: onmousemove event handlerlegend
: (default: false
): show legend below the chartThere is another directive chart-base
that takes an extra attribute chart-type
to define the type
dynamically, see stacked bar example.
For IE8 and older browsers, you will need SVG polyfills and Shims
<canvas id="line" class="chart chart-line" data="data" labels="labels"
legend="true" series="series" click="onClick"></canvas>
angular.module("app", ["chart.js"]).controller("LineCtrl", ['$scope', '$timeout', function ($scope, $timeout) {
$scope.labels = ["January", "February", "March", "April", "May", "June", "July"];
$scope.series = ['Series A', 'Series B'];
$scope.data = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
$scope.onClick = function (points, evt) {
console.log(points, evt);
};
// Simulate async data update
$timeout(function () {
$scope.data = [
[28, 48, 40, 19, 86, 27, 90],
[65, 59, 80, 81, 56, 55, 40]
];
}, 3000);
}]);
angular-chart.js watch updates on data, series, labels, colours and options and will update, or destroy and recreate, the chart on changes.
There are a set of 7 default colours. Colours can be replaced using the colours
attribute.
If there is more data than colours, colours are generated randomly or can be provided
via a function through the getColour
attribute.
Hex colours are converted to Chart.js colours automatically, including different shades for highlight, fill, stroke, etc.
Please check if issue exists and otherwise open issue in github. Please add a link to a plunker, jsbin, or equivalent. Here is a jsbin template for convenience.
Pull requests welcome!
npm test
Thank you!
Deepu K Sasidharan
Inspired from this demo.
angular-clock.js is available under the MIT license.
FAQs
An angular.js clock widget
The npm package angular-clock receives a total of 194 weekly downloads. As such, angular-clock popularity was classified as not popular.
We found that angular-clock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.