chore(frontend): add extra types to frontend
This commit is contained in:
@@ -10,12 +10,6 @@ type FrequencyWord = {
|
|||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
type AverageEmotionByTopic = {
|
|
||||||
topic: string;
|
|
||||||
n: number;
|
|
||||||
[emotion: string]: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Vocab = {
|
type Vocab = {
|
||||||
author: string;
|
author: string;
|
||||||
events: number;
|
events: number;
|
||||||
@@ -58,13 +52,25 @@ type HeatmapCell = {
|
|||||||
type TimeAnalysisResponse = {
|
type TimeAnalysisResponse = {
|
||||||
events_per_day: EventsPerDay[];
|
events_per_day: EventsPerDay[];
|
||||||
weekday_hour_heatmap: HeatmapCell[];
|
weekday_hour_heatmap: HeatmapCell[];
|
||||||
burstiness: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content Analysis
|
// Content Analysis
|
||||||
|
type NGram = {
|
||||||
|
count: number;
|
||||||
|
ngram: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type AverageEmotionByTopic = {
|
||||||
|
topic: string;
|
||||||
|
n: number;
|
||||||
|
[emotion: string]: string | number;
|
||||||
|
}
|
||||||
|
|
||||||
type ContentAnalysisResponse = {
|
type ContentAnalysisResponse = {
|
||||||
word_frequencies: FrequencyWord[];
|
word_frequencies: FrequencyWord[];
|
||||||
average_emotion_by_topic: AverageEmotionByTopic[];
|
average_emotion_by_topic: AverageEmotionByTopic[];
|
||||||
|
common_three_phrases: NGram[];
|
||||||
|
common_two_phrases: NGram[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Summary
|
// Summary
|
||||||
|
|||||||
@@ -108,9 +108,7 @@ class StatGen:
|
|||||||
return {
|
return {
|
||||||
"top_users": self.interaction_analysis.top_users(filtered_df),
|
"top_users": self.interaction_analysis.top_users(filtered_df),
|
||||||
"users": self.interaction_analysis.per_user_analysis(filtered_df),
|
"users": self.interaction_analysis.per_user_analysis(filtered_df),
|
||||||
"interaction_graph": self.interaction_analysis.interaction_graph(
|
"interaction_graph": self.interaction_analysis.interaction_graph(filtered_df)
|
||||||
filtered_df
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_interactional_analysis(self, df: pd.DataFrame, filters: dict | None = None) -> dict:
|
def get_interactional_analysis(self, df: pd.DataFrame, filters: dict | None = None) -> dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user