mirror of https://github.com/buster-so/buster.git
update chart animation
This commit is contained in:
parent
1355077026
commit
387508ee33
|
@ -190,7 +190,7 @@ export const BusterChartJSComponent = React.memo(
|
||||||
const updateMode = useMemoizedFn((params: { datasetIndex: number }): UpdateMode => {
|
const updateMode = useMemoizedFn((params: { datasetIndex: number }): UpdateMode => {
|
||||||
if (!ref) return 'default';
|
if (!ref) return 'default';
|
||||||
const areLabelsChanged = previousData?.labels !== data.labels;
|
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';
|
return 'default';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ export const ChartMountedPlugin: Plugin<ChartType, ChartMountedPluginOptions> =
|
||||||
afterRender: (chart, args, options) => {
|
afterRender: (chart, args, options) => {
|
||||||
if (chart.$initialAnimationCompleted === undefined) {
|
if (chart.$initialAnimationCompleted === undefined) {
|
||||||
chart.$initialAnimationCompleted = true;
|
chart.$initialAnimationCompleted = true;
|
||||||
// chart.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chart.$mountedPlugin || !chart || !options) return;
|
if (chart.$mountedPlugin || !chart || !options) return;
|
||||||
|
|
|
@ -12,7 +12,8 @@ export const ThemeColorDots: React.FC<{
|
||||||
<div className="flex shrink-0 items-center gap-0">
|
<div className="flex shrink-0 items-center gap-0">
|
||||||
{colors.slice(0, numberOfColorsToShow).map((color, colorIdx) => (
|
{colors.slice(0, numberOfColorsToShow).map((color, colorIdx) => (
|
||||||
<div
|
<div
|
||||||
key={color}
|
// biome-ignore lint/suspicious/noArrayIndexKey: we need to use the index to force a re-render
|
||||||
|
key={color + colorIdx}
|
||||||
className={cn(
|
className={cn(
|
||||||
'ball rounded-full',
|
'ball rounded-full',
|
||||||
colorIdx > 0 && '-ml-0.5 h-2 w-2 shadow-[0_0_0_0.75px]',
|
colorIdx > 0 && '-ml-0.5 h-2 w-2 shadow-[0_0_0_0.75px]',
|
||||||
|
|
|
@ -165,7 +165,7 @@ const useCollectionSelectMenu = ({ dashboardId }: { dashboardId: string }) => {
|
||||||
openInfoMessage('Dashboard removed from collections');
|
openInfoMessage('Dashboard removed from collections');
|
||||||
});
|
});
|
||||||
|
|
||||||
const { modal, ...dropdownProps } = useSaveToCollectionsDropdownContent({
|
const { ModalComponent, ...dropdownProps } = useSaveToCollectionsDropdownContent({
|
||||||
onSaveToCollection,
|
onSaveToCollection,
|
||||||
onRemoveFromCollection,
|
onRemoveFromCollection,
|
||||||
selectedCollections
|
selectedCollections
|
||||||
|
@ -182,7 +182,7 @@ const useCollectionSelectMenu = ({ dashboardId }: { dashboardId: string }) => {
|
||||||
icon: <ASSET_ICONS.collectionAdd />,
|
icon: <ASSET_ICONS.collectionAdd />,
|
||||||
items: [
|
items: [
|
||||||
<React.Fragment key="collection-sub-menu">
|
<React.Fragment key="collection-sub-menu">
|
||||||
{collectionSubMenu} {modal}
|
{collectionSubMenu} {ModalComponent}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue