225 lines
6.4 KiB
TypeScript
Raw Normal View History

import { InfoCircleOutlined } from '@ant-design/icons';
import Spinner from 'components/Spinner';
import { DEFAULT_ENTITY_VERSION } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import GridPanelSwitch from 'container/GridPanelSwitch';
2023-12-01 18:16:25 +05:30
import { getFormatNameByOptionId } from 'container/NewWidget/RightContainer/alertFomatCategories';
import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';
import { Time } from 'container/TopNav/DateTimeSelection/config';
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
import { Time as TimeV2 } from 'container/TopNav/DateTimeSelectionV2/config';
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
import { useIsDarkMode } from 'hooks/useDarkMode';
import { useResizeObserver } from 'hooks/useDimensions';
import { getUPlotChartOptions } from 'lib/uPlotLib/getUplotChartOptions';
import { getUPlotChartData } from 'lib/uPlotLib/utils/getUplotChartData';
import { useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
import { AlertDef } from 'types/api/alerts/def';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
import { EQueryType } from 'types/common/dashboard';
import { GlobalReducer } from 'types/reducer/globalTime';
import { getGraphType } from 'utils/getGraphType';
import { getSortedSeriesData } from 'utils/getSortedSeriesData';
import { getTimeRange } from 'utils/getTimeRange';
import { ChartContainer, FailedMessageContainer } from './styles';
2023-12-01 18:16:25 +05:30
import { getThresholdLabel } from './utils';
export interface ChartPreviewProps {
name: string;
query: Query | null;
graphType?: PANEL_TYPES;
selectedTime?: timePreferenceType;
Logs explorer design update (#4352) * feat: logs explorer - new design * feat: update styles * feat: added new toolbar for logs explorer (#4336) * feat: logs list view changes (#4348) * feat: logs list view changes * fix: list view and toolbar styles * feat: side btns * feat: added auto refresh handler * feat: handle popover close for btn click date time * feat: extract the common log actions btn component * feat: update the button for log line actions * fix: event propagation from context button * feat: use styles from ui-library * Query builder design update (#4359) * feat: QB design update * fix: add functionality and light mode styles * fix: ts issues * fix: update all css color variables to correct names * fix: lint errors * feat: new table view for logs explorer list section (#4353) * feat: table view changes for logs list * feat: code refactor to support log line actions * feat: code refactor to support log line actions * fix: the positioning of the btns * feat: fix the table onclick * fix: header issue * fix: on hover * fix: type issue * fix: eslint error * fix: type errors (#4360) * feat: handle light theme for logs explorer design changes (#4363) * feat: handle light theme for list tables and dateTime selection * feat: handle light theme for popover * fix: address review comments * feat: date time custom time modal to render inside the new popover (#4366) * feat: single calender for range picker * fix: edgecases * feat: integrate date time selector across app * fix: remove dangling border after element removal * feat: handle qb design changes across the application * feat: handle light theme * feat: handle light theme * fix: virtuoso scroll refresh issue * feat: handle new typing changes for date time picker v2 (#4386) Co-authored-by: Yunus M <myounis.ar@live.com> * chore: styles improvement across new design (#4389) * fix: improve date time styles * feat: table view changes according to new design * fix: button visibility in clickhouse and promQL headers (#4390) * feat: change the tabs to new design buttons for query builder * Settings theme change (#4368) * feat: settings theme change * [Refactor]: New design for Log details page (#4362) New design for Log details page Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Yunus M <myounis.ar@live.com> * feat: save view for new design (#4392) * feat: save view for new design * refactor: done with save view * feat: update styles for logs detail view (#4407) * feat: update styles for logs detail view * feat: update styles for logs detail view * feat: add raw view attributes in the logs list view (#4422) * feat: add raw view attributes in the logs list view * feat: add raw view attributes in the logs list view * fix: raw attributes * fix: logs UI improvements (#4426) * fix: remove fixed times from the date time picker v2 * fix: added old logs explorer CTA in new designs * feat: handle active logs indicator update * fix: address review comments * fix: old logs explorer page * fix: remove info text and add relative time buttons * fix: update logs explorer tab designs * fix: update logs explorer tab designs * fix: update logs explorer tab designs * refactor: New design for Save views. (#4435) * feat: [GH-4436]: date range enhancements (#4448) * feat: [GH-4436]: when selecting custom time range it should be from start of day to end of date * fix: custom time width and refresh text visibility issues (#4428) --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: update ui (#4449) * feat: added loading and error states for logs design (#4452) * feat: added loading and error states for logs design * feat: added error states for table view and time series view * feat: handle error and loading states * feat: loading states * [Refactor]: Tab Switch deplay issue and UI improvement for Clickhouse (#4409) * fix: switching between logs display tabs (#4457) * [Feat]: View in Traces (#4450) * refactor: datetime selector beside run query removed add to dashboard * refactor: added tab for traces view details page * refactor: done with the save view in traces * fix: the gittery effect when navigatigating from views * refactor: view tab view title light mode support * refactor: removed console * fix: gittery effect when switch view from views tabs * refactor: separate traces routes * refactor: remove query params * chore: fix tsc issues * fix: jest config issues * fix: update TODO and remove extra braces * feat: handle loading states and incorporate ui feedback (#4479) * UI feedback updates (#4482) * feat: handle loading and fix ui issues * feat: ui updates * fix: logs explorer issues (#4483) * fix: logs explorer issues * fix: jest test cases * feat: support custom times unique to pages new design changes (#4485) * fix: loading states for list log view (#4486) * fix: logs search view query fix, logs details view - attribute tags alignment fix (#4489) * fix: delete empty file * fix: chart loading when scrolling logs (#4495) * fix: chart should not load when scrolling the logs as it is already fetched * fix: make the search bar as default rather than advanced options * fix: rename show context to show in context * fix: query range api not triggering on default select first load (#4498) * Refactor: Log Explorer UI changes. (#4502) * refactor: used selected view enum * refactor: updated hight of switch old button and tab border * refactor: import fixes * refactor: query builder border and button groups * refactor: removed hypen from refreshed * refactor: show delete button only when there is more than one query * refactor: sqaure up the query build button groups * refactor: updated css * fix: additional filter color button shadow * refactor: removed commented code and used selected panel enum * refactor: updated typecheck script * refactor: used enum selected view (#4504) * fix: retain the current query on date time change (#4510) * feat: added new icon for promQL and added tooltips for dashboards and alerts (#4512) * feat: added new icon for promQL and added tooltips for dashboards and alerts * fix: styles at 1440 px zoom * fix: rename clickhouse to clickHouse --------- Co-authored-by: Vikrant Gupta <54737045+Vikrant2520@users.noreply.github.com> Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com> Co-authored-by: Rajat Dabade <rajat@signoz.io>
2024-02-12 00:23:19 +05:30
selectedInterval?: Time | TimeV2;
headline?: JSX.Element;
alertDef?: AlertDef;
userQueryKey?: string;
allowSelectedIntervalForStepGen?: boolean;
yAxisUnit: string;
}
// eslint-disable-next-line sonarjs/cognitive-complexity
function ChartPreview({
name,
query,
graphType = PANEL_TYPES.TIME_SERIES,
selectedTime = 'GLOBAL_TIME',
selectedInterval = '5min',
headline,
userQueryKey,
allowSelectedIntervalForStepGen = false,
alertDef,
yAxisUnit,
}: ChartPreviewProps): JSX.Element | null {
const { t } = useTranslation('alerts');
const threshold = alertDef?.condition.target || 0;
const [minTimeScale, setMinTimeScale] = useState<number>();
const [maxTimeScale, setMaxTimeScale] = useState<number>();
const { minTime, maxTime, selectedTime: globalSelectedInterval } = useSelector<
AppState,
GlobalReducer
>((state) => state.globalTime);
const canQuery = useMemo((): boolean => {
if (!query || query == null) {
return false;
}
switch (query?.queryType) {
case EQueryType.PROM:
return query.promql?.length > 0 && query.promql[0].query !== '';
case EQueryType.CLICKHOUSE:
return (
query.clickhouse_sql?.length > 0 &&
query.clickhouse_sql[0].query?.length > 0
);
case EQueryType.QUERY_BUILDER:
return (
query.builder.queryData.length > 0 &&
query.builder.queryData[0].queryName !== ''
);
default:
return false;
}
}, [query]);
const queryResponse = useGetQueryRange(
{
query: query || initialQueriesMap.metrics,
globalSelectedInterval: selectedInterval,
graphType: getGraphType(graphType),
selectedTime,
params: {
allowSelectedIntervalForStepGen,
},
},
alertDef?.version || DEFAULT_ENTITY_VERSION,
{
queryKey: [
'chartPreview',
userQueryKey || JSON.stringify(query),
selectedInterval,
minTime,
maxTime,
],
retry: false,
enabled: canQuery,
},
);
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
const graphRef = useRef<HTMLDivElement>(null);
useEffect((): void => {
const { startTime, endTime } = getTimeRange(queryResponse);
setMinTimeScale(startTime);
setMaxTimeScale(endTime);
}, [maxTime, minTime, globalSelectedInterval, queryResponse]);
if (queryResponse.data && graphType === PANEL_TYPES.BAR) {
const sortedSeriesData = getSortedSeriesData(
queryResponse.data?.payload.data.result,
);
queryResponse.data.payload.data.result = sortedSeriesData;
}
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
const chartData = getUPlotChartData(queryResponse?.data?.payload);
const containerDimensions = useResizeObserver(graphRef);
const isDarkMode = useIsDarkMode();
2023-12-01 18:16:25 +05:30
const optionName =
getFormatNameByOptionId(alertDef?.condition.targetUnit || '') || '';
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
const options = useMemo(
() =>
getUPlotChartOptions({
id: 'alert_legend_widget',
yAxisUnit,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
apiResponse: queryResponse?.data?.payload,
dimensions: containerDimensions,
minTimeScale,
maxTimeScale,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
isDarkMode,
thresholds: [
{
index: '0', // no impact
keyIndex: 0,
moveThreshold: (): void => {},
selectedGraph: PANEL_TYPES.TIME_SERIES, // no impact
2023-12-01 18:16:25 +05:30
thresholdValue: threshold,
thresholdLabel: `${t(
'preview_chart_threshold_label',
2023-12-01 18:16:25 +05:30
)} (y=${getThresholdLabel(
optionName,
threshold,
alertDef?.condition.targetUnit,
yAxisUnit,
2023-12-01 18:16:25 +05:30
)})`,
thresholdUnit: alertDef?.condition.targetUnit,
},
],
softMax: null,
softMin: null,
panelType: graphType,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
}),
[
yAxisUnit,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
queryResponse?.data?.payload,
containerDimensions,
minTimeScale,
maxTimeScale,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
isDarkMode,
2023-12-01 18:16:25 +05:30
threshold,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
t,
2023-12-01 18:16:25 +05:30
optionName,
alertDef?.condition.targetUnit,
graphType,
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
],
);
return (
<ChartContainer>
{headline}
{(queryResponse?.isError || queryResponse?.error) && (
<FailedMessageContainer color="red" title="Failed to refresh the chart">
<InfoCircleOutlined />{' '}
{queryResponse.error.message || t('preview_chart_unexpected_error')}
</FailedMessageContainer>
)}
{queryResponse.isLoading && (
<Spinner size="large" tip="Loading..." height="70vh" />
)}
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
{chartData && !queryResponse.isError && (
<div ref={graphRef} style={{ height: '100%' }}>
<GridPanelSwitch
options={options}
panelType={graphType}
data={chartData}
name={name || 'Chart Preview'}
panelData={queryResponse.data?.payload.data.newResult.data.result || []}
query={query || initialQueriesMap.metrics}
yAxisUnit={yAxisUnit}
feat: uplot graph is added and some re-rendering is reduced (#3771) * feat: uplot graph is added and some re-rendering is reduced * chore: uplot is updated * feat: changes for the graph is updated * refactor: added y-axis unit in uplot graph (#3818) * refactor: added y-axis unit in uplot graph * refactor: removed the ticks stroke from both access * feat: create tooltip plugin for uplot charts (#3823) * feat: create tooltip plugin for uplot charts * feat: show labels in legends section --------- Co-authored-by: Yunus M <myounis.ar@live.com> * feat: uplot points is handled (#3817) * chore: resize is updated * chore: uplot chart dark mode is updated * chore: widget is updated * chore: options is updated * chore: value panel is updated * feat: uplot chart is updated * feat: onDrag is updated * feat: data for graph is updated * feat: alert section is fixed * feat: not found is updated * feat: fix dashboard title section and other uplot parity issues (#3839) * feat: fix dashboard title section and other uplot parity issues * feat: update scrollbar style for legend container * chore: initial width is updated * feat: onlcick is updated * feat: widget full view fixes (#3847) Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: show labels in tooltip overlay (#3867) * chore: memo is added * feat: toggle is updated * fix: Tooltip values is now fixed (#3894) * chore: tooltip is updated * chore: avoided the compute based on show * chore: tooltip data is updated * feat: resize graph based on the y axis max label length (#3895) * chore: build is in progress to fix * [Feat]: Full View (#3896) * fix: initial setup for full view done * refactor: done with the graph manager logic * refactor: done with the toggle issue in full view * refactor: done with toggle of data * refactor: done with legend to table mapping * refactor: ts error * chore: utils is updated * refactor: updated types * fix: option type fix --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com> * feat: use spline renderer to plot curved line graphs, full view impor… (#3919) * feat: use spline renderer to plot curved line graphs, full view imporvements * feat: increase min height for panel * chore: move code to utils and plugins in uplot folder * chore: update tooltip styles * fix: add panel issue in dashboard (#3920) * fix: update on click plugin opts import path * feat: replace time series graph in logs explorer and trace explorer with uplot (#3925) * feat: alert threshold is added (#3931) * feat: uplot styles are fixed (#3941) * Fix/app dex aligment (#3944) * feat: uplot styles are fixed * fix: app dex aligment * fix: full view after saving is fixed * feat: css is updated (#3948) * feat: on click handler position - factor in the padding on top and left * fix: timestamp for start and end is updated for view trace (#3966) * fix: timestamp for start and end is updated for view trace * chore: timestamp is added * fix: loading over flow is fixed (#3969) --------- Co-authored-by: Rajat Dabade <rajat@signoz.io> Co-authored-by: Yunus M <myounis.ar@live.com>
2023-11-15 15:33:45 +05:30
/>
</div>
)}
</ChartContainer>
);
}
ChartPreview.defaultProps = {
graphType: PANEL_TYPES.TIME_SERIES,
selectedTime: 'GLOBAL_TIME',
selectedInterval: '5min',
headline: undefined,
userQueryKey: '',
allowSelectedIntervalForStepGen: false,
alertDef: undefined,
};
export default ChartPreview;