Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
env: {
browser: true,
node: true,
es6: true,
},
extends: 'eslint:recommended',
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react'],
rules: {},
};
180 changes: 90 additions & 90 deletions app/javascript/packs/proCharts.js
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
import Chart from 'chart.js';
// import Chart from 'chart.js';

const reactionsCanvas = document.getElementById('reactionsChart');
const commentsCanvas = document.getElementById('commentsChart');
// const reactionsCanvas = document.getElementById('reactionsChart');
// const commentsCanvas = document.getElementById('commentsChart');

export const reactionsChart = new Chart(reactionsCanvas, {
type: 'line',
data: {
labels: JSON.parse(reactionsCanvas.dataset.labels),
datasets: [
{
label: 'Reaction Total',
data: JSON.parse(reactionsCanvas.dataset.totalCount),
// data: [5, 10, 15, 17, 25, 23],
fill: false,
borderColor: 'rgb(75, 192, 192)',
lineTension: 0.1,
},
{
label: 'Total Likes',
data: JSON.parse(reactionsCanvas.dataset.totalLikes),
// data: [2, 5, 10, 10, 15, 13],
fill: false,
borderColor: 'rgb(229, 100, 100)',
lineTension: 0.1,
},
{
label: 'Total Unicorns',
data: JSON.parse(reactionsCanvas.dataset.totalUnicorns),
// data: [1, 2, 2, 4, 5, 3],
fill: false,
borderColor: 'rgb(157, 57, 233)',
lineTension: 0.1,
},
{
label: 'Total Bookmarks',
data: JSON.parse(reactionsCanvas.dataset.totalReadinglist),
// data: [2, 3, 3, 3, 5, 7],
fill: false,
borderColor: 'rgb(10, 133, 255)',
lineTension: 0.1,
},
],
},
options: {
title: {
display: true,
text: 'Reactions over the Last Week',
},
scales: {
yAxes: [
{
ticks: {
suggestedMin: 0,
precision: 0,
},
},
],
},
},
});
// export const reactionsChart = new Chart(reactionsCanvas, {
// type: 'line',
// data: {
// labels: JSON.parse(reactionsCanvas.dataset.labels),
// datasets: [
// {
// label: 'Reaction Total',
// data: JSON.parse(reactionsCanvas.dataset.totalCount),
// // data: [5, 10, 15, 17, 25, 23],
// fill: false,
// borderColor: 'rgb(75, 192, 192)',
// lineTension: 0.1,
// },
// {
// label: 'Total Likes',
// data: JSON.parse(reactionsCanvas.dataset.totalLikes),
// // data: [2, 5, 10, 10, 15, 13],
// fill: false,
// borderColor: 'rgb(229, 100, 100)',
// lineTension: 0.1,
// },
// {
// label: 'Total Unicorns',
// data: JSON.parse(reactionsCanvas.dataset.totalUnicorns),
// // data: [1, 2, 2, 4, 5, 3],
// fill: false,
// borderColor: 'rgb(157, 57, 233)',
// lineTension: 0.1,
// },
// {
// label: 'Total Bookmarks',
// data: JSON.parse(reactionsCanvas.dataset.totalReadinglist),
// // data: [2, 3, 3, 3, 5, 7],
// fill: false,
// borderColor: 'rgb(10, 133, 255)',
// lineTension: 0.1,
// },
// ],
// },
// options: {
// title: {
// display: true,
// text: 'Reactions over the Last Week',
// },
// scales: {
// yAxes: [
// {
// ticks: {
// suggestedMin: 0,
// precision: 0,
// },
// },
// ],
// },
// },
// });

export const commentsChart = new Chart(commentsCanvas, {
type: 'line',
data: {
labels: JSON.parse(commentsCanvas.dataset.labels),
datasets: [
{
label: 'Total Comments',
data: JSON.parse(commentsCanvas.dataset.totalCount),
fill: false,
borderColor: 'rgb(75, 192, 192)',
lineTension: 0.1,
},
],
},
options: {
title: {
display: true,
text: 'Comments over the Last Week',
},
scales: {
yAxes: [
{
ticks: {
suggestedMin: 0,
precision: 0,
},
},
],
},
},
});
// export const commentsChart = new Chart(commentsCanvas, {
// type: 'line',
// data: {
// labels: JSON.parse(commentsCanvas.dataset.labels),
// datasets: [
// {
// label: 'Total Comments',
// data: JSON.parse(commentsCanvas.dataset.totalCount),
// fill: false,
// borderColor: 'rgb(75, 192, 192)',
// lineTension: 0.1,
// },
// ],
// },
// options: {
// title: {
// display: true,
// text: 'Comments over the Last Week',
// },
// scales: {
// yAxes: [
// {
// ticks: {
// suggestedMin: 0,
// precision: 0,
// },
// },
// ],
// },
// },
// });
11 changes: 11 additions & 0 deletions config/webpack/development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
const environment = require('./environment');

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
environment.plugins.append(
'BundleAnalyzer',
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: true,
}),
);

const config = environment.toWebpackConfig();

// For more information, see https://webpack.js.org/configuration/devtool/#devtool
Expand Down
7 changes: 7 additions & 0 deletions myBudget.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"budget": {
"transferSize": {
"javascript": 460000
}
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"eslint-plugin-ignore-erb": "^0.1.1",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.33.2",
"faker": "^4.1.0",
"husky": "^1.3.1",
"jest": "^23.5.0",
Expand All @@ -99,7 +99,8 @@
"prop-types": "^15.7.2",
"pusher-js": "^4.4.0",
"twilio-video": "^1.15.2",
"web-share-wrapper": "^0.2.1"
"web-share-wrapper": "^0.2.1",
"webpack-bundle-analyzer": "^4.10.1"
},
"jest": {
"setupFiles": [
Expand Down
Loading