% const fs = require("fs"); const path = require("path"); const data = JSON.parse(fs.readFileSync(path.join(metadata.sourceDir, "data.json"))); const maxJavaVersionCount = data.javaVersions[Object.keys(data.javaVersions)[0]]; const javaVersions = Object.keys(data.javaVersions).filter(k => data.javaVersions[k] / maxJavaVersionCount > 0.01); const javaVersionWidth = 90 / javaVersions.length; function prettyCount(k) { const count = data.javaVersions[k]; if (count > 1000000) { return Math.round(count / 100000) / 10 + "M"; } else if (count > 1000) { return Math.round(count / 1000) + "k" } } %>