From 1fca2a2656f9ceaa7b7496a47e4a2a45a587848c Mon Sep 17 00:00:00 2001 From: Nikolas Nyby Date: Thu, 27 Feb 2025 15:56:10 -0500 Subject: [PATCH] Break out new Externalities graph type into three separate graph types Each of these scenarios has various modes within it, so I think these should be separate graph types actually. --- .../migrations/0125_alter_graph_graph_type.py | 18 ++++++++++++++++++ econplayground/main/models.py | 6 +++++- media/js/src/utils.js | 8 +++++++- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 econplayground/main/migrations/0125_alter_graph_graph_type.py diff --git a/econplayground/main/migrations/0125_alter_graph_graph_type.py b/econplayground/main/migrations/0125_alter_graph_graph_type.py new file mode 100644 index 000000000..7b2be50ac --- /dev/null +++ b/econplayground/main/migrations/0125_alter_graph_graph_type.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.6 on 2025-02-27 20:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0124_alter_graph_graph_type'), + ] + + operations = [ + migrations.AlterField( + model_name='graph', + name='graph_type', + field=models.PositiveSmallIntegerField(choices=[(0, 'Linear Demand and Supply'), (1, 'Input Markets'), (3, 'Cobb-Douglas Production Graph'), (5, 'Consumption-Leisure: Constraint'), (7, 'Consumption-Saving: Constraint'), (8, 'Linear Demand and Supply: 3 Functions'), (9, 'Linear Demand and Supply: Areas'), (10, 'Input Markets: Areas'), (11, 'Consumption-Saving: Optimal Choice'), (15, 'Consumption-Leisure: Optimal Choice'), (12, 'Input-Output Illustrations'), (13, 'Linear Demand and Supply: 2 Diagrams'), (14, 'Input Markets: 2 Diagrams'), (16, 'Template Graph'), (17, 'Optimal Choice: Consumption with 2 Goods'), (18, 'Cost Functions'), (20, 'Price Elasticity of Demand and Revenue'), (21, 'Optimal Choice: Cost-Minimizing Production Inputs'), (22, 'Tax Rate and Revenue'), (23, 'Taxation in Linear Demand and Supply'), (24, 'Tax Supply and Demand vs. Tax Revenue'), (25, 'Linear Demand and Supply - Surplus Policies'), (26, 'Negative Production Externality - Producer'), (27, 'Negative Production Externality - Industry'), (28, 'Positive Externality - Industry')], default=0), + ), + ] diff --git a/econplayground/main/models.py b/econplayground/main/models.py index a9faea09a..307a1093e 100644 --- a/econplayground/main/models.py +++ b/econplayground/main/models.py @@ -42,7 +42,11 @@ (24, 'Tax Supply and Demand vs. Tax Revenue'), (25, 'Linear Demand and Supply - Surplus Policies'), - (26, 'Externalities'), + + # Externalities + (26, 'Negative Production Externality - Producer'), + (27, 'Negative Production Externality - Industry'), + (28, 'Positive Externality - Industry'), ) ASSIGNMENT_TYPES = ( diff --git a/media/js/src/utils.js b/media/js/src/utils.js index f46c3a431..cf499222a 100644 --- a/media/js/src/utils.js +++ b/media/js/src/utils.js @@ -415,7 +415,13 @@ const displayGraphType = function(gType) { name = 'Linear Demand and Supply - Surplus Policies'; break; case 26: - name = 'Externalities'; + name = 'Negative Production Externality - Producer'; + break; + case 27: + name = 'Negative Production Externality - Industry'; + break; + case 28: + name = 'Positive Production Externality - Industry'; break; default: break;