Selaa lähdekoodia

🚧 load data

jmacura 3 vuotta sitten
vanhempi
commit
94ef00e81b

+ 15 - 0
src/app/graphs/sdm-dih.service.ts

@@ -0,0 +1,15 @@
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import {csv} from 'd3';
+
+@Injectable({providedIn: 'root'})
+export class SdmDihService {
+  constructor(private httpClient: HttpClient) {
+    this.loadData();
+  }
+  
+  async loadData() {
+    const data = await csv('../../assets/data/normalized_data.csv');
+    console.log(data);
+  }
+}

+ 3 - 1
src/app/graphs/year-graph/year-graph.component.ts

@@ -1,11 +1,13 @@
 import { Component, OnInit } from '@angular/core';
 
+import { SdmDihService } from '../sdm-dih.service';
+
 @Component({
   selector: 'year-graph',
   templateUrl: 'year-graph.component.html',
 })
 export class YearGraphComponent implements OnInit {
-  constructor() { }
+  constructor(private sdmDihService: SdmDihService) { }
 
   ngOnInit() { }
 }

+ 1 - 1
src/index.html

@@ -2,7 +2,7 @@
 <html lang="en">
 <head>
   <meta charset="utf-8">
-  <title>HSLayers-NG application</title>
+  <title>SDM DIH integration</title>
   <base href="/">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="icon" type="image/x-icon" href="favicon.ico">