@quillsql/react 2.13.48 → 2.13.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Chart.d.ts +2 -2
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +28 -41
- package/dist/cjs/ChartBuilder.d.ts +2 -2
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +157 -134
- package/dist/cjs/ChartEditor.d.ts +2 -2
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +3 -1
- package/dist/cjs/Context.d.ts +10 -3
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +324 -249
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +10 -23
- package/dist/cjs/DateRangePicker/QuillDateRangePicker.js +0 -3
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts +24 -10
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.js +472 -96
- package/dist/cjs/QuillProvider.d.ts +3 -1
- package/dist/cjs/QuillProvider.d.ts.map +1 -1
- package/dist/cjs/QuillProvider.js +2 -2
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +19 -10
- package/dist/cjs/SQLEditor.d.ts +1 -1
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +50 -16
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +20 -7
- package/dist/cjs/assets/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +2 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.d.ts +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.d.ts.map +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.js +7 -6
- package/dist/cjs/components/Chart/GaugeChart.d.ts +1 -1
- package/dist/cjs/components/Chart/GaugeChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/GaugeChart.js +62 -35
- package/dist/cjs/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/InternalChart.js +30 -33
- package/dist/cjs/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/LineChart.js +3 -1
- package/dist/cjs/components/Chart/MapChart.d.ts +3 -3
- package/dist/cjs/components/Chart/MapChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/MapChart.js +62 -34
- package/dist/cjs/components/Chart/PieChart.d.ts +3 -1
- package/dist/cjs/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/PieChart.js +80 -39
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +4 -20
- package/dist/cjs/components/Dashboard/DashboardTemplate.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardTemplate.js +2 -1
- package/dist/cjs/components/Dashboard/DataLoader.d.ts +4 -4
- package/dist/cjs/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DataLoader.js +31 -14
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.js +2 -2
- package/dist/cjs/components/Dashboard/util.d.ts +1 -1
- package/dist/cjs/components/Dashboard/util.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/util.js +7 -6
- package/dist/cjs/components/QuillMultiSelectSectionList.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectSectionList.js +32 -22
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +186 -159
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +83 -75
- package/dist/cjs/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelectWithCombo.js +18 -11
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts +2 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.js +3 -4
- package/dist/cjs/components/ReportBuilder/ui.d.ts +2 -2
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +4 -7
- package/dist/cjs/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useAskQuill.js +5 -1
- package/dist/cjs/hooks/useDashboard.d.ts.map +1 -1
- package/dist/cjs/hooks/useDashboard.js +96 -58
- package/dist/cjs/hooks/useExport.d.ts.map +1 -1
- package/dist/cjs/hooks/useExport.js +23 -13
- package/dist/cjs/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.js +8 -10
- package/dist/cjs/hooks/useReport.d.ts.map +1 -1
- package/dist/cjs/hooks/useVirtualTables.d.ts.map +1 -1
- package/dist/cjs/hooks/useVirtualTables.js +16 -22
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +19 -7
- package/dist/cjs/models/Client.d.ts +0 -1
- package/dist/cjs/models/Client.d.ts.map +1 -1
- package/dist/cjs/models/Data.d.ts +20 -0
- package/dist/cjs/models/Data.d.ts.map +1 -0
- package/dist/cjs/models/Data.js +2 -0
- package/dist/cjs/models/Filter.d.ts +42 -4
- package/dist/cjs/models/Filter.d.ts.map +1 -1
- package/dist/cjs/models/Pivot.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.d.ts +3 -2
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.js +28 -37
- package/dist/cjs/utils/client.d.ts +3 -2
- package/dist/cjs/utils/client.d.ts.map +1 -1
- package/dist/cjs/utils/client.js +38 -39
- package/dist/cjs/utils/columnProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/columnProcessing.js +14 -3
- package/dist/cjs/utils/constants.d.ts +1 -0
- package/dist/cjs/utils/constants.d.ts.map +1 -1
- package/dist/cjs/utils/constants.js +2 -1
- package/dist/cjs/utils/dashboard.d.ts +3 -2
- package/dist/cjs/utils/dashboard.d.ts.map +1 -1
- package/dist/cjs/utils/dashboard.js +30 -12
- package/dist/cjs/utils/dataFetcher.d.ts +8 -5
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +189 -65
- package/dist/cjs/utils/filterProcessing.d.ts +2 -1
- package/dist/cjs/utils/filterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/filterProcessing.js +24 -38
- package/dist/cjs/utils/getDomain.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.d.ts +2 -1
- package/dist/cjs/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.js +15 -11
- package/dist/cjs/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/pivotProcessing.js +3 -5
- package/dist/cjs/utils/queryConstructor.js +1 -1
- package/dist/cjs/utils/report.d.ts +10 -7
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/report.js +52 -60
- package/dist/cjs/utils/schema.d.ts +4 -3
- package/dist/cjs/utils/schema.d.ts.map +1 -1
- package/dist/cjs/utils/schema.js +30 -44
- package/dist/cjs/utils/tableProcessing.d.ts +16 -10
- package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/tableProcessing.js +91 -90
- package/dist/cjs/utils/textProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/textProcessing.js +2 -1
- package/dist/cjs/utils/ui.d.ts.map +1 -1
- package/dist/esm/Chart.d.ts +2 -2
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +30 -43
- package/dist/esm/ChartBuilder.d.ts +2 -2
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +158 -135
- package/dist/esm/ChartEditor.d.ts +2 -2
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +4 -2
- package/dist/esm/Context.d.ts +10 -3
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +326 -251
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +12 -25
- package/dist/esm/DateRangePicker/QuillDateRangePicker.js +0 -3
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts +24 -10
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.js +471 -95
- package/dist/esm/QuillProvider.d.ts +3 -1
- package/dist/esm/QuillProvider.d.ts.map +1 -1
- package/dist/esm/QuillProvider.js +2 -2
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +21 -12
- package/dist/esm/SQLEditor.d.ts +1 -1
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +53 -19
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +21 -8
- package/dist/esm/assets/ExclamationFilledIcon.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +2 -1
- package/dist/esm/components/Chart/CustomReferenceLine.d.ts +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.d.ts.map +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.js +8 -7
- package/dist/esm/components/Chart/GaugeChart.d.ts +1 -1
- package/dist/esm/components/Chart/GaugeChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/GaugeChart.js +64 -37
- package/dist/esm/components/Chart/InternalChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/InternalChart.js +32 -35
- package/dist/esm/components/Chart/LineChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/LineChart.js +3 -1
- package/dist/esm/components/Chart/MapChart.d.ts +3 -3
- package/dist/esm/components/Chart/MapChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/MapChart.js +67 -39
- package/dist/esm/components/Chart/PieChart.d.ts +3 -1
- package/dist/esm/components/Chart/PieChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/PieChart.js +80 -39
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +5 -21
- package/dist/esm/components/Dashboard/DashboardSection.js +2 -2
- package/dist/esm/components/Dashboard/DashboardTemplate.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardTemplate.js +3 -2
- package/dist/esm/components/Dashboard/DataLoader.d.ts +4 -4
- package/dist/esm/components/Dashboard/DataLoader.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DataLoader.js +32 -15
- package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.js +2 -2
- package/dist/esm/components/Dashboard/util.d.ts +1 -1
- package/dist/esm/components/Dashboard/util.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/util.js +8 -7
- package/dist/esm/components/QuillMultiSelectSectionList.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectSectionList.js +32 -22
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +187 -160
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +85 -77
- package/dist/esm/components/QuillSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillSelectWithCombo.js +18 -11
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts +2 -1
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/FilterStack.js +3 -4
- package/dist/esm/components/ReportBuilder/ui.d.ts +2 -2
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +4 -7
- package/dist/esm/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useAskQuill.js +6 -2
- package/dist/esm/hooks/useDashboard.d.ts.map +1 -1
- package/dist/esm/hooks/useDashboard.js +98 -60
- package/dist/esm/hooks/useExport.d.ts.map +1 -1
- package/dist/esm/hooks/useExport.js +25 -15
- package/dist/esm/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.js +9 -11
- package/dist/esm/hooks/useReport.d.ts.map +1 -1
- package/dist/esm/hooks/useReport.js +1 -1
- package/dist/esm/hooks/useVirtualTables.d.ts.map +1 -1
- package/dist/esm/hooks/useVirtualTables.js +17 -23
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +2 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +20 -8
- package/dist/esm/models/Client.d.ts +0 -1
- package/dist/esm/models/Client.d.ts.map +1 -1
- package/dist/esm/models/Data.d.ts +20 -0
- package/dist/esm/models/Data.d.ts.map +1 -0
- package/dist/esm/models/Data.js +1 -0
- package/dist/esm/models/Filter.d.ts +42 -4
- package/dist/esm/models/Filter.d.ts.map +1 -1
- package/dist/esm/models/Pivot.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.d.ts +3 -2
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.js +28 -37
- package/dist/esm/utils/client.d.ts +3 -2
- package/dist/esm/utils/client.d.ts.map +1 -1
- package/dist/esm/utils/client.js +38 -39
- package/dist/esm/utils/columnProcessing.d.ts.map +1 -1
- package/dist/esm/utils/columnProcessing.js +14 -3
- package/dist/esm/utils/constants.d.ts +1 -0
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +1 -0
- package/dist/esm/utils/dashboard.d.ts +3 -2
- package/dist/esm/utils/dashboard.d.ts.map +1 -1
- package/dist/esm/utils/dashboard.js +31 -13
- package/dist/esm/utils/dataFetcher.d.ts +8 -5
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +187 -65
- package/dist/esm/utils/filterProcessing.d.ts +2 -1
- package/dist/esm/utils/filterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/filterProcessing.js +25 -39
- package/dist/esm/utils/getDomain.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.d.ts +2 -1
- package/dist/esm/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.js +16 -12
- package/dist/esm/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/esm/utils/pivotProcessing.js +5 -7
- package/dist/esm/utils/queryConstructor.js +1 -1
- package/dist/esm/utils/report.d.ts +10 -7
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/report.js +53 -61
- package/dist/esm/utils/schema.d.ts +4 -3
- package/dist/esm/utils/schema.d.ts.map +1 -1
- package/dist/esm/utils/schema.js +30 -44
- package/dist/esm/utils/tableProcessing.d.ts +16 -10
- package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
- package/dist/esm/utils/tableProcessing.js +93 -92
- package/dist/esm/utils/textProcessing.d.ts.map +1 -1
- package/dist/esm/utils/textProcessing.js +2 -1
- package/dist/esm/utils/ui.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'd3-transition';
|
|
2
|
-
import { AxisFormat } from
|
|
2
|
+
import { AxisFormat } from '../../Dashboard';
|
|
3
3
|
export default function GaugeChart({ data, xAxisField, xAxisFormat, containerStyle, colors, isAnimationActive, }: {
|
|
4
4
|
data: any[];
|
|
5
5
|
xAxisField: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GaugeChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/GaugeChart.tsx"],"names":[],"mappings":"AAOA,OAAO,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,IAAI,EACJ,UAAU,EACV,WAAW,EACX,cAAc,EACd,MAAM,EACN,iBAAwB,GACzB,EAAE;IACD,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,
|
|
1
|
+
{"version":3,"file":"GaugeChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/GaugeChart.tsx"],"names":[],"mappings":"AAOA,OAAO,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,IAAI,EACJ,UAAU,EACV,WAAW,EACX,cAAc,EACd,MAAM,EACN,iBAAwB,GACzB,EAAE;IACD,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,2CAiBA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
// import { arc } from 'd3-shape';
|
|
4
4
|
// import { interpolate } from 'd3-interpolate';
|
|
5
5
|
// import { select } from 'd3-selection';
|
|
6
6
|
// These two are just for type checking
|
|
7
7
|
import 'd3-transition';
|
|
8
|
-
import { axisFormatter } from
|
|
8
|
+
import { axisFormatter } from '../../utils/axisFormatter';
|
|
9
9
|
export default function GaugeChart({ data, xAxisField, xAxisFormat, containerStyle, colors, isAnimationActive = true, }) {
|
|
10
10
|
const percentage = parseFloat(data[0]?.[xAxisField]) || 0;
|
|
11
11
|
const normalizedPercentage = ['whole_number', 'two_decimal_places'].includes(xAxisFormat)
|
|
@@ -13,7 +13,7 @@ export default function GaugeChart({ data, xAxisField, xAxisFormat, containerSty
|
|
|
13
13
|
: Math.max(Math.min(percentage, 1), 0);
|
|
14
14
|
return (_jsx(D3Gauge, { percentage: normalizedPercentage, xAxisFormat: xAxisFormat, containerStyle: { ...containerStyle }, colors: colors, isAnimationActive: isAnimationActive }));
|
|
15
15
|
}
|
|
16
|
-
function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationActive }) {
|
|
16
|
+
function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationActive, }) {
|
|
17
17
|
const containerRef = useRef(null);
|
|
18
18
|
const svgRef = useRef(null);
|
|
19
19
|
const gaugeGroupRef = useRef(null);
|
|
@@ -32,13 +32,13 @@ function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationA
|
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
import('d3-shape').then(({ arc }) => {
|
|
34
34
|
setArc(() => arc);
|
|
35
|
-
})
|
|
35
|
+
});
|
|
36
36
|
import('d3-interpolate').then(({ interpolate }) => {
|
|
37
37
|
setInterpolate(() => interpolate);
|
|
38
|
-
})
|
|
38
|
+
});
|
|
39
39
|
import('d3-selection').then(({ select }) => {
|
|
40
40
|
setSelect(() => select);
|
|
41
|
-
})
|
|
41
|
+
});
|
|
42
42
|
}, []);
|
|
43
43
|
// --- Initialization ---
|
|
44
44
|
useEffect(() => {
|
|
@@ -61,16 +61,19 @@ function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationA
|
|
|
61
61
|
gaugeGroupRef.current.append('path').attr('class', `arc-seg seg${i}`);
|
|
62
62
|
}
|
|
63
63
|
// Create needle outline and needle.
|
|
64
|
-
needleOutlineRef.current = gaugeGroupRef.current
|
|
64
|
+
needleOutlineRef.current = gaugeGroupRef.current
|
|
65
|
+
.append('line')
|
|
65
66
|
.attr('stroke', 'white')
|
|
66
67
|
.attr('stroke-width', 8)
|
|
67
68
|
.attr('stroke-linecap', 'round');
|
|
68
|
-
needleRef.current = gaugeGroupRef.current
|
|
69
|
+
needleRef.current = gaugeGroupRef.current
|
|
70
|
+
.append('line')
|
|
69
71
|
.attr('stroke', 'black')
|
|
70
72
|
.attr('stroke-width', 4)
|
|
71
73
|
.attr('stroke-linecap', 'round');
|
|
72
74
|
// Create text label.
|
|
73
|
-
textRef.current = gaugeGroupRef.current
|
|
75
|
+
textRef.current = gaugeGroupRef.current
|
|
76
|
+
.append('text')
|
|
74
77
|
.attr('class', 'gauge-label')
|
|
75
78
|
.attr('text-anchor', 'middle')
|
|
76
79
|
.attr('fill', '#000')
|
|
@@ -107,21 +110,31 @@ function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationA
|
|
|
107
110
|
// Vertical offset to visually center the 270° arc.
|
|
108
111
|
const verticalOffset = gaugeHeight * 0.05;
|
|
109
112
|
// Update viewBox so our internal coordinates scale.
|
|
110
|
-
svgRef.current
|
|
111
|
-
.attr('viewBox', `0 0 ${gaugeWidth} ${gaugeHeight}`);
|
|
113
|
+
svgRef.current.attr('viewBox', `0 0 ${gaugeWidth} ${gaugeHeight}`);
|
|
112
114
|
// Center the gauge group.
|
|
113
115
|
gaugeGroupRef.current.attr('transform', `translate(${gaugeWidth / 2}, ${gaugeHeight / 2 + verticalOffset})`);
|
|
114
116
|
// Draw the arc segments.
|
|
115
117
|
const segments = [
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
{
|
|
119
|
+
start: startAngle,
|
|
120
|
+
end: startAngle + totalAngle / 3,
|
|
121
|
+
color: colors[1] || 'red',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
start: startAngle + totalAngle / 3,
|
|
125
|
+
end: startAngle + (2 * totalAngle) / 3,
|
|
126
|
+
color: colors[3] || 'yellow',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
start: startAngle + (2 * totalAngle) / 3,
|
|
130
|
+
end: startAngle + totalAngle,
|
|
131
|
+
color: colors[2] || 'green',
|
|
132
|
+
},
|
|
119
133
|
];
|
|
120
|
-
const arcGenerator = arc()
|
|
121
|
-
.innerRadius(innerRadius)
|
|
122
|
-
.outerRadius(radius);
|
|
134
|
+
const arcGenerator = arc().innerRadius(innerRadius).outerRadius(radius);
|
|
123
135
|
segments.forEach((seg, i) => {
|
|
124
|
-
gaugeGroupRef.current
|
|
136
|
+
gaugeGroupRef.current
|
|
137
|
+
?.select(`.arc-seg.seg${i}`)
|
|
125
138
|
.attr('d', arcGenerator({
|
|
126
139
|
innerRadius,
|
|
127
140
|
outerRadius: radius,
|
|
@@ -144,47 +157,53 @@ function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationA
|
|
|
144
157
|
const newAngle = startAngle + totalAngle * percentage - Math.PI / 2;
|
|
145
158
|
const endpoints = calcEndpoints(newAngle);
|
|
146
159
|
// Update text font-size relative to radius.
|
|
147
|
-
textRef.current
|
|
160
|
+
textRef.current
|
|
161
|
+
.attr('font-size', radius / 3)
|
|
148
162
|
// Position text below the gauge center.
|
|
149
163
|
.attr('y', radius * 0.1);
|
|
150
164
|
if (isAnimationActive) {
|
|
151
165
|
const prevAngle = startAngle + totalAngle * previousPercentageRef.current - Math.PI / 2;
|
|
152
166
|
const angleInterpolator = interpolate(prevAngle, newAngle);
|
|
153
167
|
const textInterpolator = interpolate(previousPercentageRef.current, percentage);
|
|
154
|
-
needleRef.current
|
|
168
|
+
needleRef.current
|
|
169
|
+
.interrupt()
|
|
155
170
|
.transition()
|
|
156
171
|
.duration(1000)
|
|
157
|
-
.tween(
|
|
172
|
+
.tween('needle', function () {
|
|
158
173
|
return function (t) {
|
|
159
174
|
const currentAngle = angleInterpolator(t);
|
|
160
175
|
const { x1, y1, x2, y2 } = calcEndpoints(currentAngle);
|
|
161
|
-
needleRef
|
|
162
|
-
.attr(
|
|
163
|
-
.attr(
|
|
164
|
-
.attr(
|
|
165
|
-
.attr(
|
|
166
|
-
needleOutlineRef
|
|
167
|
-
.attr(
|
|
168
|
-
.attr(
|
|
169
|
-
.attr(
|
|
170
|
-
.attr(
|
|
176
|
+
needleRef
|
|
177
|
+
.current.attr('x1', x1)
|
|
178
|
+
.attr('y1', y1)
|
|
179
|
+
.attr('x2', x2)
|
|
180
|
+
.attr('y2', y2);
|
|
181
|
+
needleOutlineRef
|
|
182
|
+
.current.attr('x1', x1)
|
|
183
|
+
.attr('y1', y1)
|
|
184
|
+
.attr('x2', x2)
|
|
185
|
+
.attr('y2', y2);
|
|
171
186
|
const currentPercentage = textInterpolator(t);
|
|
172
187
|
const percentText = axisFormatter({
|
|
173
|
-
value: xAxisFormat === 'percent'
|
|
188
|
+
value: xAxisFormat === 'percent'
|
|
189
|
+
? currentPercentage
|
|
190
|
+
: currentPercentage * 100,
|
|
174
191
|
field: 'amount',
|
|
175
|
-
fields: [{ field: 'amount', format: xAxisFormat }]
|
|
192
|
+
fields: [{ field: 'amount', format: xAxisFormat }],
|
|
176
193
|
}) + (xAxisFormat === 'percent' ? '' : '%');
|
|
177
194
|
textRef.current?.text(percentText);
|
|
178
195
|
};
|
|
179
196
|
});
|
|
180
197
|
}
|
|
181
198
|
else {
|
|
182
|
-
needleRef.current
|
|
199
|
+
needleRef.current
|
|
200
|
+
.interrupt()
|
|
183
201
|
.attr('x1', endpoints.x1)
|
|
184
202
|
.attr('y1', endpoints.y1)
|
|
185
203
|
.attr('x2', endpoints.x2)
|
|
186
204
|
.attr('y2', endpoints.y2);
|
|
187
|
-
needleOutlineRef.current
|
|
205
|
+
needleOutlineRef.current
|
|
206
|
+
.interrupt()
|
|
188
207
|
.attr('x1', endpoints.x1)
|
|
189
208
|
.attr('y1', endpoints.y1)
|
|
190
209
|
.attr('x2', endpoints.x2)
|
|
@@ -192,13 +211,21 @@ function D3Gauge({ percentage, containerStyle, xAxisFormat, colors, isAnimationA
|
|
|
192
211
|
const percentText = axisFormatter({
|
|
193
212
|
value: xAxisFormat === 'percent' ? percentage : percentage * 100,
|
|
194
213
|
field: 'amount',
|
|
195
|
-
fields: [{ field: 'amount', format: xAxisFormat }]
|
|
214
|
+
fields: [{ field: 'amount', format: xAxisFormat }],
|
|
196
215
|
}) + (xAxisFormat === 'percent' ? '' : '%');
|
|
197
216
|
textRef.current.text(percentText);
|
|
198
217
|
}
|
|
199
218
|
previousPercentageRef.current = percentage;
|
|
200
219
|
firstMountRef.current = false;
|
|
201
|
-
}, [
|
|
220
|
+
}, [
|
|
221
|
+
percentage,
|
|
222
|
+
colors,
|
|
223
|
+
isAnimationActive,
|
|
224
|
+
xAxisFormat,
|
|
225
|
+
select,
|
|
226
|
+
arc,
|
|
227
|
+
interpolate,
|
|
228
|
+
]);
|
|
202
229
|
// Use ResizeObserver to trigger updates on container size changes.
|
|
203
230
|
useEffect(() => {
|
|
204
231
|
if (!containerRef.current)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/InternalChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InternalChart.d.ts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AO,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,2CA+dA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useContext, useMemo, useRef, useLayoutEffect } from 'react';
|
|
2
|
+
import { useState, useEffect, useContext, useMemo, useRef, useLayoutEffect, } from 'react';
|
|
3
3
|
import { differenceInHours } from 'date-fns';
|
|
4
4
|
import { DashboardConfigContext, ReportFiltersContext, ThemeContext, } from '../../Context';
|
|
5
5
|
import { QuillLoadingSkeleton } from '../../components/Chart/ChartSkeleton';
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
DashboardFilterType as DashboardFilterVariant, FilterType, } from '../../models/Filter';
|
|
10
10
|
import { applyCustomFilterToDashDateFilter } from '../../utils/filterProcessing';
|
|
11
11
|
import { DashboardFilter } from '../../components/Dashboard/DashboardFilter';
|
|
12
|
-
import { QuillSelectComponent } from '../../components/QuillSelect';
|
|
13
12
|
import { QuillDateRangePicker } from '../../DateRangePicker/QuillDateRangePicker';
|
|
14
13
|
import QuillMetricComponent from '../../components/Dashboard/MetricComponent';
|
|
15
|
-
import { COMPARISON_RANGE, defaultOptionsV2, getRangeFromPresetOptions,
|
|
14
|
+
import { COMPARISON_RANGE, convertPresetOptionsToSelectableList, defaultOptionsV2, getRangeFromPresetOptions, } from '../../DateRangePicker/dateRangePickerUtils';
|
|
16
15
|
import { ChartDisplay } from '../../Chart';
|
|
17
16
|
import { TEMP_REPORT_ID } from '../../models/Report';
|
|
18
17
|
import { QuillMultiSelectComponentWithCombo } from '../QuillMultiSelectWithCombo';
|
|
18
|
+
import { QuillSelectComponentWithCombo } from '../QuillSelectWithCombo';
|
|
19
19
|
function areDatesNearby(date1, date2) {
|
|
20
20
|
return Math.abs(differenceInHours(date1, date2)) < 24;
|
|
21
21
|
}
|
|
@@ -160,7 +160,7 @@ const TogglePrimitive = ({ value, onClick, style, disabled, }) => {
|
|
|
160
160
|
color: '#607D8B',
|
|
161
161
|
} }))] }));
|
|
162
162
|
};
|
|
163
|
-
export default function InternalChart({ report, colors, className, containerStyle, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, hideHorizontalCartesianGrid = false, hideVerticalCartesianGrid = true, hideSubsequentXAxisTicks = false, cartesianGridLineStyle = 'solid', cartesianGridLineColor, comparisonLineStyle, hideDateRangeFilter = false, filtersEnabled, setFiltersEnabled, mapColorsToFields, LoadingComponent = QuillLoadingSkeleton, SelectComponent =
|
|
163
|
+
export default function InternalChart({ report, colors, className, containerStyle, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, hideHorizontalCartesianGrid = false, hideVerticalCartesianGrid = true, hideSubsequentXAxisTicks = false, cartesianGridLineStyle = 'solid', cartesianGridLineColor, comparisonLineStyle, hideDateRangeFilter = false, filtersEnabled, setFiltersEnabled, mapColorsToFields, LoadingComponent = QuillLoadingSkeleton, SelectComponent = QuillSelectComponentWithCombo, MultiSelectComponent = QuillMultiSelectComponentWithCombo, DateRangePickerComponent = QuillDateRangePicker, MetricComponent = QuillMetricComponent, filters, onDashboardFilterChange, onClickChartElement, loading, error, isAdmin, filterToggleDisabled, layoutChanged, }) {
|
|
164
164
|
const { reportFilters } = useContext(ReportFiltersContext);
|
|
165
165
|
const { dashboardConfig } = useContext(DashboardConfigContext);
|
|
166
166
|
const currentReportFilters = useMemo(() => {
|
|
@@ -184,28 +184,12 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
184
184
|
});
|
|
185
185
|
}, [reportFilters, report?.id]);
|
|
186
186
|
const reportDateFilter = useMemo(() => {
|
|
187
|
-
return Object.values(reportFilters[report?.id ?? TEMP_REPORT_ID] ?? {}).find((f) => f.filter.filterType === 'date_range')
|
|
187
|
+
return Object.values(reportFilters[report?.id ?? TEMP_REPORT_ID] ?? {}).find((f) => f.filter.filterType === 'date_range')
|
|
188
|
+
?.filter;
|
|
188
189
|
}, [reportFilters, report?.id]);
|
|
189
190
|
const presetOptions = useMemo(() => {
|
|
190
191
|
return reportDateFilter
|
|
191
|
-
? (reportDateFilter.
|
|
192
|
-
if (!elem.isStatic) {
|
|
193
|
-
return {
|
|
194
|
-
label: elem.label,
|
|
195
|
-
value: elem.value,
|
|
196
|
-
startDate: PRIMARY_RANGE[elem.value]?.startDate ??
|
|
197
|
-
PRIMARY_RANGE['LAST_30_DAYS'].startDate,
|
|
198
|
-
endDate: PRIMARY_RANGE[elem.value]?.endDate ??
|
|
199
|
-
PRIMARY_RANGE['LAST_30_DAYS'].endDate,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
return {
|
|
203
|
-
label: elem.label,
|
|
204
|
-
value: elem.value,
|
|
205
|
-
startDate: new Date(elem.startDate),
|
|
206
|
-
endDate: new Date(elem.endDate),
|
|
207
|
-
};
|
|
208
|
-
}) ?? defaultOptionsV2)
|
|
192
|
+
? convertPresetOptionsToSelectableList(reportDateFilter.presetOptions ?? [], reportDateFilter.defaultPresetRanges ?? [])
|
|
209
193
|
: defaultOptionsV2;
|
|
210
194
|
}, [reportDateFilter]);
|
|
211
195
|
// const userFilters = useMemo(() => {
|
|
@@ -221,10 +205,7 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
221
205
|
useEffect(() => {
|
|
222
206
|
if (reportDateFilter) {
|
|
223
207
|
// Filter for custom date filter that applies to the report's dateField
|
|
224
|
-
const customDateFilter = filters?.find((f) => f.filterType === FilterType.Date
|
|
225
|
-
// FIXME: this is the correct way to do it but the demo has a hardcoded filter field
|
|
226
|
-
// && f.field === report?.dateField?.field && f.table === report?.dateField?.table,
|
|
227
|
-
);
|
|
208
|
+
const customDateFilter = filters?.find((f) => f.filterType === FilterType.Date);
|
|
228
209
|
if (!customDateFilter) {
|
|
229
210
|
return;
|
|
230
211
|
}
|
|
@@ -343,8 +324,8 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
343
324
|
const handleResize = () => {
|
|
344
325
|
measureItems();
|
|
345
326
|
};
|
|
346
|
-
window.addEventListener(
|
|
347
|
-
return () => window.removeEventListener(
|
|
327
|
+
window.addEventListener('resize', handleResize);
|
|
328
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
348
329
|
}, [currentReportFilters, filtersEnabled, layoutChanged]);
|
|
349
330
|
if (error) {
|
|
350
331
|
return (_jsx("div", { style: containerStyle, className: className, children: _jsx(ChartError, { errorMessage: error }) }));
|
|
@@ -402,7 +383,9 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
402
383
|
// If filters are expanded, show all filters, otherwise show only the first row
|
|
403
384
|
maxHeight: filtersExpanded ? undefined : 108,
|
|
404
385
|
minWidth: 500,
|
|
405
|
-
paddingBottom: !filtersExpanded && filtersOverflowing && filtersEnabled
|
|
386
|
+
paddingBottom: !filtersExpanded && filtersOverflowing && filtersEnabled
|
|
387
|
+
? 116
|
|
388
|
+
: 0,
|
|
406
389
|
position: 'relative',
|
|
407
390
|
}, children: [filtersEnabled &&
|
|
408
391
|
currentReportFilters.map((filter, index) => (_jsx(DashboardFilter, { filter: {
|
|
@@ -413,7 +396,9 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
413
396
|
...filterValues[filter.filter.label],
|
|
414
397
|
}, isLoading: filter.loading, onChangeFilter: updateFilter, theme: theme, SelectComponent: SelectComponent, MultiSelectComponent: MultiSelectComponent, DateRangePickerComponent: DateRangePickerComponent, disabled: !filtersEnabled, containerStyle: {
|
|
415
398
|
// display: !filtersExpanded && visibleFilters[index] ? 'none' : 'inline',
|
|
416
|
-
visibility: !filtersExpanded && visibleFilters[index]
|
|
399
|
+
visibility: !filtersExpanded && visibleFilters[index]
|
|
400
|
+
? 'hidden'
|
|
401
|
+
: 'visible',
|
|
417
402
|
} }, index))), filtersOverflowing && filtersEnabled && (_jsx("div", { style: {
|
|
418
403
|
width: '100%',
|
|
419
404
|
position: filtersExpanded ? 'static' : 'absolute',
|
|
@@ -462,9 +447,21 @@ export default function InternalChart({ report, colors, className, containerStyl
|
|
|
462
447
|
display: 'flex',
|
|
463
448
|
}, children: _jsx(MetricComponent, { error: error, isLoading: loading, report: report, children: report?.rows?.[0]?.[report.xAxisField] }) })), report.chartType !== 'table' && report.chartType !== 'metric' && (_jsx(ChartDisplay, { config: report, containerStyle: {
|
|
464
449
|
minHeight: 300,
|
|
465
|
-
width: ['US map', 'World map'].includes(report.chartType)
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
450
|
+
width: ['US map', 'World map'].includes(report.chartType)
|
|
451
|
+
? '70%'
|
|
452
|
+
: ['gauge'].includes(report.chartType)
|
|
453
|
+
? undefined
|
|
454
|
+
: '100%',
|
|
455
|
+
height: ['US map', 'World map'].includes(report.chartType)
|
|
456
|
+
? 'fit-content'
|
|
457
|
+
: ['gauge'].includes(report.chartType)
|
|
458
|
+
? 500
|
|
459
|
+
: undefined,
|
|
460
|
+
marginLeft: ['gauge'].includes(report.chartType)
|
|
461
|
+
? 'undefined'
|
|
462
|
+
: 'auto',
|
|
463
|
+
marginRight: ['gauge'].includes(report.chartType)
|
|
464
|
+
? 'undefined'
|
|
465
|
+
: 'auto',
|
|
469
466
|
}, reportId: report.id, colors: colors, className: className, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesianGrid: hideCartesianGrid, hideHorizontalCartesianGrid: hideHorizontalCartesianGrid, hideVerticalCartesianGrid: hideVerticalCartesianGrid, hideSubsequentXAxisTicks: hideSubsequentXAxisTicks, cartesianGridLineStyle: cartesianGridLineStyle, cartesianGridLineColor: cartesianGridLineColor, hideDateRangeFilter: hideDateRangeFilter, comparisonLineStyle: comparisonLineStyle, isAnimationActive: isAnimationActive, loading: loading, scrollable: true, colorMap: colorMap, LoadingComponent: LoadingComponent, onClickChartElement: onClickChartElement, referenceLines: report.referenceLineYValues }))] }))] }));
|
|
470
467
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/LineChart.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA4B7C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,QAAa,EACb,WAAW,EACX,IAAI,EACJ,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,EACzB,2BAAmC,EACnC,yBAAgC,EAChC,wBAAgC,EAChC,sBAAgC,EAChC,mBAA6B,EAC7B,sBAAsB,EACtB,mBAA8B,EAC9B,UAAU,EACV,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B,EAAE,OAAO,CAAC;IACrC,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,sBAAsB,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3C,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,cAAc,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/LineChart.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA4B7C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,QAAa,EACb,WAAW,EACX,IAAI,EACJ,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,EACzB,2BAAmC,EACnC,yBAAgC,EAChC,wBAAgC,EAChC,sBAAgC,EAChC,mBAA6B,EAC7B,sBAAsB,EACtB,mBAA8B,EAC9B,UAAU,EACV,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,GAAG,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B,EAAE,OAAO,CAAC;IACrC,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,sBAAsB,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC3C,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CACvD,2CAySA"}
|
|
@@ -160,7 +160,9 @@ export default function LineChart({ colors, colorMap = {}, yAxisFields, data, co
|
|
|
160
160
|
const gradientStop = getCustomColor(index, elem.field, 'stop') ?? '#00000000';
|
|
161
161
|
const uniqueId = `gradient_${hashCode(gradientStart)}_${hashCode(gradientStop)}`;
|
|
162
162
|
return (_jsx("defs", { children: _jsxs("linearGradient", { id: uniqueId, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "5%", stopColor: gradientStart, stopOpacity: 0.4 }), _jsx("stop", { offset: "95%", stopColor: gradientStop, stopOpacity: 0 })] }) }, `defs_${uniqueId}_${index}`));
|
|
163
|
-
}), referenceLines &&
|
|
163
|
+
}), referenceLines &&
|
|
164
|
+
Array.isArray(referenceLines) &&
|
|
165
|
+
referenceLines.map(({ label, query }) => (_jsx(Customized, { component: (props) => (_jsx(CustomReferenceLine, { ...props, referenceLine: query, label: label })) }, label))), yAxisFields &&
|
|
164
166
|
yAxisFields.map((elem, index) => {
|
|
165
167
|
const gradientStart = hashCode(getCustomColor(index, elem.field, 'start') ??
|
|
166
168
|
getCustomColor(index, elem.field) ??
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QuillTheme } from
|
|
2
|
-
import { AxisFormat } from
|
|
3
|
-
import { ColorMapType } from
|
|
1
|
+
import { QuillTheme } from '../../QuillProvider';
|
|
2
|
+
import { AxisFormat } from '../../Dashboard';
|
|
3
|
+
import { ColorMapType } from '../../Chart';
|
|
4
4
|
export declare function USMap({ theme, data, xAxisField, xAxisFormat, yAxisFields, onClickChartElement, colors, colorMap, className, containerStyle, }: {
|
|
5
5
|
theme: QuillTheme | null;
|
|
6
6
|
data: any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/MapChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/MapChart.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA+T3C,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,cAAc,GACf,EAAE;IACD,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,CAAC;IACpE,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACtC,2CAsLA;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,cAAc,GACf,EAAE;IACD,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,CAAC;IACpE,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACtC,2CAuLA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ComposableMap, Geographies, Geography, useMapContext } from
|
|
3
|
-
import { useEffect, useMemo, useRef, useState } from
|
|
4
|
-
import ChartTooltipFrame from
|
|
5
|
-
import ChartTooltipRow from
|
|
6
|
-
import { valueFormatter } from
|
|
7
|
-
const statesUrl =
|
|
8
|
-
const countriesUrl =
|
|
2
|
+
import { ComposableMap, Geographies, Geography, useMapContext, } from 'react-simple-maps';
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import ChartTooltipFrame from './ChartTooltipFrame';
|
|
5
|
+
import ChartTooltipRow from './ChartTooltipRow';
|
|
6
|
+
import { valueFormatter } from '../../utils/valueFormatter';
|
|
7
|
+
const statesUrl = 'https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json';
|
|
8
|
+
const countriesUrl = 'https://cdn.jsdelivr.net/npm/world-atlas@2/countries-50m.json';
|
|
9
9
|
const fipsToNames = {
|
|
10
10
|
'01': { name: 'Alabama', abbreviation: 'AL' },
|
|
11
11
|
'02': { name: 'Alaska', abbreviation: 'AK' },
|
|
@@ -130,7 +130,10 @@ const isoToNames = {
|
|
|
130
130
|
'233': { name: 'Estonia', abbreviation: 'EE' },
|
|
131
131
|
'234': { name: 'Faroe Islands', abbreviation: 'FO' },
|
|
132
132
|
'238': { name: 'Falkland Islands', abbreviation: 'FK' },
|
|
133
|
-
'239': {
|
|
133
|
+
'239': {
|
|
134
|
+
name: 'South Georgia and the South Sandwich Islands',
|
|
135
|
+
abbreviation: 'GS',
|
|
136
|
+
},
|
|
134
137
|
'242': { name: 'Fiji', abbreviation: 'FJ' },
|
|
135
138
|
'246': { name: 'Finland', abbreviation: 'FI' },
|
|
136
139
|
'248': { name: 'Åland Islands', abbreviation: 'AX' },
|
|
@@ -247,7 +250,10 @@ const isoToNames = {
|
|
|
247
250
|
'643': { name: 'Russia', abbreviation: 'RU' },
|
|
248
251
|
'646': { name: 'Rwanda', abbreviation: 'RW' },
|
|
249
252
|
'652': { name: 'Saint Barthélemy', abbreviation: 'BL' },
|
|
250
|
-
'654': {
|
|
253
|
+
'654': {
|
|
254
|
+
name: 'Saint Helena, Ascension and Tristan da Cunha',
|
|
255
|
+
abbreviation: 'SH',
|
|
256
|
+
},
|
|
251
257
|
'659': { name: 'Saint Kitts and Nevis', abbreviation: 'KN' },
|
|
252
258
|
'660': { name: 'Anguilla', abbreviation: 'AI' },
|
|
253
259
|
'662': { name: 'Saint Lucia', abbreviation: 'LC' },
|
|
@@ -322,7 +328,7 @@ export function USMap({ theme, data, xAxisField, xAxisFormat, yAxisFields, onCli
|
|
|
322
328
|
// These must be dynamically loaded as they are not available as CommonJS modules.
|
|
323
329
|
const [scaleLog, setScaleLog] = useState(null);
|
|
324
330
|
useEffect(() => {
|
|
325
|
-
import(
|
|
331
|
+
import('d3-scale').then((scale) => {
|
|
326
332
|
setScaleLog(() => scale.scaleLog);
|
|
327
333
|
});
|
|
328
334
|
}, []);
|
|
@@ -355,24 +361,34 @@ export function USMap({ theme, data, xAxisField, xAxisFormat, yAxisFields, onCli
|
|
|
355
361
|
colors[0];
|
|
356
362
|
return scaleLog()
|
|
357
363
|
.domain([minValue, maxValue])
|
|
358
|
-
.range([gradientStart ??
|
|
359
|
-
}, [
|
|
364
|
+
.range([gradientStart ?? '#f7fbff', gradientStop ?? '#08306b']);
|
|
365
|
+
}, [
|
|
366
|
+
mappedData,
|
|
367
|
+
measureField,
|
|
368
|
+
colorMap,
|
|
369
|
+
yAxisFields,
|
|
370
|
+
xAxisField,
|
|
371
|
+
colors,
|
|
372
|
+
scaleLog,
|
|
373
|
+
]);
|
|
360
374
|
const hoveredValue = useMemo(() => {
|
|
361
|
-
return !hoveredState
|
|
362
|
-
|
|
363
|
-
mappedData[fipsToNames[hoveredState]?.abbreviation
|
|
364
|
-
|
|
375
|
+
return !hoveredState
|
|
376
|
+
? undefined
|
|
377
|
+
: (mappedData[fipsToNames[hoveredState]?.abbreviation ?? '']?.[measureField] ??
|
|
378
|
+
mappedData[fipsToNames[hoveredState]?.name ?? '']?.[measureField] ??
|
|
379
|
+
mappedData[fipsToNames[hoveredState]?.abbreviation?.toLowerCase() ?? '']?.[measureField] ??
|
|
380
|
+
mappedData[fipsToNames[hoveredState]?.name?.toLowerCase() ?? '']?.[measureField]);
|
|
365
381
|
}, [hoveredState, mappedData, measureField]);
|
|
366
382
|
return (_jsxs("div", { ref: containerRef, className: className, style: {
|
|
367
|
-
width:
|
|
368
|
-
height:
|
|
383
|
+
width: '100%',
|
|
384
|
+
height: 'auto',
|
|
369
385
|
marginTop: '-6.5%',
|
|
370
386
|
zIndex: 0,
|
|
371
387
|
...containerStyle,
|
|
372
|
-
position:
|
|
388
|
+
position: 'relative',
|
|
373
389
|
}, children: [_jsx(ComposableMap, { projection: "geoAlbersUsa", children: _jsx(MapLayout, { hoveredRegion: hoveredState, setHoveredRegion: setHoveredState, setHoveredCoords: setHoveredCoords, containerRef: containerRef, mappedData: mappedData, measureField: measureField, colorScale: colorScale, onClickChartElement: onClickChartElement, regionNames: fipsToNames, geographyUrl: statesUrl }) }), hoveredCoords && hoveredState && (_jsx("div", { style: {
|
|
374
|
-
position:
|
|
375
|
-
pointerEvents:
|
|
390
|
+
position: 'absolute',
|
|
391
|
+
pointerEvents: 'none',
|
|
376
392
|
left: hoveredCoords[0],
|
|
377
393
|
top: hoveredCoords[1],
|
|
378
394
|
}, children: _jsxs(ChartTooltipFrame, { theme: theme, children: [_jsx("div", { style: {
|
|
@@ -425,7 +441,7 @@ export function WorldMap({ theme, data, xAxisField, xAxisFormat, yAxisFields, on
|
|
|
425
441
|
// These must be dynamically loaded as they are not available as CommonJS modules.
|
|
426
442
|
const [scaleLog, setScaleLog] = useState(null);
|
|
427
443
|
useEffect(() => {
|
|
428
|
-
import(
|
|
444
|
+
import('d3-scale').then((scale) => {
|
|
429
445
|
setScaleLog(() => scale.scaleLog);
|
|
430
446
|
});
|
|
431
447
|
}, []);
|
|
@@ -458,25 +474,35 @@ export function WorldMap({ theme, data, xAxisField, xAxisFormat, yAxisFields, on
|
|
|
458
474
|
colors[0];
|
|
459
475
|
return scaleLog()
|
|
460
476
|
.domain([minValue, maxValue])
|
|
461
|
-
.range([gradientStart ??
|
|
462
|
-
}, [
|
|
477
|
+
.range([gradientStart ?? '#f7fbff', gradientStop ?? '#08306b']);
|
|
478
|
+
}, [
|
|
479
|
+
mappedData,
|
|
480
|
+
measureField,
|
|
481
|
+
colorMap,
|
|
482
|
+
yAxisFields,
|
|
483
|
+
xAxisField,
|
|
484
|
+
colors,
|
|
485
|
+
scaleLog,
|
|
486
|
+
]);
|
|
463
487
|
const hoveredValue = useMemo(() => {
|
|
464
|
-
return !hoveredCountry
|
|
465
|
-
|
|
466
|
-
mappedData[isoToNames[hoveredCountry]?.abbreviation
|
|
467
|
-
|
|
488
|
+
return !hoveredCountry
|
|
489
|
+
? undefined
|
|
490
|
+
: (mappedData[isoToNames[hoveredCountry]?.abbreviation ?? '']?.[measureField] ??
|
|
491
|
+
mappedData[isoToNames[hoveredCountry]?.name ?? '']?.[measureField] ??
|
|
492
|
+
mappedData[isoToNames[hoveredCountry]?.abbreviation?.toLowerCase() ?? '']?.[measureField] ??
|
|
493
|
+
mappedData[isoToNames[hoveredCountry]?.name?.toLowerCase() ?? '']?.[measureField]);
|
|
468
494
|
}, [hoveredCountry, mappedData, measureField]);
|
|
469
495
|
return (_jsxs("div", { ref: containerRef, className: className, style: {
|
|
470
|
-
width:
|
|
471
|
-
height:
|
|
496
|
+
width: '100%',
|
|
497
|
+
height: 'auto',
|
|
472
498
|
marginTop: '-5%',
|
|
473
499
|
marginBottom: '-6.5%',
|
|
474
500
|
zIndex: 0,
|
|
475
501
|
...containerStyle,
|
|
476
|
-
position:
|
|
502
|
+
position: 'relative',
|
|
477
503
|
}, children: [_jsx(ComposableMap, { projection: "geoEqualEarth", children: _jsx(MapLayout, { hoveredRegion: hoveredCountry, setHoveredRegion: setHoveredCountry, setHoveredCoords: setHoveredCoords, containerRef: containerRef, mappedData: mappedData, measureField: measureField, colorScale: colorScale, onClickChartElement: onClickChartElement, geographyUrl: countriesUrl, regionNames: isoToNames }) }), hoveredCoords && hoveredCountry && (_jsx("div", { style: {
|
|
478
|
-
position:
|
|
479
|
-
pointerEvents:
|
|
504
|
+
position: 'absolute',
|
|
505
|
+
pointerEvents: 'none',
|
|
480
506
|
left: hoveredCoords[0],
|
|
481
507
|
top: hoveredCoords[1],
|
|
482
508
|
}, children: _jsxs(ChartTooltipFrame, { theme: theme, children: [_jsx("div", { style: {
|
|
@@ -522,7 +548,7 @@ function MapLayout({ geographyUrl, hoveredRegion, setHoveredRegion, setHoveredCo
|
|
|
522
548
|
// These must be dynamically loaded as they are not available as CommonJS modules.
|
|
523
549
|
const [geoCentroid, setGeoCentroid] = useState(null);
|
|
524
550
|
useEffect(() => {
|
|
525
|
-
import(
|
|
551
|
+
import('d3-geo').then((geo) => {
|
|
526
552
|
setGeoCentroid(() => geo.geoCentroid);
|
|
527
553
|
});
|
|
528
554
|
}, []);
|
|
@@ -532,16 +558,18 @@ function MapLayout({ geographyUrl, hoveredRegion, setHoveredRegion, setHoveredCo
|
|
|
532
558
|
mappedData[regionNames[geo.id]?.name ?? ''] ??
|
|
533
559
|
mappedData[regionNames[geo.id]?.abbreviation?.toLowerCase() ?? ''] ??
|
|
534
560
|
mappedData[regionNames[geo.id]?.name?.toLowerCase() ?? ''];
|
|
535
|
-
const value = regionData
|
|
536
|
-
|
|
537
|
-
|
|
561
|
+
const value = regionData
|
|
562
|
+
? parseFloat(regionData[measureField])
|
|
563
|
+
: null;
|
|
564
|
+
const fill = value != null ? colorScale(value) : '#D6D6DA';
|
|
565
|
+
return (_jsx(Geography, { geography: geo, fill: fill, stroke: "#FFFFFF", strokeWidth: 0.5, onMouseEnter: () => {
|
|
538
566
|
if (!geoCentroid)
|
|
539
567
|
return;
|
|
540
568
|
const centroid = geoCentroid(geo);
|
|
541
569
|
const projected = projection(centroid);
|
|
542
570
|
if (projected && containerRef.current) {
|
|
543
571
|
const [x, y] = projected;
|
|
544
|
-
const svg = containerRef.current.querySelector(
|
|
572
|
+
const svg = containerRef.current.querySelector('svg');
|
|
545
573
|
if (svg) {
|
|
546
574
|
const svgRect = svg.getBoundingClientRect();
|
|
547
575
|
const viewBoxWidth = 800, viewBoxHeight = 600;
|
|
@@ -561,6 +589,6 @@ function MapLayout({ geographyUrl, hoveredRegion, setHoveredRegion, setHoveredCo
|
|
|
561
589
|
if (regionData) {
|
|
562
590
|
onClickChartElement?.(regionData);
|
|
563
591
|
}
|
|
564
|
-
} }, geo.id + index.toString());
|
|
592
|
+
} }, geo.id + index.toString()));
|
|
565
593
|
}) }));
|
|
566
594
|
}
|
|
@@ -29,11 +29,13 @@ export declare const ChartTooltipFrame: ({ children, theme, }: {
|
|
|
29
29
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
export interface ChartTooltipRowProps {
|
|
31
31
|
value: string;
|
|
32
|
+
rawValue?: string;
|
|
33
|
+
valueKey?: string;
|
|
32
34
|
name: string;
|
|
33
35
|
color: Color;
|
|
34
36
|
theme: any;
|
|
35
37
|
}
|
|
36
|
-
export declare const ChartTooltipRow: ({ value, name, color, theme, }: ChartTooltipRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const ChartTooltipRow: ({ value, rawValue, valueKey, name, color, theme, }: ChartTooltipRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
39
|
export interface DonutChartTooltipProps {
|
|
38
40
|
active: boolean | undefined;
|
|
39
41
|
payload: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/PieChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,QAAA,MAAM,iBAAiB,6DAMb,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE9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