Arizona K-12 Funding Reform Model
html`<div style="padding-bottom: 5px; border: 1px solid; background-color: #f5f5f5;"> <div class="box-title" style="font-style: italic; font-weight: 700; font-size: 16px;">Output Selection</div>
<div style="margin: 0x 5px 5px 5px; text-align: center;">${viewof variableSelection}</div>${viewof districtCharter} ${viewof perPupilTotal}</div>`;
html`<br><div style="padding-bottom: 5px; border: 1px solid; background-color: #f5f5f5;">
<div class="wrapper-1">
<div class="box-title" style="font-style: italic; font-weight: 700; font-size: 16px;">Modeled Changes</div>
</div>
<div class="wrapper-1">
<div class="box-title" style="font-size: 16px;">${districtCharter.optradio == '0' ? 'Districts' : 'Charters'} Higher/Lower</div>
</div>${pieChart}
<div class="wrapper-1">
<div class="box-title" style="font-size: 16px;">${perPupilTotal.optradio === '0' ? 'Weighted Average' : ''} ${perPupilTotalLabel}</div>
</div>
<div class="wrapper-1">
<div class="box-item">${d3.format("$,.0f")(totalFigure)}</div>
</div>
<div class="wrapper-1">
<div class="box-title" style="font-size: 16px;">% Change ${perPupilTotalLabel}</div>
</div>
<div class="wrapper-1">
<div class="box-item" >${d3.format(".1%")(percentChangeFigure)}</div>
</div>
</div>`
html`
<div style="display: ${districtMapDisplay}; text-align: center; margin-bottom: 0px;">${districtMap}</div>
<div style="display: ${charterMapDisplay}; text-align: center; margin-bottom: 0px;">${charterMap}</div>
`
import {select, slider, checkbox, number} from "@jashkenas/inputs";
// viewof newFilter = text({
// placeholder: 'e.g. St Johns Unified District',
// title: 'Search for district'
// })
viewof newFilter = form(html`<form>
<div style="margin: 0;"><input name="message" type="text" value=""></div>
`)
tableDataTemp = {
if (districtCharter.optradio == '0') {
return aq.from(completeDistrictSummary)
.orderby('NAME')
.objects();
} else {
return aq.from(completeCharterSummary)
.orderby('NAME')
.objects();
}
}
tableData = tableDataTemp.filter(d => d.NAME.match(new RegExp(newFilter.message, 'i')));
html`<div style="height: 10px;"></div><span style="font-size: 14px;">Search for district: ${viewof newFilter}</span>`
html`
<div class="data-table">
<table>
<tr>
<th rowspan=2 colspan=2>${districtCharter.optradio == '0' ? 'District' : 'Charter'}</th>
<th colspan=3>${variableSelection[0]}</th>
</tr>
<tr>
<th>${variableSelection[0] !== "District-to-Charter Formula" ? "Current" : "Traditional Modeled"}</th>
<th>Modeled</th>
<th>Difference</th>
</tr>
${tableData.map((d, i) => html`
<tr>
<td style="background-color: ${i % 2 == 0 ? "#f5f5f5" : "#fff"};">
${d.ID}
</td>
<td style="background-color: ${i % 2 == 0 ? "#f5f5f5" : "#fff"};">
${d.NAME}
</td>
<td style="background-color: ${i % 2 == 0 ? "#f5f5f5" : "#fff"}; font-weight: 600;">
${d3.format("$,.0f")(variableSelection[0] === "Total Available" ? d.total_available_current : variableSelection[0] === "Equalization Base" ? d.equalization_base_current : variableSelection[0] === "Equalization Assistance" ? d.equalization_assistance_current : d.total_available_modeled).replace(/G/, " B").replace(/M/, " M")}
</td>
<td style="background-color: ${i % 2 == 0 ? "#f5f5f5" : "#fff"}; font-weight: 600;">
${d3.format("$,.0f")(variableSelection[0] === "Total Available" ? d.total_available_modeled : variableSelection[0] === "Equalization Base" ? d.equalization_base_modeled : variableSelection[0] === "Equalization Assistance" ? d.equalization_assistance_modeled : d.d2c_total_available).replace(/G/, " B").replace(/M/, " M")}
</td>
<td style="background-color: ${color(variableSelection[0] === "Total Available" ? d.total_available_difference : variableSelection[0] === "Equalization Base" ? d.equalization_base_difference : variableSelection[0] === "Equalization Assistance" ? d.equalization_assistance_difference : d.d2c_total_available_difference) + "99"};">
${d3.format(".1%")(variableSelection[0] === "Total Available" ? d.total_available_difference : variableSelection[0] === "Equalization Base" ? d.equalization_base_difference : variableSelection[0] === "Equalization Assistance" ? d.equalization_assistance_difference : d.d2c_total_available_difference)}
</td>
</tr>
`)
}
</table>
</div>
`
viewof countySelectionInput = {
const options = [
{name: "Arizona", value: ["Arizona", 1.2, -175, 0, 7, 3, "16px"], selected: true},
{name: "1st Legislative District", value: ["AZ-1", 2.6, -687, -369, 7, 3, "16px"]},
{name: "2nd Legislative District", value: ["AZ-2", 2.53, -852, -1000, 7, 3, "16px"]},
{name: "3rd Legislative District", value: ["AZ-3", 2.2, -665, -785, 7, 3, "16px"]},
{name: "4th Legislative District", value: ["AZ-4", 2, -307, -567, 7, 3, "16px"]},
{name: "5th Legislative District", value: ["AZ-5", 1.7, -70, -31, 7, 3, "16px"]},
{name: "6th Legislative District", value: ["AZ-6", 2, -600, -200, 7, 3, "16px"]},
{name: "7th Legislative District", value: ["AZ-7",1.28, -200, 0, 7, 3, "16px"]},
{name: "8th Legislative District", value: ["AZ-8", 2.25, -625, -640, 7, 3, "16px"]},
{name: "9th Legislative District", value: ["AZ-9", 2.25, -675, -775, 7, 3, "16px"]},
{name: "10th Legislative District", value: ["AZ-10", 2.5, -850, -985, 7, 3, "16px"]},
{name: "11th Legislative District", value: ["AZ-11", 2.5, -710, -840, 7, 3, "16px"]},
{name: "12th Legislative District", value: ["AZ-12", 6, -2400, -1900, 3, 1, "10px"]},
{name: "13th Legislative District", value: ["AZ-13", 2.5, -400, -650, 7, 3, "16px"]},
{name: "14th Legislative District", value: ["AZ-14", 2.5, -1000, -925, 7, 3, "16px"]},
{name: "15th Legislative District", value: ["AZ-15", 6, -2300, -1800, 3, 1, "10px"]},
{name: "16th Legislative District", value: ["AZ-16", 6, -2400, -1900, 3, 1, "10px"]},
{name: "17th Legislative District", value: ["AZ-17", 6, -2300, -1800, 3, 1, "10px"]},
{name: "18th Legislative District", value: ["AZ-18", 6, -2300, -1800, 3, 1, "10px"]},
{name: "19th Legislative District", value: ["AZ-19", 6, -2300, -1800, 3, 1, "10px"]},
{name: "20th Legislative District", value: ["AZ-20", 6, -2300, -1800, 3, 1, "10px"]},
{name: "21st Legislative District", value: ["AZ-21", 6, -2300, -1800, 3, 1, "10px"]},
{name: "22nd Legislative District", value: ["AZ-22", 6, -2300, -1800, 3, 1, "10px"]},
{name: "23rd Legislative District", value: ["AZ-23", 6, -2300, -1800, 3, 1, "10px"]},
{name: "24th Legislative District", value: ["AZ-24", 6, -2300, -1800, 3, 1, "10px"]},
{name: "25th Legislative District", value: ["AZ-25", 6, -2300, -1800, 3, 1, "10px"]},
{name: "26th Legislative District", value: ["AZ-26", 6, -2300, -1800, 3, 1, "10px"]},
{name: "27th Legislative District", value: ["AZ-27", 6, -2300, -1800, 3, 1, "10px"]},
{name: "28th Legislative District", value: ["AZ-28", 6, -2300, -1800, 3, 1, "10px"]},
{name: "29th Legislative District", value: ["AZ-29", 6, -2300, -1800, 3, 1, "10px"]},
{name: "30th Legislative District", value: ["AZ-30", 6, -2300, -1800, 3, 1, "10px"]},
];
const form = html`<form style="display: flex; align-items: center; font-size: 18px;"><select name=i>${options.map(o => Object.assign(html`<option>`, {textContent: o.name, selected: o.selected}))}`;
form.i.onchange = () => form.dispatchEvent(new CustomEvent("input"));
form.oninput = () => form.value = options[form.i.selectedIndex].value;
form.oninput();
return form;
}
scenarioButton = {
if (clickCount === 0 || clickCount === 1) {
return [4775.27, 'selected', 0, 0.04, 0.06, 0.115, 4.771, 6.024, 5.988, 7.947, 3.158, 6.773, 3.595, 0.292, 4.822, 4.421, 4.806, 1985.58 , 2314.16]
}
};
scenarioSwith = {
if (clickCount === 0 || clickCount === 1) {
return ['', 'selected', // Teacher Compensation Adjustment
'selected', '', // Teacher Experience Index
'selected', '', // Adjacent Ways
'selected', '', // CSF & IIF
'selected', '', // Debt Service
'selected', '', // Maintenance & Operations
'selected', '', // Other Revenue
'selected', '', // School Facilities
'selected', '', // Unrestricted Capital Outlay
'selected', '', // TRCL
'selected', '' // Charter Base Adjustment
]
}
};
viewof variableSelection = {if (districtCharter.optradio === '0') {
const options = [
{name: "Total Available", value: ["Total Available", 0], selected: true},
{name: "Equalization Base", value: ["Equalization Base", 1]},
{name: "Equalization Assistance", value: ["Equalization Assistance", 2]},
{name: "District-to-Charter Formula", value: ["District-to-Charter Formula", 3]},
];
const form = html`<form style="font-size: 16px;"><select style="width: 150px;" name=i>${options.map(o => Object.assign(html`<option>`, {textContent: o.name, selected: o.selected}))}`;
form.i.onchange = () => form.dispatchEvent(new CustomEvent("input"));
form.oninput = () => form.value = options[form.i.selectedIndex].value;
form.oninput();
return form;
} else {
const options = [
{name: "Total Available", value: ["Total Available", 0], selected: true}
];
const form = html`<form style="font-size: 16px;"><select style="width: 150px;" name=i>${options.map(o => Object.assign(html`<option>`, {textContent: o.name, selected: o.selected}))}`;
form.i.onchange = () => form.dispatchEvent(new CustomEvent("input"));
form.oninput = () => form.value = options[form.i.selectedIndex].value;
form.oninput();
return form;
}
};
html`
<style>
#district , #charter {
display: none;
}
.district-switch {
background-color: ${districtCharter1Color};
border-radius: 5px 0 0 5px;
border: 1px solid #000;
padding: 5px;
}
.charter-switch {
background-color: ${districtCharter2Color};
border-radius: 0 5px 5px 0;
border: 1px solid #000;
padding: 5px;
}
`
districtCharter1Color = {
if (districtCharter.optradio == '0') {
return "#d3d3d3"
} else {
return "#fff"
}
};
districtCharter2Color = {
if (districtCharter.optradio == '1') {
return "#d3d3d3"
} else {
return "#fff"
}
};
viewof districtCharter = form(
html`
<form style="text-align: center; font-size: 16px;">
<label class="district-switch">
<input id="district" type="radio" name="optradio" value="0" checked>District
</label>
<label class="charter-switch">
<input id="charter" type="radio" name="optradio" value="1">Charter
</label>
</form>
`
)
html`
<style>
#per-pupil , #total {
display: none;
}
.per-pupil-switch {
background-color: ${perPupilTotal1Color};
border-radius: 5px 0 0 5px;
border: 1px solid #000;
padding: 5px;
}
.total-switch {
background-color: ${perPupilTotal2Color};
border-radius: 0 5px 5px 0;
border: 1px solid #000;
padding: 5px;
}
`
perPupilTotal1Color = {
if (perPupilTotal.optradio == '0') {
return "#d3d3d3"
} else {
return "#fff"
}
};
perPupilTotal2Color = {
if (perPupilTotal.optradio == '1') {
return "#d3d3d3"
} else {
return "#fff"
}
};
viewof perPupilTotal = form(
html`
<form style="text-align: center; font-size: 16px;">
<label class="per-pupil-switch">
<input id="per-pupil" type="radio" name="optradio" value="0" checked>Per Pupil
</label>
<label class="total-switch">
<input id="total" type="radio" name="optradio" value="1">Total
</label>
</form>
`
)
perPupilTotalLabel = {
if (perPupilTotal.optradio == "0") {
return "Per Pupil"
} else {
return "Total"
}
};
summaryFiguresData = {
if (perPupilTotal.optradio == "0") {
return aq.from(completeDistrictSummary)
.derive({
"total_available_current": d => d["total_available_current"] * d.ADM,
"total_available_modeled": d => d["total_available_modeled"] * d.ADM,
"equalization_base_current": d => d["equalization_base_current"] * d.ADM,
"equalization_base_modeled": d => d["equalization_base_modeled"] * d.ADM,
"equalization_assistance_current": d => d["equalization_assistance_current"] * d.ADM,
"equalization_assistance_modeled": d => d["equalization_assistance_modeled"] * d.ADM,
"d2c_total_available": d => d["d2c_total_available"] * d.ADM,
})
.rollup({"Total Available - Current": d => op.sum(d["total_available_current"]) / op.sum(d["ADM"]),
"Total Available - Modeled": d => op.sum(d["total_available_modeled"]) / op.sum(d["ADM"]),
"Equalization Base - Current": d => op.sum(d["equalization_base_current"]) / op.sum(d["ADM"]),
"Equalization Base - Modeled": d => op.sum(d["equalization_base_modeled"]) / op.sum(d["ADM"]),
"Equalization Assistance - Current": d => op.sum(d["equalization_assistance_current"]) / op.sum(d["ADM"]),
"Equalization Assistance - Modeled": d => op.sum(d["equalization_assistance_modeled"]) / op.sum(d["ADM"]),
"District-to-Charter Formula - Modeled": d => op.sum(d["d2c_total_available"]) / op.sum(d["ADM"]),
"ADM": d => op.sum(d["ADM"])
})
.derive({
"Total Available - Total Change": d => d["Total Available - Modeled"] / d["Total Available - Current"] - 1,
"Equalization Base - Total Change": d => d["Equalization Base - Modeled"] / d["Equalization Base - Current"] - 1,
"Equalization Assistance - Total Change": d => d["Equalization Assistance - Modeled"] / d["Equalization Assistance - Current"] - 1,
"District-to-Charter Formula - Total Change": d => d["District-to-Charter Formula - Modeled"] / d["Total Available - Current"] - 1
})
.objects();
} else {
return aq.from(completeDistrictSummary)
.rollup({
"Total Available - Current": d => op.sum(d["total_available_current"]),
"Total Available - Modeled": d => op.sum(d["total_available_modeled"]),
"Equalization Base - Current": d => op.sum(d["equalization_base_current"]),
"Equalization Base - Modeled": d => op.sum(d["equalization_base_modeled"]),
"Equalization Assistance - Current": d => op.sum(d["equalization_assistance_current"]),
"Equalization Assistance - Modeled": d => op.sum(d["equalization_assistance_modeled"]),
"Total Available - Total Change": d => op.sum(d["total_available_modeled"])/op.sum(d["total_available_current"]) - 1,
"Equalization Base - Total Change": d => op.sum(d["equalization_base_modeled"])/op.sum(d["equalization_base_current"]) - 1,
"Equalization Assistance - Total Change": d => op.sum(d["equalization_assistance_modeled"])/op.sum(d["equalization_assistance_current"]) - 1,
"District-to-Charter Formula - Modeled": d => op.sum(d["d2c_total_available"]),
"District-to-Charter Formula - Total Change": d => op.sum(d["d2c_total_available"])/op.sum(d["total_available_current"]) - 1})
.objects();
}
};
charterSummaryFiguresData = {
if (perPupilTotal.optradio == "0") {
return aq.from(completeCharterSummary)
.derive({
"total_available_current": d => d["total_available_current"] * d.ADM,
"total_available_modeled": d => d["total_available_modeled"] * d.ADM
})
.rollup({"Total Available - Current": d => op.sum(d["total_available_current"]) / op.sum(d["ADM"]),
"Total Available - Modeled": d => op.sum(d["total_available_modeled"]) / op.sum(d["ADM"])
})
.derive({
"Total Available - Total Change": d => d["Total Available - Modeled"] / d["Total Available - Current"] - 1
})
.objects();
} else {
return aq.from(completeCharterSummary)
.rollup({
"Total Available - Current": d => op.sum(d["total_available_current"]),
"Total Available - Modeled": d => op.sum(d["total_available_modeled"]),
"Total Available - Total Change": d => op.sum(d["total_available_modeled"])/op.sum(d["total_available_current"]) - 1})
.objects();
}
};
charterTotalFigure = {
return charterSummaryFiguresData[0]["Total Available - Current"]
};
districtTotalFigure = {
if (variableSelection[0] === "Total Available") {
return summaryFiguresData[0]["Total Available - Modeled"]
} else if (variableSelection[0] === "Equalization Base") {
return summaryFiguresData[0]["Equalization Base - Modeled"]
} else if (variableSelection[0] === "Equalization Assistance") {
return summaryFiguresData[0]["Equalization Assistance - Modeled"]
} else {
return summaryFiguresData[0]["District-to-Charter Formula - Modeled"]
}
};
totalFigure = {
if (districtCharter.optradio === '0') {
return districtTotalFigure
} else {
return charterTotalFigure
}
};
charterPercentChangeFigure = {
return charterSummaryFiguresData[0]["Total Available - Total Change"]
};
districtPercentChangeFigure = {
if (variableSelection[0] == "Total Available") {
return summaryFiguresData[0]["Total Available - Total Change"]
} else if (variableSelection[0] == "Equalization Base") {
return summaryFiguresData[0]["Equalization Base - Total Change"]
} else if (variableSelection[0] == "Equalization Assistance") {
return summaryFiguresData[0]["Equalization Assistance - Total Change"]
} else {
return summaryFiguresData[0]["District-to-Charter Formula - Total Change"]
}
};
percentChangeFigure = {
if (districtCharter.optradio == '0') {
return districtPercentChangeFigure
} else {
return charterPercentChangeFigure
}
};
// Pie Chart
dataPieTemp = {
if (districtCharter.optradio === '0') {
return aq.from(tableDataTemp)
.derive({"Total Available - Increase": d => +op.round10(d.total_available_modeled) > +op.round10(d.total_available_current) ? 1 : 0})
.derive({"Total Available - Decrease": d => +op.round10(d.total_available_modeled) < +op.round10(d.total_available_current) ? 1 : 0})
.derive({"Total Available - No Change": d => +op.round10(d.total_available_modeled) === +op.round10(d.total_available_current) ? 1 : 0})
.derive({"Equalization Base - Increase": d => +op.round10(d.equalization_base_modeled) > +op.round10(d.equalization_base_current) ? 1 : 0})
.derive({"Equalization Base - Decrease": d => +op.round10(d.equalization_base_modeled) < +op.round10(d.equalization_base_current) ? 1 : 0})
.derive({"Equalization Base - No Change": d => +op.round10(d.equalization_base_modeled) === +op.round10(d.equalization_base_current) ? 1 : 0})
.derive({"Equalization Assistance - Increase": d => +op.round10(d.equalization_assistance_modeled) > +op.round10(d.equalization_assistance_current) ? 1 : 0})
.derive({"Equalization Assistance - Decrease": d => +op.round10(d.equalization_assistance_modeled) < +op.round10(d.equalization_assistance_current) ? 1 : 0})
.derive({"Equalization Assistance - No Change": d => +op.round10(d.equalization_assistance_modeled) === +op.round10(d.equalization_assistance_current) ? 1 : 0})
.derive({"District-to-Charter Formula - Increase": d => +op.round10(d.d2c_total_available) > +op.round10(d.total_available_current) ? 1 : 0})
.derive({"District-to-Charter Formula - Decrease": d => +op.round10(d.d2c_total_available) < +op.round10(d.total_available_current) ? 1 : 0})
.derive({"District-to-Charter Formula - No Change": d => +op.round10(d.d2c_total_available) === +op.round10(d.total_available_current) ? 1 : 0})
.rollup({"Total Available - Increase": d => op.sum(d["Total Available - Increase"]),
"Equalization Base - Increase": d => op.sum(d["Equalization Base - Increase"]),
"Equalization Assistance - Increase": d => op.sum(d["Equalization Assistance - Increase"]),
"Total Available - Decrease": d => op.sum(d["Total Available - Decrease"]),
"Equalization Base - Decrease": d => op.sum(d["Equalization Base - Decrease"]),
"Equalization Assistance - Decrease": d => op.sum(d["Equalization Assistance - Decrease"]),
"Total Available - No Change": d => op.sum(d["Total Available - No Change"]),
"Equalization Base - No Change": d => op.sum(d["Equalization Base - No Change"]),
"Equalization Assistance - No Change": d => op.sum(d["Equalization Assistance - No Change"]),
"District-to-Charter Formula - Increase": d => op.sum(d["District-to-Charter Formula - Increase"]),
"District-to-Charter Formula - Decrease": d => op.sum(d["District-to-Charter Formula - Decrease"]),
"District-to-Charter Formula - No Change": d => op.sum(d["District-to-Charter Formula - No Change"])})
// .select('ID', 'NAME', 'Total Available - Increase', 'Total Available - No Change', 'Total Available - Decrease', 'total_available_modeled', 'total_available_current')
// .orderby('NAME')
// .derive({"Total Available - Increase": d => d["Total Available - Increase"] / (d["Total Available - Increase"] + d["Total Available - Decrease"] + d["Total Available - No Change"] ),
// "Total Available - Decrease": d => d["Total Available - Decrease"] / (d["Total Available - Increase"] + d["Total Available - Decrease"] + d["Total Available - No Change"] ),
// "Total Available - No Change": d => d["Total Available - No Change"] / (d["Total Available - Increase"] + d["Total Available - Decrease"] + d["Total Available - No Change"] )})
// .derive({"Equalization Base - Increase": d => d["Equalization Base - Increase"] / (d["Equalization Base - Increase"] + d["Equalization Base - Decrease"] + d["Equalization Base - No Change"] ),
// "Equalization Base - Decrease": d => d["Equalization Base - Decrease"] / (d["Equalization Base - Increase"] + d["Equalization Base - Decrease"] + d["Equalization Base - No Change"] ),
// "Equalization Base - No Change": d => d["Equalization Base - No Change"] / (d["Equalization Base - Increase"] + d["Equalization Base - Decrease"] + d["Equalization Base - No Change"] )})
// .derive({"Equalization Assistance - Increase": d => d["Equalization Assistance - Increase"] / (d["Equalization Assistance - Increase"] + d["Equalization Assistance - Decrease"] + d["Equalization Assistance - No Change"] ),
// "Equalization Assistance - Decrease": d => d["Equalization Assistance - Decrease"] / (d["Equalization Assistance - Increase"] + d["Equalization Assistance - Decrease"] + d["Total Available - No Change"] ),
// "Equalization Assistance - No Change": d => d["Equalization Assistance - No Change"] / (d["Equalization Assistance - Increase"] + d["Equalization Assistance - Decrease"] + d["Equalization Assistance - No Change"] )})
// .derive({"District-to-Charter Formula - Increase": d => d["District-to-Charter Formula - Increase"] / (d["District-to-Charter Formula - Increase"] + d["District-to-Charter Formula - Decrease"] + d["District-to-Charter Formula - No Change"] ),
// "District-to-Charter Formula - Decrease": d => d["District-to-Charter Formula - Decrease"] / (d["District-to-Charter Formula - Increase"] + d["District-to-Charter Formula - Decrease"] + d["District-to-Charter Formula - No Change"] ),
// "District-to-Charter Formula - No Change": d => d["District-to-Charter Formula - No Change"] / (d["District-to-Charter Formula - Increase"] + d["District-to-Charter Formula - Decrease"] + d["District-to-Charter Formula - No Change"] )})
.objects();
} else {
return aq.from(tableDataTemp)
.derive({"Total Available - Increase": d => Math.round(d.total_available_modeled) > Math.round(d.total_available_current) ? 1 : 0})
.derive({"Total Available - Decrease": d => Math.round(d.total_available_modeled) < Math.round(d.total_available_current) ? 1 : 0})
.derive({"Total Available - No Change": d => Math.round(d.total_available_modeled) == Math.round(d.total_available_current) ? 1 : 0})
.rollup({"Total Available - Increase": d => op.sum(d["Total Available - Increase"]),
"Total Available - Decrease": d => op.sum(d["Total Available - Decrease"]),
"Total Available - No Change": d => op.sum(d["Total Available - No Change"])})
// .derive({"Total Available - Increase": d => d["Total Available - Increase"] / (d["Total Available - Increase"] + d["Total Available - Decrease"] + d["Total Available - No Change"] ),
// "Total Available - Decrease": d => d["Total Available - Decrease"] / (d["Total Available - Increase"] + d["Total Available - Decrease"] + d["Total Available - No Change"] ),
// "Total Available - No Change": d => d["Total Available - No Change"] / (d["Total Available - Increase"] + d["Total Available - Decrease"] + d["Total Available - No Change"] )})
.objects();
}
};
// data = aq.from(dataPieTemp)
// .select("Total Available - Increase", "Total Available - Decrease", "Total Available - No Change")
// .fold(["Total Available - Increase", "Total Available - Decrease", "Total Available - No Change"])
// .derive({"name": d => d.key})
// .objects();
// aq.from(dataPieTemp)
// .view();
data = {
if (districtCharter.optradio === '0') {
if (variableSelection[0] == "Total Available") {
return aq.from(dataPieTemp)
.select("Total Available - Increase", "Total Available - Decrease", "Total Available - No Change")
.fold(["Total Available - Increase", "Total Available - Decrease", "Total Available - No Change"])
.derive({"name": d => d.key})
.objects();
} else if (variableSelection[0] == "Equalization Base") {
return aq.from(dataPieTemp)
.select("Equalization Base - Increase", "Equalization Base - Decrease", "Equalization Base - No Change")
.fold(["Equalization Base - Increase", "Equalization Base - Decrease", "Equalization Base - No Change"])
.derive({"name": d => d.key})
.objects();
} else if (variableSelection[0] == "Equalization Assistance") {
return aq.from(dataPieTemp)
.select("Equalization Assistance - Increase", "Equalization Assistance - Decrease", "Equalization Assistance - No Change")
.fold(["Equalization Assistance - Increase", "Equalization Assistance - Decrease", "Equalization Assistance - No Change"])
.derive({"name": d => d.key})
.objects();
} else {
return aq.from(dataPieTemp)
.select("District-to-Charter Formula - Increase", "District-to-Charter Formula - Decrease", "District-to-Charter Formula - No Change")
.fold(["District-to-Charter Formula - Increase", "District-to-Charter Formula - Decrease", "District-to-Charter Formula - No Change"])
.derive({"name": d => d.key})
.objects();
}
} else {
return aq.from(dataPieTemp)
.select("Total Available - Increase", "Total Available - Decrease", "Total Available - No Change")
.fold(["Total Available - Increase", "Total Available - Decrease", "Total Available - No Change"])
.derive({"name": d => d.key})
.objects();
}
}
pie = d3.pie()
.padAngle(0.005)
.sort(null)
.value(d => d.value);
arc = {
const radius = Math.min(width, pieHeight) / 2;
return d3.arc().innerRadius(radius * 0.4).outerRadius(radius * 0.95);
};
pieHeight = {
if (width < 775) {
return width * 0.4
} else {
return width * 0.75
}
};
pieFontSize = {if (width < 775) {return "30px"} else {return "75px"}};
pieColor = d3.scaleOrdinal()
.domain(data.map(d => d.name))
.range([ "#1a9641BF", "#d7191cBF", "#d3d3d3BF"]);
pieChart = {
const arcs = pie(data);
const svg = d3
.create("svg")
.attr("viewBox", [-width / 2, -pieHeight / 2, width, pieHeight]);
svg
.selectAll("path")
.data(arcs)
.join("path")
.attr("fill", d => pieColor(d.data.name))
.attr("d", arc)
.append("title")
.text(d => `${d.data.name}: ${d.data.value}`);
svg
.append("g")
.attr("font-size", pieFontSize)
.attr("text-anchor", "middle")
.selectAll("text")
.data(arcs)
.join("text")
.attr("transform", d => `translate(${arc.centroid(d)})`)
.call(text =>
text
.filter(d => d.endAngle - d.startAngle > 0.25)
.append("tspan")
.attr("y", "0.4em")
.attr("fill", "#333")
.style("font-weight", 700)
.attr("fill-opacity", 1)
.text(d => d3.format(",.0f")(d.data.value))
);
return svg.node();
}
micro = require("micromodal@0.4.10");
micro.init({
awaitOpenAnimation: true,
awaitCloseAnimation: true
});
viewof clicks = Inputs.button("Reset All Inputs to Baseline", {style: "margin: 5px;"});
clickCount = clicks % 2;
html`<p>${viewof clicks}</p>`
baseLevelAmountPanel = html`
<div id="grid-3">
<div class="grid-item" style="width: 27vw; border: none;">Base Level Amount: ${viewof baseLevelAmountInput}</div>
<div class="grid-item" style="width: 27vw; border: none;"></div>
<div class="grid-item" style="width: 27vw;"><div class="row">
<div class="column-label">Teacher Experience Index:</div>
<div class="column-checkbox">${viewof teacherExpIndexInput}</div>
</div></div>
</div>
`
groupBPanel = html`
<div id="grid-3">
<div class="grid-item" style="width: 170px;">K-3 Reading: ${viewof k3ReadingInput}</div>
<div class="grid-item" style="width: 170px;">K-3: ${viewof k3Input}</div>
<div class="grid-item" style="width: 170px;">ELL: ${viewof ellInput}</div>
</div>
<div style="height: 5px;"></div>
<div id="grid-3">
<div class="grid-item" style="width: 170px;">HI: ${viewof sped1Input}</div>
<div class="grid-item" style="width: 170px;">MD-R, A-R, and SID-R: ${viewof sped2Input}</div>
<div class="grid-item" style="width: 170px;">MD-SC, A-SC, and SID-SC: ${viewof sped3Input}</div>
</div>
<div style="height: 5px;"></div>
<div id="grid-3">
<div class="grid-item" style="width: 170px;">MD-SSI: ${viewof sped4Input}</div>
<div class="grid-item" style="width: 170px;">OI-R: ${viewof sped5Input}</div>
<div class="grid-item" style="width: 170px;">OI-SC: ${viewof sped6Input}</div>
</div>
<div style="height: 5px;"></div>
<div id="grid-3">
<div class="grid-item" style="width: 170px;">P-SD: ${viewof sped7Input}</div>
<div class="grid-item" style="width: 170px;">DD, ED, MIID, SLD, SLI, and OHI: ${viewof sped8Input}</div>
<div class="grid-item" style="width: 170px;">ED-P: ${viewof sped9Input}</div>
</div>
<div style="height: 5px;"></div>
<div id="grid-3">
<div class="grid-item" style="width: 170px;">MOID: ${viewof sped10Input}</div>
<div class="grid-item" style="width: 170px;">VI: ${viewof sped11Input}</div>
<div class="grid-item" style="width: 170px; border: none;"></div>
</div>
<div style="height: 50px;"></div>
`
revenuePanel = html`
<div id="grid-3">
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">Adjacent Ways:</div>
<div class="column-checkbox">${viewof adjacentWaysInput}</div>
</div>
</div>
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">CSF & IIF:</div>
<div class="column-checkbox">${viewof CSFIIFInput}</div>
</div>
</div>
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">Debt Service:</div>
<div class="column-checkbox">${viewof debtServiceInput}</div>
</div>
</div>
</div>
<div id="grid-3">
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">Maintenance & Operation:</div>
<div class="column-checkbox">${viewof MOInput}</div>
</div>
</div>
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">Other Revenue:</div>
<div class="column-checkbox">${viewof otherRevenueInput}</div>
</div>
</div>
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">School Facilities:</div>
<div class="column-checkbox">${viewof schoolFacilitiesInput}</div>
</div>
</div>
</div>
<div id="grid-3">
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">Capital Outlay:</div>
<div class="column-checkbox">${viewof capitalOutlayInput}</div>
</div>
</div>
<div class="grid-item" style="width: 27vw;">
<div class="row">
<div class="column-label">TRCL:</div>
<div class="column-checkbox">${viewof TRCLInput}</div>
</div>
</div>
<div class="grid-item" style="width: 27vw; border: none;"></div>
</div>
`
districtToCharterPanel = html`
<div id="grid-3">
<div class="grid-item" style="width: 27vw; border: none;">Charter Additional Assistance (PSD, K-8): ${viewof daaP8Input}</div>
<div class="grid-item" style="width: 27vw; border: none;"></div>
<div class="grid-item" style="width: 27vw; border: none;">Charter Additional Assistance (9-12): ${viewof daaG912Input}</div>
</div>
<div style="height: 50px;"></div>
`
viewof teacherExpIndexInput = form(
html`
<form>
<select name="teacherexpindex" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[2]}>✔︎</option>
<option value="F" ${scenarioSwith[3]}>✘</option>
</select>
</form>
`
)
viewof adjacentWaysInput = form(
html`
<form>
<select name="adjacentways" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[4]}>✔︎</option>
<option value="F" ${scenarioSwith[5]}>✘</option>
</select>
</form>
`
)
viewof CSFIIFInput = form(
html`
<form>
<select name="csfiif" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[6]}>✔︎</option>
<option value="F" ${scenarioSwith[7]}>✘</option>
</select>
</form>
`
)
viewof debtServiceInput = form(
html`
<form>
<select name="debtservice" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[8]}>✔︎</option>
<option value="F" ${scenarioSwith[9]}>✘</option>
</select>
</form>
`
)
viewof MOInput = form(
html`
<form>
<select name="mo" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[10]}>✔︎</option>
<option value="F" ${scenarioSwith[11]}>✘</option>
</select>
</form>
`
)
viewof otherRevenueInput = form(
html`
<form>
<select name="otherrevenue" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[12]}>✔︎</option>
<option value="F" ${scenarioSwith[13]}>✘</option>
</select>
</form>
`
)
viewof schoolFacilitiesInput = form(
html`
<form>
<select name="schoolfacilities" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[14]}>✔︎</option>
<option value="F" ${scenarioSwith[15]}>✘</option>
</select>
</form>
`
)
viewof capitalOutlayInput = form(
html`
<form>
<select name="capitaloutlay" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[16]}>✔︎</option>
<option value="F" ${scenarioSwith[17]}>✘</option>
</select>
</form>
`
)
viewof TRCLInput = form(
html`
<form>
<select name="trcl" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
<option value="T" ${scenarioSwith[18]}>✔︎</option>
<option value="F" ${scenarioSwith[19]}>✘</option>
</select>
</form>
`
)
// viewof charterBaseAdjInput = form(
// html`
// <form>
// <select name="charterbaseadj" multiple size="2" style=" border: 0; font-size: 25px; text-align: center;">
// <option value="T" ${scenarioSwith[20]}>✔︎</option>
// <option value="F" ${scenarioSwith[21]}>✘</option>
// </select>
// </form>
// `
// )
teacherExpIndex = { if (teacherExpIndexInput.teacherexpindex[0] == "T") { return true } else { return false } };
adjacentWays = { if (adjacentWaysInput.adjacentways[0] == "T") { return true } else { return false } };
CSFIIF = { if (CSFIIFInput.csfiif[0] == "T") { return true } else { return false } };
debtService = { if (debtServiceInput.debtservice[0] == "T") { return true } else { return false } };
MO = { if (MOInput.mo[0] == "T") { return true } else { return false } };
otherRevenue = { if (otherRevenueInput.otherrevenue[0] == "T") { return true } else { return false } };
schoolFacilities = { if (schoolFacilitiesInput.schoolfacilities[0] == "T") { return true } else { return false } };
capitalOutlay = { if (capitalOutlayInput.capitaloutlay[0] == "T") { return true } else { return false } };
TRCL = { if (TRCLInput.trcl[0] == "T") { return true } else { return false } };
viewof baseLevelAmountInput = form(html`<form>
<div class="input-icon"><input name="bla" type="number" value="${scenarioButton[0]}"><i>$</i></div>
</form>`);
baseLevelAmount = baseLevelAmountInput.bla;
// Group B Adjustments
viewof k3ReadingInput = form(html`<form>
<div><input style="width: 100px" name="k3r" type="number" step="0.01" value="${scenarioButton[3]}"></div>
</form>`);
k3Reading = k3ReadingInput.k3r;
viewof k3Input = form(html`<form>
<div><input style="width: 100px" name="k3" type="number" step="0.01" value="${scenarioButton[4]}"></div>
</form>`);
k3 = k3Input.k3;
viewof ellInput = form(html`<form>
<div><input style="width: 100px" name="ell" type="number" step="0.01" value="${scenarioButton[5]}"></div>
</form>`);
ell = ellInput.ell;
viewof sped1Input = form(html`<form>
<div><input style="width: 100px" name="sped1" type="number" step="0.01" value="${scenarioButton[6]}"></div>
</form>`);
sped1 = sped1Input.sped1;
viewof sped2Input = form(html`<form>
<div><input style="width: 100px" name="sped2" type="number" step="0.01" value="${scenarioButton[7]}"></div>
</form>`);
sped2 = sped2Input.sped2;
viewof sped3Input = form(html`<form>
<div><input style="width: 100px" name="sped3" type="number" step="0.01" value="${scenarioButton[8]}"></div>
</form>`);
sped3 = sped3Input.sped3;
viewof sped4Input = form(html`<form>
<div><input style="width: 100px" name="sped4" type="number" step="0.01" value="${scenarioButton[9]}"></div>
</form>`);
sped4 = sped4Input.sped4;
viewof sped5Input = form(html`<form>
<div><input style="width: 100px" name="sped5" type="number" step="0.01" value="${scenarioButton[10]}"></div>
</form>`);
sped5 = sped5Input.sped5;
viewof sped6Input = form(html`<form>
<div><input style="width: 100px" name="sped6" type="number" step="0.01" value="${scenarioButton[11]}"></div>
</form>`);
sped6 = sped6Input.sped6;
viewof sped7Input = form(html`<form>
<div><input style="width: 100px" name="sped7" type="number" step="0.01" value="${scenarioButton[12]}"></div>
</form>`);
sped7 = sped7Input.sped7;
viewof sped8Input = form(html`<form>
<div><input style="width: 100px" name="sped8" type="number" step="0.01" value="${scenarioButton[13]}"></div>
</form>`);
sped8 = sped8Input.sped8;
viewof sped9Input = form(html`<form>
<div><input style="width: 100px" name="sped9" type="number" step="0.01" value="${scenarioButton[14]}"></div>
</form>`);
sped9 = sped9Input.sped9;
viewof sped10Input = form(html`<form>
<div><input style="width: 100px" name="sped10" type="number" step="0.01" value="${scenarioButton[15]}"></div>
</form>`);
sped10 = sped10Input.sped10;
viewof sped11Input = form(html`<form>
<div><input style="width: 100px" name="sped11" type="number" step="0.01" value="${scenarioButton[16]}"></div>
</form>`);
sped11 = sped11Input.sped11;
// District-to-Charter
viewof daaP8Input = form(html`<form>
<div class="input-icon"><input name="P8" type="number" value="${scenarioButton[17]}"><i>$</i></div>
</form>`);
daaP8 = daaP8Input.P8;
viewof daaG912Input = form(html`<form>
<div class="input-icon"><input name="G912" type="number" value="${scenarioButton[18]}"><i>$</i></div>
</form>`);
daaG912 = daaG912Input.G912;
tempDistrictsData = FileAttachment("data/arizona/district_data.csv").csv()
// Functions
functions = {aq.addFunction('round5', x => x.toFixed(5), { override: true })
aq.addFunction('round10', x => x.toFixed(10), { override: true })
aq.addFunction('round4', x => x.toFixed(4), { override: true })
aq.addFunction('round3', x => x.toFixed(3), { override: true })
aq.addFunction('round2', x => x.toFixed(2), { override: true })
aq.addFunction('trunc', x => Math.trunc(x), { override: true })}
currentDistrictsData = aq.from(tempDistrictsData)
.derive({
B_COST: d => d.NAME === "Pima County Accommodation School District" ? 5014.03 : +d.B_COST
})
.derive({
TRCL_23_CONS: d => 0,
})
.derive({
CD_TWINAS_CYK8: d => d.NAOI_CYK8 * d.SUPP_LWK8,
CD_TWINAS_CY912: d => d.NAOI_CY912 * d.SUPP_LW912,
CD_TWINAS_CYPSD: d => d.NAOI_CYPSD * d.SUPP_LWPSD,
CD_TWINAS_K3_READ: d => d.NAOI_CYK3R * 0.04,
CD_TWINAS_K3: d => d.NAOI_CYK3 * 0.06,
CD_TWINAS_ELL: d => d.NAOI_ELL * 0.115,
CD_TWINAS_SPED_1: d => d.NAOI_SPED_1 * 4.771,
CD_TWINAS_SPED_2: d => d.NAOI_SPED_2 * 6.024,
CD_TWINAS_SPED_3: d => d.NAOI_SPED_3 * 5.988,
CD_TWINAS_SPED_4: d => d.NAOI_SPED_4 * 7.947,
CD_TWINAS_SPED_5: d => d.NAOI_SPED_5 * 3.158,
CD_TWINAS_SPED_6: d => d.NAOI_SPED_6 * 6.773,
CD_TWINAS_SPED_7: d => d.NAOI_SPED_7 * 3.595,
CD_TWINAS_SPED_8: d => d.NAOI_SPED_8 * 0.292,
CD_TWINAS_SPED_9: d => d.NAOI_SPED_9 * 4.822,
CD_TWINAS_SPED_10: d => d.NAOI_SPED_10 * 4.421,
CD_TWINAS_SPED_11: d => d.NAOI_SPED_11 * 4.806,
CD_TWAFT_CYK8: d => d.AFT_CYK8 * d.SUPP_LWK8,
CD_TWAFT_CY912: d => d.AFT_CY912 * d.SUPP_LW912,
CD_TWAFT_CYPSD: d => d.AFT_CYPSD * d.SUPP_LWPSD,
CD_TWAFT_K3_READ: d => d.AFT_CYK3R * 0.04,
CD_TWAFT_K3: d => d.AFT_CYK3 * 0.06,
CD_TWAFT_ELL: d => d.AFT_ELL * 0.115,
CD_TWAFT_SPED_1: d => d.AFT_SPED_1 * 4.771,
CD_TWAFT_SPED_2: d => d.AFT_SPED_2 * 6.024,
CD_TWAFT_SPED_3: d => d.AFT_SPED_3 * 5.988,
CD_TWAFT_SPED_4: d => d.AFT_SPED_4 * 7.947,
CD_TWAFT_SPED_5: d => d.AFT_SPED_5 * 3.158,
CD_TWAFT_SPED_6: d => d.AFT_SPED_6 * 6.773,
CD_TWAFT_SPED_7: d => d.AFT_SPED_7 * 3.595,
CD_TWAFT_SPED_8: d => d.AFT_SPED_8 * 0.292,
CD_TWAFT_SPED_9: d => d.AFT_SPED_9 * 4.822,
CD_TWAFT_SPED_10: d => d.AFT_SPED_10 * 4.421,
CD_TWAFT_SPED_11: d => d.AFT_SPED_11 * 4.806,
CD_TWAPT_CYK8: d => d.APT_CYK8 * d.SUPP_LWK8,
CD_TWAPT_CY912: d => d.APT_CY912 * d.SUPP_LW912,
CD_TWAPT_CYPSD: d => d.APT_CYPSD * d.SUPP_LWPSD,
CD_TWAPT_K3_READ: d => d.APT_CYK3R * 0.04,
CD_TWAPT_K3: d => d.APT_CYK3 * 0.06,
CD_TWAPT_ELL: d => d.APT_ELL * 0.115,
CD_TWAPT_SPED_1: d => d.APT_SPED_1 * 4.771,
CD_TWAPT_SPED_2: d => d.APT_SPED_2 * 6.024,
CD_TWAPT_SPED_3: d => d.APT_SPED_3 * 5.988,
CD_TWAPT_SPED_4: d => d.APT_SPED_4 * 7.947,
CD_TWAPT_SPED_5: d => d.APT_SPED_5 * 3.158,
CD_TWAPT_SPED_6: d => d.APT_SPED_6 * 6.773,
CD_TWAPT_SPED_7: d => d.APT_SPED_7 * 3.595,
CD_TWAPT_SPED_8: d => d.APT_SPED_8 * 0.292,
CD_TWAPT_SPED_9: d => d.APT_SPED_9 * 4.822,
CD_TWAPT_SPED_10: d => d.APT_SPED_10 * 4.421,
CD_TWAPT_SPED_11: d => d.APT_SPED_11 * 4.806
})
.derive({
NAOI: d => (d.CD_TWINAS_CYK8 + d.CD_TWINAS_CY912 + d.CD_TWINAS_CYPSD +
d.CD_TWINAS_K3_READ + d.CD_TWINAS_K3 + d.CD_TWINAS_ELL +
d.CD_TWINAS_SPED_1 + d.CD_TWINAS_SPED_2 + d.CD_TWINAS_SPED_3 +
d.CD_TWINAS_SPED_4 + d.CD_TWINAS_SPED_5 + d.CD_TWINAS_SPED_6 +
d.CD_TWINAS_SPED_7 + d.CD_TWINAS_SPED_8 + d.CD_TWINAS_SPED_9 +
d.CD_TWINAS_SPED_10 + d.CD_TWINAS_SPED_11)
})
.derive({
AOIFT: d => (d.CD_TWAFT_CYK8 + d.CD_TWAFT_CY912 + d.CD_TWAFT_CYPSD +
d.CD_TWAFT_K3_READ + d.CD_TWAFT_K3 + d.CD_TWAFT_ELL +
d.CD_TWAFT_SPED_1 + d.CD_TWAFT_SPED_2 + d.CD_TWAFT_SPED_3 +
d.CD_TWAFT_SPED_4 + d.CD_TWAFT_SPED_5 + d.CD_TWAFT_SPED_6 +
d.CD_TWAFT_SPED_7 + d.CD_TWAFT_SPED_8 + d.CD_TWAFT_SPED_9 +
d.CD_TWAFT_SPED_10 + d.CD_TWAFT_SPED_11)
})
.derive({
AOIPT: d => (d.CD_TWAPT_CYK8 + d.CD_TWAPT_CY912 + d.CD_TWAPT_CYPSD +
d.CD_TWAPT_K3_READ + d.CD_TWAPT_K3 + d.CD_TWAPT_ELL +
d.CD_TWAPT_SPED_1 + d.CD_TWAPT_SPED_2 + d.CD_TWAPT_SPED_3 +
d.CD_TWAPT_SPED_4 + d.CD_TWAPT_SPED_5 + d.CD_TWAPT_SPED_6 +
d.CD_TWAPT_SPED_7 + d.CD_TWAPT_SPED_8 + d.CD_TWAPT_SPED_9 +
d.CD_TWAPT_SPED_10 + d.CD_TWAPT_SPED_11)
})
.derive({
CD_M_BSL: d => +op.round2(((d.CD_TWINAS_CYK8 + d.CD_TWINAS_CY912 + d.CD_TWINAS_CYPSD +
d.CD_TWINAS_K3_READ + d.CD_TWINAS_K3 + d.CD_TWINAS_ELL +
d.CD_TWINAS_SPED_1 + d.CD_TWINAS_SPED_2 + d.CD_TWINAS_SPED_3 +
d.CD_TWINAS_SPED_4 + d.CD_TWINAS_SPED_5 + d.CD_TWINAS_SPED_6 +
d.CD_TWINAS_SPED_7 + d.CD_TWINAS_SPED_8 + d.CD_TWINAS_SPED_9 +
d.CD_TWINAS_SPED_10 + d.CD_TWINAS_SPED_11) * d.B_COST) +
((d.CD_TWAFT_CYK8 + d.CD_TWAFT_CY912 + d.CD_TWAFT_CYPSD +
d.CD_TWAFT_K3_READ + d.CD_TWAFT_K3 + d.CD_TWAFT_ELL +
d.CD_TWAFT_SPED_1 + d.CD_TWAFT_SPED_2 + d.CD_TWAFT_SPED_3 +
d.CD_TWAFT_SPED_4 + d.CD_TWAFT_SPED_5 + d.CD_TWAFT_SPED_6 +
d.CD_TWAFT_SPED_7 + d.CD_TWAFT_SPED_8 + d.CD_TWAFT_SPED_9 +
d.CD_TWAFT_SPED_10 + d.CD_TWAFT_SPED_11) * 0.95 * d.B_COST) +
((d.CD_TWAPT_CYK8 + d.CD_TWAPT_CY912 + d.CD_TWAPT_CYPSD +
d.CD_TWAPT_K3_READ + d.CD_TWAPT_K3 + d.CD_TWAPT_ELL +
d.CD_TWAPT_SPED_1 + d.CD_TWAPT_SPED_2 + d.CD_TWAPT_SPED_3 +
d.CD_TWAPT_SPED_4 + d.CD_TWAPT_SPED_5 + d.CD_TWAPT_SPED_6 +
d.CD_TWAPT_SPED_7 + d.CD_TWAPT_SPED_8 + d.CD_TWAPT_SPED_9 +
d.CD_TWAPT_SPED_10 + d.CD_TWAPT_SPED_11) * 0.85 * d.B_COST))
})
.derive({ CD_M_ADJ_BSL: d => d.CD_M_BSL * d.TEI })
.derive({
CD_BSL_BRCL: d => +d.CD_M_ADJ_BSL + +d.B_SUPP_ADJ,
CD_TSL_TF_SSL: d => +op.round2(d.TSL_TADRM * 180 * d.TSL_SSLRM)
})
.derive({
CD_TSL_ATS: d => +op.round2(d.CD_TSL_TF_SSL * d.TSL_ATF),
CD_TSL_HESYSL: d => +d.TSL_HESYM
})
.derive({ CD_TSL_SL: d => +op.round2(+d.CD_TSL_TF_SSL + +d.CD_TSL_ATS + +d.CD_TSL_HESYSL + +d.TSL_AEBPT) })
.derive({ CD_TRCL_PRELIM: d => +op.round2(+d.CD_TSL_SL - +d.TRCL_TSL_2122 + +d.TRCL_2122) })
.derive({
CD_TRCL_23_TSL: d => +op.round2(d.CD_TSL_SL * 1.2)
})
.derive({
CD_TRCL_ADJ_23: d => +d.CD_TRCL_PRELIM > +d.CD_TRCL_23_TSL ? +d.TRCL_2122 : +d.CD_TRCL_PRELIM
})
.derive({
CD_TRCL_23: d => +d.CD_TSL_SL > +d.CD_TRCL_ADJ_23 ? +d.CD_TSL_SL : +d.CD_TRCL_ADJ_23
})
.derive({
CD_CALC_DSL: d => +op.round2(+d.CD_BSL_BRCL + +d.TRCL_23_CONS + +d.TRCL_TO + +d.CD_TSL_SL),
CD_CALC_RSL: d => +op.round2(+d.CD_BSL_BRCL + +d.TRCL_23_CONS + +d.TRCL_TO + +d.CD_TRCL_23),
CD_DAA_PSD: d => d.DAA_PSDC * d.DAA_PPSD,
CD_DAA_K8: d => d.DAA_K8C * d.DAA_K8,
CD_DAA_912: d => (+d.DAA_912C + +d.DAA_T3TOC) * d.DAA_912,
CD_DAAG_FACTOR: d => (+d.DAAG_F23_ASC/+d.DAAG_F22_ASC)
})
.derive({
CD_DAAG_FACTOR_USE: d => (+op.round5(+op.trunc((+d.CD_DAAG_FACTOR <= 1.05 ? 1 :(+d.CD_DAAG_FACTOR-1)/2 + 1) * 1e6) / 1e6) * 1e4)/1e4
})
.derive({
CD_DAAG_PSD_ADJ_FUND: d => +op.round2(d.CD_DAAG_FACTOR_USE * d.CD_DAA_PSD),
CD_DAAG_K8_ADJ_FUND: d => +op.round2(d.CD_DAAG_FACTOR_USE * d.CD_DAA_K8),
CD_DAAG_912_ADJ_FUND: d => +op.round2(d.CD_DAAG_FACTOR_USE * d.CD_DAA_912)
})
.derive({
CD_DAA_HS_TEXT: d => +op.round2(+d.DAAHS_AMOUNT),
CD_2021_PSD8_DAA_BASE: d => (+d.CD_DAAG_PSD_ADJ_FUND + +d.CD_DAAG_K8_ADJ_FUND + +d.DAAA_PSD8_ADJ)
})
.derive({
CD_2021_912_DAA_BASE: d => +d.DAAHS_AMOUNT,
CD_EB_LESSER_RCLDSL: d => +d.CD_CALC_DSL < +d.CD_CALC_RSL ? +d.CD_CALC_DSL : +d.CD_CALC_RSL,
CD_EB_PSD8: d => (((+d.NAOI_CYK8 + +d.AFT_CYK8 + +d.APT_CYK8) * +d.SUPP_LWK8) + ((+d.NAOI_CYPSD + +d.AFT_CYPSD + +d.APT_CYPSD) * +d.SUPP_LWPSD)),
CD_EB_912: d => (((+d.NAOI_CY912 + +d.AFT_CY912 + +d.APT_CY912) * +d.SUPP_LW912))
})
.derive({
CD_EB_PSD8_PCT: d => +op.round10(+d.CD_EB_PSD8 / (+d.CD_EB_PSD8 + +d.CD_EB_912)),
CD_EB_912_PCT: d => +op.round10(+d.CD_EB_912 / (+d.CD_EB_PSD8 + +d.CD_EB_912))
})
.derive({
CD_EB_RCLDCL_PSD8: d => +op.round2(+d.CD_EB_LESSER_RCLDSL * +d.CD_EB_PSD8_PCT) - +d.TRCL_TO,
CD_EB_RCLDCL_912: d => +op.round2(+d.CD_EB_LESSER_RCLDSL * +d.CD_EB_912_PCT),
CD_QUAL_LEVY: d => ((+d.TAX_PAV1 + +d.TAX_PRIMARY + (+d.TAX_SR * 2) + (+d.TAX_GPLET * 2))/100 * +d.TAX_RATE)
})
.derive({
CD_EA_PSD8: d => +op.round2((+d.CD_EB_RCLDCL_PSD8 + +d.CD_2021_PSD8_DAA_BASE + - (+d.CD_QUAL_LEVY / 2)) < 0 ? 0 : (+d.CD_EB_RCLDCL_PSD8 + +d.CD_2021_PSD8_DAA_BASE + - (+d.CD_QUAL_LEVY / 2))),
CD_EA_912: d => +op.round2((+d.CD_EB_RCLDCL_912 + +d.CD_2021_912_DAA_BASE + +d.TRCL_TO + - (+d.CD_QUAL_LEVY/2)) < 0 ? 0 : (+d.CD_2021_912_DAA_BASE + +d.CD_EB_RCLDCL_912 + +d.TRCL_TO - (+d.CD_QUAL_LEVY / 2)))
})
.select('ID', 'NAME', 'B_COST', 'DAA_912', 'CD_DAAG_912_ADJ_FUND', 'CD_2021_912_DAA_BASE', 'TSL_AEBPT', 'TRCL_23_CONS', 'CD_TSL_SL', 'CD_TRCL_23_TSL', 'TRCL_2122', 'CD_TRCL_PRELIM',
'CD_DAAG_FACTOR_USE', 'CD_DAAG_PSD_ADJ_FUND', 'CD_DAAG_K8_ADJ_FUND', 'CD_DAAG_912_ADJ_FUND',
'NAOI', 'AOIFT', 'AOIPT', 'B_COST', 'CD_TWINAS_CYK8', 'CD_TWINAS_CY912', 'CD_TWINAS_CYPSD', 'CD_TWINAS_K3_READ', 'CD_TWINAS_K3', 'CD_TWINAS_ELL', 'CD_TWINAS_SPED_1', 'CD_TWINAS_SPED_2', 'CD_TWINAS_SPED_3', 'CD_TWINAS_SPED_4', 'CD_TWINAS_SPED_5', 'CD_TWINAS_SPED_6', 'CD_TWINAS_SPED_7', 'CD_TWINAS_SPED_8', 'CD_TWINAS_SPED_9', 'CD_TWINAS_SPED_10', 'CD_TWINAS_SPED_11', 'CD_TWAFT_CYK8', 'CD_TWAFT_CY912', 'CD_TWAFT_CYPSD', 'CD_TWAFT_K3_READ', 'CD_TWAFT_K3', 'CD_TWAFT_ELL', 'CD_TWAFT_SPED_1', 'CD_TWAFT_SPED_2', 'CD_TWAFT_SPED_3', 'CD_TWAFT_SPED_4', 'CD_TWAFT_SPED_5', 'CD_TWAFT_SPED_6', 'CD_TWAFT_SPED_7', 'CD_TWAFT_SPED_8', 'CD_TWAFT_SPED_9', 'CD_TWAFT_SPED_10', 'CD_TWAFT_SPED_11', 'CD_TWAPT_CYK8', 'CD_TWAPT_CY912', 'CD_TWAPT_CYPSD', 'CD_TWAPT_K3_READ', 'CD_TWAPT_K3', 'CD_TWAPT_ELL', 'CD_TWAPT_SPED_1', 'CD_TWAPT_SPED_2', 'CD_TWAPT_SPED_3', 'CD_TWAPT_SPED_4', 'CD_TWAPT_SPED_5', 'CD_TWAPT_SPED_6', 'CD_TWAPT_SPED_7', 'CD_TWAPT_SPED_8', 'CD_TWAPT_SPED_9', 'CD_TWAPT_SPED_10', 'CD_TWAPT_SPED_11', 'CD_M_BSL', 'CD_M_ADJ_BSL', 'CD_BSL_BRCL', 'CD_TSL_TF_SSL', 'CD_TSL_ATS', 'CD_TSL_HESYSL', 'CD_TSL_SL', 'CD_TRCL_PRELIM', 'CD_TRCL_23_TSL', 'CD_TRCL_ADJ_23', 'CD_TRCL_23', 'CD_CALC_DSL', 'CD_CALC_RSL', 'CD_DAA_PSD', 'CD_DAA_K8', 'CD_DAA_912', 'CD_DAAG_FACTOR', 'CD_DAAG_FACTOR_USE', 'CD_DAAG_PSD_ADJ_FUND', 'CD_DAAG_K8_ADJ_FUND', 'CD_DAAG_912_ADJ_FUND',
'CD_DAA_HS_TEXT', 'CD_2021_PSD8_DAA_BASE', 'CD_2021_912_DAA_BASE', 'CD_EB_LESSER_RCLDSL', 'CD_EB_PSD8', 'CD_EB_912', 'CD_EB_PSD8_PCT', 'CD_EB_912_PCT', 'CD_EB_RCLDCL_PSD8', 'CD_EB_RCLDCL_912', 'CD_QUAL_LEVY', 'CD_EA_PSD8', 'CD_EA_912', 'TRCL_TO')
.objects();
modeledDistrictsData = aq.from(tempDistrictsData)
.params({
// teacherCompAdj: teacherCompAdj,
baseLevelAmount: baseLevelAmount,
teacherExpIndex: teacherExpIndex,
k3Reading: k3Reading,
k3: k3,
ell: ell,
sped1: sped1,
sped2: sped2,
sped3: sped3,
sped4: sped4,
sped5: sped5,
sped6: sped6,
sped7: sped7,
sped8: sped8,
sped9: sped9,
sped10: sped10,
sped11: sped11})
// .derive({ TeacherCompAdj: (d, $) => $.teacherCompAdj == true ? 1.0125 : 1})
.derive({ MD_B_COST_Temp: (d, $) => +op.round2($.baseLevelAmount) })
.derive({ MD_B_COST: d => d.NAME === "Pima County Accommodation School District" ? 5014.03 : +d.MD_B_COST_Temp })
.derive({
TRCL_23_CONS: d => 0
})
.derive({
MD_TWINAS_CYK8: d => +d.NAOI_CYK8 * +d.SUPP_LWK8,
MD_TWINAS_CY912: d => +d.NAOI_CY912 * +d.SUPP_LW912,
MD_TWINAS_CYPSD: d => +d.NAOI_CYPSD * +d.SUPP_LWPSD,
MD_TWINAS_K3_READ: (d, $) => +d.NAOI_CYK3R * $.k3Reading,
MD_TWINAS_K3: (d, $) => +d.NAOI_CYK3 * $.k3,
MD_TWINAS_ELL: (d, $) =>+d.NAOI_ELL * $.ell,
MD_TWINAS_SPED_1: (d, $) => +d.NAOI_SPED_1 * $.sped1,
MD_TWINAS_SPED_2: (d, $) => +d.NAOI_SPED_2 * $.sped2,
MD_TWINAS_SPED_3: (d, $) => +d.NAOI_SPED_3 * $.sped3,
MD_TWINAS_SPED_4: (d, $) => +d.NAOI_SPED_4 * $.sped4,
MD_TWINAS_SPED_5: (d, $) => +d.NAOI_SPED_5 * $.sped5,
MD_TWINAS_SPED_6: (d, $) => +d.NAOI_SPED_6 * $.sped6,
MD_TWINAS_SPED_7: (d, $) => +d.NAOI_SPED_7 * $.sped7,
MD_TWINAS_SPED_8: (d, $) => +d.NAOI_SPED_8 * $.sped8,
MD_TWINAS_SPED_9: (d, $) => +d.NAOI_SPED_9 * $.sped9,
MD_TWINAS_SPED_10: (d, $) => +d.NAOI_SPED_10 * $.sped10,
MD_TWINAS_SPED_11: (d, $) => +d.NAOI_SPED_11 * $.sped11
})
.derive({
MD_TWAFT_CYK8: d => +d.AFT_CYK8 * +d.SUPP_LWK8,
MD_TWAFT_CY912: d => +d.AFT_CY912 * +d.SUPP_LW912,
MD_TWAFT_CYPSD: d => +d.AFT_CYPSD * +d.SUPP_LWPSD,
MD_TWAFT_K3_READ: (d, $) => +d.AFT_CYK3R * $.k3Reading,
MD_TWAFT_K3: (d, $) => +d.AFT_CYK3 * $.k3,
MD_TWAFT_ELL: (d, $) => +d.AFT_ELL * $.ell,
MD_TWAFT_SPED_1: (d, $) => +d.AFT_SPED_1 * $.sped1,
MD_TWAFT_SPED_2: (d, $) => +d.AFT_SPED_2 * $.sped2,
MD_TWAFT_SPED_3: (d, $) => +d.AFT_SPED_3 * $.sped3,
MD_TWAFT_SPED_4: (d, $) => +d.AFT_SPED_4 * $.sped4,
MD_TWAFT_SPED_5: (d, $) => +d.AFT_SPED_5 * $.sped5,
MD_TWAFT_SPED_6: (d, $) => +d.AFT_SPED_6 * $.sped6,
MD_TWAFT_SPED_7: (d, $) => +d.AFT_SPED_7 * $.sped7,
MD_TWAFT_SPED_8: (d, $) => +d.AFT_SPED_8 * $.sped8,
MD_TWAFT_SPED_9: (d, $) => +d.AFT_SPED_9 * $.sped9,
MD_TWAFT_SPED_10: (d, $) => +d.AFT_SPED_10 * $.sped10,
MD_TWAFT_SPED_11: (d, $) => +d.AFT_SPED_11 * $.sped11
})
.derive({
MD_TWAPT_CYK8: d => +d.APT_CYK8 * +d.SUPP_LWK8,
MD_TWAPT_CY912: d => +d.APT_CY912 * +d.SUPP_LW912,
MD_TWAPT_CYPSD: d => +d.APT_CYPSD * +d.SUPP_LWPSD,
MD_TWAPT_K3_READ: (d, $) => +d.APT_CYK3R * $.k3Reading,
MD_TWAPT_K3: (d, $) => +d.APT_CYK3 * $.k3,
MD_TWAPT_ELL: (d, $) => +d.APT_ELL * $.ell,
MD_TWAPT_SPED_1: (d, $) => +d.APT_SPED_1 * $.sped1,
MD_TWAPT_SPED_2: (d, $) => +d.APT_SPED_2 * $.sped2,
MD_TWAPT_SPED_3: (d, $) => +d.APT_SPED_3 * $.sped3,
MD_TWAPT_SPED_4: (d, $) => +d.APT_SPED_4 * $.sped4,
MD_TWAPT_SPED_5: (d, $) => +d.APT_SPED_5 * $.sped5,
MD_TWAPT_SPED_6: (d, $) => +d.APT_SPED_6 * $.sped6,
MD_TWAPT_SPED_7: (d, $) => +d.APT_SPED_7 * $.sped7,
MD_TWAPT_SPED_8: (d, $) => +d.APT_SPED_8 * $.sped8,
MD_TWAPT_SPED_9: (d, $) => +d.APT_SPED_9 * $.sped9,
MD_TWAPT_SPED_10: (d, $) => +d.APT_SPED_10 * $.sped10,
MD_TWAPT_SPED_11: (d, $) => +d.APT_SPED_11 * $.sped11
})
.derive({
MD_NAOI: d => (d.MD_TWINAS_CYK8 + d.MD_TWINAS_CY912 + d.MD_TWINAS_CYPSD +
d.MD_TWINAS_K3_READ + d.MD_TWINAS_K3 + d.MD_TWINAS_ELL +
d.MD_TWINAS_SPED_1 + d.MD_TWINAS_SPED_2 + d.MD_TWINAS_SPED_3 +
d.MD_TWINAS_SPED_4 + d.MD_TWINAS_SPED_5 + d.MD_TWINAS_SPED_6 +
d.MD_TWINAS_SPED_7 + d.MD_TWINAS_SPED_8 + d.MD_TWINAS_SPED_9 +
d.MD_TWINAS_SPED_10 + d.MD_TWINAS_SPED_11)
})
.derive({
MD_AOIFT: d => (d.MD_TWAFT_CYK8 + d.MD_TWAFT_CY912 + d.MD_TWAFT_CYPSD +
d.MD_TWAFT_K3_READ + d.MD_TWAFT_K3 + d.MD_TWAFT_ELL +
d.MD_TWAFT_SPED_1 + d.MD_TWAFT_SPED_2 + d.MD_TWAFT_SPED_3 +
d.MD_TWAFT_SPED_4 + d.MD_TWAFT_SPED_5 + d.MD_TWAFT_SPED_6 +
d.MD_TWAFT_SPED_7 + d.MD_TWAFT_SPED_8 + d.MD_TWAFT_SPED_9 +
d.MD_TWAFT_SPED_10 + d.MD_TWAFT_SPED_11)
})
.derive({
MD_AOIPT: d => (d.MD_TWAPT_CYK8 + d.MD_TWAPT_CY912 + d.MD_TWAPT_CYPSD +
d.MD_TWAPT_K3_READ + d.MD_TWAPT_K3 + d.MD_TWAPT_ELL +
d.MD_TWAPT_SPED_1 + d.MD_TWAPT_SPED_2 + d.MD_TWAPT_SPED_3 +
d.MD_TWAPT_SPED_4 + d.MD_TWAPT_SPED_5 + d.MD_TWAPT_SPED_6 +
d.MD_TWAPT_SPED_7 + d.MD_TWAPT_SPED_8 + d.MD_TWAPT_SPED_9 +
d.MD_TWAPT_SPED_10 + d.MD_TWAPT_SPED_11)
})
.derive({
MD_M_BSL: d => +op.round2(((+d.MD_TWINAS_CYK8 + +d.MD_TWINAS_CY912 + +d.MD_TWINAS_CYPSD +
+d.MD_TWINAS_K3_READ + +d.MD_TWINAS_K3 + +d.MD_TWINAS_ELL +
+d.MD_TWINAS_SPED_1 + +d.MD_TWINAS_SPED_2 + +d.MD_TWINAS_SPED_3 +
+d.MD_TWINAS_SPED_4 + +d.MD_TWINAS_SPED_5 + +d.MD_TWINAS_SPED_6 +
+d.MD_TWINAS_SPED_7 + +d.MD_TWINAS_SPED_8 + +d.MD_TWINAS_SPED_9 +
+d.MD_TWINAS_SPED_10 + +d.MD_TWINAS_SPED_11) * +d.MD_B_COST) +
((+d.MD_TWAFT_CYK8 + +d.MD_TWAFT_CY912 + +d.MD_TWAFT_CYPSD +
+d.MD_TWAFT_K3_READ + +d.MD_TWAFT_K3 + +d.MD_TWAFT_ELL +
+d.MD_TWAFT_SPED_1 + +d.MD_TWAFT_SPED_2 + +d.MD_TWAFT_SPED_3 +
+d.MD_TWAFT_SPED_4 + +d.MD_TWAFT_SPED_5 + +d.MD_TWAFT_SPED_6 +
+d.MD_TWAFT_SPED_7 + +d.MD_TWAFT_SPED_8 + +d.MD_TWAFT_SPED_9 +
+d.MD_TWAFT_SPED_10 + +d.MD_TWAFT_SPED_11) * 0.95 * +d.MD_B_COST) +
((+d.MD_TWAPT_CYK8 + +d.MD_TWAPT_CY912 + +d.MD_TWAPT_CYPSD +
+d.MD_TWAPT_K3_READ + +d.MD_TWAPT_K3 + +d.MD_TWAPT_ELL +
+d.MD_TWAPT_SPED_1 + +d.MD_TWAPT_SPED_2 + +d.MD_TWAPT_SPED_3 +
+d.MD_TWAPT_SPED_4 + +d.MD_TWAPT_SPED_5 + +d.MD_TWAPT_SPED_6 +
+d.MD_TWAPT_SPED_7 + +d.MD_TWAPT_SPED_8 + +d.MD_TWAPT_SPED_9 +
+d.MD_TWAPT_SPED_10 + +d.MD_TWAPT_SPED_11) * 0.85 * +d.MD_B_COST))
})
.derive({ MD_M_ADJ_BSL: (d, $) => $.teacherExpIndex == true ? +d.MD_M_BSL * +d.TEI : +d.MD_M_BSL })
.derive({
MD_BSL_BRCL: d => +d.MD_M_ADJ_BSL + +d.B_SUPP_ADJ,
MD_TSL_TF_SSL: d => +op.round2(+d.TSL_TADRM * 180 * +d.TSL_SSLRM)
})
.derive({
MD_TSL_ATS: d => +op.round2(+d.MD_TSL_TF_SSL * +d.TSL_ATF),
MD_TSL_HESYSL: d => +d.TSL_HESYM
})
.derive({ MD_TSL_SL: d => +op.round2(+d.MD_TSL_TF_SSL + +d.MD_TSL_ATS + +d.MD_TSL_HESYSL + +d.TSL_AEBPT)})
.derive({
MD_TRCL_PRELIM: d => +op.round2(+d.MD_TSL_SL - + d.TRCL_TSL_2122 + +d.TRCL_2122),
MD_TRCL_23_TSL: d => +op.round2(+d.MD_TSL_SL * 1.2)
})
.derive({ MD_TRCL_ADJ_23: d => +d.MD_TRCL_PRELIM > +d.MD_TRCL_23_TSL ? +d.TRCL_2122 : +d.MD_TRCL_PRELIM})
.derive({ MD_TRCL_23: d => +d.MD_TSL_SL > +d.MD_TRCL_ADJ_23 ? +d.MD_TSL_SL : +d.MD_TRCL_ADJ_23})
.derive({
MD_CALC_DSL: d => +op.round2(+d.MD_BSL_BRCL + +d.TRCL_23_CONS + +d.TRCL_TO + +d.MD_TSL_SL),
MD_CALC_RSL: d => +op.round2(+d.MD_BSL_BRCL + +d.TRCL_23_CONS + +d.TRCL_TO + +d.MD_TRCL_23),
MD_DAA_PSD: d => +d.DAA_PSDC * +d.DAA_PPSD,
MD_DAA_K8: d => +d.DAA_K8C * +d.DAA_K8,
MD_DAA_912: d => (+d.DAA_912C + +d.DAA_T3TOC) * +d.DAA_912,
MD_DAAG_FACTOR: d => (+d.DAAG_F23_ASC/+d.DAAG_F22_ASC)
})
.derive({
MD_DAAG_FACTOR_USE: d => (+op.round5(+op.trunc((+d.MD_DAAG_FACTOR <= 1.05 ? 1 :(+d.MD_DAAG_FACTOR-1)/2 + 1) * 1e6) / 1e6) * 1e4)/1e4
})
.derive({
MD_DAAG_PSD_ADJ_FUND: d => +op.round2(+d.MD_DAAG_FACTOR_USE * +d.MD_DAA_PSD),
MD_DAAG_K8_ADJ_FUND: d => +op.round2(+d.MD_DAAG_FACTOR_USE * +d.MD_DAA_K8),
MD_DAAG_912_ADJ_FUND: d => +op.round2(+d.MD_DAAG_FACTOR_USE * +d.MD_DAA_912)
})
.derive({
MD_DAA_HS_TEXT: d => +op.round2(+d.DAAHS_AMOUNT),
MD_2021_PSD8_DAA_BASE: d => (+d.MD_DAAG_PSD_ADJ_FUND + +d.MD_DAAG_K8_ADJ_FUND + +d.DAAA_PSD8_ADJ)
})
.derive({
MD_2021_912_DAA_BASE: d => +d.DAAHS_AMOUNT,
MD_EB_LESSER_RCLDSL: d => +d.MD_CALC_DSL < +d.MD_CALC_RSL ? +d.MD_CALC_DSL : +d.MD_CALC_RSL,
MD_EB_PSD8: d => ((+d.NAOI_CYK8 + +d.AFT_CYK8 + +d.APT_CYK8) * +d.SUPP_LWK8) + ((+d.NAOI_CYPSD + +d.AFT_CYPSD + +d.APT_CYPSD) * +d.SUPP_LWPSD),
MD_EB_912: d => ((+d.NAOI_CY912 + +d.AFT_CY912 + +d.APT_CY912) * +d.SUPP_LW912)
})
.derive({
MD_EB_PSD8_PCT: d => +op.round10(+d.MD_EB_PSD8 / (+d.MD_EB_PSD8 + +d.MD_EB_912)),
MD_EB_912_PCT: d => +op.round10(+d.MD_EB_912 / (+d.MD_EB_PSD8 + +d.MD_EB_912))
})
.derive({
MD_EB_RCLDCL_PSD8: d => +op.round2(+d.MD_EB_LESSER_RCLDSL * +d.MD_EB_PSD8_PCT) - +d.TRCL_TO,
MD_EB_RCLDCL_912: d => +op.round2(+d.MD_EB_LESSER_RCLDSL * +d.MD_EB_912_PCT),
MD_QUAL_LEVY: d => ((+d.TAX_PAV1 + +d.TAX_PRIMARY + (+d.TAX_SR * 2) + (+d.TAX_GPLET * 2))/100 * +d.TAX_RATE)
})
.derive({
MD_EA_PSD8: d => +op.round2(+d.MD_2021_PSD8_DAA_BASE + +d.MD_EB_RCLDCL_PSD8 - (+d.MD_QUAL_LEVY / 2) < 0 ? 0 : +d.MD_2021_PSD8_DAA_BASE + +d.MD_EB_RCLDCL_PSD8 - (+d.MD_QUAL_LEVY / 2)),
MD_EA_912: d => +op.round2(+d.MD_EB_RCLDCL_912 + +d.MD_2021_912_DAA_BASE - (+d.MD_QUAL_LEVY / 2) + +d.TRCL_TO < 0 ? 0 : +d.MD_EB_RCLDCL_912 + +d.MD_2021_912_DAA_BASE - (+d.MD_QUAL_LEVY / 2) + +d.TRCL_TO),
ADM: d => +d.NAOI_CYPSD + +d.NAOI_CYK8 + +d.NAOI_CY912 + +d.AFT_CYPSD + +d.AFT_CYK8 + +d.AFT_CY912 + +d.APT_CYPSD + +d.APT_CYK8 + +d.APT_CY912
})
.select('ID', 'NAME', 'MD_TSL_SL', 'MD_TRCL_23_TSL', 'TRCL_2122', 'MD_TRCL_PRELIM',
'MD_NAOI', 'MD_AOIFT', 'MD_AOIPT', 'MD_B_COST', 'MD_TWINAS_CYK8', 'MD_TWINAS_CY912', 'MD_TWINAS_CYPSD',
'MD_TWINAS_K3_READ', 'MD_TWINAS_K3', 'MD_TWINAS_ELL', 'MD_TWINAS_SPED_1', 'MD_TWINAS_SPED_2', 'MD_TWINAS_SPED_3',
'MD_TWINAS_SPED_4', 'MD_TWINAS_SPED_5', 'MD_TWINAS_SPED_6', 'MD_TWINAS_SPED_7', 'MD_TWINAS_SPED_8', 'MD_TWINAS_SPED_9', 'MD_TWINAS_SPED_10', 'MD_TWINAS_SPED_11', 'MD_M_BSL', 'MD_M_ADJ_BSL', 'MD_BSL_BRCL', 'MD_TSL_TF_SSL', 'MD_TSL_ATS', 'MD_TSL_HESYSL', 'MD_TSL_SL', 'MD_TRCL_PRELIM', 'MD_TRCL_23_TSL', 'MD_TRCL_ADJ_23', 'MD_TRCL_23', 'MD_CALC_DSL', 'MD_CALC_RSL', 'MD_DAA_PSD', 'MD_DAA_K8', 'MD_DAA_912', 'MD_DAAG_FACTOR', 'MD_DAAG_FACTOR_USE', 'MD_DAAG_PSD_ADJ_FUND', 'MD_DAAG_K8_ADJ_FUND', 'MD_DAAG_912_ADJ_FUND', 'MD_DAA_HS_TEXT', 'MD_2021_PSD8_DAA_BASE', 'MD_2021_912_DAA_BASE', 'MD_EB_LESSER_RCLDSL', 'MD_EB_PSD8', 'MD_EB_912', 'MD_EB_PSD8_PCT', 'MD_EB_912_PCT', 'MD_EB_RCLDCL_PSD8', 'MD_EB_RCLDCL_912', 'MD_QUAL_LEVY', 'MD_EA_PSD8', 'MD_EA_912', 'TRCL_TO', 'ADM', 'NAOI_CYK8', 'NAOI_CY912')
.objects();
currentSummary = aq.from(currentDistrictsData)
.derive({
current_equalization_base: d => (d.CD_EB_RCLDCL_PSD8 + d.CD_EB_RCLDCL_912 + d.CD_2021_PSD8_DAA_BASE + d.CD_2021_912_DAA_BASE + +d.TRCL_TO),
current_equalization_assistance: d => (d.CD_EA_PSD8 + d.CD_EA_912)
})
.select("ID", "NAME", "CD_EA_PSD8", "CD_EA_912", "current_equalization_base", "current_equalization_assistance")
.objects();
modeledSummary = aq.from(modeledDistrictsData)
.derive({
modeled_equalization_base: d => (d.MD_EB_RCLDCL_PSD8 + d.MD_EB_RCLDCL_912 + d.MD_2021_PSD8_DAA_BASE + d.MD_2021_912_DAA_BASE + +d.TRCL_TO),
modeled_equalization_assistance: d => (d.MD_EA_PSD8 + d.MD_EA_912),
NAOI_CYK8: d => +d.NAOI_CYK8,
NAOI_CY912: d => +d.NAOI_CY912
})
.select("ID", "NAME", "modeled_equalization_base", "modeled_equalization_assistance", "MD_TRCL_23", "MD_TSL_SL", "MD_QUAL_LEVY", "ADM", "NAOI_CYK8", "NAOI_CY912")
.objects();
districtsSummary = aq.from(currentSummary)
.join_left(aq.from(modeledSummary), [["ID", "NAME"], ["ID", "NAME"]])
.objects();
testingData = aq.from(tempDistrictsData)
.params({
// teacherCompAdj: teacherCompAdj,
baseLevelAmount: baseLevelAmount,
teacherExpIndex: teacherExpIndex,
k3Reading: k3Reading,
k3: k3,
ell: ell,
sped1: sped1,
sped2: sped2,
sped3: sped3,
sped4: sped4,
sped5: sped5,
sped6: sped6,
sped7: sped7,
sped8: sped8,
sped9: sped9,
sped10: sped10,
sped11: sped11,
daaP8: daaP8,
daaG912: daaG912})
// .derive({ TeacherCompAdj: (d, $) => $.teacherCompAdj == true ? 1.0125 : 1})
.derive({ d2c_B_COST_Temp: (d, $) => +op.round2($.baseLevelAmount) })
.derive({ d2c_B_COST: d => d.NAME === "Pima County Accommodation School District" ? 5014.03 : +d.d2c_B_COST_Temp })
.derive({
TRCL_23_CONS: d => 0
})
.derive({
d2c_TWINAS_CYK8: d => +d.NAOI_CYK8 * +d.SUPP_LWK8,
d2c_TWINAS_CY912: d => +d.NAOI_CY912 * +d.SUPP_LW912,
d2c_TWINAS_CYPSD: d => +d.NAOI_CYPSD * +d.SUPP_LWPSD,
d2c_TWINAS_K3_READ: (d, $) => +d.NAOI_CYK3R * $.k3Reading,
d2c_TWINAS_K3: (d, $) => +d.NAOI_CYK3 * $.k3,
d2c_TWINAS_ELL: (d, $) =>+d.NAOI_ELL * $.ell,
d2c_TWINAS_SPED_1: (d, $) => +d.NAOI_SPED_1 * $.sped1,
d2c_TWINAS_SPED_2: (d, $) => +d.NAOI_SPED_2 * $.sped2,
d2c_TWINAS_SPED_3: (d, $) => +d.NAOI_SPED_3 * $.sped3,
d2c_TWINAS_SPED_4: (d, $) => +d.NAOI_SPED_4 * $.sped4,
d2c_TWINAS_SPED_5: (d, $) => +d.NAOI_SPED_5 * $.sped5,
d2c_TWINAS_SPED_6: (d, $) => +d.NAOI_SPED_6 * $.sped6,
d2c_TWINAS_SPED_7: (d, $) => +d.NAOI_SPED_7 * $.sped7,
d2c_TWINAS_SPED_8: (d, $) => +d.NAOI_SPED_8 * $.sped8,
d2c_TWINAS_SPED_9: (d, $) => +d.NAOI_SPED_9 * $.sped9,
d2c_TWINAS_SPED_10: (d, $) => +d.NAOI_SPED_10 * $.sped10,
d2c_TWINAS_SPED_11: (d, $) => +d.NAOI_SPED_11 * $.sped11
})
.derive({
d2c_TWAFT_CYK8: d => +d.AFT_CYK8 * +d.SUPP_LWK8,
d2c_TWAFT_CY912: d => +d.AFT_CY912 * +d.SUPP_LW912,
d2c_TWAFT_CYPSD: d => +d.AFT_CYPSD * +d.SUPP_LWPSD,
d2c_TWAFT_K3_READ: (d, $) => +d.AFT_CYK3R * $.k3Reading,
d2c_TWAFT_K3: (d, $) => +d.AFT_CYK3 * $.k3,
d2c_TWAFT_ELL: (d, $) => +d.AFT_ELL * $.ell,
d2c_TWAFT_SPED_1: (d, $) => +d.AFT_SPED_1 * $.sped1,
d2c_TWAFT_SPED_2: (d, $) => +d.AFT_SPED_2 * $.sped2,
d2c_TWAFT_SPED_3: (d, $) => +d.AFT_SPED_3 * $.sped3,
d2c_TWAFT_SPED_4: (d, $) => +d.AFT_SPED_4 * $.sped4,
d2c_TWAFT_SPED_5: (d, $) => +d.AFT_SPED_5 * $.sped5,
d2c_TWAFT_SPED_6: (d, $) => +d.AFT_SPED_6 * $.sped6,
d2c_TWAFT_SPED_7: (d, $) => +d.AFT_SPED_7 * $.sped7,
d2c_TWAFT_SPED_8: (d, $) => +d.AFT_SPED_8 * $.sped8,
d2c_TWAFT_SPED_9: (d, $) => +d.AFT_SPED_9 * $.sped9,
d2c_TWAFT_SPED_10: (d, $) => +d.AFT_SPED_10 * $.sped10,
d2c_TWAFT_SPED_11: (d, $) => +d.AFT_SPED_11 * $.sped11
})
.derive({
d2c_TWAPT_CYK8: d => +d.APT_CYK8 * +d.SUPP_LWK8,
d2c_TWAPT_CY912: d => +d.APT_CY912 * +d.SUPP_LW912,
d2c_TWAPT_CYPSD: d => +d.APT_CYPSD * +d.SUPP_LWPSD,
d2c_TWAPT_K3_READ: (d, $) => +d.APT_CYK3R * $.k3Reading,
d2c_TWAPT_K3: (d, $) => +d.APT_CYK3 * $.k3,
d2c_TWAPT_ELL: (d, $) => +d.APT_ELL * $.ell,
d2c_TWAPT_SPED_1: (d, $) => +d.APT_SPED_1 * $.sped1,
d2c_TWAPT_SPED_2: (d, $) => +d.APT_SPED_2 * $.sped2,
d2c_TWAPT_SPED_3: (d, $) => +d.APT_SPED_3 * $.sped3,
d2c_TWAPT_SPED_4: (d, $) => +d.APT_SPED_4 * $.sped4,
d2c_TWAPT_SPED_5: (d, $) => +d.APT_SPED_5 * $.sped5,
d2c_TWAPT_SPED_6: (d, $) => +d.APT_SPED_6 * $.sped6,
d2c_TWAPT_SPED_7: (d, $) => +d.APT_SPED_7 * $.sped7,
d2c_TWAPT_SPED_8: (d, $) => +d.APT_SPED_8 * $.sped8,
d2c_TWAPT_SPED_9: (d, $) => +d.APT_SPED_9 * $.sped9,
d2c_TWAPT_SPED_10: (d, $) => +d.APT_SPED_10 * $.sped10,
d2c_TWAPT_SPED_11: (d, $) => +d.APT_SPED_11 * $.sped11
})
.derive({
d2c_NAOI: d => (d.d2c_TWINAS_CYK8 + d.d2c_TWINAS_CY912 + d.d2c_TWINAS_CYPSD +
d.d2c_TWINAS_K3_READ + d.d2c_TWINAS_K3 + d.d2c_TWINAS_ELL +
d.d2c_TWINAS_SPED_1 + d.d2c_TWINAS_SPED_2 + d.d2c_TWINAS_SPED_3 +
d.d2c_TWINAS_SPED_4 + d.d2c_TWINAS_SPED_5 + d.d2c_TWINAS_SPED_6 +
d.d2c_TWINAS_SPED_7 + d.d2c_TWINAS_SPED_8 + d.d2c_TWINAS_SPED_9 +
d.d2c_TWINAS_SPED_10 + d.d2c_TWINAS_SPED_11)
})
.derive({
d2c_AOIFT: d => (d.d2c_TWAFT_CYK8 + d.d2c_TWAFT_CY912 + d.d2c_TWAFT_CYPSD +
d.d2c_TWAFT_K3_READ + d.d2c_TWAFT_K3 + d.d2c_TWAFT_ELL +
d.d2c_TWAFT_SPED_1 + d.d2c_TWAFT_SPED_2 + d.d2c_TWAFT_SPED_3 +
d.d2c_TWAFT_SPED_4 + d.d2c_TWAFT_SPED_5 + d.d2c_TWAFT_SPED_6 +
d.d2c_TWAFT_SPED_7 + d.d2c_TWAFT_SPED_8 + d.d2c_TWAFT_SPED_9 +
d.d2c_TWAFT_SPED_10 + d.d2c_TWAFT_SPED_11)
})
.derive({
d2c_AOIPT: d => (d.d2c_TWAPT_CYK8 + d.d2c_TWAPT_CY912 + d.d2c_TWAPT_CYPSD +
d.d2c_TWAPT_K3_READ + d.d2c_TWAPT_K3 + d.d2c_TWAPT_ELL +
d.d2c_TWAPT_SPED_1 + d.d2c_TWAPT_SPED_2 + d.d2c_TWAPT_SPED_3 +
d.d2c_TWAPT_SPED_4 + d.d2c_TWAPT_SPED_5 + d.d2c_TWAPT_SPED_6 +
d.d2c_TWAPT_SPED_7 + d.d2c_TWAPT_SPED_8 + d.d2c_TWAPT_SPED_9 +
d.d2c_TWAPT_SPED_10 + d.d2c_TWAPT_SPED_11)
})
.derive({
d2c_M_BSL: d => +op.round2(((+d.d2c_TWINAS_CYK8 + +d.d2c_TWINAS_CY912 + +d.d2c_TWINAS_CYPSD +
+d.d2c_TWINAS_K3_READ + +d.d2c_TWINAS_K3 + +d.d2c_TWINAS_ELL +
+d.d2c_TWINAS_SPED_1 + +d.d2c_TWINAS_SPED_2 + +d.d2c_TWINAS_SPED_3 +
+d.d2c_TWINAS_SPED_4 + +d.d2c_TWINAS_SPED_5 + +d.d2c_TWINAS_SPED_6 +
+d.d2c_TWINAS_SPED_7 + +d.d2c_TWINAS_SPED_8 + +d.d2c_TWINAS_SPED_9 +
+d.d2c_TWINAS_SPED_10 + +d.d2c_TWINAS_SPED_11) * +d.d2c_B_COST) +
((+d.d2c_TWAFT_CYK8 + +d.d2c_TWAFT_CY912 + +d.d2c_TWAFT_CYPSD +
+d.d2c_TWAFT_K3_READ + +d.d2c_TWAFT_K3 + +d.d2c_TWAFT_ELL +
+d.d2c_TWAFT_SPED_1 + +d.d2c_TWAFT_SPED_2 + +d.d2c_TWAFT_SPED_3 +
+d.d2c_TWAFT_SPED_4 + +d.d2c_TWAFT_SPED_5 + +d.d2c_TWAFT_SPED_6 +
+d.d2c_TWAFT_SPED_7 + +d.d2c_TWAFT_SPED_8 + +d.d2c_TWAFT_SPED_9 +
+d.d2c_TWAFT_SPED_10 + +d.d2c_TWAFT_SPED_11) * 0.95 * +d.d2c_B_COST) +
((+d.d2c_TWAPT_CYK8 + +d.d2c_TWAPT_CY912 + +d.d2c_TWAPT_CYPSD +
+d.d2c_TWAPT_K3_READ + +d.d2c_TWAPT_K3 + +d.d2c_TWAPT_ELL +
+d.d2c_TWAPT_SPED_1 + +d.d2c_TWAPT_SPED_2 + +d.d2c_TWAPT_SPED_3 +
+d.d2c_TWAPT_SPED_4 + +d.d2c_TWAPT_SPED_5 + +d.d2c_TWAPT_SPED_6 +
+d.d2c_TWAPT_SPED_7 + +d.d2c_TWAPT_SPED_8 + +d.d2c_TWAPT_SPED_9 +
+d.d2c_TWAPT_SPED_10 + +d.d2c_TWAPT_SPED_11) * 0.85 * +d.d2c_B_COST))
})
.derive({ d2c_M_ADJ_BSL: (d, $) => $.teacherExpIndex == true ? +d.d2c_M_BSL * +d.TEI : +d.d2c_M_BSL })
.derive({
d2c_BSL_BRCL: d => +d.d2c_M_ADJ_BSL + +d.B_SUPP_ADJ,
d2c_TSL_TF_SSL: d => +op.round2(+d.TSL_TADRM * 180 * +d.TSL_SSLRM)
})
.derive({
d2c_TSL_ATS: d => +op.round2(+d.d2c_TSL_TF_SSL * +d.TSL_ATF),
d2c_TSL_HESYSL: d => +d.TSL_HESYM
})
.derive({ d2c_TSL_SL: d => +op.round2(+d.d2c_TSL_TF_SSL + +d.d2c_TSL_ATS + +d.d2c_TSL_HESYSL + +d.TSL_AEBPT)})
.derive({
d2c_TRCL_PRELIM: d => +op.round2(+d.d2c_TSL_SL - + d.TRCL_TSL_2122 + +d.TRCL_2122),
d2c_TRCL_23_TSL: d => +op.round2(+d.d2c_TSL_SL * 1.2)
})
.derive({ d2c_TRCL_ADJ_23: d => +d.d2c_TRCL_PRELIM > +d.d2c_TRCL_23_TSL ? +d.TRCL_2122 : +d.d2c_TRCL_PRELIM})
.derive({ d2c_TRCL_23: d => +d.d2c_TSL_SL > +d.d2c_TRCL_ADJ_23 ? +d.d2c_TSL_SL : +d.d2c_TRCL_ADJ_23})
.derive({
d2c_CALC_DSL: d => +op.round2(+d.d2c_BSL_BRCL + +d.TRCL_23_CONS + +d.TRCL_TO + +d.d2c_TSL_SL),
d2c_CALC_RSL: d => +op.round2(+d.d2c_BSL_BRCL + +d.TRCL_23_CONS + +d.TRCL_TO + +d.d2c_TRCL_23),
// Testing
d2c_DAA_PSD: (d, $) => +d.DAA_PSDC * $.daaP8,
d2c_DAA_K8: (d, $) => +d.DAA_K8C * $.daaP8,
d2c_DAA_912: (d, $) => (+d.DAA_912C + +d.DAA_T3TOC) * $.daaG912,
d2c_DAAG_FACTOR: d => (+d.DAAG_F23_ASC/+d.DAAG_F22_ASC)
})
.derive({
d2c_RCL_DSL: d => +d.d2c_CALC_DSL < +d.d2c_CALC_RSL ? +d.d2c_CALC_DSL : +d.d2c_CALC_RSL
})
.derive({
d2c_total_available: d => +d.d2c_RCL_DSL + +d.d2c_DAA_PSD + +d.d2c_DAA_K8 + +d.d2c_DAA_912
})
// .select('ID', 'd2c_B_COST', 'd2c_BSL_BRCL', 'd2c_TSL_TF_SSL', 'd2c_TSL_ATS', 'd2c_TSL_HESYSL', 'd2c_TSL_SL', 'd2c_TRCL_PRELIM', 'd2c_TRCL_23_TSL', 'd2c_TRCL_ADJ_23', 'd2c_TRCL_23', 'd2c_CALC_DSL', 'd2c_CALC_RSL', 'd2c_RCL_DSL', 'd2c_DAA_PSD', 'd2c_DAA_K8', 'd2c_DAA_912', 'd2c_total_available', 'd2c_DAAG_FACTOR')
.select('ID', 'd2c_total_available');
localRevenue = FileAttachment("data/arizona/local_revenue_020723.csv").csv();
// localRevenue_ = FileAttachment("data/arizona/local_revenue_.csv").csv();
trclData = aq.from(districtsSummary)
.select("ID", "NAME", "MD_TRCL_23", "MD_TSL_SL", "MD_QUAL_LEVY", "modeled_equalization_assistance", "current_equalization_assistance", "modeled_equalization_base", "current_equalization_base", "ADM");
completeDistrictSummaryTemp2 = aq.from(localRevenue)
.join_left(trclData, [["ID"], ["ID"]])
.derive({
AdjacentWays: d => +d["Adjacent Ways"],
CSF_IIF: d => +d["Classroom Site & Ins Improv Funds-CSF & IIF"],
DebtService: d => +d["Debt Service"],
MaintenanceOperations: d => +d["Maintenance & Operations (M&O)"],
OtherRevenue: d => +d["Other: See Definitions for Description"],
SchoolFacilities: d => +d["School Facilities"],
UnrestrictedCapitalOutlay: d => +d["Unrestricted Capital Outlay"]
})
.params({
adjacentWays: adjacentWays,
CSFIIF: CSFIIF,
debtService: debtService,
MO: MO,
otherRevenue: otherRevenue,
schoolFacilities: schoolFacilities,
capitalOutlay: capitalOutlay,
TRCL: TRCL
})
.derive({
adj_way: d => adjacentWays ? d.AdjacentWays : 0 ,
csf_iif: d => CSFIIF ? d.CSF_IIF : 0 ,
dev_serv: d => debtService ? d.DebtService : 0 ,
other_rev: d => otherRevenue ? d.OtherRevenue : 0 ,
sch_fac: d => schoolFacilities ? d.SchoolFacilities : 0 ,
unres_cap_out: d => capitalOutlay ? d.UnrestrictedCapitalOutlay : 0,
trcl: d => TRCL ? (+d.MD_TRCL_23 - +d.MD_TSL_SL) : 0
})
.derive({
MD_APP_QUAL_LEVY_CURRENT: d => +d.current_equalization_base - +d.current_equalization_assistance,
MD_APP_QUAL_LEVY_MODELED: d => +d.modeled_equalization_base - +d.modeled_equalization_assistance
})
.derive({
maint_op: d => MO ? (+d.MaintenanceOperations - (+d.MD_APP_QUAL_LEVY_MODELED)) > 0 ? (+d.MaintenanceOperations - (+d.MD_APP_QUAL_LEVY_MODELED)) : 0 : 0 ,
})
.derive({
maint_op_current: d => (+d.MaintenanceOperations - (+d.MD_APP_QUAL_LEVY_CURRENT)) > 0 ? (+d.MaintenanceOperations - (+d.MD_APP_QUAL_LEVY_CURRENT)) : 0
})
.derive({
total_local_revenue_modeled: d => d.adj_way + d.csf_iif + d.dev_serv + d.maint_op + d.other_rev + d.sch_fac + d.unres_cap_out + d.trcl
})
.derive({
total_local_revenue_current: d => d.AdjacentWays + d.CSF_IIF + d.DebtService + d.maint_op_current + d.OtherRevenue + d.SchoolFacilities + d.UnrestrictedCapitalOutlay + (+d.MD_TRCL_23 - +d.MD_TSL_SL)
})
.derive({
total_available_modeled: d => d.modeled_equalization_base + d.total_local_revenue_modeled > d.modeled_equalization_base ? d.modeled_equalization_base + d.total_local_revenue_modeled : d.modeled_equalization_base,
total_available_current: d => d.current_equalization_base + d.total_local_revenue_current > d.current_equalization_base ? d.current_equalization_base + d.total_local_revenue_current : d.current_equalization_base,
equalization_base_modeled: d => d.modeled_equalization_base,
equalization_base_current: d => d.current_equalization_base,
equalization_assistance_modeled: d => d.modeled_equalization_assistance,
equalization_assistance_current: d => d.current_equalization_assistance
})
.objects();
completeDistrictSummaryTemp = aq.from(completeDistrictSummaryTemp2)
.join_left(testingData, [["ID"], ["ID"]])
// .join_full(localRevenue, [["ID"], ["ID"]])
.objects();
completeDistrictSummary = {
if (perPupilTotal.optradio == "0") {
return aq.from(completeDistrictSummaryTemp)
.derive({
total_available_modeled: d => d.total_available_modeled / d.ADM,
total_available_current: d => d.total_available_current / d.ADM,
equalization_base_modeled: d => d.equalization_base_modeled / d.ADM,
equalization_base_current: d => d.equalization_base_current / d.ADM,
equalization_assistance_modeled: d => d.equalization_assistance_modeled / d.ADM,
equalization_assistance_current: d => d.equalization_assistance_current / d.ADM,
d2c_total_available: d => d.d2c_total_available / d.ADM
})
.derive({
total_available_difference: d => d.total_available_modeled / d.total_available_current - 1,
equalization_base_difference: d => d.equalization_base_modeled / d.equalization_base_current - 1,
equalization_assistance_difference: d => d.equalization_assistance_current === 0 ? 0 : d.equalization_assistance_modeled / d.equalization_assistance_current - 1,
d2c_total_available_difference: d => d.d2c_total_available / d.total_available_modeled - 1
})
.select("ID", "NAME", "total_available_modeled", "total_available_current", "equalization_base_modeled", "equalization_base_current", "equalization_assistance_modeled", "equalization_assistance_current",
"d2c_total_available",
"total_available_difference", "equalization_base_difference", "equalization_assistance_difference", "d2c_total_available_difference", "ADM")
.objects();
} else {
return aq.from(completeDistrictSummaryTemp)
.derive({
total_available_difference: d => d.total_available_modeled / d.total_available_current - 1,
equalization_base_difference: d => d.equalization_base_modeled / d.equalization_base_current - 1,
equalization_assistance_difference: d => d.equalization_assistance_current === 0 ? 0 : d.equalization_assistance_modeled / d.equalization_assistance_current - 1,
d2c_total_available_difference: d => d.d2c_total_available / d.total_available_modeled - 1
})
.select("ID", "NAME", "total_available_modeled", "total_available_current", "equalization_base_modeled", "equalization_base_current", "equalization_assistance_modeled", "equalization_assistance_current",
"d2c_total_available",
"total_available_difference", "equalization_base_difference", "equalization_assistance_difference", "d2c_total_available_difference", "ADM")
.objects();
}
};
charterDataTemp = FileAttachment("data/arizona/charter_data.csv").csv();
currentChartersData = aq.from(charterDataTemp)
.derive({
CC_TWINAS_CYK8: d => d.NAOI_CYK8 * d.SUPP_LWK8,
CC_TWINAS_CY912: d => d.NAOI_CY912 * d.SUPP_LW912,
// CC_TWINAS_CYPSD: d => +op.round3(d.NAOI_CYPSD * +d.SUPP_LWPSD),
CC_TWINAS_K3_READ: d => d.NAOI_CYK3R * 0.04,
CC_TWINAS_K3: d => d.NAOI_CYK3 * 0.06,
CC_TWINAS_ELL: d => d.NAOI_ELL * 0.115,
CC_TWINAS_SPED_1: d => d.NAOI_SPED_1 * 4.771,
CC_TWINAS_SPED_2: d => d.NAOI_SPED_2 * 6.024,
CC_TWINAS_SPED_3: d => d.NAOI_SPED_3 * 5.988,
CC_TWINAS_SPED_4: d => d.NAOI_SPED_4 * 7.947,
CC_TWINAS_SPED_5: d => d.NAOI_SPED_5 * 3.158,
CC_TWINAS_SPED_6: d => d.NAOI_SPED_6 * 6.773,
CC_TWINAS_SPED_7: d => d.NAOI_SPED_7 * 3.595,
CC_TWINAS_SPED_8: d => d.NAOI_SPED_8 * 0.292,
CC_TWINAS_SPED_9: d => d.NAOI_SPED_9 * 4.822,
CC_TWINAS_SPED_10: d => d.NAOI_SPED_10 * 4.421,
CC_TWINAS_SPED_11: d => d.NAOI_SPED_11 * 4.806,
CC_TWAFT_CYK8: d => d.AFT_CYK8 * d.SUPP_LWK8,
CC_TWAFT_CY912: d => d.AFT_CY912 * d.SUPP_LW912,
// CC_TWAFT_CYPSD: d => +op.round3(d.AFT_CYPSD * +d.SUPP_LWPSD),
CC_TWAFT_K3_READ: d => d.AFT_CYK3R * 0.04,
CC_TWAFT_K3: d => d.AFT_CYK3 * 0.06,
CC_TWAFT_ELL: d => d.AFT_ELL * 0.115,
CC_TWAFT_SPED_1: d => d.AFT_SPED_1 * 4.771,
CC_TWAFT_SPED_2: d => d.AFT_SPED_2 * 6.024,
CC_TWAFT_SPED_3: d => d.AFT_SPED_3 * 5.988,
CC_TWAFT_SPED_4: d => d.AFT_SPED_4 * 7.947,
CC_TWAFT_SPED_5: d => d.AFT_SPED_5 * 3.158,
CC_TWAFT_SPED_6: d => d.AFT_SPED_6 * 6.773,
CC_TWAFT_SPED_7: d => d.AFT_SPED_7 * 3.595,
CC_TWAFT_SPED_8: d => d.AFT_SPED_8 * 0.292,
CC_TWAFT_SPED_9: d => d.AFT_SPED_9 * 4.822,
CC_TWAFT_SPED_10: d => d.AFT_SPED_10 * 4.421,
CC_TWAFT_SPED_11: d => d.AFT_SPED_11 * 4.806,
CC_TWAPT_CYK8: d => d.APT_CYK8 * d.SUPP_LWK8,
CC_TWAPT_CY912: d => d.APT_CY912 * d.SUPP_LW912,
// CC_TWAPT_CYPSD: d => +op.round3(d.APT_CYPSD * +d.SUPP_LWPSD),
CC_TWAPT_K3_READ: d => d.APT_CYK3R * 0.04,
CC_TWAPT_K3: d => d.APT_CYK3 * 0.06,
CC_TWAPT_ELL: d => d.APT_ELL * 0.115,
CC_TWAPT_SPED_1: d => d.APT_SPED_1 * 4.771,
CC_TWAPT_SPED_2: d => d.APT_SPED_2 * 6.024,
CC_TWAPT_SPED_3: d => d.APT_SPED_3 * 5.988,
CC_TWAPT_SPED_4: d => d.APT_SPED_4 * 7.947,
CC_TWAPT_SPED_5: d => d.APT_SPED_5 * 3.158,
CC_TWAPT_SPED_6: d => d.APT_SPED_6 * 6.773,
CC_TWAPT_SPED_7: d => d.APT_SPED_7 * 3.595,
CC_TWAPT_SPED_8: d => d.APT_SPED_8 * 0.292,
CC_TWAPT_SPED_9: d => d.APT_SPED_9 * 4.822,
CC_TWAPT_SPED_10: d => d.APT_SPED_10 * 4.421,
CC_TWAPT_SPED_11: d => d.APT_SPED_11 * 4.806
})
.derive({
"B_COST": d => (d.ID === 'ADE79085' || d.ID === 'ADE90878' || d.ID === 'ADE91937' || d.ID === 'ADE91992' || d.ID === 'ADE92768' || d.ID === 'ADE903484' || d.ID === 'ADE1000050') ? 5014.03 : +d.B_COST,
})
.derive({
aoi_ft: d => ((
d.CC_TWAFT_CYK8 + d.CC_TWAFT_CY912 + d.CC_TWAFT_K3_READ + d.CC_TWAFT_K3 + d.CC_TWAFT_ELL + d.CC_TWAFT_SPED_1 + d.CC_TWAFT_SPED_2 + d.CC_TWAFT_SPED_3 + d.CC_TWAFT_SPED_4 + d.CC_TWAFT_SPED_5 + d.CC_TWAFT_SPED_6 + d.CC_TWAFT_SPED_7 + d.CC_TWAFT_SPED_8 + d.CC_TWAFT_SPED_9 + d.CC_TWAFT_SPED_10 + d.CC_TWAFT_SPED_11
) * 0.95 * +d.B_COST)
})
.derive({
CC_BSL: d => (((
d.CC_TWINAS_CYK8 + d.CC_TWINAS_CY912 + d.CC_TWINAS_K3_READ + d.CC_TWINAS_K3 + d.CC_TWINAS_ELL + d.CC_TWINAS_SPED_1 + d.CC_TWINAS_SPED_2 + d.CC_TWINAS_SPED_3 + d.CC_TWINAS_SPED_4 + d.CC_TWINAS_SPED_5 + d.CC_TWINAS_SPED_6 + d.CC_TWINAS_SPED_7 + d.CC_TWINAS_SPED_8 + d.CC_TWINAS_SPED_9 + d.CC_TWINAS_SPED_10 + d.CC_TWINAS_SPED_11
) * +d.B_COST)
+ ((
d.CC_TWAFT_CYK8 + d.CC_TWAFT_CY912 + d.CC_TWAFT_K3_READ + d.CC_TWAFT_K3 + d.CC_TWAFT_ELL + d.CC_TWAFT_SPED_1 + d.CC_TWAFT_SPED_2 + d.CC_TWAFT_SPED_3 + d.CC_TWAFT_SPED_4 + d.CC_TWAFT_SPED_5 + d.CC_TWAFT_SPED_6 + d.CC_TWAFT_SPED_7 + d.CC_TWAFT_SPED_8 + d.CC_TWAFT_SPED_9 + d.CC_TWAFT_SPED_10 + d.CC_TWAFT_SPED_11
) * 0.95 * +d.B_COST)
+ ((
d.CC_TWAPT_CYK8 + d.CC_TWAPT_CY912 + d.CC_TWAPT_K3_READ + d.CC_TWAPT_K3 + d.CC_TWAPT_ELL + d.CC_TWAPT_SPED_1 + d.CC_TWAPT_SPED_2 + d.CC_TWAPT_SPED_3 + d.CC_TWAPT_SPED_4 + d.CC_TWAPT_SPED_5 + d.CC_TWAPT_SPED_6 + d.CC_TWAPT_SPED_7 + d.CC_TWAPT_SPED_8 + d.CC_TWAPT_SPED_9 + d.CC_TWAPT_SPED_10 + d.CC_TWAPT_SPED_11
) * 0.85 * +d.B_COST)
)
})
.derive({
CC_ADJ_BSL: d => +d.CC_BSL + +d.B_SUPP_ADJ,
CC_AA_K8: d => +d.AA_K8C * +d.AA_K8AAPS,
CC_AA_912: d => +d.AA_912C * +d.AA_912AAPS,
})
.derive({
CC_EQ_BA: d => +d.CC_ADJ_BSL + +d.CC_AA_K8 + +d.CC_AA_912,
})
.objects();
modeledChartersData = aq.from(currentChartersData)
.params({baseLevelAmount: baseLevelAmount,
k3Reading: k3Reading,
k3: k3,
ell: ell,
sped1: sped1,
sped2: sped2,
sped3: sped3,
sped4: sped4,
sped5: sped5,
sped6: sped6,
sped7: sped7,
sped8: sped8,
sped9: sped9,
sped10: sped10,
sped11: sped11,
daaP8: daaP8,
daaG912: daaG912
// msWeight: msWeight
})
.derive({ADJ_IND: d => 0})
// .derive({ charterBaseAdj: (d, $) => $.charterBaseAdj == true ? 1.05000081287029 : 1})
.derive({ MC_B_COST: (d, $) => +op.round2($.baseLevelAmount)})
.derive({
MC_TWINAS_CYK8: d => d.NAOI_CYK8 * d.SUPP_LWK8,
MC_TWINAS_CY912: d => d.NAOI_CY912 * d.SUPP_LW912,
// MC_TWINAS_CYPSD: d => +op.round3(d.NAOI_CYPSD * +d.SUPP_LWPSD),
MC_TWINAS_K3_READ: (d, $) => d.NAOI_CYK3R * $.k3Reading,
MC_TWINAS_K3: (d, $) => d.NAOI_CYK3 * $.k3,
MC_TWINAS_ELL: (d, $) => d.NAOI_ELL * $.ell,
MC_TWINAS_SPED_1: (d, $) => d.NAOI_SPED_1 * $.sped1,
MC_TWINAS_SPED_2: (d, $) => d.NAOI_SPED_2 * $.sped2,
MC_TWINAS_SPED_3: (d, $) => d.NAOI_SPED_3 * $.sped3,
MC_TWINAS_SPED_4: (d, $) => d.NAOI_SPED_4 * $.sped4,
MC_TWINAS_SPED_5: (d, $) => d.NAOI_SPED_5 * $.sped5,
MC_TWINAS_SPED_6: (d, $) => d.NAOI_SPED_6 * $.sped6,
MC_TWINAS_SPED_7: (d, $) => d.NAOI_SPED_7 * $.sped7,
MC_TWINAS_SPED_8: (d, $) => d.NAOI_SPED_8 * $.sped8,
MC_TWINAS_SPED_9: (d, $) => d.NAOI_SPED_9 * $.sped9,
MC_TWINAS_SPED_10: (d, $) => d.NAOI_SPED_10 * $.sped10,
MC_TWINAS_SPED_11: (d, $) => d.NAOI_SPED_11 * $.sped11,
MC_TWAFT_CYK8: d => d.AFT_CYK8 * d.SUPP_LWK8,
MC_TWAFT_CY912: d => d.AFT_CY912 * d.SUPP_LW912,
// MC_TWAFT_CYPSD: d => +op.round3(d.AFT_CYPSD * +d.SUPP_LWPSD),
MC_TWAFT_K3_READ: (d, $) => d.AFT_CYK3R * $.k3Reading,
MC_TWAFT_K3: (d, $) => d.AFT_CYK3 * $.k3,
MC_TWAFT_ELL: (d, $) => d.AFT_ELL * $.ell,
MC_TWAFT_SPED_1: (d, $) => d.AFT_SPED_1 * $.sped1,
MC_TWAFT_SPED_2: (d, $) => d.AFT_SPED_2 * $.sped2,
MC_TWAFT_SPED_3: (d, $) => d.AFT_SPED_3 * $.sped3,
MC_TWAFT_SPED_4: (d, $) => d.AFT_SPED_4 * $.sped4,
MC_TWAFT_SPED_5: (d, $) => d.AFT_SPED_5 * $.sped5,
MC_TWAFT_SPED_6: (d, $) => d.AFT_SPED_6 * $.sped6,
MC_TWAFT_SPED_7: (d, $) => d.AFT_SPED_7 * $.sped7,
MC_TWAFT_SPED_8: (d, $) => d.AFT_SPED_8 * $.sped8,
MC_TWAFT_SPED_9: (d, $) => d.AFT_SPED_9 * $.sped9,
MC_TWAFT_SPED_10: (d, $) => d.AFT_SPED_10 * $.sped10,
MC_TWAFT_SPED_11: (d, $) => d.AFT_SPED_11 * $.sped11,
MC_TWAPT_CYK8: d => d.APT_CYK8 * d.SUPP_LWK8,
MC_TWAPT_CY912: d => d.APT_CY912 * d.SUPP_LW912,
// MC_TWAPT_CYPSD: d => +op.round3(d.APT_CYPSD * +d.SUPP_LWPSD),
MC_TWAPT_K3_READ: (d, $) => d.APT_CYK3R * $.k3Reading,
MC_TWAPT_K3: (d, $) => d.APT_CYK3 * $.k3,
MC_TWAPT_ELL: (d, $) => d.APT_ELL * $.ell,
MC_TWAPT_SPED_1: (d, $) => d.APT_SPED_1 * $.sped1,
MC_TWAPT_SPED_2: (d, $) => d.APT_SPED_2 * $.sped2,
MC_TWAPT_SPED_3: (d, $) => d.APT_SPED_3 * $.sped3,
MC_TWAPT_SPED_4: (d, $) => d.APT_SPED_4 * $.sped4,
MC_TWAPT_SPED_5: (d, $) => d.APT_SPED_5 * $.sped5,
MC_TWAPT_SPED_6: (d, $) => d.APT_SPED_6 * $.sped6,
MC_TWAPT_SPED_7: (d, $) => d.APT_SPED_7 * $.sped7,
MC_TWAPT_SPED_8: (d, $) => d.APT_SPED_8 * $.sped8,
MC_TWAPT_SPED_9: (d, $) => d.APT_SPED_9 * $.sped9,
MC_TWAPT_SPED_10: (d, $) => d.APT_SPED_10 * $.sped10,
MC_TWAPT_SPED_11: (d, $) => d.APT_SPED_11 * $.sped11
})
// .derive({
// MC_MS_WEIGHT: (d, $) => ((+d.MS_ENR_6 + +d.MS_ENR_7 + +d.MS_ENR_8) * $.msWeight)
// })
.derive({
"MC_B_COST": d => (d.ID === 'ADE79085' || d.ID === 'ADE90878' || d.ID === 'ADE91937' || d.ID === 'ADE91992' || d.ID === 'ADE92768' || d.ID === 'ADE903484' || d.ID === 'ADE1000050') ? 5014.03 : +d.MC_B_COST,
})
.derive({
MC_BSL: d => ((d.MC_TWINAS_CYK8 + d.MC_TWINAS_CY912 + d.MC_TWINAS_K3_READ + d.MC_TWINAS_K3 + d.MC_TWINAS_ELL + d.MC_TWINAS_SPED_1 + d.MC_TWINAS_SPED_2 + d.MC_TWINAS_SPED_3 + d.MC_TWINAS_SPED_4 + d.MC_TWINAS_SPED_5 + d.MC_TWINAS_SPED_6 + d.MC_TWINAS_SPED_7 + d.MC_TWINAS_SPED_8 + d.MC_TWINAS_SPED_9 + d.MC_TWINAS_SPED_10 + d.MC_TWINAS_SPED_11) * d.MC_B_COST) +
((d.MC_TWAFT_CYK8 + d.MC_TWAFT_CY912 + d.MC_TWAFT_K3_READ + d.MC_TWAFT_K3 + d.MC_TWAFT_ELL + d.MC_TWAFT_SPED_1 + d.MC_TWAFT_SPED_2 + d.MC_TWAFT_SPED_3 + d.MC_TWAFT_SPED_4 + d.MC_TWAFT_SPED_5 + d.MC_TWAFT_SPED_6 + d.MC_TWAFT_SPED_7 + d.MC_TWAFT_SPED_8 + d.MC_TWAFT_SPED_9 + d.MC_TWAFT_SPED_10 + d.MC_TWAFT_SPED_11) * 0.95 * d.MC_B_COST) +
((d.MC_TWAPT_CYK8 + d.MC_TWAPT_CY912 + d.MC_TWAPT_K3_READ + d.MC_TWAPT_K3 + d.MC_TWAPT_ELL + d.MC_TWAPT_SPED_1 + d.MC_TWAPT_SPED_2 + d.MC_TWAPT_SPED_3 + d.MC_TWAPT_SPED_4 + d.MC_TWAPT_SPED_5 + d.MC_TWAPT_SPED_6 + d.MC_TWAPT_SPED_7 + d.MC_TWAPT_SPED_8 + d.MC_TWAPT_SPED_9 + d.MC_TWAPT_SPED_10 + d.MC_TWAPT_SPED_11) * 0.85 * d.MC_B_COST)
})
.derive({
MC_ADJ_BSL: d => d.MC_BSL + +d.B_SUPP_ADJ,
MC_AA_K8: (d, $) => d.AA_K8C * $.daaP8,
MC_AA_912: (d, $) => d.AA_912C * $.daaG912
})
.derive({
MC_EQ_BA: d => d.MC_ADJ_BSL + d.MC_AA_K8 + d.MC_AA_912
})
.derive({
ADM: d => +d.NAOI_CYK8 + +d.NAOI_CY912 + +d.AFT_CYK8 + +d.AFT_CY912 + +d.APT_CYK8 + +d.APT_CY912
})
// .select("NAME", "charterBaseAdj", "MC_B_COST", "MC_TWINAS_CYK8", "MC_TWINAS_CY912", "MC_TWINAS_CYPSD", "MC_TWINAS_K3_READ", "MC_TWINAS_K3", "MC_TWINAS_ELL", "MC_TWINAS_SPED_1", "MC_TWINAS_SPED_2", "MC_TWINAS_SPED_3", "MC_TWINAS_SPED_4", "MC_TWINAS_SPED_5", "MC_TWINAS_SPED_6", "MC_TWINAS_SPED_7", "MC_TWINAS_SPED_8", "MC_TWINAS_SPED_9", "MC_TWINAS_SPED_10", "MC_TWINAS_SPED_11", "MC_TWAFT_CYK8", "MC_TWAFT_CY912", "MC_TWAFT_CYPSD", "MC_TWAFT_K3_READ", "MC_TWAFT_K3", "MC_TWAFT_ELL", "MC_TWAFT_SPED_1", "MC_TWAFT_SPED_2", "MC_TWAFT_SPED_3", "MC_TWAFT_SPED_4", "MC_TWAFT_SPED_5", "MC_TWAFT_SPED_6", "MC_TWAFT_SPED_7", "MC_TWAFT_SPED_8", "MC_TWAFT_SPED_9", "MC_TWAFT_SPED_10", "MC_TWAFT_SPED_11", "MC_TWAPT_CYK8", "MC_TWAPT_CY912", "MC_TWAPT_CYPSD", "MC_TWAPT_K3_READ", "MC_TWAPT_K3", "MC_TWAPT_ELL", "MC_TWAPT_SPED_1", "MC_TWAPT_SPED_2", "MC_TWAPT_SPED_3", "MC_TWAPT_SPED_4", "MC_TWAPT_SPED_5", "MC_TWAPT_SPED_6", "MC_TWAPT_SPED_7", "MC_TWAPT_SPED_8", "MC_TWAPT_SPED_9", "MC_TWAPT_SPED_10", "MC_TWAPT_SPED_11", "MC_MS_WEIGHT", "MC_BSL", "MC_ADJ_BSL", "MC_AA_K8", "MC_AA_912", "MC_EQ_BA", "ADM")
// .select("charterBaseAdj", "MC_B_COST")
.objects();
completeCharterSummary = {
if (perPupilTotal.optradio == "0") {
return aq.from(modeledChartersData)
.derive({
total_available_current: d => d.CC_EQ_BA,
total_available_modeled: d => d.MC_EQ_BA
})
.derive({
total_available_modeled: d => d.total_available_modeled / d.ADM,
total_available_current: d => d.total_available_current / d.ADM
})
.derive({
total_available_difference: d => d.total_available_modeled / d.total_available_current - 1
})
.select("ID", "NAME", "total_available_modeled", "total_available_current", "total_available_difference", "ADM")
.objects();
} else {
return aq.from(modeledChartersData)
.derive({
total_available_current: d => d.CC_EQ_BA,
total_available_modeled: d => d.MC_EQ_BA
})
.derive({
total_available_difference: d => d.total_available_modeled / d.total_available_current - 1
})
.select("ID", "NAME", "total_available_modeled", "total_available_current", "total_available_difference", "ADM")
.objects();
}
};
citiesCoord = FileAttachment("cities.json").json();
stateShapefile = await d3.json("https://raw.githubusercontent.com/jordancampbell23/map_json/main/us_state_object.json");
stateShape = stateShapefile.features[2];
map_data = aq.from(topojson.feature(us_topojson, us_topojson.objects.counties).features)
.params({stateNum: "04"})
.filter((d, stateNum) => op.startswith(d["id"], stateNum))
.objects();
countySelection = map_data[countySelectionInput[1]]
countyShape = countySelection;
mapDataTemp = FileAttachment("./az_coords.json").json();
mapDataTemp2 = aq.from(mapDataTemp)
.params({districtSelection: countySelectionInput[0]})
.join_left(aq.from(completeDistrictSummary), [["NAME"], ["NAME"]])
.join_left(aq.from(senateDistrictData), ["NAME", "Name"])
.filter((d, $) => $.districtSelection === "Arizona" ? (d["District Filter"] === 1 || d["District Filter"] === 0 || d["District Filter"] === undefined) : d["District Filter"] === 1)
.objects();
mapData = mapDataTemp2.filter(d => d.NAME.match(new RegExp(newFilter.message, 'i')));
maxValue = d3.max(mapDataTemp2.map(d => +d.ADM));
// radiusCounty= d3.scaleSqrt().domain([0, maxValue]).range([5, 10]);
radiusState = d3.scaleSqrt().domain([0, maxValue]).range([countySelectionInput[5], countySelectionInput[4]]);
mapBackgroundColor = "#d3d3d3";
stateOutlineColor = "#fff";
circleStrokeWidth = 0.5;
circleOpacity = 0.25;
circleStrokeColor = "#000";
color = d3.scaleQuantize([-0.05, 0.05], ["#d7191c", "#fdae61", "#fff", "#a6d96a", "#1a9641"]);
tooltip = d3
.select('body')
.append('circle')
.style("width", "200px")
.style('position', 'absolute')
.style('z-index', '9999')
.style('visibility', 'hidden')
.style("background", "rgba(250,250,250, 1)")
.style("border", "1px solid #DDD")
.style("margin", "4px;")
.style('font-size', "0.85rem")
.style('font-weight', 400)
.style('font-family', "'Open Sans', sans-serif")
.style('transition', "transition: top 300ms ease, left 300ms ease;")
d3 = require("d3@5");
topojson = require("topojson-client@3");
// Formatting
formatPct = d3.format(",.0f")
// Mapping
interstatesp = d3.json("https://raw.githubusercontent.com/jordancampbell23/roadjson/main/interstate.json");
interstates = d3.json("https://raw.githubusercontent.com/jordancampbell23/roadjson/main/usroads.json");
us_topojson = d3.json("https://gist.githubusercontent.com/palewire/6e346850e48208a03c2fd09ba103d97a/raw/ba3e7ebefe2f50c411496abb273a8e65bd70ad60/us-10m-unprojected.json");
us_outline = topojson.feature(us_topojson, us_topojson.objects.states);
us_states_mesh = topojson.mesh(us_topojson, us_topojson.objects.states, (a, b) => a != b);
us_counties = topojson.feature(us_topojson, us_topojson.objects.counties);
projection = d3.geoAlbersUsa().fitSize([960, 600], us_outline);
stateProjection = d3.geoAlbersUsa().fitSize([960, 600], stateShape);
path = d3.geoPath().projection(projection);
statePath = d3.geoPath().projection(stateProjection);
countyProjection = d3.geoAlbersUsa().fitSize([960, 600], countyShape);
countyPath = d3.geoPath().projection(countyProjection);
html`
<style>
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap');
<body>
font-family: 'Open Sans', sans-serif;
</body>
.toolTip {
position: absolute;
display: none;
min-width: 30px;
max-width: 240px;
border-radius: 4px;
height: auto;
background: rgba(250,250,250, 0.9);
border: 1px solid #DDD;
padding: 4px 8px;
font-size: .85rem;
text-align: left;
z-index: 1000;
transition: top 300ms ease, left 300ms ease;
pointer-events: none;
}
</style>
`
senateDistrictDataTemp = FileAttachment("data/arizona/senate_districts.csv").csv();
senateDistrictData = aq.from(senateDistrictDataTemp)
.params({districtSelection: countySelectionInput[0]})
.derive({"District Filter": (d, $) => d["State Senate District"] === $.districtSelection ? 1 : 0})
.objects();
translateValues = `translate(${countySelectionInput[2]}, ${countySelectionInput[3]}) scale(${countySelectionInput[1]})`;
districtMapDisplay = {
if (districtCharter.optradio == '0') {
return ""
} else {
return "none"
}
};
charterMapDisplay = {
if (districtCharter.optradio == '1') {
return ""
} else {
return "none"
}
};
charterMapDataTemp = FileAttachment("./az_charter_coords.json").json();
charterMapDataTemp2 = aq.from(charterMapDataTemp)
// .params({districtSelection: countySelectionInput[0]})
.join_left(aq.from(completeCharterSummary), [["ID"], ["ID"]])
// .join_left(aq.from(senateDistrictData), ["NAME", "Name"])
// .filter((d, $) => $.districtSelection === "Arizona" ? (d["District Filter"] === 1 || d["District Filter"] === 0) : d["District Filter"] === 1)
.derive({NAME: d => d.NAME_1})
.select(aq.not('NAME_1', 'NAME_2'))
.objects();
charterMapData = charterMapDataTemp2.filter(d => d.NAME.match(new RegExp(newFilter.message, 'i')));
// Charter Map
charterMap = {
const svg = d3.create("svg")
.attr("viewBox", "0 0 850 750")
.style("width", "90%")
.style("height", "auto");
svg.append("path")
.datum(stateShape)
.attr("fill", mapBackgroundColor)
.attr("transform", translateValues)
.attr("d", statePath);
svg.append("path")
.datum(us_counties)
.attr("fill", "none")
.attr("stroke", "white")
.attr("stroke-linejoin", "round")
.attr("transform", translateValues)
.attr("d", statePath);
svg
.append("path")
.datum(topojson.feature(interstates, interstates.objects.roads))
.attr("fill", "none")
.attr("stroke", "#fff")
.attr("stroke-width", 0.5)
.attr("stroke-linejoin", "round")
.attr("transform", translateValues)
.attr("d", statePath);
svg
.append("path")
.datum(interstatesp)
.attr("fill", "none")
.attr("stroke", "#fff")
.attr("stroke-width", 1)
.attr("stroke-linejoin", "round")
.attr("transform", translateValues)
.attr("d", statePath);
const g = svg.append('g');
const citiesGroup = g.append('g').attr('class', 'cities').attr("transform", translateValues);
// <g> for each city
const cityCircles = citiesGroup.selectAll('.city')
.data(citiesCoord)
.join('g')
.attr('class', 'city')
.attr('data-name', d => d.name)
.attr('transform', d => `translate(${stateProjection(d.coordinates)[0]}, ${stateProjection(d.coordinates)[1]})`);
// city circles
// cityCircles.append('circle')
// .attr('fill', '#222222')
// .attr('stroke', "#222222")
// .attr('cx', 0)
// .attr('cy', 0)
// .attr('r', 2);
// city labels
cityCircles.append('text')
.attr('x', d => d.x || 7)
.attr('y', d => d.y || 5)
.attr('text-anchor', d => d.anchor || 'start')
.attr('font-family', "'Open Sans', sans-serif")
.attr('font-weight', '700')
.attr('fill', 'none')
.attr('stroke', '#fff')
.attr('stroke-width', '2.5')
.attr('stroke-opacity', '0.8')
// .attr('font-size', '16px')
.attr('pointer-events', 'none')
.attr('font-size', d => d.size === 'large' ? countySelectionInput[6] : "10px")
.style('display', d => d.size === 'large' ? '' : "none")
.text(d => d.name);
cityCircles.append('text')
.attr('x', d => d.x || 7)
.attr('y', d => d.y || 5)
.attr('text-anchor', d => d.anchor || 'start')
.attr('font-family', "'Open Sans', sans-serif")
.attr('font-weight', '700')
.attr('fill', '#333')
// .attr('font-size', '16px')
.attr('pointer-events', 'none')
.attr('font-size', d => d.size === 'large' ? countySelectionInput[6] : "10px")
.style('display', d => d.size === 'large' ? '' : "none")
.text(d => d.name);
svg.append("g")
.attr("fill-opacity", circleOpacity)
.attr("stroke", circleStrokeColor)
.attr("stroke-width", circleStrokeWidth)
.attr("transform", translateValues)
.selectAll("circle")
.data(charterMapData)
.join("circle")
.attr("transform", d => `translate(${statePath.centroid(d)})`)
.attr("r", d => radiusState(d.ADM))
.attr("fill", d => color(+d.total_available_difference))
.on('mouseover', function(d) {
tooltip
.html(
`<div style='margin: 4px; font-size: 14px;'>${d.NAME} <hr style='margin:2px; padding:0; border-top: 3px solid #333;'>
Modeled: ${d3.format("$,.0f")(d.total_available_modeled)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Current: ${d3.format("$,.0f")(d.total_available_current)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Difference: ${d3.format(".1%")(d.total_available_difference)}
</div>`)
.style('visibility', 'visible')
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
d3.select(this)
.attr('fill', '#2879cd00')
.attr('stroke', '#333')
.attr('stroke-width', 1);
})
.on('mousemove', function(d) {
tooltip
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
})
.on('mouseout', function() {
tooltip.html(``).style('visibility', 'hidden');
d3.select(this)
.attr('fill', d => color(+d.total_available_difference))
.attr('stroke-width', circleStrokeWidth)
.attr("stroke", circleStrokeColor);
});
// const g = svg.append('g');
// const citiesGroup = g.append('g').attr('class', 'cities');
// // <g> for each city
// const cityCircles = citiesGroup.selectAll('.city')
// .data(citiesCoord)
// .join('g')
// .attr('class', 'city')
// .attr('data-name', d => d.name)
// .attr('transform', d => `translate(${stateProjection(d.coordinates)[0]}, ${stateProjection(d.coordinates)[1]})`);
// // city circles
// // cityCircles.append('circle')
// // .attr('fill', '#222222')
// // .attr('stroke', "#222222")
// // .attr('cx', 0)
// // .attr('cy', 0)
// // .attr('r', 2);
// // city labels
// cityCircles.append('text')
// .attr('x', d => d.x || 7)
// .attr('y', d => d.y || 5)
// .attr('text-anchor', d => d.anchor || 'start')
// .attr('font-family', "'Open Sans', sans-serif")
// .attr('font-weight', '700')
// .attr('fill', 'none')
// .attr('stroke', '#fff')
// .attr('stroke-width', '2.5')
// .attr('stroke-opacity', '0.8')
// .attr('font-size', '16px')
// .attr('pointer-events', 'none')
// .attr('font-style', d => d.type === 'neighborhood' ? 'italic' : null)
// .text(d => d.name);
// cityCircles.append('text')
// .attr('x', d => d.x || 7)
// .attr('y', d => d.y || 5)
// .attr('text-anchor', d => d.anchor || 'start')
// .attr('font-family', "'Open Sans', sans-serif")
// .attr('font-weight', '700')
// .attr('fill', '#333')
// .attr('font-size', '16px')
// .attr('pointer-events', 'none')
// .attr('font-style', d => d.type === 'neighborhood' ? 'italic' : null)
// .text(d => d.name);
// }
return svg.node();
}
districtMap = {
const svg = d3.create("svg")
.attr("viewBox", "0 0 850 750")
.style("width", "90%")
.style("height", "auto");
svg.append("path")
.datum(stateShape)
.attr("fill", mapBackgroundColor)
.attr("transform", translateValues)
.attr("d", statePath);
svg.append("path")
.datum(us_counties)
.attr("fill", "none")
.attr("stroke", "white")
.attr("stroke-linejoin", "round")
.attr("transform", translateValues)
.attr("d", statePath);
svg
.append("path")
.datum(topojson.feature(interstates, interstates.objects.roads))
.attr("fill", "none")
.attr("stroke", "#fff")
.attr("stroke-width", 0.5)
.attr("stroke-linejoin", "round")
.attr("transform", translateValues)
.attr("d", statePath);
svg
.append("path")
.datum(interstatesp)
.attr("fill", "none")
.attr("stroke", "#fff")
.attr("stroke-width", 1)
.attr("stroke-linejoin", "round")
.attr("transform", translateValues)
.attr("d", statePath);
const g = svg.append('g');
const citiesGroup = g.append('g').attr('class', 'cities').attr("transform", translateValues);
// <g> for each city
const cityCircles = citiesGroup.selectAll('.city')
.data(citiesCoord)
.join('g')
.attr('class', 'city')
.attr('data-name', d => d.name)
.attr('transform', d => `translate(${stateProjection(d.coordinates)[0]}, ${stateProjection(d.coordinates)[1]})`);
// city circles
// cityCircles.append('circle')
// .attr('fill', '#222222')
// .attr('stroke', "#222222")
// .attr('cx', 0)
// .attr('cy', 0)
// .attr('r', 2);
// city labels
cityCircles.append('text')
.attr('x', d => d.x || 7)
.attr('y', d => d.y || 5)
.attr('text-anchor', d => d.anchor || 'start')
.attr('font-family', "'Open Sans', sans-serif")
.attr('font-weight', '700')
.attr('fill', 'none')
.attr('stroke', '#fff')
.attr('stroke-width', '2.5')
.attr('stroke-opacity', '0.8')
// .attr('font-size', '16px')
.attr('pointer-events', 'none')
.attr('font-size', d => d.size === 'large' ? countySelectionInput[6] : "10px")
.style('display', d => d.size === 'large' ? '' : "none")
.text(d => d.name);
cityCircles.append('text')
.attr('x', d => d.x || 7)
.attr('y', d => d.y || 5)
.attr('text-anchor', d => d.anchor || 'start')
.attr('font-family', "'Open Sans', sans-serif")
.attr('font-weight', '700')
.attr('fill', '#333')
// .attr('font-size', '16px')
.attr('pointer-events', 'none')
.attr('font-size', d => d.size === 'large' ? countySelectionInput[6] : "10px")
.style('display', d => d.size === 'large' ? '' : "none")
.text(d => d.name);
if (variableSelection[0] == "Total Available") {
svg.append("g")
.attr("fill-opacity", circleOpacity)
.attr("stroke", circleStrokeColor)
.attr("stroke-width", circleStrokeWidth)
.attr("transform", translateValues)
.selectAll("circle")
.data(mapData)
.join("circle")
.attr("transform", d => `translate(${statePath.centroid(d)})`)
.attr("r", d => radiusState(d.ADM))
.attr("fill", d => color(+d.total_available_difference))
.on('mouseover', function(d) {
tooltip
.html(
`<div style='margin: 4px; font-size: 14px;'>${d.NAME} <hr style='margin:2px; padding:0; border-top: 3px solid #333;'>
Modeled: ${d3.format("$,.0f")(d.total_available_modeled)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Current: ${d3.format("$,.0f")(d.total_available_current)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Difference: ${d3.format(".1%")(d.total_available_difference)}
</div>`)
.style('visibility', 'visible')
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
d3.select(this)
.attr('stroke', '#333')
.attr('stroke-width', 1);
})
.on('mousemove', function(d) {
tooltip
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
})
.on('mouseout', function() {
tooltip.html(``).style('visibility', 'hidden');
d3.select(this)
.attr('stroke-width', circleStrokeWidth)
.attr("stroke", circleStrokeColor);
});
} else if (variableSelection[0] == "Equalization Base") {
svg.append("g")
.attr("fill-opacity", circleOpacity)
.attr("stroke", circleStrokeColor)
.attr("stroke-width", circleStrokeWidth)
.attr("transform", translateValues)
.selectAll("circle")
.data(mapData)
.join("circle")
.attr("transform", d => `translate(${statePath.centroid(d)})`)
.attr("r", d => radiusState(d.ADM))
.attr("fill", d => color(+d.equalization_base_difference))
.on('mouseover', function(d) {
tooltip
.html(
`<div style='margin: 4px; font-size: 14px;'>${d.NAME} <hr style='margin:2px; padding:0; border-top: 3px solid #333;'>
Modeled: ${d3.format("$,.0f")(d.equalization_base_modeled)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Current: ${d3.format("$,.0f")(d.equalization_base_current)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Difference: ${d3.format(".0%")(d.equalization_base_difference)}
</div>`)
.style('visibility', 'visible')
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
d3.select(this)
.attr('stroke', '#333')
.attr('stroke-width', 1);
})
.on('mousemove', function(d) {
tooltip
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
})
.on('mouseout', function() {
tooltip.html(``).style('visibility', 'hidden');
d3.select(this)
.attr('stroke-width', circleStrokeWidth)
.attr("stroke", circleStrokeColor);
});
} else if (variableSelection[0] == "Equalization Assistance") {
svg.append("g")
.attr("fill-opacity", circleOpacity)
.attr("stroke", circleStrokeColor)
.attr("stroke-width", circleStrokeWidth)
.attr("transform", translateValues)
.selectAll("circle")
.data(mapData)
.join("circle")
.attr("transform", d => `translate(${statePath.centroid(d)})`)
.attr("r", d => radiusState(d.ADM))
.attr("fill", d => color(+d.equalization_assistance_difference))
.on('mouseover', function(d) {
tooltip
.html(
`<div style='margin: 4px; font-size: 14px;'>${d.NAME} <hr style='margin:2px; padding:0; border-top: 3px solid #333;'>
Modeled: ${d3.format("$,.0f")(d.equalization_assistance_modeled)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Current: ${d3.format("$,.0f")(d.equalization_assistance_current)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Difference: ${d3.format(".0%")(d.equalization_assistance_difference)}
</div>`)
.style('visibility', 'visible')
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
d3.select(this)
.attr('stroke', '#333')
.attr('stroke-width', 1);
})
.on('mousemove', function(d) {
tooltip
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
})
.on('mouseout', function() {
tooltip.html(``).style('visibility', 'hidden');
d3.select(this)
.attr('stroke-width', circleStrokeWidth)
.attr("stroke", circleStrokeColor);
});
} else {
svg.append("g")
.attr("fill-opacity", circleOpacity)
.attr("stroke", circleStrokeColor)
.attr("stroke-width", circleStrokeWidth)
.attr("transform", translateValues)
.selectAll("circle")
.data(mapData)
.join("circle")
.attr("transform", d => `translate(${statePath.centroid(d)})`)
.attr("r", d => radiusState(d.ADM))
.attr("fill", d => color(+d.d2c_total_available_difference))
.on('mouseover', function(d) {
tooltip
.html(
`<div style='margin: 4px; font-size: 14px;'>${d.NAME} <hr style='margin:2px; padding:0; border-top: 3px solid #333;'>
Modeled: ${d3.format("$,.0f")(d.d2c_total_available)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Current: ${d3.format("$,.0f")(d.total_available_current)}
<hr style='margin:2px; padding:0; border-top: 1px solid #333;'>
Difference: ${d3.format(".0%")(d.d2c_total_available_difference)}
</div>`)
.style('visibility', 'visible')
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
d3.select(this)
.attr('stroke', '#333')
.attr('stroke-width', 1);
})
.on('mousemove', function(d) {
tooltip
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
})
.on('mouseout', function() {
tooltip.html(``).style('visibility', 'hidden');
d3.select(this)
.attr('stroke-width', circleStrokeWidth)
.attr("stroke", circleStrokeColor);
});
}
return svg.node();
}
aq = {
const aq = await require(`arquero@${aq_version}`);
// load and install any additional packages
(await Promise.all(aq_packages.map(pkg => require(pkg))))
.forEach(pkg => aq.addPackage(pkg));
// Add HTML table view method to tables
aq.addTableMethod('view', toView, { override: true });
return aq;
};
aq_version = "5.1.0";
aq_packages = [];
op = aq.op;
toView = {
const DEFAULT_LIMIT = 100;
const DEFAULT_NULL = value => `<span style="color: #999;">${value}</span>`;
const tableStyle = 'margin: 0; border-collapse: collapse; width: initial;';
const cellStyle = 'padding: 1px 5px; white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;';
// extend table prototype to provide an HTML table view
return function(dt, opt = {}) {
// permit shorthand for limit
if (typeof opt === 'number') opt = { limit: opt };
// marshal cell color options
const color = { ...opt.color };
if (typeof opt.color === 'function') {
// if function, apply to all columns
dt.columnNames().forEach(name => color[name] = opt.color);
} else {
// otherwise, gather per-column color options
for (const key in color) {
const value = color[key];
color[key] = typeof value === 'function' ? value : () => value;
}
}
// marshal CSS styles as toHTML() options
const table = `${tableStyle}`;
const td = (name, index, row) => {
return `${cellStyle} max-width: ${+opt.maxCellWidth || 300}px;`
+ (color[name] ? ` background-color: ${color[name](index, row)};` : '');
};
opt = {
limit: DEFAULT_LIMIT,
null: DEFAULT_NULL,
...opt,
style: { table, td, th: td }
};
// return container div, bind table value to support viewof operator
const size = `max-height: ${+opt.height || 270}px`;
const style = `${size}; overflow-x: auto; overflow-y: auto;`;
const view = html`<div style="${style}">${dt.toHTML(opt)}</div>`;
view.value = dt;
return view;
};
};
function formValue(form) {
const object = {};
for (const input of form.elements) {
if (input.disabled || !input.hasAttribute("name")) continue;
let value = input.value;
switch (input.type) {
case "range":
case "number": {
value = input.valueAsNumber;
break;
}
case "date": {
value = input.valueAsDate;
break;
}
case "radio": {
if (!input.checked) continue;
break;
}
case "checkbox": {
if (input.checked) value = true;
else if (input.name in object) continue;
else value = false;
break;
}
case "file": {
value = input.multiple ? input.files : input.files[0];
break;
}
case "select-multiple": {
value = Array.from(input.selectedOptions, option => option.value);
break;
}
}
object[input.name] = value;
}
return object;
}
function form(form) {
const container = html`<div>${form}`;
form.addEventListener("submit", event => event.preventDefault());
form.addEventListener("change", () => container.dispatchEvent(new CustomEvent("input")));
form.addEventListener("input", () => container.value = formValue(form));
container.value = formValue(form);
return container
}
inputStyles = html`
<style>
option:checked {
background: #d3d3d3;
border-radius: 5px;
}
select:focus {
outline: none;
}
.column-label {
padding: 2vw;
float: left;
width: 75%;
}
.column-checkbox {
padding: 2vw;
float: left;
width: 25%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
</style>
`
style_sheet = html`<style>
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap');
body {
font-family: 'Open Sans', sans-serif;
}
.input-icon {
position: relative;
}
.input-icon > i {
position: absolute;
display: block;
transform: translate(0, -50%);
top: 50%;
pointer-events: none;
width: 25px;
text-align: center;
font-style: normal;
}
.input-icon > input {
padding-left: 25px;
padding-right: 0;
}
.input-icon-right > i {
right: 0;
}
.input-icon-right > input {
padding-left: 0;
padding-right: 25px;
text-align: right;
}
select {
font-family: 'Open Sans', sans-serif;
// border-radius: 20px;
background-color: #fff;
}
.chip-circle {
border-radius: 50%;
display: inline-block;
position: relative;
width: 10px;
height: 10px;
}
label {
margin-top: 20px;
padding: 10px;
padding-right:15px;
text-align: center;
cursor: pointer;
background-color: #fff;
color: #2e3745;
font-weight: 600;
}
input[type="range"] {
-webkit-appearance: none;
border: none;
margin: 18px 0;
width: 100%;
box-shadow: -2px -2px 8px white, 2px 2px 8px rgba(black, 0.5);
}
input[type="range"]:focus {
outline: none;
}
input[type="range"]::-webkit-slider-runnable-track {
border: none;
width: 100%;
height: 5px;
cursor: pointer;
background: #fff;
border-radius: 10px;
box-shadow: rgb(204, 219, 232) 3px 3px 6px 0px inset, rgba(255, 255, 255, 0.5) -3px -3px 6px 1px inset;
}
input[type="range"]::-webkit-slider-thumb {
height: 15px;
width: 15px;
border-radius: 30px;
box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.37);
/* border: 1px solid #333; */
background: #fff;
cursor: pointer;
-webkit-appearance: none;
margin-top: -5px;
}
input[type="range"]:focus::-webkit-slider-runnable-track {
background: #fff;
border: none;
}
input[type="range"]::-moz-range-track {
border: none;
width: 100%;
height: 5px;
cursor: pointer;
background: #fff;
border-radius: 10px;
box-shadow: rgb(204, 219, 232) 3px 3px 6px 0px inset, rgba(255, 255, 255, 0.5) -3px -3px 6px 1px inset;
}
input[type="range"]::-moz-range-thumb {
height: 15px;
width: 15px;
border-radius: 30px;
box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.37);
/* border: 1px solid #333; */
background: #fff;
cursor: pointer;
-webkit-appearance: none;
margin-top: -5px;
}
input[type="range"]::-ms-track {
border: none;
width: 100%;
height: 5px;
cursor: pointer;
background: transparent;
border-color: transparent;
border-width: 16px 0;
color: transparent;
}
input[type="range"]::-ms-fill-lower {
background: #e0e0e0;
border-radius: 2.6px;
}
input[type="range"]::-ms-fill-upper {
background: #e0e0e0;
border-radius: 2.6px;
}
input[type="range"]::-ms-thumb {
border: none;
height: 20px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
}
input[type="range"]:focus::-ms-fill-lower {
background: #fff;
}
input[type="range"]:focus::-ms-fill-upper {
background: #fff;
}
.oi-ec050e input[type=checkbox] {
height: 25px;
width: 25px;
background-color: #f63;
}
#grid-3 {
display: grid;
grid-template-columns: auto auto auto;
background-color: #fff;
}
#grid-4 {
display: grid;
grid-template-columns: auto auto auto auto;
background-color: #fff;
}
#grid-4-full {
display: grid;
grid-template-columns: auto auto auto auto;
background-color: #fff;
border-top: 1px solid #d3d3d3;
border-right: 1px solid #d3d3d3;
border-bottom: 1px solid #d3d3d3;
border-left: 1px solid #d3d3d3;
}
#grid-4-top {
display: grid;
grid-template-columns: auto auto auto auto;
background-color: #fff;
border-top: 1px solid #d3d3d3;
border-right: 1px solid #d3d3d3;
border-left: 1px solid #d3d3d3;
}
#grid-4-bottom {
display: grid;
grid-template-columns: auto auto auto auto;
background-color: #fff;
border-bottom: 1px solid #d3d3d3;
border-right: 1px solid #d3d3d3;
border-left: 1px solid #d3d3d3;
}
#grid-6-top {
display: grid;
grid-template-columns: auto auto auto auto auto auto;
background-color: #fff;
border-top: 1px solid #d3d3d3;
border-right: 1px solid #d3d3d3;
border-left: 1px solid #d3d3d3;
}
#grid-6-bottom {
display: grid;
grid-template-columns: auto auto auto auto auto auto;
background-color: #fff;
border-bottom: 1px solid #d3d3d3;
border-right: 1px solid #d3d3d3;
border-left: 1px solid #d3d3d3;
}
.grid-item {
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid #d3d3d3;
padding: 20px;
font-size: 16px;
text-align: left;
}
.wrapper-3 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
.wrapper-2 {
display: grid;
grid-template-columns: 1fr 1fr;
}
.wrapper-1 {
display: grid;
grid-template-columns: 1fr;
}
.data-table table {
width: 100%;
border-collapse: separate;
border-spacing: 0.1rem;
overflow-y: scroll;
font-size: 14px;
}
.data-table td,
.data-table th {
padding: 0.3rem;
word-wrap: break-word;
border-bottom: 0;
text-align: center;
font-size: 14px;
}
.data-table td:nth-child(1) {
text-align: left;
}
.data-table th {
color: #fff;
background-color: #384354;
position: sticky;
}
.data-table td {
background-color: #fff;
}
.sort {
display: none
}
.box-title {
text-align: center;
font-weight: 500;
color: #333;
font-size: 18px;
}
.box-item {
border: 3px solid #2e3745;
background-color: #fff;
color: #2e3745;
font-weight: 700;
text-align: center;
padding: 10px 0 10px 0;
margin: 0 10px 0 10px;
font-size: 22px;
}
</style>`