|
@@ -1,6 +1,6 @@
|
|
|
// import attractivity from '../Attractivity.json';
|
|
// import attractivity from '../Attractivity.json';
|
|
|
import nuts from '../nuts.js';
|
|
import nuts from '../nuts.js';
|
|
|
-import {factors} from './factors.js';
|
|
|
|
|
|
|
+//import {factors} from './factors.js';
|
|
|
|
|
|
|
|
export class AdjusterService {
|
|
export class AdjusterService {
|
|
|
constructor(HsCore, HsUtilsService, $rootScope, $http, $location) {
|
|
constructor(HsCore, HsUtilsService, $rootScope, $http, $location) {
|
|
@@ -11,9 +11,9 @@ export class AdjusterService {
|
|
|
this.$http = $http;
|
|
this.$http = $http;
|
|
|
this.serviceBaseUrl =
|
|
this.serviceBaseUrl =
|
|
|
$location.host() === 'localhost'
|
|
$location.host() === 'localhost'
|
|
|
- ? 'https://jmacura.ml/ws/'
|
|
|
|
|
|
|
+ ? 'https://jmacura.ml/ws/' // 'http://localhost:3000/'
|
|
|
: 'https://publish.lesprojekt.cz/nodejs/';
|
|
: 'https://publish.lesprojekt.cz/nodejs/';
|
|
|
- this.factors = factors;
|
|
|
|
|
|
|
+ this.factors = [];
|
|
|
this.clusters = [];
|
|
this.clusters = [];
|
|
|
this.method = 'haclust';
|
|
this.method = 'haclust';
|
|
|
this._clusteringInProcess = true;
|
|
this._clusteringInProcess = true;
|
|
@@ -28,19 +28,19 @@ export class AdjusterService {
|
|
|
const f = () => {
|
|
const f = () => {
|
|
|
this._clusteringInProcess = true;
|
|
this._clusteringInProcess = true;
|
|
|
this.$http({
|
|
this.$http({
|
|
|
- method: 'get',
|
|
|
|
|
|
|
+ method: 'post',
|
|
|
url: this.serviceBaseUrl + 'clusters',
|
|
url: this.serviceBaseUrl + 'clusters',
|
|
|
- /*data: {
|
|
|
|
|
|
|
+ data: {
|
|
|
factors: this.factors.map((f) => {
|
|
factors: this.factors.map((f) => {
|
|
|
return {
|
|
return {
|
|
|
- factor: f.factor,
|
|
|
|
|
|
|
+ factor: f.name,
|
|
|
weight: f.weight,
|
|
weight: f.weight,
|
|
|
datasets: f.datasets
|
|
datasets: f.datasets
|
|
|
.filter((ds) => ds.included)
|
|
.filter((ds) => ds.included)
|
|
|
.map((ds) => ds.name),
|
|
.map((ds) => ds.name),
|
|
|
};
|
|
};
|
|
|
}),
|
|
}),
|
|
|
- },*/
|
|
|
|
|
|
|
+ },
|
|
|
})
|
|
})
|
|
|
.then((response) => {
|
|
.then((response) => {
|
|
|
const clusterData = response.data.response;
|
|
const clusterData = response.data.response;
|