(private datasource: GraphDataSource)
| 82 | } |
| 83 | |
| 84 | constructor(private datasource: GraphDataSource) { |
| 85 | const wrapper = d3.select('.graph-container').append('div').attr('class', 'graph-wrapper'); |
| 86 | wrapper.append('h3').text('Program Stats'); |
| 87 | |
| 88 | this.svg = wrapper.append('svg') |
| 89 | .attr('width', this.width + this.margins.left + this.margins.right) |
| 90 | .attr('height', this.height + this.margins.top + this.margins.bottom); |
| 91 | this.g = this.svg.append('g').attr('transform', `translate(${(this.height / 2) + this.margins.left}, ${(this.height / 2) + this.margins.top})`); |
| 92 | this.legend = this.svg.append('g').attr('transform', `translate(${this.height + this.margins.left + 40}, ${this.margins.top})`); |
| 93 | |
| 94 | this.pie = d3.pie<FunctionStat>().sort(null).value((d) => d.count); |
| 95 | |
| 96 | const radius = this.height / 2; |
| 97 | |
| 98 | this.path = d3.arc() |
| 99 | .outerRadius(radius) |
| 100 | .innerRadius(0); |
| 101 | |
| 102 | window.requestAnimationFrame(this.updateGraph.bind(this)); |
| 103 | } |
| 104 | |
| 105 | public updateGraph() { |
| 106 | if (!this.stopped) { |
nothing calls this directly
no test coverage detected