Revision 51332
Added by Myrto Koukouli about 6 years ago
statistics.component.ts | ||
---|---|---|
1 |
import {Component} from '@angular/core';
|
|
1 |
import {Component, Input} from '@angular/core';
|
|
2 | 2 |
import {Observable} from 'rxjs/Observable'; |
3 | 3 |
import {ActivatedRoute, Router} from '@angular/router'; |
4 | 4 |
import { Location, TitleCasePipe } from '@angular/common'; |
... | ... | |
35 | 35 |
public communityId = null; |
36 | 36 |
public communityInfo = null; |
37 | 37 |
|
38 |
@Input() currentMode = 'showInMonitor'; |
|
38 | 39 |
entitiesList: string[] = availableEntities; |
39 | 40 |
chartCatsList: string[] = availableCharts; |
40 |
allowedCharts: string[] = []; |
|
41 |
allowedCharts: Map<string,string[]> = new Map<string,string[]>(); |
|
42 |
allowedEntities: string[] = []; |
|
41 | 43 |
|
42 | 44 |
statisticsSum: StatisticsSummary; |
43 | 45 |
statisticsDisplay: StatisticsDisplay; |
44 | 46 |
chartsUrlMap: {}; |
45 | 47 |
|
46 |
public displayedTimeline: string; |
|
47 |
public displayedTimelineUrl: string; |
|
48 |
public displayedGraph: string; |
|
49 |
public displayedGraphUrl: string; |
|
50 |
public displayedProjectChart: string; |
|
51 |
public displayedProjectChartUrl: string; |
|
48 |
displayedTimeline: string; |
|
49 |
displayedTimelineUrl: string; |
|
50 |
displayedGraph: string; |
|
51 |
displayedGraphUrl: string; |
|
52 |
displayedProjectChart: string; |
|
53 |
displayedProjectChartUrl: string; |
|
54 |
displayedEntity: string; |
|
52 | 55 |
|
53 | 56 |
constructor ( |
54 | 57 |
private route: ActivatedRoute, |
... | ... | |
134 | 137 |
}, |
135 | 138 |
() => { |
136 | 139 |
this.createChartUrlMap(); |
137 |
this.initializeDisplayedCharts('showInMonitor');
|
|
140 |
this.initializeDisplayedCharts(); |
|
138 | 141 |
} |
139 | 142 |
); |
140 | 143 |
} |
141 | 144 |
|
142 |
/* /!* checks which charts exist and which the admin has chosen to display in connect monitor *!/ |
|
143 |
private createCharts() { |
|
144 |
this.createChartUrlMap(); |
|
145 | 145 |
|
146 |
/!* for each entity find the statistics display information |
|
147 |
from apiUrl/statistics/communityId |
|
148 |
*!/ |
|
149 |
for ( let entity of this.entitiesList ) { |
|
150 |
let displayOptionsForEntity = this.statisticsDisplay.entities[entity]; |
|
151 |
|
|
152 |
/!* if the community has produced such entities *!/ |
|
153 |
if (displayOptionsForEntity && this.statisticsSum[entity+(entity=='software'?'':'s')]['total'] ) { |
|
154 |
|
|
155 |
/!* create a map of charts to be displayed *!/ |
|
156 |
let chartsMap: Map<string,any> = new Map<string,any>(); |
|
157 |
|
|
158 |
/!* for each chart category find which charts exist |
|
159 |
and which the admin has chosen to be displayed here |
|
160 |
*!/ |
|
161 |
for (let chart of this.chartCatsList) { |
|
162 |
|
|
163 |
/!* current chart is *!/ |
|
164 |
let displayOptionsForCharts = this.statisticsDisplay.entities[entity].charts.map[chart]; |
|
165 |
|
|
166 |
/!* in the future we probably won't need to check if the url exists *!/ |
|
167 |
/!* currently the url titles are created using the entity name and the chart name in camelcase *!/ |
|
168 |
let urlString = this.chartsUrlMap[entity + this.getCamelCaseString(chart)]; |
|
169 |
|
|
170 |
if (displayOptionsForCharts && displayOptionsForCharts.showInMonitor && urlString ) { |
|
171 |
chartsMap.set( chart, urlString ); |
|
172 |
this.allowedCharts.push(entity + this.getCamelCaseString(chart)); |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 |
/!* add the entity's charts to the charts map *!/ |
|
177 |
this.charts.set(entity, chartsMap); |
|
178 |
|
|
179 |
/!* add the entity in the available entities for the current community *!/ |
|
180 |
this.entitiesForCommunity.push(entity); |
|
181 |
} |
|
182 |
} |
|
183 |
this.onChangeEntity(this.entitiesForCommunity[0]); |
|
184 |
}*/ |
|
185 |
|
|
186 |
initializeDisplayedCharts(mode: string) { |
|
146 |
initializeDisplayedCharts() { |
|
187 | 147 |
let firstEntity: string; |
148 |
console.log(`my current mode is: ${this.currentMode}`); |
|
188 | 149 |
for (let entity of this.entitiesList) { |
189 | 150 |
if (this.statisticsDisplay.entities[entity]) { |
190 | 151 |
|
152 |
this.allowedEntities.push(entity); |
|
153 |
this.allowedCharts[entity] = []; |
|
154 |
|
|
191 | 155 |
for (let chart of this.chartCatsList){ |
192 |
if (this.statisticsDisplay.entities[entity].charts.map[chart] && |
|
193 |
this.statisticsDisplay.entities[entity].charts.map[chart][mode] && |
|
156 |
if (this.statisticsSum[entity].total && |
|
157 |
this.statisticsDisplay.entities[entity].charts.map[chart] && |
|
158 |
this.statisticsDisplay.entities[entity].charts.map[chart][this.currentMode] && |
|
194 | 159 |
this.chartsUrlMap[entity + this.getCamelCaseString(chart)]) { |
195 | 160 |
|
196 |
this.allowedCharts.push(entity + this.getCamelCaseString(chart)); |
|
161 |
this.allowedCharts[entity].push(entity + this.getCamelCaseString(chart));
|
|
197 | 162 |
} |
198 | 163 |
} |
199 | 164 |
if (!firstEntity){ |
... | ... | |
207 | 172 |
createChartUrlMap() { |
208 | 173 |
this.chartsUrlMap = { |
209 | 174 |
publicationTimeline : this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&persistent=false&data=com=query&data={"query":"comTimelinePubs","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} publications through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83%`), |
210 |
publicationGraph: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comOAPubs","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} publications by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=90%`),
|
|
175 |
publicationGraph: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comOAPubs","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} publications by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
|
|
211 | 176 |
publicationProjectcolumn: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectPubs","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`), |
212 | 177 |
publicationProjectpie: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectPubs","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=91%&h=90%`), |
213 | 178 |
publicationProjecttable: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}gtable.php?com=query&data={"query":"comProjectPubs","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%`), |
214 | 179 |
datasetTimeline: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comTimelineData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} datasets through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83%`), |
215 |
datasetGraph: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comOAData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} datasets by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=90%`),
|
|
216 |
datasetProjectcolumn: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}`),
|
|
180 |
datasetGraph: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comOAData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} datasets by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
|
|
181 |
datasetProjectcolumn: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["datasets"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
|
|
217 | 182 |
datasetProjectpie: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=91%&h=90%`), |
218 |
datasetProjecttable: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}gtable.php?com=query&data={"query":"comProjectData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%`),
|
|
183 |
datasetProjecttable: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}gtable.php?com=query&data={"query":"comProjectData","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["Datasets"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%`),
|
|
219 | 184 |
softwareTimeline: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comTimelineSoft","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} software through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83%`), |
220 |
softwareGraph: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comOASoft","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} software by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=90%`),
|
|
221 |
softwareProjectcolumn: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectSoft","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}`), |
|
185 |
softwareGraph: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comOASoft","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":"${this.communityId.toUpperCase()} software by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
|
|
186 |
softwareProjectcolumn: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectSoft","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
|
|
222 | 187 |
softwareProjectpie: this.sanitizer.bypassSecurityTrustResourceUrl(`${this.properties.statisticsFrameAPIURL}chart.php?com=query&data={"query":"comProjectSoft","comId":"${this.communityId}","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=91%&h=90%`), |
223 |
softwareProjecttable: this.sanitizer.bypassSecurityTrustResourceUrl(this.properties.statisticsFrameAPIURL + 'gtable.php?com=query&data={"query":"comProjectSoft","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%')
|
|
188 |
softwareProjecttable: this.sanitizer.bypassSecurityTrustResourceUrl(this.properties.statisticsFrameAPIURL + 'gtable.php?com=query&data={"query":"comProjectSoft","comId":"'+ this.communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["Software"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%')
|
|
224 | 189 |
}; |
225 | 190 |
} |
226 | 191 |
|
... | ... | |
228 | 193 |
onChangeEntity (entity: string) { |
229 | 194 |
this.displayedTimeline = `${entity}Timeline`; |
230 | 195 |
this.displayedTimelineUrl = this.chartsUrlMap[this.displayedTimeline]; |
196 |
console.log(`displayed Timeline is: ${this.displayedTimeline}`); |
|
231 | 197 |
this.displayedGraph = `${entity}Graph`; |
232 | 198 |
this.displayedGraphUrl = this.chartsUrlMap[this.displayedGraph]; |
233 |
this.displayedProjectChart = this.allowedCharts.filter( x => x.includes(entity+'Project') )[0]; |
|
234 |
this.displayedProjectChartUrl = this.chartsUrlMap[this.displayedProjectChart]; |
|
235 |
console.log(`displayed Timeline is: ${this.displayedTimeline}`); |
|
236 | 199 |
console.log(`displayed Graph is: ${this.displayedGraph}`); |
237 |
console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`); |
|
200 |
let firstProjectChart = this.allowedCharts[entity].filter( x => x.includes(entity+'Project') ); |
|
201 |
this.changeDisplayedProjectChart(firstProjectChart.shift()); |
|
202 |
this.displayedEntity = entity; |
|
203 |
console.log(`displayed entity is ${entity}`); |
|
238 | 204 |
} |
239 | 205 |
|
240 | 206 |
changeDisplayedProjectChart(chartName: string) { |
... | ... | |
244 | 210 |
} |
245 | 211 |
|
246 | 212 |
} |
213 |
|
|
214 |
|
|
215 |
@Component({ |
|
216 |
selector: 'statistics-for-dashboard', |
|
217 |
templateUrl: 'statistics-for-dashboard.component.html', |
|
218 |
}) |
|
219 |
|
|
220 |
export class StatisticsForDashboardComponent extends StatisticsComponent { |
|
221 |
ngOnInit() { |
|
222 |
super.ngOnInit(); |
|
223 |
} |
|
224 |
|
|
225 |
} |
Also available in: Unified diff
finished statistics monitor and added statistics to dashboard