[DASHBOARDS] Move all the graph computing logic to the backend (#17189)
- Create resolvers for each type of charts which needs data transformation after the group by operation: Bar Chart, Line Chart and Pie Chart - Move all the utils to the backend and refactored some into services This allows all the computation to be done in the backend, improving performances in the frontend.
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
export const BAR_CHART_MAXIMUM_NUMBER_OF_BARS = 100;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const BAR_CHART_MAXIMUM_NUMBER_OF_GROUPS_PER_BAR = 50;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
|
||||
|
||||
export const DATE_GRANULARITIES_WITHOUT_GAP_FILLING = new Set([
|
||||
ObjectRecordGroupByDateGranularity.DAY_OF_THE_WEEK,
|
||||
ObjectRecordGroupByDateGranularity.MONTH_OF_THE_YEAR,
|
||||
ObjectRecordGroupByDateGranularity.QUARTER_OF_THE_YEAR,
|
||||
ObjectRecordGroupByDateGranularity.NONE,
|
||||
]);
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const EXTRA_ITEM_TO_DETECT_TOO_MANY_GROUPS = 1;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
|
||||
|
||||
export const GRAPH_DEFAULT_DATE_GRANULARITY =
|
||||
ObjectRecordGroupByDateGranularity.DAY;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { GraphOrderBy } from 'src/engine/metadata-modules/page-layout-widget/enums/graph-order-by.enum';
|
||||
|
||||
export const GRAPH_DEFAULT_ORDER_BY = GraphOrderBy.FIELD_ASC;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const LINE_CHART_MAXIMUM_NUMBER_OF_DATA_POINTS = 100;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const LINE_CHART_MAXIMUM_NUMBER_OF_NON_STACKED_SERIES = 50;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const LINE_CHART_MAXIMUM_NUMBER_OF_STACKED_SERIES = 50;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const PIE_CHART_MAXIMUM_NUMBER_OF_SLICES = 100;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { type ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
|
||||
|
||||
export type SupportedDateGranularityForGapFilling =
|
||||
| ObjectRecordGroupByDateGranularity.DAY
|
||||
| ObjectRecordGroupByDateGranularity.MONTH
|
||||
| ObjectRecordGroupByDateGranularity.QUARTER
|
||||
| ObjectRecordGroupByDateGranularity.YEAR
|
||||
| ObjectRecordGroupByDateGranularity.WEEK;
|
||||
Reference in New Issue
Block a user