@@ -705,58 +705,6 @@ export class LineChartService {
705705 } )
706706 }
707707
708- // private addBrush(chart: D3Selection<D3BaseType, {}, D3ContainerElement, {}>,
709- // xScale: D3ScaleTime<number, number>,
710- // yScale: D3ScaleLinear<number, number>,
711- // data: TimeSeries[]): void {
712- // chart.selectAll('.brush')
713- // .remove();
714- // this.brush.on('end', () => this.updateChart(chart, xScale, yScale));
715- // chart.append('g')
716- // .attr('class', 'brush')
717- // .data([1])
718- // .call(this.brush)
719- // .on('dblclick', () => {
720- // xScale.domain([this.getMinDate(data), this.getMaxDate(data)]);
721- // this.resetChart(xScale, yScale);
722- // });
723- // }
724- //
725- // private resetChart(xScale: D3ScaleTime<number, number>, yScale: D3ScaleLinear<number, number>) {
726- // d3Select('.x-axis').transition().call(this.updateXAxis, xScale);
727- // d3Select('g#time-series-chart-drawing-area').selectAll('.line')
728- // .each((data, index, nodes) => {
729- // d3Select(nodes[index])
730- // .attr('d', (dataItem: TimeSeries) => this.getLineGenerator(xScale, yScale)(dataItem.values));
731- // })
732- // }
733- //
734- // private updateChart(selection: any, xScale: D3ScaleTime<number, number>, yScale: D3ScaleLinear<number, number>) {
735- // // selected boundaries
736- // let extent = d3Event.selection;
737- // // If no selection, back to initial coordinate. Otherwise, update X axis domain
738- // if (!extent) {
739- // return
740- // } else {
741- // let minDate = xScale.invert(extent[0]);
742- // let maxDate = xScale.invert(extent[1]);
743- // xScale.domain([minDate, maxDate]);
744- // selection.select(".brush").call(this.brush.move, null); // This remove the grey brush area
745- // d3Select('.x-axis').transition().call(this.updateXAxis, xScale);
746- // selection.selectAll('.line').each((_, index, nodes) => {
747- // d3Select(nodes[index])
748- // .transition()
749- // .attr('d', (dataItem: TimeSeries) => {
750- // let newDataValues = dataItem.values.filter((point) => {
751- // return point.date <= maxDate && point.date >= minDate;
752- // });
753- // return this.getLineGenerator(xScale, yScale)(newDataValues);
754- // })
755- // }
756- // )
757- // }
758- // }
759-
760708 private drawLine ( selection : any ,
761709 xScale : D3ScaleTime < number , number > ,
762710 yScale : D3ScaleLinear < number , number > ) : D3Selection < D3BaseType , TimeSeries , D3BaseType , { } > {
0 commit comments