diff --git a/css/ds.css b/css/ds.css index efb6aed..13f5aeb 100644 --- a/css/ds.css +++ b/css/ds.css @@ -73,6 +73,9 @@ table.table td, table.table th { border: none; } +.table-sample { + max-width: 65%; +} #map { height: 500px; } diff --git a/js/ds.js b/js/ds.js index 7898bf2..c60d3e6 100644 --- a/js/ds.js +++ b/js/ds.js @@ -1,6 +1,7 @@ 'use strict'; const MAPBOX_TOKEN = 'pk.eyJ1Ijoibmljb3BhIiwiYSI6ImNsZmNiZGN0ZTJzbGgzdG8xYnZxOXRvd28ifQ.nvK1VYF6lwPpA094cL83KQ'; import * as resmap from './resmap.js'; +import {plot} from './plot.js'; /** * @namespace DataSpace */ @@ -10,7 +11,7 @@ DataSpace.BASE_URL = 'http://dataspace.ispc.cnr.it'; DataSpace.FE_URL = `${DataSpace.BASE_URL}/custom-fe`; DataSpace.RES_ENDPOINT = '/resources/'; DataSpace.FILES_URI = `${DataSpace.BASE_URL}/files/uploadedfiles/`; -// TODO maybe these assignments are non needed? +// TODO maybe these assignments are not needed? DataSpace.RESOURCE_REPORT = { 'Object' : resmap.OBJECT_REPORT, 'Context' : resmap.CONTEXT_REPORT, @@ -125,10 +126,17 @@ DataSpace.renderReport = async function (report, archesJson, images) this.getRelatedAnalysisId(archesJson) ); + console.log(this.getRelatedAnalysisId(archesJson)); + container.innerHTML += await this.renderAnalysisReport( report.resource, report.displayname ); + const spectra = report.resource['Analysis Spectra'][0]; + const rawData = await this.fetchFileUrl(spectra['Spectrum Raw Data']); + + plot([[1, 2, 3, 4, 5], [1, 2, 4, 8, 16]], 'plot'); + } } /** @@ -142,16 +150,17 @@ DataSpace.renderAnalysisReport = async function (resource, type) { const shape = this.createShape(resource, 'Analysis'); let html = ` -
- ${key.replace('Analysis', '')} | + table += `|
+ ${key.replace('Analysis', '')} + | ${resource[key]} |