Not sure this is possible without having an external server resource - however i’m happy to be proved wrong.
You can mimic the pickup_availabilty files, which gets the .store_availabilities array, showing whether a product is available at that location, but doesn’t give the inventory of that variant, just that its available, you also need the localpickup to be enabled for each location, so doesn’t really work for those showing “warehouse” stock, which appears to be the main reason people wanting to show this.
The only way i can see do this is to go through partners.shopify, create your own app on your own server, then use the unstable version of the admin api to get inventory level at location based on the inventory.id gained from querying against the variant, then return a simple array of inventory:location to display on the store.
Having only worked on shopify for a month i’m staggered at how such basic requirements have to be (for most users) outsourced to paid apps.. this is so simple to create on open source carts..