Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
],
"description": "Github widgets for the angular-dashboard-framework",
"dependencies": {
"angular-dashboard-framework": "~0.11.0",
"angular-chart.js": "^0.10.2"
"angular": ">=1.4 <1.6",
"angular-dashboard-framework": "~0.12.0",
"angular-chart.js": "^1.1.1"
},
"devDependencies": {
"angular-local-storage": "0.1.5"
},
"resolutions": {
"angular": ">=1.3.0",
"angular-bootstrap": "^0.14.3",
"angular-bootstrap": "~1.1.2",
"bootstrap": "^3.3.6",
"Sortable": "^1.2.1"
"Sortable": "~1.4.2"
},
"overrides": {
"bootstrap": {
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,28 @@
"url": "https://github.com/sdorra/adf-widget-github"
},
"description": "Github widgets for the angular-dashboard-framework",
"dependencies": {},
"devDependencies": {
"gulp": "^3.8.11",
"gulp": "^3.9.1",
"gulp-angular-filesort": "^1.1.1",
"gulp-angular-templatecache": "^1.6.0",
"gulp-concat": "^2.5.2",
"gulp-angular-templatecache": "^1.7.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "~2.2.0",
"gulp-csslint": "^0.1.5",
"gulp-headerfooter": "^1.0.3",
"gulp-if": "^1.2.5",
"gulp-inject": "^1.2.0",
"gulp-jshint": "^1.9.4",
"gulp-if": "^2.0.2",
"gulp-inject": "^4.0.0",
"gulp-jshint": "^2.0.0",
"gulp-less": "^3.0.2",
"gulp-load-plugins": "^0.9.0",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-minify-css": "^1.0.0",
"gulp-minify-html": "^1.0.1",
"gulp-ng-annotate": "^0.5.2",
"gulp-rename": "^1.2.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.3",
"ng-annotate-adf-plugin": "^0.1.2",
"gulp-uglify": "^1.1.0",
"jshint-stylish": "^1.0.1",
"gulp-uglify": "^1.2.0",
"jshint-stylish": "~2.1.0",
"wiredep": "~2.2.2",
"del": "^1.1.1"
"del": "^2.0.2"
}
}
10 changes: 9 additions & 1 deletion src/author.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,19 @@ function GithubAuthorController(config, commits) {
}
});

var options = {
legend: {
display: true,
position: "bottom"
}
}

var chart = {
labels: [],
data: [],
series: ["Commits"],
class: "chart-pie"
class: "chart-pie",
options: options
};

angular.forEach(data, function (count, author) {
Expand Down
26 changes: 13 additions & 13 deletions src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,26 @@ function RegisterWidgets(dashboardProvider) {
// register github template by extending the template object
dashboardProvider
.widget('githubHistory', angular.extend({
title: 'Github History',
description: 'Display the commit history of a GitHub project as chart',
title: 'GitHub History',
description: 'Displays the commit history of a GitHub project as chart',
controller: 'GithubHistoryController',
templateUrl: '{widgetsPath}/github/src/line-chart.html'
}, commitWidgets))
.widget('githubAuthor', angular.extend({
title: 'Github Author',
title: 'GitHub Author',
description: 'Displays the commits per author as pie chart',
controller: 'GithubAuthorController',
templateUrl: '{widgetsPath}/github/src/pie-chart.html'
}, commitWidgets))
.widget('githubCommits', angular.extend({
title: 'Github Commits',
description: 'Displays the commits as list',
title: 'GitHub Commits',
description: 'Displays the commits of a GitHub project',
controller: 'GithubCommitsController',
templateUrl: '{widgetsPath}/github/src/commits.html'
}, commitWidgets))
.widget('githubIssues', angular.extend({
title: 'Github Issues',
description: 'Displays issues as list of a GitHub project',
title: 'GitHub Issues',
description: 'Displays the issues of a GitHub project',
controller: 'GithubIssuesController',
templateUrl: '{widgetsPath}/github/src/issues.html',
resolve: {
Expand All @@ -85,8 +85,8 @@ function RegisterWidgets(dashboardProvider) {
}
}, widget))
.widget('githubUserEvents', {
title: 'Github User Events',
description: 'Display events of a certain user.',
title: 'GitHub User Events',
description: 'Displays events of a certain user',
category: 'GitHub',
controller: 'GithubEventsController',
controllerAs: 'vm',
Expand All @@ -104,8 +104,8 @@ function RegisterWidgets(dashboardProvider) {
}
})
.widget('githubOrganisationEvents', {
title: 'Github Organisation Events',
description: 'Display events of a public organisation.',
title: 'GitHub Organisation Events',
description: 'Displays events of a public organisation',
category: 'GitHub',
controller: 'GithubEventsController',
controllerAs: 'vm',
Expand All @@ -123,8 +123,8 @@ function RegisterWidgets(dashboardProvider) {
}
})
.widget('githubRepoEvents', {
title: 'Github Repository Events',
description: 'Display events of a certain repository.',
title: 'GitHub Repository Events',
description: 'Displays events of a certain repository',
category: 'GitHub',
controller: 'GithubEventsController',
controllerAs: 'vm',
Expand Down
31 changes: 26 additions & 5 deletions src/history.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ function GithubHistoryController($filter, config, commits) {
function createChart() {
var data = {};

var orderedCommits = $filter('orderBy')(commits, function(commit){
var orderedCommits = $filter('orderBy')(commits, function (commit) {
return commit.commit.author.date;
});

angular.forEach(orderedCommits, function(commit) {
angular.forEach(orderedCommits, function (commit) {
var day = commit.commit.author.date;
day = day.substring(0, day.indexOf('T'));

Expand All @@ -53,14 +53,35 @@ function GithubHistoryController($filter, config, commits) {
});

var chartData = [];
var options = {
scales: {
yAxes: [
{
id: 'y-axis-1',
display: true,
position: 'left',
ticks: { fixedStepSize: 1 },
scaleLabel: {
display: true,
labelString: 'Commits'
}
}
]
},
legend: {
display: true,
position: "bottom"
}
}
var chart = {
labels: [],
data: [chartData],
series: ["Commits"],
class: "chart-line"
series: [config.path],
class: "chart-line",
options: options
};

angular.forEach(data, function(count, day) {
angular.forEach(data, function (count, day) {
chart.labels.push(day);
chartData.push(count);
});
Expand Down
2 changes: 1 addition & 1 deletion src/line-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div ng-if="vm.chart">
<canvas id="line" class="chart chart-line"
chart-data="vm.chart.data" chart-labels="vm.chart.labels"
chart-series="vm.chart.series">
chart-series="vm.chart.series" chart-options="vm.chart.options">
</canvas>
</div>
</div>
2 changes: 1 addition & 1 deletion src/pie-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div ng-if="vm.chart">
<canvas id="pie" class="chart chart-pie"
chart-legend="true" chart-data="vm.chart.data"
chart-labels="vm.chart.labels">
chart-labels="vm.chart.labels" chart-options="vm.chart.options" >
</canvas>
</div>
</div>