Skip to content

Commit

Permalink
Upgraded to D3.js v7 including charts.js code.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed May 27, 2023
1 parent 07fd62f commit b7f8790
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 234 deletions.
12 changes: 6 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dist_noinst_DATA = \
resources/css/fa.min.css \
resources/js/app.js \
resources/js/charts.js \
resources/js/d3.v3.min.js \
resources/js/d3.v7.min.js \
resources/js/hogan.min.js

noinst_PROGRAMS = bin2c
Expand Down Expand Up @@ -38,7 +38,7 @@ CLEANFILES = \
resources/css/bootstrap.min.css.tmp \
resources/css/fa.min.css.tmp \
resources/css/app.css.tmp \
resources/js/d3.v3.min.js.tmp \
resources/js/d3.v7.min.js.tmp \
resources/js/hogan.min.js.tmp \
resources/js/charts.js.tmp \
resources/js/app.js.tmp
Expand Down Expand Up @@ -76,12 +76,12 @@ else
./bin2c $(srcdir)/resources/css/app.css src/appcss.h app_css
endif
# D3.js
src/d3js.h: bin2c$(EXEEXT) $(srcdir)/resources/js/d3.v3.min.js
src/d3js.h: bin2c$(EXEEXT) $(srcdir)/resources/js/d3.v7.min.js
if HAS_SEDTR
cat $(srcdir)/resources/js/d3.v3.min.js | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > $(srcdir)/resources/js/d3.v3.min.js.tmp
./bin2c $(srcdir)/resources/js/d3.v3.min.js.tmp src/d3js.h d3_js
cat $(srcdir)/resources/js/d3.v7.min.js | sed "s/^[[:space:]]*//" | sed "/^$$/d" | tr -d "\r\n" > $(srcdir)/resources/js/d3.v7.min.js.tmp
./bin2c $(srcdir)/resources/js/d3.v7.min.js.tmp src/d3js.h d3_js
else
./bin2c $(srcdir)/resources/js/d3.v3.min.js src/d3js.h d3_js
./bin2c $(srcdir)/resources/js/d3.v7.min.js src/d3js.h d3_js
endif
# Hogan.js
src/hoganjs.h: bin2c$(EXEEXT) $(srcdir)/resources/js/hogan.min.js
Expand Down
1 change: 1 addition & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ line.indicator {
shape-rendering: crispEdges;
stroke: #999;
stroke-width: 1;
display: none;
}
.area0,
.bars.y0 .bar,
Expand Down
3 changes: 2 additions & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,8 @@ GoAccess.Charts = {

d3.select("#chart-" + panel)
.datum(this.processChartData(this.getPanelData(panel, data)))
.call(chart.width($("#chart-" + panel).offsetWidth));
.call(chart.width($("#chart-" + panel).offsetWidth))
.append("div").attr("class", "chart-tooltip-wrap");
},

// Reload (doesn't redraw) all chart's data
Expand Down
Loading

0 comments on commit b7f8790

Please sign in to comment.