-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial re-write of stats.thunderbird.net
- Loading branch information
1 parent
a8f5b39
commit 8e9bbd4
Showing
156 changed files
with
37,969 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true | ||
}, | ||
root: true, | ||
extends: "airbnb-base", | ||
overrides: [], | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module" | ||
}, | ||
rules: { | ||
"max-len": ["error", { code: 120 }], | ||
"no-underscore-dangle": ["error", { "allowAfterThis": true }], | ||
"import/no-unresolved": 0, // Turn off "Unable to resolve path to module ..." error | ||
"import/extensions": 0, // Turn off "Missing file extension for ..." error | ||
"class-methods-use-this": 0, | ||
}, | ||
ignorePatterns: ["node_modules", "src/dist", "docs", "tools"], | ||
settings: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
# stats | ||
User count stats collector and display for Thunderbird. | ||
# Thunderbird Stats | ||
|
||
Thunderbird's html and vanilla js stats dashboard. | ||
|
||
Thunderbird Stats uses Vite to streamline development and import node modules as needed. | ||
|
||
## Install | ||
|
||
``` | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
## Charts | ||
|
||
### Chart Component | ||
Charts are JavaScript web components that inherit a `base-chart.js`, they are located in `src/assets/js/charts`. | ||
There's also a `index.js` file that will handle importing the chart for stats. | ||
|
||
Below is a small interface for how the charts are generally structured: | ||
```javascript | ||
class Interface extends BaseChart { | ||
constructor(); // Pass a html template to BaseChart's constructor, and then call fetchData | ||
fetchData(); // Fetches the data required for the chart. Place the data into a class variable. | ||
create(); // Setup options, and data for the ChartJS chart. Make sure to call `this._createChart` to create the chart. | ||
}; | ||
``` | ||
### Transformers | ||
Transformers are a JavaScript class that handles processing the data from source to something ChartJS can handle. | ||
Below is a small interface for how transformers are generally structured: | ||
```javascript | ||
class Interface { | ||
constructor(data); // Pass in the data | ||
toChartData(); // Transforms the data to ChartJS data format | ||
} | ||
``` | ||
### Providers | ||
Providers are a JavaScript class that provides data upon a ready signal. Currently, the only example is the slot data provider. |
Oops, something went wrong.