Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/components/chart/useInsightYears.ts from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 662 Bytes
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/components/chart/useInsightYears.ts
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/components/chart/useInsightYears.ts
-
curl -L -o useInsightYears.ts https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/components/chart/useInsightYears.ts
662 Bytes
| import { useMemo } from 'react' | |
| import { useTopicTimeline } from '../stance/TimelineChart' | |
| import type { InsightYear } from '../../utils/chartInsight' | |
| /** The topic's real meetings per year in the scope, for a takeaway title (#1409); undefined while loading or unavailable. */ | |
| export function useInsightYears(topicSlug: string | undefined, stateCode?: string, city?: string | null): InsightYear[] | undefined { | |
| const q = useTopicTimeline(topicSlug ?? '', stateCode, city, Boolean(topicSlug)) | |
| return useMemo( | |
| () => q.data?.years.map((y) => ({ year: y.year, meetings: y.meetings, share: y.share, recorded: y.all_recorded_meetings })), | |
| [q.data], | |
| ) | |
| } | |