Revision 58912
Added by Stefania Martziou almost 4 years ago
data-handler.service.ts | ||
---|---|---|
9 | 9 |
CountryPageOverviewData |
10 | 10 |
} from '../domain/overview-map-data'; |
11 | 11 |
import {Indicator} from '../domain/overview-data'; |
12 |
import {TreemapHighchartsData} from '../domain/treemap-highcharts-data'; |
|
12 | 13 |
|
13 | 14 |
@Injectable () |
14 | 15 |
export class DataHandlerService { |
... | ... | |
699 | 700 |
return countryPageOverviewData; |
700 | 701 |
} |
701 | 702 |
|
703 |
public convertRawDataToTreemapHighchartsData(rawData: RawData) { |
|
704 |
|
|
705 |
const treeMapData: TreemapHighchartsData[] = []; |
|
706 |
|
|
707 |
for (const series of rawData.datasets) { |
|
708 |
if (series.series.query.name === 'new.oso.funders.results') { |
|
709 |
|
|
710 |
// let index = 1; |
|
711 |
for (const rowResult of series.series.result) { |
|
712 |
|
|
713 |
const treeMapItemData: TreemapHighchartsData = new TreemapHighchartsData(); |
|
714 |
treeMapItemData.name = rowResult.row[1]; |
|
715 |
treeMapItemData.value = Number(rowResult.row[0]); |
|
716 |
treeMapItemData.colorValue = Number(rowResult.row[0]); |
|
717 |
// treeMapItemData.colorValue = index; |
|
718 |
|
|
719 |
treeMapData.push(treeMapItemData); |
|
720 |
|
|
721 |
// index = index + 1; |
|
722 |
} |
|
723 |
} |
|
724 |
} |
|
725 |
|
|
726 |
return treeMapData; |
|
727 |
} |
|
728 |
|
|
702 | 729 |
private rawResultToCountryMapData(result: Row[]) { |
703 | 730 |
|
704 | 731 |
const entityMapData: CountryMapData[] = []; |
Also available in: Unified diff
Working on the new version of the oso - started incorporating charts and created a treemap highcharts component