-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
52,493 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ staticfiles/ | |
# Ignore digital_meal folder | ||
digital_meal/ | ||
|
||
*/temp | ||
temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 3.2.17 on 2024-08-30 13:29 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='InstagramStatistics', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=30)), | ||
('follow_counts', models.JSONField(default=None, null=True)), | ||
('biodiversity_counts', models.JSONField(default=None, null=True)), | ||
('pension_counts', models.JSONField(default=None, null=True)), | ||
('party_counts', models.JSONField(default=None, null=True)), | ||
('social_media_use', models.JSONField()), | ||
('last_updated', models.DateTimeField(blank=True, null=True)), | ||
('project_pk', models.IntegerField(default=0)), | ||
], | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
reports/migrations/0002_alter_instagramstatistics_social_media_use.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.17 on 2024-08-30 13:31 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('reports', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='instagramstatistics', | ||
name='social_media_use', | ||
field=models.JSONField(default=None, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
from bokeh.embed import components | ||
from bokeh.plotting import figure | ||
|
||
|
||
FIRE_PALETTE = ['#de0c1c', '#fe2d2d', '#fb7830', '#fecf02'] #, '#ffeea3'] | ||
|
||
|
||
def get_language_plot(data, bar_color='#000'): | ||
""" | ||
data = {'posemo': 2.060499780797895, 'negemo': 0.7452871547566856, 'anx': 0.131521262604121, | ||
'anger': 0.08768084173608066, 'sad': 0.5260850504164841, 'social': 3.9017974572555874, | ||
'cogproc': 9.294169224024545, 'bio': 0.7891275756247259, 'body': 0.08768084173608066}, | ||
""" | ||
original_categories = ['posemo', 'negemo', 'anx', 'anger', 'sad'] #, 'social', 'cogproc', 'bio', 'body'] | ||
new_names = { | ||
'posemo': 'Positive Emotionen', | ||
'negemo': 'Negative Emotionen', | ||
'anx': 'Angst', | ||
'anger': 'Wut', | ||
'sad': 'Traurigkeit', | ||
'social': 'Sozial (?)', | ||
'cogproc': 'Kognitive Prozesse (?)', | ||
'bio': 'Physisch (?)', | ||
'body': 'Körper (?)' | ||
} | ||
|
||
categories = [new_names[c] for c in original_categories] | ||
values = [data[c] for c in original_categories] | ||
|
||
p = figure(x_range=categories, height=400, width=400, | ||
toolbar_location=None, tools="") | ||
p.vbar(x=categories, top=values, width=0.9, | ||
fill_color=bar_color, line_color=bar_color) | ||
|
||
p.border_fill_color = None | ||
p.y_range.start = 0 | ||
p.x_range.range_padding = 0.1 | ||
p.xaxis.major_label_orientation = 1 | ||
p.axis.minor_tick_line_color = None | ||
p.xgrid.grid_line_color = None | ||
p.ygrid.grid_line_color = None | ||
|
||
p.xaxis.group_text_color = '#000' | ||
p.xaxis.group_text_font_size = '10pt' | ||
|
||
p.xaxis.axis_label = 'Emotionalität Ihrer Suchanfragen' | ||
p.yaxis.axis_label = f'Score' | ||
p.xaxis.axis_label_text_font_size = '11pt' | ||
p.yaxis.axis_label_text_font_size = '9pt' | ||
p.xaxis.axis_label_text_font_style = 'normal' | ||
p.yaxis.axis_label_text_font_style = 'normal' | ||
p.xaxis.major_label_text_font_size = '10pt' | ||
p.xaxis.major_tick_line_color = None | ||
|
||
script, div = components(p) | ||
return {'script': script, 'div': div} |
Oops, something went wrong.