LukePrior / nbn-upgrade-map

Interactive map showing premises eligible for the NBN FTTP upgrade program.
https://nbn.lukeprior.com/
MIT License
134 stars 11 forks source link

Show green (or another non-red) colour for upgrades available other than FTTP #361

Closed lyricnz closed 5 months ago

lyricnz commented 5 months ago

Eg

image

Current code has some requirements around FTTN/FTTC, and an implicit assumption that all upgrades are FTTP

    // Eligible for immediate upgrade
    if ((status == "Eligible To Order") && (tech == "FTTN" || tech == "FTTC")) {
        return dotTypes.FTTPUpgrade;
    }

    // Eligible for upgrade soon
    if ((status == "Build Finalised" || status == "MDU Complex Eligible To Apply" || status == "MDU Complex Premises In Build") && (tech == "FTTN" || tech == "FTTC")) {
        return dotTypes.FTTPUpgradeSoon;
    }
lyricnz commented 5 months ago

Related to #359 and #350 and #327

lyricnz commented 5 months ago
image
lyricnz commented 5 months ago

Added a tool for dumping status -> tech -> upgrade.

For 'Eligible To Order' this is:

 'Eligible To Order': {'FTTB': {'FTTP': 151},
                       'FTTC': {'FTTP': 554, 'FTTP_SA': 1123220, 'NULL_NA': 11},
                       'FTTN': {'FTTC': 16,
                                'FTTP': 161861,
                                'FTTP_SA': 1212985,
                                'NULL': 1,
                                'NULL_NA': 96,
                                'WIRELESS': 4},
                       'FTTP': {'NULL_NA': 11187},
                       'HFC': {'FTTP': 20},
                       'NULL': {'FTTP_SA': 3, 'NULL_NA': 2},
                       'SATELLITE': {'FTTC': 1,
                                     'FTTN': 10,
                                     'FTTP': 81,
                                     'NULL_NA': 2,
                                     'SATELLITE': 3,
                                     'WIRELESS': 4413},
                       'WIRELESS': {'FTTC': 1012,
                                    'FTTN': 178,
                                    'FTTN_SA': 246,
                                    'FTTP': 1089,
                                    'NULL_NA': 422}},
lyricnz commented 5 months ago
image
LukePrior commented 5 months ago

For 'Eligible To Order' this is:

Oh this is very interesting indeed.

lyricnz commented 5 months ago
image
lyricnz commented 5 months ago

@LukePrior the full status -> tech -> upgrade:count dump is

{'?': {'FTTB': {'NULL_NA': 610471},
       'FTTC': {'NULL_NA': 38320},
       'FTTN': {'NULL_NA': 1},
       'FTTP': {'NULL_NA': 2806138},
       'HFC': {'NULL_NA': 2735177},
       'NULL': {'NULL_NA': 138737, 'UNKNOWN': 1731},
       'SATELLITE': {'NULL_NA': 397569, 'UNKNOWN': 5},
       'WIRELESS': {'NULL_NA': 744029, 'UNKNOWN': 23}},
 'Build Finalised': {'FTTB': {'FTTP_NA': 33},
                     'FTTC': {'FTTP_NA': 66},
                     'FTTN': {'FTTP_NA': 56915},
                     'FTTP': {'FTTP_NA': 21, 'SAT_NA': 1},
                     'NULL': {'FTTP_NA': 83},
                     'SATELLITE': {'FTTP_NA': 131, 'FW_NA': 6},
                     'WIRELESS': {'FTTP_NA': 1098}},
 'Committed': {'FTTB': {'FTTP_NA': 3},
               'FTTC': {'FTTP_NA': 4},
               'FTTN': {'FTTP_NA': 809872},
               'FTTP': {'FTTP_NA': 3},
               'NULL': {'FTTP_NA': 43},
               'SATELLITE': {'FTTP_NA': 1},
               'WIRELESS': {'FTTP_NA': 3}},
 'Eligible To Order': {'FTTB': {'FTTP': 151},
                       'FTTC': {'FTTP': 554, 'FTTP_SA': 1123220, 'NULL_NA': 11},
                       'FTTN': {'FTTC': 16,
                                'FTTP': 161861,
                                'FTTP_SA': 1212985,
                                'NULL': 1,
                                'NULL_NA': 96,
                                'WIRELESS': 4},
                       'FTTP': {'NULL_NA': 11187},
                       'HFC': {'FTTP': 20},
                       'NULL': {'FTTP_SA': 3, 'NULL_NA': 2},
                       'SATELLITE': {'FTTC': 1,
                                     'FTTN': 10,
                                     'FTTP': 81,
                                     'NULL_NA': 2,
                                     'SATELLITE': 3,
                                     'WIRELESS': 4413},
                       'WIRELESS': {'FTTC': 1012,
                                    'FTTN': 178,
                                    'FTTN_SA': 246,
                                    'FTTP': 1089,
                                    'NULL_NA': 422}},
 'Eligible to Order': {'FTTN': {'FTTP_NA': 2}, 'FTTP': {'FTTP_NA': 446}},
 'In Design': {'FTTN': {'FTTP_NA': 537030},
               'NULL': {'FTTP_NA': 25},
               'WIRELESS': {'FTTP_NA': 2}},
 'MDU Complex Eligible To Apply': {'FTTB': {'FTTP_NA': 385},
                                   'FTTC': {'FTTP_NA': 345779},
                                   'FTTN': {'FTTP_NA': 458221},
                                   'FTTP': {'FTTP_NA': 413},
                                   'HFC': {'FTTP_NA': 36},
                                   'NULL': {'FTTP_NA': 428},
                                   'WIRELESS': {'FTTP_NA': 2}},
 'MDU Complex Premises In Build': {'FTTC': {'FTTP_NA': 95},
                                   'FTTN': {'FTTP_NA': 533}},
 'New Tech Connected': {'FTTB': {'FTTP': 190},
                        'FTTC': {'FTTP': 3496},
                        'FTTN': {'FTTC': 29, 'FTTP': 11586, 'FTTP_NA': 1},
                        'FTTP': {'FTTP_NA': 33},
                        'HFC': {'FTTP': 98},
                        'SATELLITE': {'FTTN': 6, 'FTTP': 11, 'WIRELESS': 94},
                        'WIRELESS': {'FTTC': 57, 'FTTN': 49, 'FTTP': 45}},
 'Not Planned': {'FTTC': {'NULL_NA': 6},
                 'FTTN': {'NULL_NA': 748337},
                 'FTTP': {'NULL_NA': 65},
                 'HFC': {'NULL_NA': 1},
                 'NULL': {'NULL_NA': 33782},
                 'WIRELESS': {'NULL_NA': 2}},
 'Planned': {'FTTN': {'FTTP_NA': 429}},
 'Previous Tech Disconnected': {'FTTB': {'NULL_NA': 4},
                                'FTTC': {'NULL_NA': 21},
                                'FTTN': {'FTTP_NA': 62, 'NULL_NA': 267},
                                'FTTP': {'FTTP_NA': 175873, 'NULL_NA': 21006},
                                'NULL': {'FTTP_NA': 27},
                                'SATELLITE': {'NULL_NA': 5},
                                'WIRELESS': {'NULL_NA': 453}}}
LukePrior commented 5 months ago

I'm not sure on the colours especially for other upgrade which could for example be from Wireless to FTTN but would still show up as "better" then like FTTC. Or in your latest image where Satellite to FW is shown as "better" then SAT/FW.

I'm not sure what the best way to approach this, maybe the behaviour is fine and we can leave as is.

Some other options would be to dynamically generate for each tech/upgrade but that would need a lot of colours.

LukePrior commented 5 months ago

If we were to split it out as much as possible I think we would have the following, organised "best to worst"

lyricnz commented 5 months ago

Why is Wireless->FTTN (blue) "better" than FTTC? Because red/orange is bad? Feel free to change them to whatever you like :)

lyricnz commented 5 months ago

You missed HFC->FTTP upgrade available (there are 98 of those). And satellite with/without upgrade? (there are upgrades to FTTN, FTTC, FTTP and wireless, with wireless being the most common)

LukePrior commented 5 months ago

You missed HFC->FTTP upgrade available (there are 98 of those). And satellite with/without upgrade?

Oh the way I wrote it was listing the technology which can be upgraded to rather then the one upgrading from, not sure what is clearer.

i.e. no one is getting upgraded to Satellite

lyricnz commented 5 months ago

I guess it all comes down to what you're trying to show - current tech, upgrade availability / upgrade-to, etc. It's all up to function getDotType(tech, upgrade, date, status, generated) which currently shows "upgrade" by preference, followed by current tech type.

LukePrior commented 5 months ago

Yeah it would be good to better understand who's using the site and what for so could then customise the experience to best suit their needs but for time being this seems like a good setup.

lyricnz commented 5 months ago

@LukePrior maybe raise another issue to revisit node-colouring as a whole? This PR was attempting to show people who had non-FTTP upgrades a different colour.

lyricnz commented 5 months ago

Maybe you could even have a toggle/selector that switched out getDotType() completely for a couple of different options?