|
@@ -1,5 +1,5 @@
|
|
|
// 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 {
|
|
@@ -35,7 +35,7 @@ export class AdjusterService {
|
|
|
}),
|
|
}),
|
|
|
},*/
|
|
},*/
|
|
|
}).then((response) => {
|
|
}).then((response) => {
|
|
|
- this.clusters = response.data.response;
|
|
|
|
|
|
|
+ const clusters = response.data.response;
|
|
|
console.log(this.clusters);
|
|
console.log(this.clusters);
|
|
|
/*let max = 0;
|
|
/*let max = 0;
|
|
|
this.clusters.forEach((a) => {
|
|
this.clusters.forEach((a) => {
|
|
@@ -49,30 +49,17 @@ export class AdjusterService {
|
|
|
});
|
|
});
|
|
|
this.attractivity.forEach((a) => {
|
|
this.attractivity.forEach((a) => {
|
|
|
this.nutsCodeRecordRelations[a.code] = a;
|
|
this.nutsCodeRecordRelations[a.code] = a;
|
|
|
- });
|
|
|
|
|
|
|
+ });*/
|
|
|
nuts.nuts3Source.forEachFeature((feature) => {
|
|
nuts.nuts3Source.forEachFeature((feature) => {
|
|
|
- feature.set(
|
|
|
|
|
- 'total',
|
|
|
|
|
- this.nutsCodeRecordRelations[feature.get('NUTS_ID')].aggregate
|
|
|
|
|
- );
|
|
|
|
|
- feature.set(
|
|
|
|
|
- 'totalForHumans',
|
|
|
|
|
- (
|
|
|
|
|
- this.nutsCodeRecordRelations[feature.get('NUTS_ID')].aggregate *
|
|
|
|
|
- 100
|
|
|
|
|
- ).toFixed(2)
|
|
|
|
|
|
|
+ const featureData = clusters.find(
|
|
|
|
|
+ (item) => item['nuts_id'] === feature.get('NUTS_ID')
|
|
|
);
|
|
);
|
|
|
- this.factors.forEach((factor) => {
|
|
|
|
|
- feature.set(
|
|
|
|
|
- factor.factor,
|
|
|
|
|
- (
|
|
|
|
|
- this.nutsCodeRecordRelations[feature.get('NUTS_ID')][
|
|
|
|
|
- factor.factor
|
|
|
|
|
- ] * 100
|
|
|
|
|
- ).toFixed(2)
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ Object.keys(featureData).forEach(function (key, index) {
|
|
|
|
|
+ if (key !== 'nuts_id') {
|
|
|
|
|
+ feature.set(key, featureData[key]);
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
- });*/
|
|
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
this.HsUtilsService.debounce(f, 300)();
|
|
this.HsUtilsService.debounce(f, 300)();
|