2 コミット 4a670b0491 ... d6d916ec10

作者 SHA1 メッセージ 日付
  Michael Zitzmann d6d916ec10 Initial commit 5 年 前
  Michael Zitzmann 4a670b0491 Initial commit 5 年 前
4 ファイル変更13 行追加11 行削除
  1. 10 5
      bin/prepareData.js
  2. 2 3
      bin/preprocess.js
  3. 1 1
      build.json
  4. 0 2
      rollup.config.js

+ 10 - 5
bin/prepareData.js

@@ -114,9 +114,15 @@ function transformData() {
     });
 
     // Resultat als JSON speichern
-    fs.writeFileSync(path.join('../', config.path.build, 'data.json'), JSON.stringify(result, null, '\t'), 'utf8');
-
-
+    fs.writeFileSync(
+        path.join(
+            '../',
+            config.path.output,
+            config.path.data,
+            'data.json'),
+        JSON.stringify(result, null, '\t'),
+        'utf8'
+    );
 
     // Runde alle Zahlen auf 4 Nachkommastellen
     function round(v) {
@@ -124,6 +130,5 @@ function transformData() {
     }
 }
 
-createDirectory(path.join('../', config.path.build));
-createDirectory(path.join('../', config.path.output));
+createDirectory(path.join('../', config.path.output, config.path.data));
 transformData();

+ 2 - 3
bin/preprocess.js

@@ -53,7 +53,7 @@ function createVisualisationHtml() {
             fs.writeFileSync(
                 path.join(
                     '../',
-                    config.path.build,
+                    config.path.output,
                     config.html.visualisation.name
                 ), result.html
             );
@@ -103,7 +103,7 @@ function createContextHtml() {
                 fs.writeFileSync(
                     path.join(
                         '../',
-                        config.path.build,
+                        config.path.output,
                         config.html.index.name
                     ), result.html
                 );
@@ -115,6 +115,5 @@ function createHtml() {
     createContextHtml();
 }
 
-createDirectory(path.join('../', config.path.build));
 createDirectory(path.join('../', config.path.output));
 createHtml();

+ 1 - 1
build.json

@@ -22,7 +22,7 @@
             "skeleton": "main.html"
         },
         "visualisation": {
-            "name": "crime.html",
+            "name": "treemap.html",
             "skeleton": "visualisation.html"
         }
     },

+ 0 - 2
rollup.config.js

@@ -68,8 +68,6 @@ const generateConfiguration = (target, option) => {
                 targets: [
                     { src: path.join(config.path.build, '/*.css'), dest: path.join(config.path.output, config.path.css) },
                     { src: path.join(config.path.build, '/*.js*'), dest: path.join(config.path.output, config.path.js) },
-                    { src: path.join(config.path.build, '/*.html'), dest: config.path.output },
-                    { src: path.join(config.path.build, '/*.json'), dest:  path.join(config.path.output, config.path.data) },
                     { src: path.join(config.path.assets, config.path.js), dest: config.path.output },
                     { src: path.join(config.path.assets, config.path.css), dest: config.path.output },
                     { src: path.join(config.path.assets, config.path.img), dest: config.path.output },