_depthScale(depth) { return d3 .scaleOrdinal() .domain([0, 1, 2]) .range(d3.schemeCategory10)(depth); }
constructor() { super() this.state = { circles: [] }; this.color = d3.scaleOrdinal(d3.schemeCategory10); this.calculateCircles.bind(this); this.renderCircle.bind(this); }
const AnimatedPiechart = ({ x, y, r, data }) => { let pie = d3.pie() .value((d) => d.value)(data) .sort((a, b) => d3.ascending(a.data.i, b.data.i)), translate = `translate(${x}, ${y})`, colors = d3.scaleOrdinal(d3.schemeCategory10); return ( <g transform={translate}> {pie.map((d, i) => ( <Arc key={`arc-${i}`} data={d} innerRadius="0" outerRadius={r} color={colors(d.data.i)} /> ))} </g> ); }
render(){ const {x,y,r,data} = this.props; let pie = d3.pie() .value((d)=>(d.value))(data) .sort((a,b)=>d3.ascending(a.data.i,b.data.i)); let translate = `translate(${x},${y})`; let colors = d3.scaleOrdinal(d3.schemeCategory10); return ( <g transform={translate}> { pie.map((d,i)=>( <Arc key={i} data={d} innerRadius="0" outerRadius={r} color={colors(d.data.i)}/> )) } </g> ); }
const Pie = ({data, innerRadius, outerRadius, padAngle, valueMap}) => { const colors = d3.schemeCategory10;
function ordinalScales() { const data = d3.range(30); const colors = d3.scaleOrdinal(d3.schemeCategory10); const points = d3.scalePoint() .domain(data)
this.ref = ref; this.format = d3.format('.2f'); this.colors = d3.scaleOrdinal(d3.schemeCategory10); this.createPie = d3 .pie()
.range(d3.schemeCategory10.map((c) => { c = d3.rgb(c); c.opacity = 0.6;
.range([innerHeight, 0]); const color = d3.scaleOrdinal(d3.schemeCategory10);
const h = props.height; const color = d3.scaleOrdinal(d3.schemeCategory10);
.range([innerHeight, 0]); const z = d3.scaleOrdinal(d3.schemeCategory10) .domain(keys);
_depthScale(depth) { return d3 .scaleOrdinal() .domain([0, 1, 2]) .range(d3.schemeCategory10)(depth); }
_colorScale(movie) { return d3 .scaleOrdinal() .domain(['movie1', 'movie2', 'movie3', 'movie4', 'movie5', 'movie6']) .range(d3.schemeCategory10)(movie); }
_colorScale(movie) { return d3 .scaleOrdinal() .domain(['movie1', 'movie2', 'movie3', 'movie4', 'movie5', 'movie6']) .range(d3.schemeCategory10)(movie); }
_depthScale(depth) { return d3 .scaleOrdinal() .domain([0, 1, 2]) .range(d3.schemeCategory10)(depth); }