Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Initial DataCubeComponents / dimension values query optimizations #1360

Merged
merged 19 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/charts/area/chart-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const ChartAreasVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/column/chart-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const ChartColumnsVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/combo/chart-combo-line-column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const ChartComboLineColumnVisualization = (
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/combo/chart-combo-line-dual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const ChartComboLineDualVisualization = (
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/combo/chart-combo-line-single.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const ChartComboLineSingleVisualization = (
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/line/chart-lines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const ChartLinesVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/map/chart-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const ChartMapVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/pie/chart-pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const ChartPieVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/scatterplot/chart-scatterplot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const ChartScatterplotVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/charts/table/chart-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const ChartTableVisualization = ({
iri: cube.iri,
componentIris,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/configurator/components/chart-options-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const ChartOptionsSelector = ({
cubeFilters: chartConfig.cubes.map((cube) => ({
iri: cube.iri,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/configurator/components/chart-type-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const ChartTypeSelector = (props: ChartTypeSelectorProps) => {
cubeFilters: chartConfig.cubes.map((cube) => ({
iri: cube.iri,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
22 changes: 13 additions & 9 deletions app/configurator/configurator-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import setWith from "lodash/setWith";
import sortBy from "lodash/sortBy";
import unset from "lodash/unset";
import { NextRouter, useRouter } from "next/router";
import { createContext, Dispatch, useContext, useEffect, useMemo } from "react";
import { Dispatch, createContext, useContext, useEffect, useMemo } from "react";
import { Reducer, useImmerReducer } from "use-immer";

import {
Expand Down Expand Up @@ -34,20 +34,20 @@ import {
ConfiguratorStatePublishing,
ConfiguratorStateSelectingDataSet,
DataSource,
decodeConfiguratorState,
enableLayouting,
Filters,
FilterValue,
Filters,
GenericField,
GenericFields,
getChartConfig,
getChartConfigFilters,
ImputationType,
InteractiveFiltersConfig,
Layout,
decodeConfiguratorState,
enableLayouting,
getChartConfig,
getChartConfigFilters,
isAreaConfig,
isColorFieldInConfig,
isTableConfig,
Layout,
makeMultiFilter,
} from "@/config-types";
import { mapValueIrisToColor } from "@/configurator/components/ui-helpers";
Expand All @@ -59,9 +59,9 @@ import {
DataCubeComponents,
Dimension,
DimensionValue,
ObservationValue,
isGeoDimension,
isMeasure,
ObservationValue,
} from "@/domain/data";
import { DEFAULT_DATA_SOURCE } from "@/domain/datasource";
import { client } from "@/graphql/client";
Expand Down Expand Up @@ -359,7 +359,11 @@ const getCachedComponents = (
sourceType: draft.dataSource.type,
sourceUrl: draft.dataSource.url,
locale,
cubeFilter: { iri: cubeFilter.iri, joinBy: cubeFilter.joinBy },
cubeFilter: {
bprusinowski marked this conversation as resolved.
Show resolved Hide resolved
iri: cubeFilter.iri,
joinBy: cubeFilter.joinBy,
loadValues: true,
},
})!;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const InteractiveFiltersConfigurator = ({
cubeFilters: chartConfig.cubes.map((cube) => ({
iri: cube.iri,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down
1 change: 1 addition & 0 deletions app/configurator/table/table-chart-configurator.hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const useTableChartController = (
cubeFilters: chartConfig.cubes.map((cube) => ({
iri: cube.iri,
joinBy: cube.joinBy,
loadValues: true,
})),
},
});
Expand Down