@angularai/analytics
v0.0.3
Published
<div align="center"> <h1>@angularai/analytics</h1> <p>π AI-powered analytics and insights for Angular applications</p>
Downloads
337
Readme
Overview
@angularai/analytics provides AI-powered analytics components and services for Angular applications. Track user behavior, analyze patterns, and gain insights with intelligent data visualization.
β¨ Features
- π Smart Analytics: AI-powered data analysis and pattern recognition
- π Interactive Dashboards: Beautiful, responsive analytics dashboards
- π Trend Detection: Automatic trend and anomaly detection
- π± Real-time Updates: Live data streaming with RxJS
- π¨ Customizable Charts: Flexible chart components with theming support
- π§ Fully Typed: Complete TypeScript support
π¦ Installation
npm install @angularai/analytics @angularai/coreπ Quick Start
1. Import the Module
import { Component } from '@angular/core';
import { AnalyticsDashboardComponent } from '@angularai/analytics';
@Component({
selector: 'app-analytics',
standalone: true,
imports: [AnalyticsDashboardComponent],
template: `
<analytics-dashboard
[data]="analyticsData"
[config]="dashboardConfig"
/>
`
})
export class AnalyticsComponent {
analyticsData = {
pageViews: 15420,
uniqueVisitors: 8234,
bounceRate: 42.5,
avgSessionDuration: 185
};
dashboardConfig = {
theme: 'light',
refreshInterval: 30000
};
}2. Use the Analytics Service
import { Component, inject } from '@angular/core';
import { AnalyticsService } from '@angularai/analytics';
@Component({ ... })
export class TrackingComponent {
private analytics = inject(AnalyticsService);
trackEvent(eventName: string, data: any) {
this.analytics.track(eventName, data);
}
getInsights() {
this.analytics.getInsights().subscribe(insights => {
console.log('AI Insights:', insights);
});
}
}π API Reference
AnalyticsService
@Injectable({ providedIn: 'root' })
export class AnalyticsService {
// Track an event
track(eventName: string, data?: any): void;
// Get AI-powered insights
getInsights(): Observable<Insight[]>;
// Get trend analysis
analyzeTrends(data: DataPoint[]): Observable<TrendAnalysis>;
// Detect anomalies
detectAnomalies(data: DataPoint[]): Observable<Anomaly[]>;
}AnalyticsDashboardComponent
Inputs
| Input | Type | Default | Description |
|-------|------|---------|-------------|
| data | AnalyticsData | {} | Analytics data to display |
| config | DashboardConfig | {} | Dashboard configuration |
| theme | 'light' \| 'dark' | 'light' | Color theme |
| refreshInterval | number | 0 | Auto-refresh interval (ms) |
π¦ Related Packages
| Package | Description | |---------|-------------| | @angularai/core | Core AI functionality | | @angularai/chatbot | AI chat components | | @angularai/smart-datatable | AI data tables |
π Related Projects
| Framework | Repository | Status | |-----------|-----------|--------| | Vue.js | @aivue | β Available | | React | @anthropic-ai/react | β Available | | Angular | @angularai | β Available | | Svelte | @svelteai | π‘ Planned |
π License
MIT Β© AngularAI
