Explorar el Código

📝 improve disc component docs

jmacura hace 3 años
padre
commit
2e66c7c356
Se han modificado 1 ficheros con 29 adiciones y 3 borrados
  1. 29 3
      src/app/discs-chart/disc.component.ts

+ 29 - 3
src/app/discs-chart/disc.component.ts

@@ -5,22 +5,48 @@ import {select} from 'd3';
 import {SdmDihService} from '../sdm-dih.service';
 import {YearGraphService} from './year-graph.service';
 
+/**
+ * Universal component representing one disc in any disc-chart
+ */
 @Component({
   // eslint-disable-next-line @angular-eslint/component-selector
   selector: 'disc',
   templateUrl: 'disc.component.html',
 })
 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;
+  /**
+   * 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() 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';
+  /**
+   * Pointer to <use> SVG element of an arrow in this disc
+   */
   private arrowUse;
+  /**
+   * Attractiveness data about a region this disc represents
+   */
   private regionData;
+  /**
+   * Pointer to <g> SVG element of the main area of this disc
+   */
   private svgContent;
+  /**
+   * Pointer to <text> SVG element of the text above this disc
+   */
   private svgContentText;
 
   constructor(