Created
August 21, 2017 20:45
-
-
Save AlexPikalov/2b1e6fd67bb6042cbf0caf95da546693 to your computer and use it in GitHub Desktop.
d3-old-way.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'chart', | |
template: '<svg></svg>' | |
}) | |
class ChartComponent implements OnInit { | |
constructor(private el: ElementRef) {} | |
ngOnInit() { | |
const svg = d3.select(this.el.nativeElement) | |
.attr('width', '480px') | |
.attr('height', '480px'); | |
// update svg, add new elements etc. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment