Author: avin

  • Using Leaflet in a Power BI Custom Visual

    For some of the spatial visualisations I’ve been working with in Power BI, I’ve had to create Custom Visuals as the out-of-the-box and visuals in the AppSource don’t quite hit the mark. I’m quite fond of Leaflet for map rendering. Here’s how I got it working with a Power BI Custom Visual. Create a new…

  • Translink GTFS

    I recently became aware that Translink, Queensland’s public transport provider, openly publishes both a GTFS (General Transit Feed Specification) Static dataset and Realtime feed. The GTFS Static dataset provides information on routes, schedules, stops and pathing, while the Realtime feed provides information on current vehicle lat/long coordinates and delay information. I created a web app…

  • Offline web apps

    I was doing some work with a mobile web application that had to continue to operate in a disconnected scenario, as users may intermittently go in and out of areas with mobile network reception. Adding offline support was reasonably straightforward in web browsers that support: Online/offline status to determine whether to post content to an…

  • Querying ArcGIS attribute subtypes and domains with SQL

    ArcGIS geodatabases have the concept of domains, where an attribute can be restricted to a set of values, similar to a drop down list. Furthermore, geodatabases also allow an attribute to be specified as a subtype where the subtype determines which set of domains that apply to attributes. This can be used when setting up…

  • web.config for React and Node.js on Azure App Service

    I’ve been creating a web application using React and Node.js, and decided to host it on Azure App Service. I had a lot of difficulty finding an appropriate web.config rewrite rules that would host static assets, redirect deep React Router links to index.html and send API calls to Node.js via iisnode. I finally came across…

  • WebdriverIO with ChromeDriver headless without Selenium

    I was excited to discover that WebdriverIO supports the use of ChromeDriver running in headless mode without the use of Selenium (because ChromeDriver supports the WebDriver protocol). Here’s a starter guide (assuming Node.js is installed): Install Chrome Web Browser Download ChromeDriver Run ChromeDriver Install WebdriverIO by running npm i webdriverio Run the following file (based…

  • Multiple layouts with React Router v4

    I was searching for a way to add use multiple layouts with React Router v4. I could only find examples for v3, but was inspired by the Redirects (Auth) example in the docs. I created a simple wrapper component for a Route that allows a layout prop to be passed which renders the component as…

  • Creating a ArcGIS map service raster layer in PyQGIS

    It’s relatively straightforward creating layers programatically in QGIS using PyQGIS. However, the documentation isn’t clear on how to use create a raster layer from a ArcGIS map service. The list of raster providers can be found by searching for addRasterProviderDialog in qgsdatasourcemanagerdialog.cpp. There are two mandatory parts to the data source string when specifying the…

  • ASX 200 Market Cap

    I recently came across this /r/dataisbeautiful post and was wondering what the equivalent would look like using Australian stocks. I found historical market cap data for the ASX 200 and using D3 created a similar visualisation, experimenting with D3’s transitions, scales, areas and axis. Source code on GitHub.

  • Websockets are easy

    I was interested in getting a minimal example working for Websockets and it was surprisingly easy to get a demo working between Node.js and a browser. First install the ws library: Create an index.js file with the contents: Start the Node.js process: In a browser console, send a message to the Node.js process: