Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# List of available resources for Agile-Mashup (widgets and operators)

This set of Wirecloud components allow the creation and visualization of agile dashboards where you can easily check the progress and status of agile projects using charts and tables to plot the data.

Currently Github, Gitlab, Jira and Jenkins are supported.

Example dashboard to check Wirecloud's development on Github: [Wirecloud example](https://wirecloud.conwet.fi.upm.es/alex.rodriguez/Example#view=workspace)

# List of available resources for Agile-Mashup (widgets and operators)

## Harvesters (Harvest phase)

This operators harvest data from the online tools, such as Github.
Expand Down
68 changes: 65 additions & 3 deletions pie-chart-generator-operator/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,70 @@
bower_components/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components
src/bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/

# Dependency directories
node_modules/
src/bower_components/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# distribution content
dist/
build/

# Some configuration files
_SpecRunner.html
src/js/.tern-port
.DS_Store
6 changes: 2 additions & 4 deletions pie-chart-generator-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Pie Chart Generator operator
======================
# Pie Chart Generator operator

The Pie Chart Generator operator is a WireCloud operator that provides the ability to draw pie charts.

Build
-----
## Build

Be sure to have installed [Node.js](http://node.js) in your system. For example, you can install it on Ubuntu and Debian running the following commands:

Expand Down
2 changes: 1 addition & 1 deletion pie-chart-generator-operator/src/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<operator xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="pie-chart-generator" version="0.3.3">
<operator xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="pie-chart-generator" version="0.3.4">
<details>
<title>Pie Chart Generator</title>
<authors>Alejandro Rodriguez &lt;[email protected]&gt;</authors>
Expand Down
9 changes: 9 additions & 0 deletions pie-chart-generator-operator/src/doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# CHANGELOG

## v0.3.4

- Adds 3D format.
- Allow point select.
- Change PlotOptions.
- Update README content (correction some problems).

## v0.3.3

- Adds dataHandler support.
Expand Down
2 changes: 1 addition & 1 deletion pie-chart-generator-operator/src/doc/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Introduction
# Introduction

Generates a pie chart from a dataset

Expand Down
33 changes: 24 additions & 9 deletions pie-chart-generator-operator/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
MashupPlatform.wiring.registerCallback("label-serie", labelSerieCallback);
};

var labelSerieCallback = function labelSerieCallback (data) {
var labelSerieCallback = function labelSerieCallback(data) {
if (data) {
var labelSerie = toNumberSerie(data);
labelSerie = calculateSeries(labelSerie);
Expand All @@ -25,7 +25,7 @@
}
};

var numberSerieCallback = function numberSerieCallback (data) {
var numberSerieCallback = function numberSerieCallback(data) {
if (data) {
var numberSerie = data;
numberSerie = calculateSeries(numberSerie);
Expand All @@ -35,10 +35,10 @@
}
};

var toNumberSerie = function toNumberSerie (serie) {
var toNumberSerie = function toNumberSerie(serie) {
var result = [];

serie.forEach (function (data) {
serie.forEach(function (data) {
if (result[data]) {
result[data] += 1;
} else {
Expand All @@ -54,21 +54,33 @@

var keys = Object.keys(data);
for (var i = 0; i < keys.length; i++) {
result.push({name: keys[i], y: data[keys[i]]});
result.push({
name: keys[i],
y: data[keys[i]]
});
}
return result;
};

var dataHandler = function dataHandler (pie) {
var dataHandler = function dataHandler(pie) {
var filterBy = pie.name;
var meta = series.metadata;
return [{type: meta.filterAttributeType || "eq", value: filterBy, attr: meta.filterAttribute}];
return [{
type: meta.filterAttributeType || "eq",
value: filterBy,
attr: meta.filterAttribute
}];
};

var build_pie_chart = function build_pie_chart(series) {
var options = {
chart: {
type: 'pie'
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: MashupPlatform.prefs.get('title')
Expand All @@ -80,7 +92,10 @@
data: series
}],
plotOptions: {
series: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
format: '{point.name}: {point.percentage:.1f}%'
Expand Down