Skip to content

Instantly share code, notes, and snippets.

View random82's full-sized avatar

Dominik Raniszewski random82

View GitHub Profile
@random82
random82 / histogram.component.ts
Created April 25, 2017 11:03
Drawing histogram using D3 in Angular2
import { Component, OnInit, ElementRef } from '@angular/core';
import { select } from 'd3-selection';
import { scaleLinear } from 'd3-scale';
import { range, histogram, max } from 'd3-array';
import { format } from 'd3-format';
import { randomBates } from 'd3-random';
import { axisBottom } from 'd3-axis';
@Component({
selector:'histogram',