diff options
| author | Petri Hienonen <petri.hienonen@gmail.com> | 2025-11-13 18:55:58 +0200 |
|---|---|---|
| committer | Petri Hienonen <petri.hienonen@gmail.com> | 2025-11-13 18:55:58 +0200 |
| commit | e92bf0544d423f0ab2ff7801f02b17f863a97387 (patch) | |
| tree | dace83622f146672aa4f2902d4935523e75847e6 /app/components.js | |
| parent | e4fdd8457d2d320eea502f0801fc22eceb8947b1 (diff) | |
| download | housing-e92bf0544d423f0ab2ff7801f02b17f863a97387.tar.zst | |
Update score calculation
Diffstat (limited to 'app/components.js')
| -rw-r--r-- | app/components.js | 83 |
1 files changed, 59 insertions, 24 deletions
diff --git a/app/components.js b/app/components.js index 1c8c6aa..0995692 100644 --- a/app/components.js +++ b/app/components.js @@ -422,7 +422,7 @@ export class Sidebar { children: [ Dom.heading( 3, - "Scoring", + "Scoring Weights", new DomOptions({ styles: { color: "#333", @@ -431,60 +431,95 @@ export class Sidebar { }, }), ), + // Basic house properties Widgets.slider( "w-price", - "Price weight", + "Price", "price", this.#weights.price, this.#onWeightChange, ), Widgets.slider( + "w-year", + "Construction Year", + "constructionYear", + this.#weights.constructionYear, + this.#onWeightChange, + ), + Widgets.slider( + "w-area", + "Living Area", + "livingArea", + this.#weights.livingArea, + this.#onWeightChange, + ), + + // Location factors + Widgets.slider( "w-market", - "Market distance", + "Market Distance", "distanceMarket", this.#weights.distanceMarket, this.#onWeightChange, ), Widgets.slider( "w-school", - "School distance", + "School Distance", "distanceSchool", this.#weights.distanceSchool, this.#onWeightChange, ), + + // Transit distances Widgets.slider( - "w-crime", - "Crime rate", - "crimeRate", - this.#weights.crimeRate, + "w-train", + "Train Distance", + "distanceTrain", + this.#weights.distanceTrain, this.#onWeightChange, ), Widgets.slider( - "w-safety", - "Safety index", - "safety", - this.#weights.safety, + "w-lightrail", + "Light Rail Distance", + "distanceLightRail", + this.#weights.distanceLightRail, this.#onWeightChange, ), Widgets.slider( - "w-students", - "S2 students", - "s2Students", - this.#weights.s2Students, + "w-tram", + "Tram Distance", + "distanceTram", + this.#weights.distanceTram, this.#onWeightChange, ), + + // Statistical area factors Widgets.slider( - "w-railway", - "Railway distance", - "distanceRailway", - this.#weights.distanceRailway, + "w-foreign", + "Foreign Speakers", + "foreignSpeakers", + this.#weights.foreignSpeakers, this.#onWeightChange, ), Widgets.slider( - "w-year", - "Construction year", - "constructionYear", - this.#weights.constructionYear, + "w-unemployment", + "Unemployment Rate", + "unemploymentRate", + this.#weights.unemploymentRate, + this.#onWeightChange, + ), + Widgets.slider( + "w-income", + "Average Income", + "averageIncome", + this.#weights.averageIncome, + this.#onWeightChange, + ), + Widgets.slider( + "w-education", + "Higher Education", + "higherEducation", + this.#weights.higherEducation, this.#onWeightChange, ), ], |
