Skip to content

Commit

Permalink
Chore: Remove Chart JS TW Colors Plugin (#4920)
Browse files Browse the repository at this point in the history
Because:
- We're not using enough of it's features to justify the extra
dependencies.
- It's preventing us from upgrading to Tailwind 4
  • Loading branch information
KevinMulhern authored Feb 12, 2025
1 parent 6c9c449 commit c496b37
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 46 deletions.
4 changes: 1 addition & 3 deletions app/javascript/controllers/chart_controller.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Controller } from '@hotwired/stimulus'

import { Chart } from 'chart.js/auto'
import twColorsPlugin from 'chartjs-plugin-tailwindcss-colors'
import twConfig from '../../../tailwind.config'

export default class ChartController extends Controller {
static values = {
Expand All @@ -17,7 +15,7 @@ export default class ChartController extends Controller {
{
type: this.typeValue,
data: this.dataValue,
plugins: [twColorsPlugin(twConfig), ...this.chartTypePlugins()],
plugins: [...this.chartTypePlugins()],
options: {
maintainAspectRatio: false,
responsive: true,
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/reports/lesson_completions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
label: 'Lesson completions',
data: @lesson_completions_stats.values,
fill: true,
backgroundColor: 'blue-200',
borderColor: 'blue-600',
backgroundColor: '#bedbff',
borderColor: '#155dfc',
borderWidth: 2
}
],
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/reports/paths/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
{
label: 'Lesson completions',
data: @path_lesson_completions.map(&:count),
borderColor: 'emerald-600',
backgroundColor: 'emerald-200',
borderColor: '#009966',
backgroundColor: '#a4f4cf',
borderWidth: 1,
barThickness: 20,
borderRadius: 4
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/reports/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
label: 'Sign ups',
data: @sign_up_stats.values,
fill: true,
backgroundColor: 'blue-200',
borderColor: 'blue-600',
backgroundColor: '#bedbff',
borderColor: '#155dfc',
borderWidth: 2,
}
],
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"browserslist": "^4.23.3",
"chart.js": "^4.4.4",
"chartjs-plugin-crosshair": "^2.0.0",
"chartjs-plugin-tailwindcss-colors": "^0.2.4",
"chokidar": "^4.0.3",
"debounce": "^2.2.0",
"el-transition": "^0.0.7",
Expand Down
36 changes: 0 additions & 36 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c496b37

Please sign in to comment.