Переглянути джерело

fix: use stable clustering algorithm

Temporary fix-like until proper way is discovered
jmacura 5 роки тому
батько
коміт
673cb9e905
2 змінених файлів з 4 додано та 4 видалено
  1. 2 2
      src/adjuster/adjuster.service.js
  2. 2 2
      src/app.component.js

+ 2 - 2
src/adjuster/adjuster.service.js

@@ -69,8 +69,8 @@ export class AdjusterService {
           });
           });
           const clusters = [];
           const clusters = [];
           for (const region of clusterData) {
           for (const region of clusterData) {
-            if (!clusters.includes(region['km25.cluster'])) {
-              clusters.push(region['km25.cluster']);
+            if (!clusters.includes(region['haclust'])) {
+              clusters.push(region['haclust']);
             }
             }
           }
           }
           this.clusters = clusters;
           this.clusters = clusters;

+ 2 - 2
src/app.component.js

@@ -70,7 +70,7 @@ const nuts2style = new Style({
 });
 });
 
 
 const nuts3style = function (feature) {
 const nuts3style = function (feature) {
-  if (isNaN(feature.get('km25.cluster'))) {
+  if (isNaN(feature.get('haclust'))) {
     return [
     return [
       new Style({
       new Style({
         fill: new Fill({
         fill: new Fill({
@@ -86,7 +86,7 @@ const nuts3style = function (feature) {
     return [
     return [
       new Style({
       new Style({
         fill: new Fill({
         fill: new Fill({
-          color: randomColorPalette[feature.get('km25.cluster') - 1],
+          color: randomColorPalette[feature.get('haclust') - 1],
         }),
         }),
       }),
       }),
     ];
     ];