Skip to content

Commit

Permalink
Merge pull request #50 from MaibornWolff/dataServiceRef
Browse files Browse the repository at this point in the history
Data service ref
  • Loading branch information
ukinimod authored Nov 1, 2017
2 parents 8443eb8 + f622ed1 commit 0258dcc
Show file tree
Hide file tree
Showing 15 changed files with 722 additions and 18 deletions.
5 changes: 4 additions & 1 deletion visualization/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ module.exports = function (grunt) {
},
karmaSingle: {
command: path.resolve("node_modules", ".bin", "karma") + " start ./conf/karma.config.js",
stdout: true
stdout: true,
options: {
maxBuffer: 40000 * 1024
}
},
karmaAuto: {
command: path.resolve("node_modules", ".bin", "karma") + " start ./conf/karma.auto.config.js",
Expand Down
4 changes: 3 additions & 1 deletion visualization/app/codeCharta/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "./url/url.js";
import "./treemap/treemap.js";
import "./scenario/scenario.js";
import "./tooltip/tooltip.js";
import "./statistic/statistic.js";

angular.module(
"app.codeCharta.core",
Expand All @@ -15,6 +16,7 @@ angular.module(
"app.codeCharta.core.url",
"app.codeCharta.core.treemap",
"app.codeCharta.core.scenario",
"app.codeCharta.core.tooltip"
"app.codeCharta.core.tooltip",
"app.codeCharta.core.statistic"
]
);
3 changes: 1 addition & 2 deletions visualization/app/codeCharta/core/data/model/codeMap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export class CodeMap {

constructor(fileName, projectName, root) {

constructor(fileName = "", projectName = "", root = {}) {
this.fileName = fileName;
this.projectName = projectName;
this.root = root;
Expand Down
2 changes: 1 addition & 1 deletion visualization/app/codeCharta/core/data/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"attributeList":{
"type":"object",
"patternProperties": {
"^.*$":{
"^[A-Za-z0-9_]+$":{
"type": "number"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Scenario} from "./model/scenario.js";
import {Settings} from "../settings/model/settings.js";
import {Scale} from "../settings/model/scale.js";
import {Range} from "../settings/model/range.js";
import {STATISTIC_OPS} from "../statistic/statisticMapService";

/**
* Applies and manages scenarios.
Expand Down Expand Up @@ -53,7 +54,7 @@ class ScenarioService {
*/
getDefaultScenario() {
let defaultRange = new Range(20,40,false);
let defaultSettings = new Settings(this.settingsService.settings.map, defaultRange, "rloc", "mcc", "mcc", false, 1, new Scale(1,1,1), new Scale(0,300,1000), 1);
let defaultSettings = new Settings(this.settingsService.settings.map, defaultRange, "rloc", "mcc", "mcc", false, 1, new Scale(1,1,1), new Scale(0,300,1000), 1, STATISTIC_OPS.NO_OPERATIONS);
return new Scenario("rloc/mcc/mcc(20,40)", defaultSettings);
}

Expand Down
11 changes: 10 additions & 1 deletion visualization/app/codeCharta/core/settings/model/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export class Settings {
* @param {Scale} scaling
* @param {Scale} camera
* @param {Number} margin
* @param {STATISTIC_OPS} operation
*/
constructor(map, neutralColorRange, areaMetric, heightMetric, colorMetric, deltas, amountOfTopLabels, scaling, camera, margin) {
constructor(map, neutralColorRange, areaMetric, heightMetric, colorMetric, deltas, amountOfTopLabels, scaling,
camera, margin, operation) {

/**
* currently selected map
Expand Down Expand Up @@ -78,6 +80,12 @@ export class Settings {
*/
this.margin = margin;

/**
* statistical operation to be applied in the set of maps to get map
* @type {STATISTIC_OPS}
*/
this.operation = operation;

}

/**
Expand All @@ -95,6 +103,7 @@ export class Settings {
this.scaling = settings.scaling;
this.camera = settings.camera;
this.margin = settings.margin;
this.operation = settings.operation;
}

}
2 changes: 1 addition & 1 deletion visualization/app/codeCharta/core/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {SettingsService} from "./settingsService.js";

angular.module(
"app.codeCharta.core.settings",
["app.codeCharta.core.url", "app.codeCharta.core.data"]
["app.codeCharta.core.url", "app.codeCharta.core.data", "app.codeCharta.core.statistic"]
);

angular.module("app.codeCharta.core.settings").service(
Expand Down
21 changes: 18 additions & 3 deletions visualization/app/codeCharta/core/settings/settingsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {Settings} from "./model/settings";
import {Scale} from "./model/scale";
import {Range} from "./model/range";
import {STATISTIC_OPS, StatisticMapService} from "../statistic/statisticMapService";

/**
* Stores and manipulates the current settings
Expand All @@ -15,15 +16,28 @@ class SettingsService {
* @constructor
* @param {UrlService} urlService
* @param {DataService} dataService
* @param {Scope} $rootScope
* @param {Scope} $rootScope
* @param {StatisticMapService} statisticMapService;
*/
constructor(urlService, dataService, $rootScope) {
constructor(urlService, dataService, $rootScope, statisticMapService) {

/**
* @type {UrlService}
*/
this.urlService = urlService;



/**
* @type {STATISTIC_OPS}
*/
this.STATISTIC_OPS= STATISTIC_OPS;

/**
* @type {statisticMapService}
*/
this.statisticMapService = statisticMapService;

/**
* @type {DataService}
*/
Expand All @@ -49,7 +63,8 @@ class SettingsService {
1,
new Scale(1,1,1),
new Scale(0,300,1000),
1
1,
STATISTIC_OPS.NO_OPERATIONS
);

$rootScope.$on("data-changed", (event,data) => {
Expand Down
12 changes: 12 additions & 0 deletions visualization/app/codeCharta/core/statistic/statistic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {StatisticMapService, STATISTIC_OPS} from "./statisticMapService.js";

angular.module(
"app.codeCharta.core.statistic", []
);

angular.module("app.codeCharta.core.statistic").service(
"statisticMapService", StatisticMapService
);
angular.module("app.codeCharta.core.statistic").service(
"STATISTIC_OPS", STATISTIC_OPS
);
Loading

0 comments on commit 0258dcc

Please sign in to comment.