Skip to content

Commit

Permalink
fix: default resolution and aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
tracy-french committed Oct 5, 2023
1 parent 06207f9 commit e5afdc0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const RenderAggregationsPropertiesSection = ({
}) => {
const [aggregationMaybe, updateAggregation] = useProperty(
// Default resolution is auto. We ensure the aggregation is defaulted to average instead of raw.
({ aggregationType, resolution }) => (resolution == null && aggregationType == null ? 'AVERAGE' : aggregationType),
({ aggregationType }) => aggregationType,
(properties, updatedAggregationType) => {
return {
...properties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const RenderLineAndScatterStyleSettingsSection = ({
);

const [aggregationMaybe, updateAggregation] = useProperty(
// Default resolution is auto. We ensure the aggregation is defaulted to average instead of raw.
({ aggregationType, resolution }) => (resolution == null && aggregationType == null ? 'AVERAGE' : aggregationType),
// Default resolution is auto. We ensure the aggregation is defaulted to average instead of no aggregation.
({ aggregationType }) => aggregationType,
(properties, updatedAggregationType) => ({
...properties,
queryConfig: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const barChartPlugin: DashboardPlugin = {
icon: BarIcon,
},
properties: () => ({
aggregationType: 'AVERAGE',
resolution: undefined,
queryConfig: {
source: 'iotsitewise',
query: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const lineScatterChartPlugin: DashboardPlugin = {
icon: LineIcon,
},
properties: () => ({
aggregationType: 'AVERAGE',
resolution: undefined,
queryConfig: {
source: 'iotsitewise',
query: undefined,
Expand Down
2 changes: 2 additions & 0 deletions packages/dashboard/src/customization/widgets/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export type BarChartProperties = QueryProperties & {
thresholdSettings?: ThresholdSettings;
axis?: AxisSettings;
significantDigits?: number;
resolution?: string;
aggregationType?: AggregateType;
};
export type BarChartPropertiesKeys = keyof BarChartProperties;

Expand Down

0 comments on commit e5afdc0

Please sign in to comment.