// In an app: import { setupStockCard } from '@aparte/plugin-cards/stock';
const { setupStockCard } = window.apartePlugins.cards.stock;
// A month of made-up daily candles.
const candles = Array.from({ length: 30 }, (_, i) => {
const open = 170 + Math.sin(i / 3) * 6 + i * 0.4;
const close = open + Math.sin(i * 1.7) * 3;
return { time: Date.now() - (30 - i) * 86400000, open, close,
high: Math.max(open, close) + 1 + (i % 3), low: Math.min(open, close) - 1 - (i % 2) };
});
setupStockCard({ tool: 'get_quote', variant: 'candles' });
document.querySelector('aparte-chat-bubble').setSegments([{
id: 's1', type: 'tool_call', status: 'resolved',
toolCall: { id: 'c-s1', name: 'get_quote', input: { symbol: 'ACME', range: '1M' } },
structuredResult: { symbol: 'ACME', name: 'Acme Corp.', exchange: 'NASDAQ', currency: 'USD', range: '1M', candles },
}]);