Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
import { type ChartConfig, numericTick } from '@/components/ui/chart';
import { accountLabel } from '@/lib/analyticsAccounts';
import { accountColor } from '@/lib/analyticsColors';
import { distinctCountLabels } from '@/lib/utils';
import type { AccountIdentityData } from '@/types/analytics';
export const socialAccountChartConfig = (
accounts: AccountIdentityData[],
colors: Record<string, string>,
): ChartConfig =>
Object.fromEntries(
accounts.map((account, index) => {
const label = accountLabel(account);
return [
`account_${index}`,
{
label,
color:
colors[account.social_account_key] ??
accountColor(index),
avatar: {
platform: account.platform,
name: label,
src: account.avatar_url,
verified: account.verified_badge ?? null,
},
},
];
}),
);
/** A count axis' tick, compact but never like its neighbours: close values (9,990 to 10,010) keep the decimals that tell them apart. */
export const formatCountTick = numericTick(
(_tick, index, ticks): string => distinctCountLabels(ticks)[index] ?? '',
);