|
@@ -15,7 +15,7 @@ export class DiscComponent implements OnInit, AfterViewInit {
|
|
|
@Input() factor = 'aggregated';
|
|
@Input() factor = 'aggregated';
|
|
|
@Input() region: string;
|
|
@Input() region: string;
|
|
|
@Input() scenario = 'baseline';
|
|
@Input() scenario = 'baseline';
|
|
|
- @Input() show: 'name' | 'factor' = 'name';
|
|
|
|
|
|
|
+ @Input() show: 'name' | 'factor' | 'scenario' = 'name';
|
|
|
divId = 'graph-place';
|
|
divId = 'graph-place';
|
|
|
private arrowUse;
|
|
private arrowUse;
|
|
|
private regionData;
|
|
private regionData;
|
|
@@ -120,11 +120,17 @@ export class DiscComponent implements OnInit, AfterViewInit {
|
|
|
.attr('x', 0)
|
|
.attr('x', 0)
|
|
|
.attr('y', -60)
|
|
.attr('y', -60)
|
|
|
.attr('dy', '.35em')
|
|
.attr('dy', '.35em')
|
|
|
- .text((d) =>
|
|
|
|
|
- this.show == 'name'
|
|
|
|
|
- ? d['MODEL']
|
|
|
|
|
- : this.factor.split('/').slice(-1).pop()
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ .text((d) => {
|
|
|
|
|
+ switch (this.show) {
|
|
|
|
|
+ case 'factor':
|
|
|
|
|
+ return this.factor.split('/').pop();
|
|
|
|
|
+ case 'scenario':
|
|
|
|
|
+ return this.scenario;
|
|
|
|
|
+ case 'name':
|
|
|
|
|
+ default:
|
|
|
|
|
+ return d['MODEL'];
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
.style('text-anchor', 'middle');
|
|
.style('text-anchor', 'middle');
|
|
|
this.svgContentText = this.svgContent.append('text');
|
|
this.svgContentText = this.svgContent.append('text');
|
|
|
this.svgContentText
|
|
this.svgContentText
|