MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / activityGraph

Function activityGraph

code/hangar2.js:67–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}()
66
67var activityGraph = table => {
68 let widest = Math.max(50, Math.max(...table))
69 return table.map((n, i) => {
70 let width = (n / widest) * 20
71 let full = Math.floor(width), rest = " ▏▎▍▌▋▊▉"[Math.floor((width - full) * 8)]
72 return String(i).padStart(2, " ") + " " + "█".repeat(full) + rest
73 }).join("\n")
74}
75
76var joinWifi = function(networkID, code) {
77 return new Promise((accept, reject) => {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected