Good stuff

This commit is contained in:
Andras Schmelczer 2026-02-22 22:36:40 +00:00
parent 9da2db707f
commit 8032011708
32 changed files with 1052 additions and 374 deletions

View file

@ -28,6 +28,10 @@ pub struct FeatureConfig {
pub raw: bool,
/// If true, the slider uses absolute min/max/step instead of percentile scaling
pub absolute: bool,
/// Listing modes this feature is available in (empty = all modes)
pub modes: &'static [&'static str],
/// Name of the linked feature that swaps when switching modes (empty = no link)
pub linked: &'static str,
}
/// Features whose histogram bins should be exactly 1 unit wide (one per integer).
@ -61,7 +65,7 @@ pub struct EnumFeatureGroup {
pub static FEATURE_GROUPS: &[FeatureGroup] = &[
FeatureGroup {
name: "Property",
name: "Properties in the area",
features: &[
FeatureConfig {
name: "Last known price",
@ -77,6 +81,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: true,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Estimated current price",
@ -92,6 +98,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: true,
modes: &["historical"],
linked: "Asking price",
},
FeatureConfig {
name: "Price per sqm",
@ -107,6 +115,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Est. price per sqm",
@ -122,6 +132,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Total floor area (sqm)",
@ -137,6 +149,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " sqm",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Interior height (m)",
@ -152,6 +166,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " m",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Number of bedrooms & living rooms",
@ -167,6 +183,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " rooms",
raw: false,
absolute: true,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Estimated monthly rent",
@ -179,6 +197,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/mo",
raw: false,
absolute: false,
modes: &["historical"],
linked: "Asking rent (monthly)",
},
FeatureConfig {
name: "Date of last transaction",
@ -194,6 +214,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: true,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Construction age",
@ -209,6 +231,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: true,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Asking price",
@ -224,6 +248,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: true,
modes: &["buy"],
linked: "Estimated current price",
},
FeatureConfig {
name: "Asking rent (monthly)",
@ -239,6 +265,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/mo",
raw: false,
absolute: true,
modes: &["rent"],
linked: "Estimated monthly rent",
},
FeatureConfig {
name: "Bedrooms",
@ -254,6 +282,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: true,
modes: &["buy", "rent"],
linked: "",
},
FeatureConfig {
name: "Bathrooms",
@ -269,6 +299,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: true,
modes: &["buy", "rent"],
linked: "",
},
FeatureConfig {
name: "Listing date",
@ -284,6 +316,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: true,
absolute: false,
modes: &["buy", "rent"],
linked: "",
},
],
},
@ -304,6 +338,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " mins",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Public transport to Fitzrovia (mins)",
@ -319,6 +355,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " mins",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Cycling to Bank (mins)",
@ -334,6 +372,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " mins",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Cycling to Fitzrovia (mins)",
@ -349,6 +389,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " mins",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Number of public transport stations within 2km",
@ -364,6 +406,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -384,6 +428,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Good+ primary schools within 5km",
@ -399,6 +445,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Good+ secondary schools within 5km",
@ -414,6 +462,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -431,6 +481,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Employment Score (rate)",
@ -443,6 +495,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Health Deprivation and Disability Score",
@ -458,6 +512,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Living Environment Score",
@ -473,6 +529,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Indoors Sub-domain Score",
@ -488,6 +546,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Outdoors Sub-domain Score",
@ -503,6 +563,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -524,6 +586,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Minor crime (avg/yr)",
@ -539,6 +603,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -559,6 +625,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Violence and sexual offences (avg/yr)",
@ -574,6 +642,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Criminal damage and arson (avg/yr)",
@ -589,6 +659,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Burglary (avg/yr)",
@ -604,6 +676,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Vehicle crime (avg/yr)",
@ -619,6 +693,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Robbery (avg/yr)",
@ -634,6 +710,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Other theft (avg/yr)",
@ -649,6 +727,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Shoplifting (avg/yr)",
@ -664,6 +744,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Drugs (avg/yr)",
@ -679,6 +761,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Possession of weapons (avg/yr)",
@ -694,6 +778,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Public order (avg/yr)",
@ -709,6 +795,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Bicycle theft (avg/yr)",
@ -724,6 +812,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Theft from the person (avg/yr)",
@ -739,6 +829,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Other crime (avg/yr)",
@ -754,6 +846,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "/yr",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -774,6 +868,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "%",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "% Asian",
@ -789,6 +885,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "%",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "% Black",
@ -804,6 +902,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "%",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "% Mixed",
@ -819,6 +919,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "%",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "% Other",
@ -834,6 +936,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "%",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -854,6 +958,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Number of grocery shops and supermarkets within 2km",
@ -869,6 +975,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Number of parks within 2km",
@ -884,6 +992,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: "",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
],
},
@ -904,6 +1014,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " dB",
raw: false,
absolute: false,
modes: &[],
linked: "",
},
FeatureConfig {
name: "Max available download speed (Mbps)",
@ -919,6 +1031,8 @@ pub static FEATURE_GROUPS: &[FeatureGroup] = &[
suffix: " Mbps",
raw: true,
absolute: false,
modes: &[],
linked: "",
},
],
},