Skip to content

Conversation

@gottaegbert
Copy link
Owner

No description provided.

@vercel
Copy link

vercel bot commented May 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
whothree_collection ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 4, 2025 3:21am

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Pie Chart Data Update Loop and Negative Values

The useEffect hook for updating pie chart data creates an infinite re-render loop. It includes data in its dependency array but also modifies data within the effect, leading to multiple concurrent update intervals and erratic data changes. The data dependency should be removed. Furthermore, the data adjustment logic to ensure the total sum is 100 can result in negative values for the first data item if rounding causes the sum to exceed 100, which is invalid for a pie chart.

src/app/(demo)/datavisbochu/components/d3-pie-chart.tsx#L31-L59

// 随机更新数据
useEffect(() => {
if (paused) return;
const interval = setInterval(() => {
const newData = [...data];
// 随机更新数据
newData.forEach((item) => {
item.value = Math.max(
10,
Math.min(50, item.value + Math.floor(Math.random() * 5) - 2),
);
});
// 确保总和为100
const total = newData.reduce((sum, item) => sum + item.value, 0);
newData.forEach((item) => {
item.value = Math.round((item.value / total) * 100);
});
// 调整,确保总和为100
const finalTotal = newData.reduce((sum, item) => sum + item.value, 0);
if (finalTotal !== 100) {
newData[0].value += 100 - finalTotal;
}
setData([...newData]);
}, 5000);
return () => clearInterval(interval);
}, [paused, data]);

Fix in CursorFix in Web


Bug: Incorrect CSS Property for Pie Chart Segments

The clipPath CSS property in the PieChart component is incorrectly assigned a conic-gradient value. clipPath only accepts shape functions (e.g., polygon(), circle()) for clipping, not gradients. This will not work as intended for creating pie chart segments; the conic-gradient should be applied to the background property instead.

src/app/(demo)/datavisbochu/components/charts.tsx#L225-L229

<motion.div
className={`absolute inset-0 ${colors[index % colors.length]}`}
style={{
clipPath: `conic-gradient(from ${startAngle}deg, currentColor ${angle}deg, transparent ${angle}deg)`,
}}

Fix in CursorFix in Web


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $0.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants