Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
index = i;
}
}
if (max > threshold) {
const list1 = DouglasPeucker(points.slice(0, index + 1), threshold);
const list2 = DouglasPeucker(points.slice(index, points.length), threshold);
result = list1.concat(list2);
} else {
result = [points[0], points[points.length - 1]];
}
return result;
}
const theme = getTheme('default');
describe('mini line shape', () => {
const canvasDiv = document.createElement('div');
canvasDiv.style.width = '200px';
canvasDiv.style.height = '100px';
canvasDiv.id = 'canvas';
document.body.appendChild(canvasDiv);
const canvas = new Canvas({
containerDOM: canvasDiv,
width: 200,
height: 100,
});
it('test', () => {
const plot = new G2.View({
canvas,
container: canvas.addGroup(),
autoFit: true,
height: 500,
});
chart.data(data);
chart.coordinate('polar', {
innerRadius: 0.2,
});
chart.legend('year', {
position: 'right',
offsetX: -100,
});
chart.axis(false);
chart
.interval()
.position('year*population')
.color('year', getTheme().colors_20)
.style({
lineWidth: 1,
stroke: '#fff',
});
chart.render();
const chart = new Chart({
container: 'container',
autoFit: true,
height: 500,
});
chart.data(data);
chart.coordinate('polar');
chart.legend('year', {
position: 'right',
});
chart.axis(false);
chart
.interval()
.position('year*population')
.color('year', getTheme().colors_20)
.style({
lineWidth: 1,
stroke: '#fff',
});
chart.render();