Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fix d3 import

Maksim Mrugdb442afe2316
diff --git a/app/routes/project/view/__ViewProject.helpers.tsx b/app/routes/project/view/__ViewProject.helpers.tsx
index d3d7ed4ce..e9c15a0e1 100644
--- a/app/routes/project/view/__ViewProject.helpers.tsx
+++ b/app/routes/project/view/__ViewProject.helpers.tsx
@@ -5,8 +5,6 @@ import {
GlobeEuropeAfricaIcon, LanguageIcon, DocumentTextIcon, DeviceTabletIcon,
ArrowRightCircleIcon, MagnifyingGlassIcon, ServerIcon,
} from '@heroicons/react/24/outline'
-// @ts-ignore
-import * as d3 from 'd3'
import dayjs from 'dayjs'
import {
area, areaSpline, spline, bar, line,
@@ -35,6 +33,14 @@ import _toNumber from 'lodash/toNumber'
import _toString from 'lodash/toString'
import _includes from 'lodash/includes'
+const loadD3 = async () => {
+ const d3 = await import('d3')
+
+ return d3
+}
+
+const d3 = loadD3()
+
const getAvg = (arr: any) => {
const total = _reduce(arr, (acc, c) => acc + c, 0)
return total / _size(arr)