|
@@ -5,22 +5,48 @@ import {select} from 'd3';
|
|
|
import {SdmDihService} from '../sdm-dih.service';
|
|
import {SdmDihService} from '../sdm-dih.service';
|
|
|
import {YearGraphService} from './year-graph.service';
|
|
import {YearGraphService} from './year-graph.service';
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Universal component representing one disc in any disc-chart
|
|
|
|
|
+ */
|
|
|
@Component({
|
|
@Component({
|
|
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
|
selector: 'disc',
|
|
selector: 'disc',
|
|
|
templateUrl: 'disc.component.html',
|
|
templateUrl: 'disc.component.html',
|
|
|
})
|
|
})
|
|
|
export class DiscComponent implements OnInit, AfterViewInit {
|
|
export class DiscComponent implements OnInit, AfterViewInit {
|
|
|
- @Input() domain = 'baseline'; //TODO: useless? scenario is unique and contains domain per se
|
|
|
|
|
- @Input() factor = 'aggregated';
|
|
|
|
|
@Input() region: string;
|
|
@Input() region: string;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * TODO: useless? scenario is unique and contains domain per se
|
|
|
|
|
+ */
|
|
|
|
|
+ @Input() domain = 'baseline';
|
|
|
|
|
+ @Input() factor = 'aggregated';
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Switch whether the disc input properties shall be updated when new time is selected.
|
|
|
|
|
+ * Used for scenario comparison graphs.
|
|
|
|
|
+ */
|
|
|
|
|
+ @Input() inSitu = false;
|
|
|
@Input() scenario = 'baseline';
|
|
@Input() scenario = 'baseline';
|
|
|
@Input() show: 'name' | 'factor' | 'scenario' = 'name';
|
|
@Input() show: 'name' | 'factor' | 'scenario' = 'name';
|
|
|
- @Input() inSitu = false;
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * A unique ID for a DIV element in which the disc will be drawn.
|
|
|
|
|
+ * Constructed from [region, scenario, factor, nonce] tuple, where nonce is a random series of numbers
|
|
|
|
|
+ */
|
|
|
divId = 'graph-place';
|
|
divId = 'graph-place';
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Pointer to <use> SVG element of an arrow in this disc
|
|
|
|
|
+ */
|
|
|
private arrowUse;
|
|
private arrowUse;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Attractiveness data about a region this disc represents
|
|
|
|
|
+ */
|
|
|
private regionData;
|
|
private regionData;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Pointer to <g> SVG element of the main area of this disc
|
|
|
|
|
+ */
|
|
|
private svgContent;
|
|
private svgContent;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Pointer to <text> SVG element of the text above this disc
|
|
|
|
|
+ */
|
|
|
private svgContentText;
|
|
private svgContentText;
|
|
|
|
|
|
|
|
constructor(
|
|
constructor(
|