Skip to content

Commit

Permalink
Remove unused graph fields alpha and omega - #3368
Browse files Browse the repository at this point in the history
These fields were apparently planned to be used for a graph type but it
looks like nothing is actually using them, so we can remove them.
  • Loading branch information
nikolas committed Aug 8, 2024
1 parent 05aaeb5 commit 0477d75
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.15 on 2024-08-08 17:40

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('main', '0119_alter_graph_graph_type'),
]

operations = [
migrations.RemoveField(
model_name='graph',
name='alpha',
),
migrations.RemoveField(
model_name='graph',
name='omega',
),
]
6 changes: 0 additions & 6 deletions econplayground/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,6 @@ class Meta(OrderedModel.Meta):
line_4_label = models.TextField(blank=True, null=True, default='')
line_4_dashed = models.BooleanField(default=False)

# TODO: migrate these to a1, a2, etc.
alpha = models.DecimalField(
max_digits=12, decimal_places=4, default=Decimal('0.3'))
omega = models.DecimalField(
max_digits=12, decimal_places=4, default=Decimal('0'))

# Arbitrary number storage to be used as needed for the altering
# functions of the various graph types.
#
Expand Down
2 changes: 0 additions & 2 deletions media/js/src/GraphEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ GraphEditor.propTypes = {
gAssignmentType: PropTypes.number,
gNeedsSubmit: PropTypes.bool,

gAlpha: PropTypes.number,

gA1: PropTypes.number,
gA1Name: PropTypes.string,
gA1Max: PropTypes.number,
Expand Down
12 changes: 0 additions & 12 deletions media/js/src/GraphMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ const exportGraph = function(state) {
line_3_dashed: state.gLine3Dashed,
line_4_dashed: state.gLine4Dashed,

alpha: forceFloat(state.gAlpha),
omega: forceFloat(state.gOmega),

a1: forceFloat(state.gA1),
a1_name: state.gA1Name,
a1_max: forceFloat(state.gA1Max),
Expand Down Expand Up @@ -231,9 +228,6 @@ const convertGraph = function(json) {
gLine3Dashed: json.line_3_dashed,
gLine4Dashed: json.line_4_dashed,

gAlpha: forceFloat(json.alpha),
gOmega: forceFloat(json.omega),

gA1: forceFloat(json.a1),
gA1Name: json.a1_name,
gA1Max: forceFloat(json.a1_max),
Expand Down Expand Up @@ -387,9 +381,6 @@ const importGraph = function(json, obj, callback=null) {
gLine3Dashed: json.line_3_dashed,
gLine4Dashed: json.line_4_dashed,

gAlpha: forceFloat(json.alpha),
gOmega: forceFloat(json.omega),

gA1: forceFloat(json.a1),
gA1Name: json.a1_name,
gA1Max: forceFloat(json.a1_max),
Expand Down Expand Up @@ -568,9 +559,6 @@ const defaultGraph = {
gXAxis2Label: '',
gYAxis2Label: '',

gAlpha: 0.3,
gOmega: 1,

gA1: null,
gA1Name: '',
gA1Min: 0,
Expand Down
2 changes: 0 additions & 2 deletions media/js/src/GraphViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,6 @@ GraphViewer.propTypes = {
gLine2Dashed: PropTypes.bool.isRequired,
gLine3Dashed: PropTypes.bool.isRequired,

gAlpha: PropTypes.number,

gA1: PropTypes.number,
gA1Name: PropTypes.string,
gA1Initial: PropTypes.number,
Expand Down
4 changes: 1 addition & 3 deletions media/js/src/JXGBoard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export default class JXGBoard extends React.Component {
'gLine2OffsetYInitial', 'gLine3OffsetX', 'gLine3OffsetY',
'gLine3OffsetXInitial', 'gLine3OffsetYInitial', 'gLine4OffsetX',
'gLine4OffsetY', 'gLine4OffsetXInitial', 'gLine4OffsetYInitial',
'gLine1Dashed', 'gLine2Dashed', 'gLine3Dashed', 'gAlpha',
'gLine1Dashed', 'gLine2Dashed', 'gLine3Dashed',

'gA1', 'gA1Initial', 'gA1Name',
'gA2', 'gA2Initial', 'gA2Name',
Expand Down Expand Up @@ -842,8 +842,6 @@ JXGBoard.propTypes = {
gLine2Dashed: PropTypes.bool,
gLine3Dashed: PropTypes.bool,

gAlpha: PropTypes.number,

gA1: PropTypes.number,
gA1Initial: PropTypes.number,
gA2: PropTypes.number,
Expand Down

0 comments on commit 0477d75

Please sign in to comment.