Project

General

Profile

« Previous | Next » 

Revision 51514

finished statistics pages

View differences:

modules/uoa-connect-portal/trunk/package.json
8 8
  ],
9 9
  "scripts": {
10 10
    "ng": "ng",
11
    "start": " ng serve --disable-host-check --host 0.0.0.0",
11
    "start": " ng serve --disable-host-check --host 0.0.0.0 --port 5000",
12 12
    "start:dynamic": "PORT=5000 npm run build:dynamic && npm run serve:dynamic",
13 13
    "start:static": "npm run build:static && npm run serve:static",
14 14
    "build": "ng build",
modules/uoa-connect-portal/trunk/src/app/statistics/statistics.component.ts
118 118
        console.log(" Stats! "+ this.properties.statisticsAPIURL);
119 119
        this._statisticsService.getCommunityStatistics(this.properties.statisticsAPIURL,this.communityId).subscribe (
120 120
            res => {
121
                console.log('statisticsSum is:');
121 122
                this.statisticsSum = res;
122 123
            },
123 124
            error => {
......
149 150
        let firstEntity: string;
150 151
        console.log(`my current mode is: ${this.currentMode}`);
151 152
        for (let entity of this.entitiesList) {
152
            if (this.statisticsDisplay.entities[entity]) {
153

  
153
            if (this.statisticsDisplay.entities[entity] && this.statisticsSum[entity].total) {
154
                console.log(`added ${entity} to allowedEntities`);
154 155
                this.allowedEntities.push(entity);
155 156
                this.allowedCharts[entity] = [];
156 157
                for (let chart of this.chartCatsList){
......
160 161
                        this.chartsUrlMap[entity + this.getCamelCaseString(chart)]) {
161 162

  
162 163
                        this.allowedCharts[entity].push(entity + this.getCamelCaseString(chart));
164
                        console.log(`added ${entity} - ${chart} to allowedCharts`);
163 165
                    }
164 166
                }
165 167
                if (!firstEntity){
......
172 174

  
173 175
    createChartUrlMap() {
174 176
        this.chartsUrlMap = {
175
            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%`),
176
            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%`),
177
            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%`),
178
            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%`),
179
            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%`),
180
            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%`),
181
            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%`),
182
            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%`),
183
            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%`),
177
            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":"Publications through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83%`),
178
            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":"Publications by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
179
            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":"Publications per project","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
180
            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":"Publications per project","subtitle":"","xaxistitle":"Project"}&w=91%&h=90%`),
181
            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%`),
182
            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":"Datasets through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83%`),
183
            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":"Datasets by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
184
            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":"Datasets per project","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
185
            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":"Datasets per project","subtitle":"","xaxistitle":"Project"}&w=91%&h=90%`),
184 186
            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%`),
185
            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%`),
186
            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%`),
187
            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%`),
188
            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%`),
187
            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":"Software through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83%`),
188
            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":"Software by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
189
            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":"Software per project","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
190
            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":"Software per project","subtitle":"","xaxistitle":"Project"}&w=91%&h=90%`),
189 191
            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%')
190 192
        };
191 193
    }
192 194

  
193 195

  
194 196
    onChangeEntity (entity: string) {
195
        this.displayedTimeline = `${entity}Timeline`;
196
        this.displayedTimelineUrl = this.chartsUrlMap[this.displayedTimeline];
197
        console.log(`displayed Timeline is: ${this.displayedTimeline}`);
198
        this.displayedGraph = `${entity}Graph`;
199
        this.displayedGraphUrl = this.chartsUrlMap[this.displayedGraph];
200
        console.log(`displayed Graph is: ${this.displayedGraph}`);
201
        let firstProjectChart = this.allowedCharts[entity].filter( x => x.includes(entity+'Project') );
202
        this.changeDisplayedProjectChart(firstProjectChart.shift());
203
        this.displayedEntity = entity;
204
        console.log(`displayed entity is ${entity}`);
197
      this.displayedEntity = entity;
198
      console.log(`displayed entity is ${entity}`);
199
      console.log(`statisticsSum[${entity}].total is ${this.statisticsSum[entity].total}`);
200

  
201
      if (this.statisticsSum[entity].total &&
202
          this.allowedEntities.filter(x => x == entity).length ) {
203

  
204
          console.log(`found ${entity} in allowedEntities`);
205
          this.displayedTimeline = `${entity}Timeline`;
206
          this.displayedTimelineUrl = this.chartsUrlMap[this.displayedTimeline];
207
          console.log(`displayed Timeline is: ${this.displayedTimeline}`);
208
          this.displayedGraph = `${entity}Graph`;
209
          this.displayedGraphUrl = this.chartsUrlMap[this.displayedGraph];
210
          console.log(`displayed Graph is: ${this.displayedGraph}`);
211
          if (this.allowedCharts[entity]) {
212
              let firstProjectChart = this.allowedCharts[entity].filter( x => x.includes(entity+'Project') );
213
              if (firstProjectChart[0]) {
214
                  this.changeDisplayedProjectChart(firstProjectChart[0]);
215
              } else {
216
                  this.displayedProjectChart = '';
217
                  this.displayedProjectChartUrl = '';
218
                  console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`);
219
              }
220
          }
221
      } else {
222
          this.displayedTimeline = '';
223
          this.displayedTimelineUrl = '';
224
          console.log(`displayed Timeline is: ${this.displayedTimeline}`);
225
          this.displayedGraph = '';
226
          this.displayedGraphUrl = '';
227
          console.log(`displayed Graph is: ${this.displayedGraph}`);
228
      }
205 229
    }
206 230

  
207 231
    changeDisplayedProjectChart(chartName: string) {
modules/uoa-connect-portal/trunk/src/app/statistics/statistics-for-dashboard.component.html
5 5
</div>
6 6
<div>
7 7
    <div *ngFor="let entity of allowedEntities">
8
        <div *ngIf="statisticsSum[entity].total">
8
        <div *ngIf="statisticsSum[entity].total>0">
9 9
            <div class="uk-text-uppercase uk-text-bold uk-heading-divider">
10 10
                <h3>{{ entity == 'software' ? getCamelCaseString(entity) : (entity == 'dataset'? 'Research Data' : getCamelCaseString(entity) + 's') }}</h3>
11
                <div class="uk-text-small">
11
<!--                <div class="uk-text-small">
12 12
                    <span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode]">
13 13
                        {{statisticsSum[entity].total}} {{ entity + (entity == 'software' ? '' : 's') }}
14 14
                    </span>
......
35 35
                        and {{statisticsSum[entity].embargo}}
36 36
                        {{statisticsSum[entity].embargo > 1 ? 'are' : 'is'}} still in embargo.
37 37
                    </span>
38
                </div>
38
                </div>-->
39 39
            </div>
40
            <div class="uk-grid">
40
            <div *ngIf="allowedCharts[entity]" class="uk-grid">
41 41
                <div *ngFor="let chart of allowedCharts[entity]" class="uk-width-1-2 uk-first-column">
42 42
                    <iframe [src]=chartsUrlMap[chart] width="750" height="450"></iframe>
43 43
                </div>
modules/uoa-connect-portal/trunk/src/app/statistics/statistics.component.html
3 3
    <div class="uk-container  uk-margin-bottom">
4 4

  
5 5
        <article class="uk-article ">
6
            <div *ngIf="!statisticsSum || !statisticsSum.total_projects" class="uk-alert uk-alert-info" style="margin-top:40px; padding-left:40px;">
6
            <div *ngIf="!statisticsSum || (statisticsSum.total_projects==0)" class="uk-alert uk-alert-info" style="margin-top:40px; padding-left:40px;">
7 7
                No statistics are available for {{ communityId.toUpperCase() }}
8 8
            </div>
9
            <div *ngIf="statisticsSum && statisticsSum.total_projects && statisticsDisplay && chartsUrlMap" class="uk-margin uk-margin-top">
9
            <div *ngIf="statisticsSum && (statisticsSum.total_projects>0) && statisticsDisplay && chartsUrlMap" class="uk-margin uk-margin-top">
10 10
                <div class="uk-grid">
11 11
                    <ul class="uk-tab uk-tab-left uk-width-1-6 uk-margin-top" data-uk-tab="{connect:'#tabs'}">
12 12
                        <li *ngFor="let entity of entitiesList"
......
18 18

  
19 19
                    <ul id="tabs" class="uk-switcher uk-margin uk-width-5-6" style="min-height:450px; padding-left:40px;">
20 20
                        <li *ngFor="let entity of entitiesList">
21
                            <div *ngIf="!statisticsSum[entity] ||
22
                                        !statisticsDisplay.entities[entity]"
23
                                 class="uk-alert uk-alert-info">
21 24

  
22
                            <div *ngIf="displayedEntity == entity && statisticsDisplay.entities[entity] && statisticsSum[entity]">
25
                                No {{ entity }}{{ entity == 'software' ? '' : 's' }} statistics available
26
                            </div>
27

  
28
                            <div *ngIf="(displayedEntity == entity) && statisticsSum[entity]">
23 29
                                <div class="uk-text-uppercase uk-text-bold uk-heading-divider">
24 30
                                    <h2>{{ getCamelCaseString(entity) }}{{ entity == 'software' ? '' : 's' }} statistics</h2>
25 31

  
26
                                    <div *ngIf="!statisticsSum[entity].total"
27
                                         class="uk-alert uk-alert-info">
28 32

  
29
                                        No {{ entity }}{{ entity == 'software' ? '' : 's' }} available
30
                                    </div>
31

  
32
                                    <div *ngIf="statisticsSum[entity].total"
33
                                         class="uk-text-small">
33
                                    <div *ngIf="statisticsDisplay.entities[entity]">
34 34
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode]">
35
                                            {{statisticsSum[entity].total}} {{ entity + (entity == 'software' ? '' : 's') }}
35
                                            {{statisticsSum[entity].total}} {{ entity + ( (entity == 'software' || statisticsSum[entity].total == 1) ? '' : 's') }}
36 36
                                        </span>
37
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode] &&
38
                                                     statisticsDisplay.entities[entity].numbers.map['project'][currentMode]">
39
                                             from
40
                                        </span>
37 41
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['project'][currentMode]">
38
                                            from {{statisticsSum[entity].projects}} projects.
42
                                            {{statisticsSum[entity].projects}} project{{ statisticsSum[entity].projects == 1 ? '' : 's' }}.
39 43
                                        </span><br>
40
                                        <span *ngIf="statisticsSum[entity].open_access &&
41
                                                     statisticsDisplay.entities[entity].numbers.map['open'][currentMode]">
44
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode]">
42 45
                                            {{statisticsSum[entity].open_access}}
43
                                            {{statisticsSum[entity].open_access > 1 ? 'are' : 'is'}} OA
46
                                            {{statisticsSum[entity].open_access == 1 ? 'is' : 'are'}} OA
44 47
                                        </span>
45
                                        <span *ngIf="statisticsSum[entity].closed_access &&
46
                                                     statisticsDisplay.entities[entity].numbers.map['closed'][currentMode]">,
48
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['closed'][currentMode]">
49

  
50
                                            <span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode]">
51
                                                ,
52
                                            </span>
53

  
47 54
                                            {{statisticsSum[entity].closed_access}}
48
                                            {{statisticsSum[entity].closed_access > 1 ? 'are' : 'is'}} closed
55
                                            {{statisticsSum[entity].closed_access == 1 ? 'is' : 'are'}} closed
49 56
                                        </span>
50
                                        <span *ngIf="statisticsSum[entity].restricted &&
51
                                                     statisticsDisplay.entities[entity].numbers.map['restricted'][currentMode]">,
57
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['restricted'][currentMode]">
58

  
59
                                            <span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode] ||
60
                                                         statisticsDisplay.entities[entity].numbers.map['closed'][currentMode]">
61
                                                ,
62
                                            </span>
63

  
52 64
                                            {{statisticsSum[entity].restricted}}
53
                                            {{statisticsSum[entity].restricted > 1 ? 'are' : 'is'}} restricted
65
                                            {{statisticsSum[entity].restricted == 1 ? 'is' : 'are'}} restricted
54 66
                                        </span>
55
                                        <span *ngIf="statisticsSum[entity].embargo &&
56
                                                     statisticsDisplay.entities[entity].numbers.map['embargo'][currentMode]">
57
                                            and {{statisticsSum[entity].embargo}}
58
                                            {{statisticsSum[entity].embargo > 1 ? 'are' : 'is'}} still in embargo.
67
                                        <span *ngIf="statisticsDisplay.entities[entity].numbers.map['embargo'][currentMode]">
68

  
69
                                            <span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode] ||
70
                                                         statisticsDisplay.entities[entity].numbers.map['closed'][currentMode] ||
71
                                                         statisticsDisplay.entities[entity].numbers.map['restricted'][currentMode]">
72
                                                 and
73
                                            </span>
74
                                            {{statisticsSum[entity].embargo}}
75
                                            {{statisticsSum[entity].embargo == 1 ? 'is' : 'are'}} still in embargo.
59 76
                                        </span>
60 77
                                    </div>
61 78
                                </div>
62
                                <div *ngIf="statisticsSum[entity].total">
79
                                <div *ngIf="statisticsSum[entity].total>0 && !allowedCharts[entity]"
80
                                     class="uk-alert uk-alert-info">
81
                                    No charts available
82
                                </div>
83
                                <div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity]">
63 84
                                    <div class="uk-grid">
64 85
                                        <div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] &&
65 86
                                                    statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] &&
......
76 97
                                    </div>
77 98
                                    <hr>
78 99
                                    <div>
79
                                        <h4 class="uk-text-uppercase uk-text-bold">{{ communityId }} {{ entity }}{{ entity == 'software' ? '' : 's' }} per project</h4>
100
                                        <h4 class="uk-text-uppercase uk-text-bold">{{ getCamelCaseString(entity) }}{{ entity == 'software' ? '' : 's' }} per project</h4>
80 101
                                    </div>
81 102
                                    <div>
82 103
                                        <ul class="uk-tab uk-margin-top" data-uk-tab="{connect: '#projectChartTabs'">
......
103 124
                                            </li>
104 125
                                        </ul>
105 126
                                        <ul id="projectChartTabs" class="uk-switcher uk-margin">
106
                                            <li>
127
                                            <li *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode]">
107 128
                                                <div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')">
108 129
                                                    <iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
109 130
                                                </div>
110 131
                                            </li>
111
                                            <li>
132
                                            <li *ngIf="statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode]">
112 133
                                                <div *ngIf="displayedProjectChart == (entity + 'Projectpie')">
113 134
                                                    <iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
114 135
                                                </div>
115 136
                                            </li>
116
                                            <li>
137
                                            <li *ngIf="statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
117 138
                                                <div *ngIf="displayedProjectChart == (entity + 'Projecttable')">
118 139
                                                    <iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
119 140
                                                </div>

Also available in: Unified diff