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

Inline Editor for Metrics Visualizations. #940

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions common/constants/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export const resolutionOptions = [
{ value: 'y', text: 'years' },
];

export const DEFAULT_METRIC_HEIGHT = 2;
export const DEFAULT_METRIC_HEIGHT = 3;
export const DEFAULT_METRIC_WIDTH = 12;

export const AGGREGATION_OPTIONS = [
{ label: 'avg' },
{ label: 'sum' },
{ label: 'count' },
{ label: 'min' },
{ label: 'max' },
{ value: 'avg', text: 'avg()' },
pjfitzgibbons marked this conversation as resolved.
Show resolved Hide resolved
{ value: 'sum', text: 'sum()' },
{ value: 'count', text: 'count()' },
{ value: 'min', text: 'min()' },
{ value: 'max', text: 'max()' },
];
2 changes: 1 addition & 1 deletion common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const DEFAULT_CHART_STYLES: DefaultChartStylesProps = {
FillOpacity: 100,
MarkerSize: 5,
ShowLegend: 'show',
LegendPosition: 'v',
LegendPosition: 'h',
LabelAngle: 0,
DefaultSortSectors: 'largest_to_smallest',
DefaultModeScatter: 'markers',
Expand Down
14 changes: 7 additions & 7 deletions common/types/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

import { VisualizationType } from './custom_panels';

export interface MetricData {
metricId: string;
metricType: 'savedCustomMetric' | 'prometheusMetric';
metricName: string;
}

export interface MetricType extends VisualizationType {
id: string;
savedVisualizationId: string;
x: number;
y: number;
w: number;
h: number;
metricType: 'savedCustomMetric' | 'prometheusMetric';
query: {
type: 'savedCustomMetric' | 'prometheusMetric';
aggregation: string;
attributesGroupBy: string[];
catalog: string;
availableAttributes?: string[];
};
}
2 changes: 1 addition & 1 deletion public/components/application_analytics/helpers/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const calculateAvailability = async (
const visData = await fetchVisualizationById(http, visualizationId, (value: string) =>
console.error(value)
);
const userConfigs = visData.user_configs ? JSON.parse(visData.user_configs) : {};
const userConfigs = visData.user_configs || {};
// If there are levels, we get the current value
if (userConfigs.availabilityConfig?.hasOwnProperty('level')) {
// For every saved visualization with availability levels we push it to visWithAvailability
Expand Down
Loading