Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const close = d => d.close;
// scales
const xScale = scaleTime({
range: [0, Math.PI * 2],
domain: extent(appleStock, date),
});
const yScale = scaleLog({
domain: extent(appleStock, close),
});
const angle = d => xScale(date(d));
const radius = d => yScale(close(d));
const firstPoint = appleStock[0];
const lastPoint = appleStock[appleStock.length - 1];
export default ({ width, height }) => {
if (width < 10) return null;
yScale.range([0, height / 2 - 20]);
return (
<svg height="{height}" width="{width}">
<linearGradient id="line-gradient"></linearGradient>
<rect rx="{14}" fill="{bg}" height="{height}" width="{width}"></rect>
{yScale.ticks().map((tick, i) => {
const y = yScale(tick);
const opacity = 1 / (i + 1) - (1 / i) * 0.2;
return (
<g></g></svg>