var graphStates = {}; var graphCalc; function setupGraph(graphType) { var element = document.getElementById(graphType); var graph = Desmos.GraphingCalculator(element); var expressions = [ // Projection Score { id: 'projection-score-folder', type: 'folder', title: 'Projection Score', memberIds:{ 'projection-score-note': 'projection-score-note', 'projection-score': 'projection-score' } }, { id: 'projection-score', type: 'expression', latex: 's=' + projectionScore.toString(), sliderMin: '0.1', sliderMax: '2', sliderHardMin: true, sliderHardMax: true, sliderInterval: '0.1', sliderAnimationPeriod: 4000, sliderLoopMode: 'LOOP_FORWARD_REVERSE', sliderPlayDirection:1, sliderIsPlaying:true }, // Min Wage { id: 'min-wage', type: 'expression', latex: 'm=' + minWage.toString(), secret: true }, { id: 'min-wage-point', type: 'expression', latex: '(0, m)', color: '#006bde', labelSize: 'small', showLabel: true, label: 'Min Wage', labelOrientation: Desmos.LabelOrientations.LEFT, dragMode: Desmos.DragModes.Y, secret: true, hidden: false }, { id: 'min-wage-line', type: 'expression', latex: '\\left\\{0\\le x:\\ m\\right\\}', color: '#006bde', lineStyle: Desmos.Styles.DASHED, secret: true, hidden: false }, // Base Wage { id: 'base-wage-folder', type: 'folder', title: 'Base Wage', memberIds:{ 'base-wage': 'base-wage', 'base-wage-point': 'base-wage-point', 'base-wage-line': 'base-wage-line' } }, { id: 'base-wage', type: 'expression', latex: 'b=' + baseWage.toString(), secret: true }, { id: 'base-wage-point', type: 'expression', latex: '(0, b)', color: '#41A800', labelSize: 'small', showLabel: true, label: 'Base Wage', labelOrientation: Desmos.LabelOrientations.LEFT, dragMode: Desmos.DragModes.Y, secret: true, hidden: false }, { id: 'base-wage-line', type: 'expression', latex: 'w(x)=\\left\\{0\\le x\\le p:\\ b\\right\\}', color: '#41A800', secret: false, hidden: false }, // Projected Hours { id: 'projected-hours', type: 'expression', latex: 'p=' + projectedHours.toString(), secret: true }, { id: 'projected-hours-point', type: 'expression', latex: '(p, (b+m)/2)', color: '#555', labelSize: 'small', showLabel: true, label: 'Projected Hours', labelOrientation: Desmos.LabelOrientations.LEFT, dragMode: Desmos.DragModes.X, secret: true, hidden: false }, { id: 'projected-hours-line', type: 'expression', latex: 'x=\\left\\{m\\le y\\le b:\\ p\\right\\}', color: '#555', secret: true, lineStyle: Desmos.Styles.DASHED, hidden: false }, { id: 'hourly-wage-after-overtime-folder', type: 'folder', title: 'Wage Decay', memberIds:{ 'hourly-wage-after-overtime': 'hourly-wage-after-overtime' } }, { id: 'hourly-wage-after-overtime', type: 'expression', latex: 'd(x)=\\left\\{x\\ge p:\\ (b-m)e^{-\\frac{(x-p)}{sp}}+m\\right\\}', color: '#A80E00', secret: false, hidden: false }, { id: 'cumulative-pay-folder', type: 'folder', title: 'Cumulative Pay', memberIds:{ 'cumulative-pay-before-overtime': 'cumulative-pay-before-overtime', 'cumulative-pay-after-overtime': 'cumulative-pay-after-overtime', 'cumulative-pay': 'cumulative-pay', } }, { id: 'cumulative-pay-before-overtime', type: 'expression', latex: 'v(x)=\\left\\{0\\le x\\le p:\\ bx\\right\\}', hidden: true, secret: true }, { id: 'cumulative-pay-after-overtime', type: 'expression', latex: 'c(x)=\\left\\{x\\ge p:-(b-m)spe^{-\\frac{(x-p)}{sp}}+mx\\right\\}', hidden: true, secret: true }, { id: 'cumulative-pay', type: 'expression', latex: 't(x)=\\left\\{0\\le x