|
|
@@ -1,6 +1,5 @@
|
|
|
import {HttpClient} from '@angular/common/http';
|
|
|
import {Injectable} from '@angular/core';
|
|
|
-import {Subject} from 'rxjs';
|
|
|
|
|
|
import {HsDialogContainerService} from 'hslayers-ng/components/layout/dialogs/dialog-container.service';
|
|
|
import {HsUtilsService} from 'hslayers-ng/components/utils/utils.service';
|
|
|
@@ -14,9 +13,86 @@ import {nuts} from '../nuts';
|
|
|
@Injectable({providedIn: 'root'})
|
|
|
export class AdjusterService {
|
|
|
serviceBaseUrl: string;
|
|
|
- factors;
|
|
|
- clusters;
|
|
|
+ factors = [];
|
|
|
+ clusters = [];
|
|
|
method: string;
|
|
|
+ methods = [
|
|
|
+ {
|
|
|
+ codename: 'km25.cluster',
|
|
|
+ name: 'k-means (25 random sets, Hartigan-Wong method)',
|
|
|
+ type: 'non-hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'km50hw.cluster',
|
|
|
+ name: 'k-means (50 random sets, Hartigan-Wong method)',
|
|
|
+ type: 'non-hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'km50l.cluster',
|
|
|
+ name: 'k-means (50 random sets, Lloyd method)',
|
|
|
+ type: 'non-hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'km50m.cluster',
|
|
|
+ name: 'k-means (50 random sets, MacQueen method)',
|
|
|
+ type: 'non-hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'kme_eu.cluster',
|
|
|
+ name: 'partitioning (Euclidean distance matrix)',
|
|
|
+ type: 'non-hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'kme_mn.cluster',
|
|
|
+ name: 'partitioning (Manhattan distance matrix)',
|
|
|
+ type: 'non-hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'haclust',
|
|
|
+ name: 'complete linkage (Euclidean distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'haclustmin',
|
|
|
+ name: 'complete linkage (Minkowski binary distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'haclustbin',
|
|
|
+ name: 'complete linkage (asymemetric binary distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'haclustman',
|
|
|
+ name: 'complete linkage (Manhattan distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'haclustmax',
|
|
|
+ name: 'complete linkage ("Supremum norm" distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ codename: 'haclustcan',
|
|
|
+ name: 'complete linkage (Canberra distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ /*{
|
|
|
+ codename: 'haclustcom',
|
|
|
+ name: 'complete linkage (Euclidean distance matrix)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },*/
|
|
|
+ {codename: 'haclustwd2', name: 'Ward2', type: 'hierarchical'},
|
|
|
+ {codename: 'haclustsin', name: 'single linkage', type: 'hierarchical'},
|
|
|
+ {codename: 'haclustcen', name: 'centroid (UPGMC)', type: 'hierarchical'},
|
|
|
+ {codename: 'haclustmed', name: 'median (WPGMC)', type: 'hierarchical'},
|
|
|
+ {codename: 'haclustmcq', name: 'McQuitty (WPGMA)', type: 'hierarchical'},
|
|
|
+ {
|
|
|
+ codename: 'hdclust',
|
|
|
+ name: 'DIANA (DIvisive ANAlysis)',
|
|
|
+ type: 'hierarchical',
|
|
|
+ },
|
|
|
+ ];
|
|
|
_clusteringInProcess: boolean;
|
|
|
|
|
|
constructor(
|
|
|
@@ -29,8 +105,6 @@ export class AdjusterService {
|
|
|
window.location.hostname === 'localhost'
|
|
|
? 'https://jmacura.ml/ws/' // 'http://localhost:3000/'
|
|
|
: 'https://publish.lesprojekt.cz/nodejs/';
|
|
|
- this.factors = [];
|
|
|
- this.clusters = [];
|
|
|
this.method = 'haclustwd2';
|
|
|
this._clusteringInProcess = true;
|
|
|
this.init();
|
|
|
@@ -78,7 +152,7 @@ export class AdjusterService {
|
|
|
(item) => item['nuts_id'] === feature.get('NUTS_ID')
|
|
|
);
|
|
|
if (!featureData) {
|
|
|
- console.error(`No data for feature ${feature.get('NUTS_ID')}`);
|
|
|
+ console.warn(`No data for feature ${feature.get('NUTS_ID')}`);
|
|
|
console.log(feature);
|
|
|
return;
|
|
|
}
|