feat(Chart): new component - #7022
benjamincanac wants to merge 11 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Merging this PR will improve performance by 11.39%
Performance Changes
Tip Curious why performance improved? Comment Comparing |
commit: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔗 Linked issue
❓ Type of change
📚 Description
Exploration of a
UChartcomponent built on TanStack Charts. This is a prototype to evaluate the library, not a commitment to ship it in v4. TanStack Charts is still alpha (0.18.0, pinned in the catalog) and its API can change between minor releases.@tanstack/chartsis an optional peer dependency (^0.18.0), so only apps usingUChartinstall it. On a 0.x release the caret stays within0.18.x, each alpha minor is a deliberate bump.typeisline,area,barordonut, withstacked,curve(linear,monotone,step),points,grid,x-axis,y-axis,legend,format,thicknessandheightprops. A#centerslot places content inside the donut.colorstakes theme colors or any CSS color. They are set as--ts-chart-Nvariables on the root, so charts follow the theme and color mode without rebuilding the definition.definitionaccepts a full TanStack chart definition as an escape hatch. The#tooltipslot forwards to TanStack's#tooltipBody.ChartCurveinterface inutils/chart.ts(monotone is the same Fritsch–Carlson math as d3'scurveMonotoneX), which avoids addingd3-shapeas a second peer.UChartinstead of fake bars and aconic-gradientring.Findings so far:
heightas a unitless number on the host, which the browser drops. Worked around with an explicitpxstyle.class/style, so the component needs its own root element fordata-slot.donuttype from@tanstack/charts/polar. Loading that part throughdefineAsyncComponentworks with SSR and hydration, but it's left eager for the prototype.📝 Checklist