update chart animation

This commit is contained in:
Nate Kelley 2025-05-29 16:10:19 -06:00
parent 1355077026
commit 387508ee33
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 5 additions and 5 deletions

View File

@ -190,7 +190,7 @@ export const BusterChartJSComponent = React.memo(
const updateMode = useMemoizedFn((params: { datasetIndex: number }): UpdateMode => {
if (!ref) return 'default';
const areLabelsChanged = previousData?.labels !== data.labels;
if (areLabelsChanged) return 'none'; //this will disable animation
if (areLabelsChanged) return 'default'; //this will disable animation - this was 'none', I am not sure why...
return 'default';
});

View File

@ -26,7 +26,6 @@ export const ChartMountedPlugin: Plugin<ChartType, ChartMountedPluginOptions> =
afterRender: (chart, args, options) => {
if (chart.$initialAnimationCompleted === undefined) {
chart.$initialAnimationCompleted = true;
// chart.update();
}
if (chart.$mountedPlugin || !chart || !options) return;

View File

@ -12,7 +12,8 @@ export const ThemeColorDots: React.FC<{
<div className="flex shrink-0 items-center gap-0">
{colors.slice(0, numberOfColorsToShow).map((color, colorIdx) => (
<div
key={color}
// biome-ignore lint/suspicious/noArrayIndexKey: we need to use the index to force a re-render
key={color + colorIdx}
className={cn(
'ball rounded-full',
colorIdx > 0 && '-ml-0.5 h-2 w-2 shadow-[0_0_0_0.75px]',

View File

@ -165,7 +165,7 @@ const useCollectionSelectMenu = ({ dashboardId }: { dashboardId: string }) => {
openInfoMessage('Dashboard removed from collections');
});
const { modal, ...dropdownProps } = useSaveToCollectionsDropdownContent({
const { ModalComponent, ...dropdownProps } = useSaveToCollectionsDropdownContent({
onSaveToCollection,
onRemoveFromCollection,
selectedCollections
@ -182,7 +182,7 @@ const useCollectionSelectMenu = ({ dashboardId }: { dashboardId: string }) => {
icon: <ASSET_ICONS.collectionAdd />,
items: [
<React.Fragment key="collection-sub-menu">
{collectionSubMenu} {modal}
{collectionSubMenu} {ModalComponent}
</React.Fragment>
]
}),