code: def htmlFormat(output, pathParts = (), statDict = None, query = None):
    
    statDict = statDict or scales.getStats()
    if query:
      statDict = runQuery(statDict, query)
    _htmlRenderDict(pathParts, statDict, output)
docs: Formats as HTML, writing to the given object.