diff --git a/Gruntfile.js b/Gruntfile.js index b8c8a77..c81ee2a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,10 +8,10 @@ module.exports = grunt => { }, copy: { html: { - files: [{expand: true, cwd: "src/main/", src: "**/*.html", dest: "dist/"}] + files: [{expand: true, cwd: "src/main/", src: "**/*.html", dest: "dist/", flatten: true}] }, css: { - files: [{expand: true, cwd: "src/main/", src: "**/*.css", dest: "dist/"}] + files: [{expand: true, cwd: "src/main/", src: "**/*.css", dest: "dist/", flatten: true}] }, }, focus: { @@ -43,7 +43,7 @@ module.exports = grunt => { }, webpack: { options: { - entry: "./src/main/js/index.js", + entry: "./src/main/js/main.js", module: { rules: [ { diff --git a/package-lock.json b/package-lock.json index c229aad..33f1554 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 4b4c18d..a3d5819 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dice", - "version": "1.0.12", + "version": "1.0.13", "description": "Calculates the probability of rolling a value given a combination of dice.", "author": "Felix W. Dekker", "browser": "dist/bundle.js", @@ -16,19 +16,18 @@ "deploy": "grunt deploy" }, "dependencies": { - "@fwdekker/template": "^0.0.24", - "chart.js": "^2.9.4" + "chart.js": "^3.1.1" }, "devDependencies": { "grunt": "^1.3.0", - "grunt-cli": "^1.4.1", + "grunt-cli": "^1.4.2", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-watch": "^1.1.0", "grunt-focus": "^1.0.0", "grunt-text-replace": "^0.4.0", - "grunt-webpack": "^4.0.2", - "webpack": "^5.28.0", - "webpack-cli": "^4.5.0" + "grunt-webpack": "^4.0.3", + "webpack": "^5.33.2", + "webpack-cli": "^4.6.0" } } diff --git a/src/main/index.html b/src/main/index.html index 2d37c1d..7bd6032 100644 --- a/src/main/index.html +++ b/src/main/index.html @@ -11,14 +11,15 @@ Dice probabilities | FWDekker +
@@ -70,8 +71,8 @@
- - + + diff --git a/src/main/js/index.js b/src/main/js/main.js similarity index 93% rename from src/main/js/index.js rename to src/main/js/main.js index ded1529..7322556 100644 --- a/src/main/js/index.js +++ b/src/main/js/main.js @@ -1,5 +1,8 @@ -import {$, doAfterLoad, footer, header, nav, showPage} from "@fwdekker/template"; -import Chart from "chart.js" +// noinspection JSUnresolvedVariable +const {$, doAfterLoad, footer, header, nav, showPage} = window.fwdekker; +import {Chart, CategoryScale, Filler, LineController, LineElement, LinearScale, PointElement, Tooltip} from "chart.js" + +Chart.register(CategoryScale, Filler, LineController, LineElement, LinearScale, PointElement, Tooltip); ////// @@ -49,11 +52,6 @@ doAfterLoad(() => { description: "Calculate the probability of rolling a value given a combination of dice" })); $("#footer").appendChild(footer({ - author: "Felix W. Dekker", - authorURL: "https://fwdekker.com/", - license: "MIT License", - licenseURL: "https://git.fwdekker.com/FWDekker/dice/src/branch/master/LICENSE", - vcs: "git", vcsURL: "https://git.fwdekker.com/FWDekker/dice/", version: "v%%VERSION_NUMBER%%" })); @@ -218,9 +216,7 @@ doAfterLoad(() => { type: "line", data: {}, options: { - legend: { - display: false - }, + fill: true, scales: { yAxes: [{ display: true,