SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
feat: added chart appearance settings in panel (#10573)
Abhi kumar3cdf3e06f379
diff --git a/frontend/__mocks__/resizableMock.tsx b/frontend/__mocks__/resizableMock.tsxnew file mode 100644index 0000000000..8cc5946797--- /dev/null+++ b/frontend/__mocks__/resizableMock.tsx@@ -0,0 +1,29 @@+import { PropsWithChildren } from 'react';++type CommonProps = PropsWithChildren<{+ className?: string;+ minSize?: number;+ maxSize?: number;+ defaultSize?: number;+ direction?: 'horizontal' | 'vertical';+ autoSaveId?: string;+ withHandle?: boolean;+}>;++export function ResizablePanelGroup({+ children,+ className,+}: CommonProps): JSX.Element {+ return <div className={className}>{children}</div>;+}++export function ResizablePanel({+ children,+ className,+}: CommonProps): JSX.Element {+ return <div className={className}>{children}</div>;+}++export function ResizableHandle({ className }: CommonProps): JSX.Element {+ return <div className={className} />;+}diff --git a/frontend/jest.config.ts b/frontend/jest.config.tsindex 64ec9d210f..aeb8a90a7b 100644--- a/frontend/jest.config.ts+++ b/frontend/jest.config.ts@@ -14,6 +14,7 @@ const config: Config.InitialOptions = {'\\.(css|less|scss)$': '<rootDir>/__mocks__/cssMock.ts','\\.md$': '<rootDir>/__mocks__/cssMock.ts','^uplot$': '<rootDir>/__mocks__/uplotMock.ts',+ '^@signozhq/resizable$': '<rootDir>/__mocks__/resizableMock.tsx','^hooks/useSafeNavigate$': USE_SAFE_NAVIGATE_MOCK_PATH,'^src/hooks/useSafeNavigate$': USE_SAFE_NAVIGATE_MOCK_PATH,'^.*/useSafeNavigate$': USE_SAFE_NAVIGATE_MOCK_PATH,diff --git a/frontend/package.json b/frontend/package.jsonindex 38f46f1900..6627edff63 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -64,7 +64,7 @@"@signozhq/sonner": "0.1.0","@signozhq/switch": "0.0.2","@signozhq/table": "0.3.7",- "@signozhq/toggle-group": "^0.0.1",+ "@signozhq/toggle-group": "0.0.1","@signozhq/tooltip": "0.0.2","@tanstack/react-table": "8.20.6","@tanstack/react-virtual": "3.11.2",diff --git a/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/__tests__/utils.test.ts b/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/__tests__/utils.test.tsindex 6aae0c2106..39216db607 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/__tests__/utils.test.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/__tests__/utils.test.ts@@ -224,7 +224,7 @@ describe('TimeSeriesPanel utils', () => {});});- it('uses DrawStyle.Line and VisibilityMode.Never when series has multiple valid points', () => {+ it('uses DrawStyle.Line and showPoints false when series has multiple valid points', () => {const apiResponse = createApiResponse([{metric: {},diff --git a/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.ts b/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.tsindex f69fe42305..2261b49998 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.ts@@ -10,9 +10,9 @@ import getLabelName from 'lib/getLabelName';import { OnClickPluginOpts } from 'lib/uPlotLib/plugins/onClickPlugin';import {DrawStyle,+ FillMode,LineInterpolation,LineStyle,- VisibilityMode,} from 'lib/uPlotV2/config/types';import { UPlotConfigBuilder } from 'lib/uPlotV2/config/UPlotConfigBuilder';import { isInvalidPlotValue } from 'lib/uPlotV2/utils/dataUtils';@@ -124,12 +124,12 @@ export const prepareUPlotConfig = ({label: label,colorMapping: widget.customLegendColors ?? {},spanGaps: true,- lineStyle: LineStyle.Solid,- lineInterpolation: LineInterpolation.Spline,- showPoints: hasSingleValidPoint- ? VisibilityMode.Always- : VisibilityMode.Never,+ lineStyle: widget.lineStyle || LineStyle.Solid,+ lineInterpolation: widget.lineInterpolation || LineInterpolation.Spline,+ showPoints:+ widget.showPoints || hasSingleValidPoint ? true : !!widget.showPoints,pointSize: 5,+ fillMode: widget.fillMode || FillMode.None,isDarkMode,});});diff --git a/frontend/src/container/NewWidget/NewWidget.styles.scss b/frontend/src/container/NewWidget/NewWidget.styles.scssindex 9c16a711e2..4b62e9ec9c 100644--- a/frontend/src/container/NewWidget/NewWidget.styles.scss+++ b/frontend/src/container/NewWidget/NewWidget.styles.scss@@ -65,6 +65,35 @@}}+.new-widget-container {+ .resizable-panel-left-container {+ overflow-x: hidden;+ overflow-y: auto;+ }++ .resizable-panel-right-container {+ overflow-y: auto !important;+ min-width: 350px;++ &::-webkit-scrollbar {+ width: 0.3rem;+ }+ &::-webkit-scrollbar-thumb {+ background: rgb(136, 136, 136);+ border-radius: 0.625rem;+ }+ &::-webkit-scrollbar-track {+ background: transparent;+ }+ }++ .widget-resizable-panel-group {+ .widget-resizable-handle {+ height: 100vh;+ }+ }+}+.lightMode {.edit-header {border-bottom: 1px solid var(--bg-vanilla-300);@@ -81,4 +110,11 @@}}}++ .widget-resizable-panel-group {+ .bg-border {+ background: var(--bg-vanilla-300);+ border-color: var(--bg-vanilla-300);+ }+ }}diff --git a/frontend/src/container/NewWidget/RightContainer/FillModeSelector.styles.scss b/frontend/src/container/NewWidget/RightContainer/FillModeSelector.styles.scssnew file mode 100644index 0000000000..23c8fee05b--- /dev/null+++ b/frontend/src/container/NewWidget/RightContainer/FillModeSelector.styles.scss@@ -0,0 +1,21 @@+.fill-mode-selector {+ .fill-mode-icon {+ width: 24px;+ height: 24px;+ }++ .fill-mode-label {+ text-transform: uppercase;+ font-size: 12px;+ font-weight: 500;+ color: var(--bg-vanilla-400);+ }+}++.lightMode {+ .fill-mode-selector {+ .fill-mode-label {+ color: var(--bg-ink-400);+ }+ }+}diff --git a/frontend/src/container/NewWidget/RightContainer/FillModeSelector.tsx b/frontend/src/container/NewWidget/RightContainer/FillModeSelector.tsxnew file mode 100644index 0000000000..831a27fcb9--- /dev/null+++ b/frontend/src/container/NewWidget/RightContainer/FillModeSelector.tsx@@ -0,0 +1,94 @@+import { ToggleGroup, ToggleGroupItem } from '@signozhq/toggle-group';+import { Typography } from 'antd';+import { FillMode } from 'lib/uPlotV2/config/types';++import './FillModeSelector.styles.scss';++interface FillModeSelectorProps {+ value: FillMode;+ onChange: (value: FillMode) => void;+}++export function FillModeSelector({+ value,+ onChange,+}: FillModeSelectorProps): JSX.Element {+ return (+ <section className="fill-mode-selector control-container">+ <Typography.Text className="section-heading">Fill mode</Typography.Text>+ <ToggleGroup+ type="single"+ value={value}+ variant="outline"+ size="lg"+ onValueChange={(newValue): void => {+ if (newValue) {+ onChange(newValue as FillMode);+ }+ }}+ >+ <ToggleGroupItem value={FillMode.None} aria-label="None" title="None">+ <svg+ className="fill-mode-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <rect x="8" y="16" width="32" height="16" stroke="#888" fill="none" />+ </svg>+ <Typography.Text className="section-heading-small">None</Typography.Text>+ </ToggleGroupItem>+ <ToggleGroupItem value={FillMode.Solid} aria-label="Solid" title="Solid">+ <svg+ className="fill-mode-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <rect x="8" y="16" width="32" height="16" fill="#888" />+ </svg>+ <Typography.Text className="section-heading-small">Solid</Typography.Text>+ </ToggleGroupItem>+ <ToggleGroupItem+ value={FillMode.Gradient}+ aria-label="Gradient"+ title="Gradient"+ >+ <svg+ className="fill-mode-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <defs>+ <linearGradient id="fill-gradient" x1="0" y1="0" x2="1" y2="0">+ <stop offset="0%" stopColor="#888" stopOpacity="0.2" />+ <stop offset="100%" stopColor="#888" stopOpacity="0.8" />+ </linearGradient>+ </defs>+ <rect+ x="8"+ y="16"+ width="32"+ height="16"+ fill="url(#fill-gradient)"+ stroke="#888"+ />+ </svg>+ <Typography.Text className="section-heading-small">+ Gradient+ </Typography.Text>+ </ToggleGroupItem>+ </ToggleGroup>+ </section>+ );+}diff --git a/frontend/src/container/NewWidget/RightContainer/LineInterpolationSelector.styles.scss b/frontend/src/container/NewWidget/RightContainer/LineInterpolationSelector.styles.scssnew file mode 100644index 0000000000..dfd9740238--- /dev/null+++ b/frontend/src/container/NewWidget/RightContainer/LineInterpolationSelector.styles.scss@@ -0,0 +1,21 @@+.line-interpolation-selector {+ .line-interpolation-icon {+ width: 24px;+ height: 24px;+ }++ .line-interpolation-label {+ text-transform: uppercase;+ font-size: 12px;+ font-weight: 500;+ color: var(--bg-vanilla-400);+ }+}++.lightMode {+ .line-interpolation-selector {+ .line-interpolation-label {+ color: var(--bg-ink-400);+ }+ }+}diff --git a/frontend/src/container/NewWidget/RightContainer/LineInterpolationSelector.tsx b/frontend/src/container/NewWidget/RightContainer/LineInterpolationSelector.tsxnew file mode 100644index 0000000000..76736d358a--- /dev/null+++ b/frontend/src/container/NewWidget/RightContainer/LineInterpolationSelector.tsx@@ -0,0 +1,110 @@+import { ToggleGroup, ToggleGroupItem } from '@signozhq/toggle-group';+import { Typography } from 'antd';+import { LineInterpolation } from 'lib/uPlotV2/config/types';++import './LineInterpolationSelector.styles.scss';++interface LineInterpolationSelectorProps {+ value: LineInterpolation;+ onChange: (value: LineInterpolation) => void;+}++export function LineInterpolationSelector({+ value,+ onChange,+}: LineInterpolationSelectorProps): JSX.Element {+ return (+ <section className="line-interpolation-selector control-container">+ <Typography.Text className="section-heading">+ Line interpolation+ </Typography.Text>+ <ToggleGroup+ type="single"+ value={value}+ variant="outline"+ size="lg"+ onValueChange={(newValue): void => {+ if (newValue) {+ onChange(newValue as LineInterpolation);+ }+ }}+ >+ <ToggleGroupItem+ value={LineInterpolation.Linear}+ aria-label="Linear"+ title="Linear"+ >+ <svg+ className="line-interpolation-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <circle cx="8" cy="32" r="3" fill="#888" />+ <circle cx="24" cy="16" r="3" fill="#888" />+ <circle cx="40" cy="32" r="3" fill="#888" />+ <path d="M8 32 L24 16 L40 32" stroke="#888" />+ </svg>+ </ToggleGroupItem>+ <ToggleGroupItem value={LineInterpolation.Spline} aria-label="Spline">+ <svg+ className="line-interpolation-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <circle cx="8" cy="32" r="3" fill="#888" />+ <circle cx="24" cy="16" r="3" fill="#888" />+ <circle cx="40" cy="32" r="3" fill="#888" />+ <path d="M8 32 C16 8, 32 8, 40 32" />+ </svg>+ </ToggleGroupItem>+ <ToggleGroupItem+ value={LineInterpolation.StepAfter}+ aria-label="Step After"+ >+ <svg+ className="line-interpolation-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <circle cx="8" cy="32" r="3" fill="#888" />+ <circle cx="24" cy="16" r="3" fill="#888" />+ <circle cx="40" cy="32" r="3" fill="#888" />+ <path d="M8 32 V16 H24 V32 H40" />+ </svg>+ </ToggleGroupItem>++ <ToggleGroupItem+ value={LineInterpolation.StepBefore}+ aria-label="Step Before"+ >+ <svg+ className="line-interpolation-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <circle cx="8" cy="32" r="3" fill="#888" />+ <circle cx="24" cy="16" r="3" fill="#888" />+ <circle cx="40" cy="32" r="3" fill="#888" />+ <path d="M8 32 H24 V16 H40 V32" />+ </svg>+ </ToggleGroupItem>+ </ToggleGroup>+ </section>+ );+}diff --git a/frontend/src/container/NewWidget/RightContainer/LineStyleSelector.styles.scss b/frontend/src/container/NewWidget/RightContainer/LineStyleSelector.styles.scssnew file mode 100644index 0000000000..89e67ac4d7--- /dev/null+++ b/frontend/src/container/NewWidget/RightContainer/LineStyleSelector.styles.scss@@ -0,0 +1,21 @@+.line-style-selector {+ .line-style-icon {+ width: 24px;+ height: 24px;+ }++ .line-style-label {+ text-transform: uppercase;+ font-size: 12px;+ font-weight: 500;+ color: var(--bg-vanilla-400);+ }+}++.lightMode {+ .line-style-selector {+ .line-style-label {+ color: var(--bg-ink-400);+ }+ }+}diff --git a/frontend/src/container/NewWidget/RightContainer/LineStyleSelector.tsx b/frontend/src/container/NewWidget/RightContainer/LineStyleSelector.tsxnew file mode 100644index 0000000000..fd7b8dd67b--- /dev/null+++ b/frontend/src/container/NewWidget/RightContainer/LineStyleSelector.tsx@@ -0,0 +1,66 @@+import { ToggleGroup, ToggleGroupItem } from '@signozhq/toggle-group';+import { Typography } from 'antd';+import { LineStyle } from 'lib/uPlotV2/config/types';++import './LineStyleSelector.styles.scss';++interface LineStyleSelectorProps {+ value: LineStyle;+ onChange: (value: LineStyle) => void;+}++export function LineStyleSelector({+ value,+ onChange,+}: LineStyleSelectorProps): JSX.Element {+ return (+ <section className="line-style-selector control-container">+ <Typography.Text className="section-heading">Line style</Typography.Text>+ <ToggleGroup+ type="single"+ value={value}+ variant="outline"+ size="lg"+ onValueChange={(newValue): void => {+ if (newValue) {+ onChange(newValue as LineStyle);+ }+ }}+ >+ <ToggleGroupItem value={LineStyle.Solid} aria-label="Solid" title="Solid">+ <svg+ className="line-style-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <path d="M8 24 L40 24" />+ </svg>+ <Typography.Text className="section-heading-small">Solid</Typography.Text>+ </ToggleGroupItem>+ <ToggleGroupItem+ value={LineStyle.Dashed}+ aria-label="Dashed"+ title="Dashed"+ >+ <svg+ className="line-style-icon"+ viewBox="0 0 48 48"+ fill="none"+ stroke="#888"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeDasharray="6 4"+ >+ <path d="M8 24 L40 24" />+ </svg>+ <Typography.Text className="section-heading-small">Dashed</Typography.Text>+ </ToggleGroupItem>+ </ToggleGroup>+ </section>+ );+}diff --git a/frontend/src/container/NewWidget/RightContainer/RightContainer.styles.scss b/frontend/src/container/NewWidget/RightContainer/RightContainer.styles.scssindex 796fc27273..3a53dec94f 100644--- a/frontend/src/container/NewWidget/RightContainer/RightContainer.styles.scss+++ b/frontend/src/container/NewWidget/RightContainer/RightContainer.styles.scss@@ -1,8 +1,30 @@.right-container {display: flex;flex-direction: column;+ font-family: 'Space Mono';padding-bottom: 48px;+ .section-heading {+ color: var(--bg-vanilla-400);+ font-size: 13px;+ font-style: normal;+ font-weight: 400;+ line-height: 18px; /* 138.462% */+ letter-spacing: 0.52px;+ text-transform: uppercase;+ }++ .section-heading-small {+ font-family: 'Space Mono';+ color: var(--bg-vanilla-400);+ font-size: 12px;+ font-style: normal;+ font-weight: 400;+ word-break: initial;+ line-height: 16px; /* 133.333% */+ letter-spacing: 0.48px;+ }+.header {display: flex;padding: 14px 14px 14px 12px;@@ -34,17 +56,6 @@.name-description {padding: 0 0 4px 0;- .typography {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;- }-.name-input {display: flex;padding: 6px 6px 6px 8px;@@ -90,15 +101,21 @@display: flex;flex-direction: column;- .typography {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;+ .toggle-card {+ display: flex;+ flex-direction: row;+ justify-content: space-between;+ align-items: center;+ padding: 12px;+ border-radius: 2px;+ border: 1px solid var(--bg-slate-400);+ background: var(--bg-ink-400);+ }++ .toggle-card-text-container {+ display: flex;+ flex-direction: column;+ gap: 4px;}.panel-type-select {@@ -114,55 +131,16 @@border: 1px solid var(--bg-slate-400);background: var(--bg-ink-300);}-- .select-option {- display: flex;- align-items: center;- gap: 6px;- .icon {- display: flex;- align-items: center;- }-- .display {- color: var(--bg-vanilla-100);- font-family: Inter;- font-size: 12px;- font-style: normal;- font-weight: 400;- line-height: 16px; /* 133.333% */- }- }}- .fill-gaps {- display: flex;- padding: 12px;- justify-content: space-between;- align-items: center;- border-radius: 2px;- border: 1px solid var(--bg-slate-400);- background: var(--bg-ink-400);-- .fill-gaps-text {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;- }- .fill-gaps-text-description {- color: var(--bg-vanilla-400);- font-family: Inter;- font-size: 12px;- font-style: normal;- font-weight: 400;- opacity: 0.6;- line-height: 16px; /* 133.333% */- }+ .toggle-card-description {+ color: var(--bg-vanilla-400);+ font-family: Inter;+ font-size: 12px;+ font-style: normal;+ font-weight: 400;+ opacity: 0.6;+ line-height: 16px; /* 133.333% */}.log-scale,@@ -171,17 +149,6 @@justify-content: space-between;}- .panel-time-text {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;- }-.y-axis-unit-selector,.y-axis-unit-selector-v2 {display: flex;@@ -189,14 +156,7 @@gap: 8px;.heading {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;+ @extend .section-heading;}.input {@@ -249,7 +209,6 @@.text {color: var(--bg-vanilla-400);- font-family: 'Space Mono';font-size: 12px;font-style: normal;font-weight: 400;@@ -270,30 +229,9 @@.stack-chart {flex-direction: row;justify-content: space-between;- .label {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;- }}.bucket-config {- .label {- color: var(--bg-vanilla-400);- font-family: 'Space Mono';- font-size: 13px;- font-style: normal;- font-weight: 400;- line-height: 18px; /* 138.462% */- letter-spacing: 0.52px;- text-transform: uppercase;- }-.bucket-size-label {margin-top: 8px;}@@ -322,7 +260,6 @@.label {color: var(--bg-vanilla-400);- font-family: 'Space Mono';font-size: 13px;font-style: normal;font-weight: 400;@@ -354,7 +291,6 @@.alerts-text {color: var(--bg-vanilla-400);- font-family: Inter;font-size: 14px;font-style: normal;font-weight: 400;@@ -400,6 +336,9 @@.lightMode {.right-container {background-color: var(--bg-vanilla-100);+ .section-heading {+ color: var(--bg-ink-400);+ }.header {.header-text {color: var(--bg-ink-400);@@ -427,10 +366,6 @@}.panel-config {- .typography {- color: var(--bg-ink-400);- }-.panel-type-select {.ant-select-selector {border: 1px solid var(--bg-vanilla-300);@@ -455,14 +390,14 @@}}- .fill-gaps {+ .toggle-card {border: 1px solid var(--bg-vanilla-300);background: var(--bg-vanilla-300);.fill-gaps-text {color: var(--bg-ink-400);}- .fill-gaps-text-description {+ .toggle-card-description {color: var(--bg-ink-400);}}diff --git a/frontend/src/container/NewWidget/RightContainer/__tests__/RightContainer.test.tsx b/frontend/src/container/NewWidget/RightContainer/__tests__/RightContainer.test.tsxindex acdd3b8139..4a6dbd8df7 100644--- a/frontend/src/container/NewWidget/RightContainer/__tests__/RightContainer.test.tsx+++ b/frontend/src/container/NewWidget/RightContainer/__tests__/RightContainer.test.tsx@@ -6,6 +6,11 @@ import { MemoryRouter } from 'react-router-dom';import { render as rtlRender, screen } from '@testing-library/react';import userEvent from '@testing-library/user-event';import { PANEL_TYPES } from 'constants/queryBuilder';+import {+ FillMode,+ LineInterpolation,+ LineStyle,+} from 'lib/uPlotV2/config/types';import { AppContext } from 'providers/App/App';import { IAppContext } from 'providers/App/types';import { ErrorModalProvider } from 'providers/ErrorModalProvider';@@ -165,6 +170,14 @@ describe('RightContainer - Alerts Section', () => {setContextLinks: jest.fn(),enableDrillDown: false,isNewDashboard: false,+ lineInterpolation: LineInterpolation.Spline,+ fillMode: FillMode.None,+ lineStyle: LineStyle.Solid,+ setLineInterpolation: jest.fn(),+ setFillMode: jest.fn(),+ setLineStyle: jest.fn(),+ showPoints: false,+ setShowPoints: jest.fn(),};beforeEach(() => {diff --git a/frontend/src/container/NewWidget/RightContainer/components/SettingsSection/SettingsSection.styles.scss b/frontend/src/container/NewWidget/RightContainer/components/SettingsSection/SettingsSection.styles.scssindex 1e911fc094..710bc9e36a 100644--- a/frontend/src/container/NewWidget/RightContainer/components/SettingsSection/SettingsSection.styles.scss+++ b/frontend/src/container/NewWidget/RightContainer/components/SettingsSection/SettingsSection.styles.scss@@ -43,7 +43,7 @@max-height: 0;overflow: hidden;opacity: 0;- transition: max-height 0.25s ease, opacity 0.25s ease, padding 0.25s ease;+ transition: max-height 0.1s ease, opacity 0.1s ease, padding 0.1s ease;&.open {padding-bottom: 24px;diff --git a/frontend/src/container/NewWidget/RightContainer/constants.ts b/frontend/src/container/NewWidget/RightContainer/constants.tsindex 5f4a974778..d62ff01c94 100644--- a/frontend/src/container/NewWidget/RightContainer/constants.ts+++ b/frontend/src/container/NewWidget/RightContainer/constants.ts@@ -206,3 +206,59 @@ export const panelTypeVsDecimalPrecision: {[PANEL_TYPES.TRACE]: false,[PANEL_TYPES.EMPTY_WIDGET]: false,} as const;++export const panelTypeVsLineInterpolation: {+ [key in PANEL_TYPES]: boolean;+} = {+ [PANEL_TYPES.TIME_SERIES]: true,+ [PANEL_TYPES.VALUE]: false,+ [PANEL_TYPES.TABLE]: false,+ [PANEL_TYPES.LIST]: false,+ [PANEL_TYPES.PIE]: false,+ [PANEL_TYPES.BAR]: false,+ [PANEL_TYPES.HISTOGRAM]: false,+ [PANEL_TYPES.TRACE]: false,+ [PANEL_TYPES.EMPTY_WIDGET]: false,+} as const;++export const panelTypeVsLineStyle: {+ [key in PANEL_TYPES]: boolean;+} = {+ [PANEL_TYPES.TIME_SERIES]: true,+ [PANEL_TYPES.VALUE]: false,+ [PANEL_TYPES.TABLE]: false,+ [PANEL_TYPES.LIST]: false,+ [PANEL_TYPES.PIE]: false,+ [PANEL_TYPES.BAR]: false,+ [PANEL_TYPES.HISTOGRAM]: false,+ [PANEL_TYPES.TRACE]: false,+ [PANEL_TYPES.EMPTY_WIDGET]: false,+} as const;++export const panelTypeVsFillMode: {+ [key in PANEL_TYPES]: boolean;+} = {+ [PANEL_TYPES.TIME_SERIES]: true,+ [PANEL_TYPES.VALUE]: false,+ [PANEL_TYPES.TABLE]: false,+ [PANEL_TYPES.LIST]: false,+ [PANEL_TYPES.PIE]: false,+ [PANEL_TYPES.BAR]: false,+ [PANEL_TYPES.HISTOGRAM]: false,+ [PANEL_TYPES.TRACE]: false,+ [PANEL_TYPES.EMPTY_WIDGET]: false,+} as const;++export const panelTypeVsShowPoints: {+ [key in PANEL_TYPES]: boolean;+} = {+ [PANEL_TYPES.TIME_SERIES]: true,+ [PANEL_TYPES.VALUE]: false,+ [PANEL_TYPES.TABLE]: false,+ [PANEL_TYPES.LIST]: false,+ [PANEL_TYPES.PIE]: false,+ [PANEL_TYPES.BAR]: false,+ [PANEL_TYPES.HISTOGRAM]: false,+ [PANEL_TYPES.TRACE]: false,+ [PANEL_TYPES.EMPTY_WIDGET]: false,+} as const;diff --git a/frontend/src/container/NewWidget/RightContainer/index.tsx b/frontend/src/container/NewWidget/RightContainer/index.tsxindex 5625920e5e..456cdfc824 100644--- a/frontend/src/container/NewWidget/RightContainer/index.tsx+++ b/frontend/src/container/NewWidget/RightContainer/index.tsx@@ -27,6 +27,11 @@ import {import { useDashboardVariables } from 'hooks/dashboard/useDashboardVariables';import useCreateAlerts from 'hooks/queryBuilder/useCreateAlerts';import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';+import {+ FillMode,+ LineInterpolation,+ LineStyle,+} from 'lib/uPlotV2/config/types';import {Antenna,Axis3D,@@ -35,6 +40,7 @@ import {LayoutDashboard,LineChart,Link,+ Paintbrush,Pencil,Plus,SlidersHorizontal,@@ -60,11 +66,15 @@ import {panelTypeVsContextLinks,panelTypeVsCreateAlert,panelTypeVsDecimalPrecision,+ panelTypeVsFillMode,panelTypeVsFillSpan,panelTypeVsLegendColors,panelTypeVsLegendPosition,+ panelTypeVsLineInterpolation,+ panelTypeVsLineStyle,panelTypeVsLogScale,panelTypeVsPanelTimePreferences,+ panelTypeVsShowPoints,panelTypeVsSoftMinMax,panelTypeVsStackingChartPreferences,panelTypeVsThreshold,@@ -72,7 +82,10 @@ import {} from './constants';import ContextLinks from './ContextLinks';import DashboardYAxisUnitSelectorWrapper from './DashboardYAxisUnitSelectorWrapper';+import { FillModeSelector } from './FillModeSelector';import LegendColors from './LegendColors/LegendColors';+import { LineInterpolationSelector } from './LineInterpolationSelector';+import { LineStyleSelector } from './LineStyleSelector';import ThresholdSelector from './Threshold/ThresholdSelector';import { ThresholdProps } from './Threshold/types';import { timePreferance } from './timeItems';@@ -99,6 +112,14 @@ function RightContainer({setTitle,title,selectedGraph,+ lineInterpolation,+ setLineInterpolation,+ fillMode,+ setFillMode,+ lineStyle,+ setLineStyle,+ showPoints,+ setShowPoints,bucketCount,bucketWidth,stackedBarChart,@@ -175,6 +196,11 @@ function RightContainer({panelTypeVsContextLinks[selectedGraph] && enableDrillDown;const allowDecimalPrecision = panelTypeVsDecimalPrecision[selectedGraph];+ const allowLineInterpolation = panelTypeVsLineInterpolation[selectedGraph];+ const allowLineStyle = panelTypeVsLineStyle[selectedGraph];+ const allowFillMode = panelTypeVsFillMode[selectedGraph];+ const allowShowPoints = panelTypeVsShowPoints[selectedGraph];+const { currentQuery } = useQueryBuilder();const [graphTypes, setGraphTypes] = useState<ItemsProps[]>(PanelTypesWithData);@@ -201,6 +227,22 @@ function RightContainer({[allowLegendPosition, allowLegendColors],);+ const isChartAppearanceSectionVisible = useMemo(+ () =>+ /**+ * Disabled for now as we are not done with other settings in chart appearance section+ * TODO: @ahrefabhi Enable this after we are done other settings in chart appearance section+ */++ // eslint-disable-next-line sonarjs/no-redundant-boolean+ false &&+ (allowFillMode ||+ allowLineStyle ||+ allowLineInterpolation ||+ allowShowPoints),+ [allowFillMode, allowLineStyle, allowLineInterpolation, allowShowPoints],+ );+const updateCursorAndDropdown = (value: string, pos: number): void => {setCursorPos(pos);const lastDollar = value.lastIndexOf('$', pos - 1);@@ -300,7 +342,7 @@ function RightContainer({<SettingsSection title="General" defaultOpen icon={<Pencil size={14} />}><section className="name-description control-container">- <Typography.Text className="typography">Name</Typography.Text>+ <Typography.Text className="section-heading">Name</Typography.Text><AutoCompleteoptions={dashboardVariableOptions}value={inputValue}@@ -320,7 +362,7 @@ function RightContainer({onBlur={(): void => setAutoCompleteOpen(false)}/></AutoComplete>- <Typography.Text className="typography">Description</Typography.Text>+ <Typography.Text className="section-heading">Description</Typography.Text><TextAreaplaceholder="Enter the panel description here..."bordered@@ -341,7 +383,7 @@ function RightContainer({icon={<LayoutDashboard size={14} />}><section className="panel-type control-container">- <Typography.Text className="typography">Panel Type</Typography.Text>+ <Typography.Text className="section-heading">Panel Type</Typography.Text><SelectonChange={setGraphHandler}value={selectedGraph}@@ -362,7 +404,7 @@ function RightContainer({{allowPanelTimePreference && (<section className="panel-time-preference control-container">- <Typography.Text className="panel-time-text">+ <Typography.Text className="section-heading">Panel Time Preference</Typography.Text><TimePreference@@ -376,7 +418,9 @@ function RightContainer({{allowStackingBarChart && (<section className="stack-chart control-container">- <Typography.Text className="label">Stack series</Typography.Text>+ <Typography.Text className="section-heading">+ Stack series+ </Typography.Text><Switchchecked={stackedBarChart}size="small"@@ -386,10 +430,10 @@ function RightContainer({)}{allowFillSpans && (- <section className="fill-gaps">- <div className="fill-gaps-text-container">- <Typography className="fill-gaps-text">Fill gaps</Typography>- <Typography.Text className="fill-gaps-text-description">+ <section className="fill-gaps toggle-card">+ <div className="toggle-card-text-container">+ <Typography className="section-heading">Fill gaps</Typography>+ <Typography.Text className="toggle-card-description">Fill gaps in data with 0 for continuity</Typography.Text></div>@@ -448,6 +492,36 @@ function RightContainer({</SettingsSection>)}+ {isChartAppearanceSectionVisible && (+ <SettingsSection title="Chart Appearance" icon={<Paintbrush size={14} />}>+ {allowFillMode && (+ <FillModeSelector value={fillMode} onChange={setFillMode} />+ )}+ {allowLineStyle && (+ <LineStyleSelector value={lineStyle} onChange={setLineStyle} />+ )}+ {allowLineInterpolation && (+ <LineInterpolationSelector+ value={lineInterpolation}+ onChange={setLineInterpolation}+ />+ )}+ {allowShowPoints && (+ <section className="show-points toggle-card">+ <div className="toggle-card-text-container">+ <Typography.Text className="section-heading">+ Show points+ </Typography.Text>+ <Typography.Text className="toggle-card-description">+ Display individual data points on the chart+ </Typography.Text>+ </div>+ <Switch size="small" checked={showPoints} onChange={setShowPoints} />+ </section>+ )}+ </SettingsSection>+ )}+{isAxisSectionVisible && (<SettingsSection title="Axes" icon={<Axis3D size={14} />}>{allowSoftMinMax && (@@ -475,7 +549,9 @@ function RightContainer({{allowLogScale && (<section className="log-scale control-container">- <Typography.Text className="typography">Y Axis Scale</Typography.Text>+ <Typography.Text className="section-heading">+ Y Axis Scale+ </Typography.Text><SelectonChange={(value): void =>setIsLogScale(value === LogScale.LOGARITHMIC)@@ -511,7 +587,7 @@ function RightContainer({<SettingsSection title="Legend" icon={<Layers size={14} />}>{allowLegendPosition && (<section className="legend-position control-container">- <Typography.Text className="typography">Position</Typography.Text>+ <Typography.Text className="section-heading">Position</Typography.Text><SelectonChange={(value: LegendPosition): void => setLegendPosition(value)}value={legendPosition}@@ -548,7 +624,9 @@ function RightContainer({{allowBucketConfig && (<SettingsSection title="Histogram / Buckets"><section className="bucket-config control-container">- <Typography.Text className="label">Number of buckets</Typography.Text>+ <Typography.Text className="section-heading">+ Number of buckets+ </Typography.Text><InputNumbervalue={bucketCount || null}type="number"@@ -559,7 +637,7 @@ function RightContainer({setBucketCount(val || 0);}}/>- <Typography.Text className="label bucket-size-label">+ <Typography.Text className="section-heading bucket-size-label">Bucket width</Typography.Text><InputNumber@@ -575,7 +653,7 @@ function RightContainer({}}/><section className="combine-hist">- <Typography.Text className="label">+ <Typography.Text className="section-heading">Merge all series into one</Typography.Text><Switch@@ -683,6 +761,14 @@ export interface RightContainerProps {setContextLinks: Dispatch<SetStateAction<ContextLinksData>>;enableDrillDown?: boolean;isNewDashboard: boolean;+ lineInterpolation: LineInterpolation;+ setLineInterpolation: Dispatch<SetStateAction<LineInterpolation>>;+ fillMode: FillMode;+ setFillMode: Dispatch<SetStateAction<FillMode>>;+ lineStyle: LineStyle;+ setLineStyle: Dispatch<SetStateAction<LineStyle>>;+ showPoints: boolean;+ setShowPoints: Dispatch<SetStateAction<boolean>>;}RightContainer.defaultProps = {diff --git a/frontend/src/container/NewWidget/index.tsx b/frontend/src/container/NewWidget/index.tsxindex c9c0623665..3f0ffc82a0 100644--- a/frontend/src/container/NewWidget/index.tsx+++ b/frontend/src/container/NewWidget/index.tsx@@ -6,6 +6,11 @@ import { UseQueryResult } from 'react-query';import { useSelector } from 'react-redux';import { generatePath } from 'react-router-dom';import { WarningOutlined } from '@ant-design/icons';+import {+ ResizableHandle,+ ResizablePanel,+ ResizablePanelGroup,+} from '@signozhq/resizable';import { Button, Flex, Modal, Space, Typography } from 'antd';import logEvent from 'api/common/logEvent';import { PrecisionOption, PrecisionOptionsEnum } from 'components/Graph/types';@@ -24,12 +29,16 @@ import { useDashboardVariables } from 'hooks/dashboard/useDashboardVariables';import { useUpdateDashboard } from 'hooks/dashboard/useUpdateDashboard';import { useKeyboardHotkeys } from 'hooks/hotkeys/useKeyboardHotkeys';import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';-import { useIsDarkMode } from 'hooks/useDarkMode';import { useSafeNavigate } from 'hooks/useSafeNavigate';import useUrlQuery from 'hooks/useUrlQuery';import createQueryParams from 'lib/createQueryParams';import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';import { getDashboardVariables } from 'lib/dashboardVariables/getDashboardVariables';+import {+ FillMode,+ LineInterpolation,+ LineStyle,+} from 'lib/uPlotV2/config/types';import { cloneDeep, defaultTo, isEmpty, isUndefined } from 'lodash-es';import { Check, X } from 'lucide-react';import { useScrollToWidgetIdStore } from 'providers/Dashboard/helpers/scrollToWidgetIdHelper';@@ -63,12 +72,7 @@ import QueryTypeTag from './LeftContainer/QueryTypeTag';import RightContainer from './RightContainer';import { ThresholdProps } from './RightContainer/Threshold/types';import TimeItems, { timePreferance } from './RightContainer/timeItems';-import {- Container,- LeftContainerWrapper,- PanelContainer,- RightContainerWrapper,-} from './styles';+import { Container, PanelContainer } from './styles';import { NewWidgetProps } from './types';import {getDefaultWidgetData,@@ -204,6 +208,18 @@ function NewWidget({const [legendPosition, setLegendPosition] = useState<LegendPosition>(selectedWidget?.legendPosition || LegendPosition.BOTTOM,);+ const [lineInterpolation, setLineInterpolation] = useState<LineInterpolation>(+ selectedWidget?.lineInterpolation || LineInterpolation.Spline,+ );+ const [fillMode, setFillMode] = useState<FillMode>(+ selectedWidget?.fillMode || FillMode.None,+ );+ const [lineStyle, setLineStyle] = useState<LineStyle>(+ selectedWidget?.lineStyle || LineStyle.Solid,+ );+ const [showPoints, setShowPoints] = useState<boolean>(+ selectedWidget?.showPoints ?? false,+ );const [customLegendColors, setCustomLegendColors] = useState<Record<string, string>>(selectedWidget?.customLegendColors || {});@@ -269,6 +285,10 @@ function NewWidget({softMin,softMax,fillSpans: isFillSpans,+ lineInterpolation,+ fillMode,+ lineStyle,+ showPoints,columnUnits,bucketCount,stackedBarChart,@@ -304,6 +324,10 @@ function NewWidget({stackedBarChart,isLogScale,legendPosition,+ lineInterpolation,+ fillMode,+ lineStyle,+ showPoints,customLegendColors,contextLinks,selectedWidget.columnWidths,@@ -757,7 +781,7 @@ function NewWidget({}, [query, safeNavigate, dashboardId, currentQuery]);return (- <Container>+ <Container className="new-widget-container"><div className="edit-header"><div className="left-header"><X@@ -811,79 +835,102 @@ function NewWidget({</div><PanelContainer>- <LeftContainerWrapper isDarkMode={useIsDarkMode()}>- <OverlayScrollbar>- {selectedWidget && (- <LeftContainer- selectedGraph={graphType}- selectedLogFields={selectedLogFields}- setSelectedLogFields={setSelectedLogFields}- selectedTracesFields={selectedTracesFields}- setSelectedTracesFields={setSelectedTracesFields}- selectedWidget={selectedWidget}- selectedTime={selectedTime}- requestData={requestData}- setRequestData={setRequestData}- isLoadingPanelData={isLoadingPanelData}- setQueryResponse={setQueryResponse}- enableDrillDown={enableDrillDown}- selectedDashboard={selectedDashboard}- isNewPanel={isNewPanel}- />- )}- </OverlayScrollbar>- </LeftContainerWrapper>-- <RightContainerWrapper>- <RightContainer- setGraphHandler={setGraphHandler}- title={title}- setTitle={setTitle}- description={description}- setDescription={setDescription}- stackedBarChart={stackedBarChart}- setStackedBarChart={setStackedBarChart}- opacity={opacity}- yAxisUnit={yAxisUnit}- columnUnits={columnUnits}- setColumnUnits={setColumnUnits}- bucketCount={bucketCount}- bucketWidth={bucketWidth}- combineHistogram={combineHistogram}- setCombineHistogram={setCombineHistogram}- setBucketWidth={setBucketWidth}- setBucketCount={setBucketCount}- setOpacity={setOpacity}- selectedNullZeroValue={selectedNullZeroValue}- setSelectedNullZeroValue={setSelectedNullZeroValue}- selectedGraph={graphType}- setSelectedTime={setSelectedTime}- selectedTime={selectedTime}- setYAxisUnit={setYAxisUnit}- decimalPrecision={decimalPrecision}- setDecimalPrecision={setDecimalPrecision}- thresholds={thresholds}- setThresholds={setThresholds}- selectedWidget={selectedWidget}- isFillSpans={isFillSpans}- setIsFillSpans={setIsFillSpans}- isLogScale={isLogScale}- setIsLogScale={setIsLogScale}- legendPosition={legendPosition}- setLegendPosition={setLegendPosition}- customLegendColors={customLegendColors}- setCustomLegendColors={setCustomLegendColors}- queryResponse={queryResponse}- softMin={softMin}- setSoftMin={setSoftMin}- softMax={softMax}- setSoftMax={setSoftMax}- contextLinks={contextLinks}- setContextLinks={setContextLinks}- enableDrillDown={enableDrillDown}- isNewDashboard={isNewDashboard}- />- </RightContainerWrapper>+ <ResizablePanelGroup+ direction="horizontal"+ className="widget-resizable-panel-group"+ autoSaveId="panel-editor"+ >+ <ResizablePanel+ minSize={70}+ maxSize={80}+ defaultSize={80}+ className="resizable-panel-left-container"+ >+ <OverlayScrollbar>+ {selectedWidget && (+ <LeftContainer+ selectedDashboard={selectedDashboard}+ selectedGraph={graphType}+ selectedLogFields={selectedLogFields}+ setSelectedLogFields={setSelectedLogFields}+ selectedTracesFields={selectedTracesFields}+ setSelectedTracesFields={setSelectedTracesFields}+ selectedWidget={selectedWidget}+ selectedTime={selectedTime}+ requestData={requestData}+ setRequestData={setRequestData}+ isLoadingPanelData={isLoadingPanelData}+ setQueryResponse={setQueryResponse}+ enableDrillDown={enableDrillDown}+ />+ )}+ </OverlayScrollbar>+ </ResizablePanel>+ <ResizableHandle withHandle className="widget-resizable-handle" />+ <ResizablePanel+ minSize={20}+ maxSize={30}+ defaultSize={20}+ className="resizable-panel-right-container"+ >+ <RightContainer+ setGraphHandler={setGraphHandler}+ title={title}+ setTitle={setTitle}+ description={description}+ setDescription={setDescription}+ stackedBarChart={stackedBarChart}+ setStackedBarChart={setStackedBarChart}+ lineInterpolation={lineInterpolation}+ setLineInterpolation={setLineInterpolation}+ fillMode={fillMode}+ setFillMode={setFillMode}+ lineStyle={lineStyle}+ setLineStyle={setLineStyle}+ showPoints={showPoints}+ setShowPoints={setShowPoints}+ opacity={opacity}+ yAxisUnit={yAxisUnit}+ columnUnits={columnUnits}+ setColumnUnits={setColumnUnits}+ bucketCount={bucketCount}+ bucketWidth={bucketWidth}+ combineHistogram={combineHistogram}+ setCombineHistogram={setCombineHistogram}+ setBucketWidth={setBucketWidth}+ setBucketCount={setBucketCount}+ setOpacity={setOpacity}+ selectedNullZeroValue={selectedNullZeroValue}+ setSelectedNullZeroValue={setSelectedNullZeroValue}+ selectedGraph={graphType}+ setSelectedTime={setSelectedTime}+ selectedTime={selectedTime}+ setYAxisUnit={setYAxisUnit}+ decimalPrecision={decimalPrecision}+ setDecimalPrecision={setDecimalPrecision}+ thresholds={thresholds}+ setThresholds={setThresholds}+ selectedWidget={selectedWidget}+ isFillSpans={isFillSpans}+ setIsFillSpans={setIsFillSpans}+ isLogScale={isLogScale}+ setIsLogScale={setIsLogScale}+ legendPosition={legendPosition}+ setLegendPosition={setLegendPosition}+ customLegendColors={customLegendColors}+ setCustomLegendColors={setCustomLegendColors}+ queryResponse={queryResponse}+ softMin={softMin}+ setSoftMin={setSoftMin}+ softMax={softMax}+ setSoftMax={setSoftMax}+ contextLinks={contextLinks}+ setContextLinks={setContextLinks}+ enableDrillDown={enableDrillDown}+ isNewDashboard={isNewDashboard}+ />+ </ResizablePanel>+ </ResizablePanelGroup></PanelContainer><Modaltitle={diff --git a/frontend/src/container/NewWidget/styles.ts b/frontend/src/container/NewWidget/styles.tsindex d302846c85..c8ead97f79 100644--- a/frontend/src/container/NewWidget/styles.ts+++ b/frontend/src/container/NewWidget/styles.ts@@ -1,4 +1,4 @@-import { Col, Tag as AntDTag } from 'antd';+import { Tag as AntDTag } from 'antd';import styled from 'styled-components';export const Container = styled.div`@@ -8,42 +8,6 @@ export const Container = styled.div`overflow-y: hidden;`;-export const RightContainerWrapper = styled(Col)`- &&& {- max-width: 400px;- width: 30%;- overflow-y: auto;- }- &::-webkit-scrollbar {- width: 0.3rem;- }- &::-webkit-scrollbar-thumb {- background: rgb(136, 136, 136);- border-radius: 0.625rem;- }- &::-webkit-scrollbar-track {- background: transparent;- }-`;--interface LeftContainerWrapperProps {- isDarkMode: boolean;-}--export const LeftContainerWrapper = styled(Col)<LeftContainerWrapperProps>`- &&& {- width: 100%;- overflow-y: auto;- border-right: ${({ isDarkMode }): string =>- isDarkMode- ? '1px solid var(--bg-slate-300)'- : '1px solid var(--bg-vanilla-300)'};- }- &::-webkit-scrollbar {- width: 0rem;- }-`;-export const ButtonContainer = styled.div`display: flex;gap: 8px;diff --git a/frontend/src/lib/uPlotV2/config/UPlotSeriesBuilder.ts b/frontend/src/lib/uPlotV2/config/UPlotSeriesBuilder.tsindex 4875e35c50..30d05e1279 100644--- a/frontend/src/lib/uPlotV2/config/UPlotSeriesBuilder.ts+++ b/frontend/src/lib/uPlotV2/config/UPlotSeriesBuilder.ts@@ -3,14 +3,15 @@ import { generateColor } from 'lib/uPlotLib/utils/generateColor';import { calculateWidthBasedOnStepInterval } from 'lib/uPlotV2/utils';import uPlot, { Series } from 'uplot';+import { generateGradientFill } from '../utils/generateGradientFill';import {BarAlignment,ConfigBuilder,DrawStyle,+ FillMode,LineInterpolation,LineStyle,SeriesProps,- VisibilityMode,} from './types';/**@@ -52,7 +53,7 @@ export class UPlotSeriesBuilder extends ConfigBuilder<SeriesProps, Series> {}: {resolvedLineColor: string;}): Partial<Series> {- const { lineWidth, lineStyle, lineCap, fillColor } = this.props;+ const { lineWidth, lineStyle, lineCap, fillColor, fillMode } = this.props;const lineConfig: Partial<Series> = {stroke: resolvedLineColor,width: lineWidth ?? DEFAULT_LINE_WIDTH,@@ -66,12 +67,26 @@ export class UPlotSeriesBuilder extends ConfigBuilder<SeriesProps, Series> {lineConfig.cap = lineCap;}- if (fillColor) {- lineConfig.fill = fillColor;- } else if (this.props.drawStyle === DrawStyle.Bar) {- lineConfig.fill = resolvedLineColor;+ /**+ * Configure area fill based on draw style and fill mode:+ * - bar charts always use a solid fill with the series color+ * - histogram uses the same color with a fixed alpha suffix for translucency+ * - for other series, an explicit fillMode controls whether we use a solid fill+ * or a vertical gradient from the series color to transparent+ */+ const finalFillColor = fillColor ?? resolvedLineColor;++ if (this.props.drawStyle === DrawStyle.Bar) {+ lineConfig.fill = finalFillColor;} else if (this.props.drawStyle === DrawStyle.Histogram) {- lineConfig.fill = `${resolvedLineColor}40`;+ lineConfig.fill = `${finalFillColor}40`;+ } else if (fillMode && fillMode !== FillMode.None) {+ if (fillMode === FillMode.Solid) {+ lineConfig.fill = finalFillColor;+ } else if (fillMode === FillMode.Gradient) {+ lineConfig.fill = (self: uPlot): CanvasGradient =>+ generateGradientFill(self, finalFillColor, 'rgba(0, 0, 0, 0)');+ }}return lineConfig;@@ -159,12 +174,8 @@ export class UPlotSeriesBuilder extends ConfigBuilder<SeriesProps, Series> {pointsConfig.show = pointsBuilder;} else if (drawStyle === DrawStyle.Points) {pointsConfig.show = true;- } else if (showPoints === VisibilityMode.Never) {- pointsConfig.show = false;- } else if (showPoints === VisibilityMode.Always) {- pointsConfig.show = true;} else {- pointsConfig.show = false; // default to hidden+ pointsConfig.show = !!showPoints;}return pointsConfig;diff --git a/frontend/src/lib/uPlotV2/config/__tests__/UPlotSeriesBuilder.test.ts b/frontend/src/lib/uPlotV2/config/__tests__/UPlotSeriesBuilder.test.tsindex 7b5bc23536..f13cf1ef7d 100644--- a/frontend/src/lib/uPlotV2/config/__tests__/UPlotSeriesBuilder.test.ts+++ b/frontend/src/lib/uPlotV2/config/__tests__/UPlotSeriesBuilder.test.ts@@ -2,12 +2,7 @@ import { themeColors } from 'constants/theme';import uPlot from 'uplot';import type { SeriesProps } from '../types';-import {- DrawStyle,- LineInterpolation,- LineStyle,- VisibilityMode,-} from '../types';+import { DrawStyle, LineInterpolation, LineStyle } from '../types';import { POINT_SIZE_FACTOR, UPlotSeriesBuilder } from '../UPlotSeriesBuilder';const createBaseProps = (@@ -168,17 +163,17 @@ describe('UPlotSeriesBuilder', () => {expect(config.points?.show).toBe(pointsBuilder);});- it('respects VisibilityMode for point visibility when no custom pointsBuilder is given', () => {+ it('respects showPoints for point visibility when no custom pointsBuilder is given', () => {const neverPointsBuilder = new UPlotSeriesBuilder(createBaseProps({drawStyle: DrawStyle.Line,- showPoints: VisibilityMode.Never,+ showPoints: false,}),);const alwaysPointsBuilder = new UPlotSeriesBuilder(createBaseProps({drawStyle: DrawStyle.Line,- showPoints: VisibilityMode.Always,+ showPoints: true,}),);diff --git a/frontend/src/lib/uPlotV2/config/types.ts b/frontend/src/lib/uPlotV2/config/types.tsindex bf3f85d8fc..664c310e14 100644--- a/frontend/src/lib/uPlotV2/config/types.ts+++ b/frontend/src/lib/uPlotV2/config/types.ts@@ -122,12 +122,6 @@ export enum LineInterpolation {StepBefore = 'stepBefore',}-export enum VisibilityMode {- Always = 'always',- Auto = 'auto',- Never = 'never',-}-/*** Props for configuring lines*/@@ -163,7 +157,13 @@ export interface BarConfig {export interface PointsConfig {pointColor?: string;pointSize?: number;- showPoints?: VisibilityMode;+ showPoints?: boolean;+}++export enum FillMode {+ Solid = 'solid',+ Gradient = 'gradient',+ None = 'none',}export interface SeriesProps extends LineConfig, PointsConfig, BarConfig {@@ -177,6 +177,7 @@ export interface SeriesProps extends LineConfig, PointsConfig, BarConfig {show?: boolean;spanGaps?: boolean;fillColor?: string;+ fillMode?: FillMode;isDarkMode?: boolean;stepInterval?: number;}diff --git a/frontend/src/lib/uPlotV2/utils/generateGradientFill.ts b/frontend/src/lib/uPlotV2/utils/generateGradientFill.tsnew file mode 100644index 0000000000..bf742878bd--- /dev/null+++ b/frontend/src/lib/uPlotV2/utils/generateGradientFill.ts@@ -0,0 +1,18 @@+import uPlot from 'uplot';++export function generateGradientFill(+ uPlotInstance: uPlot,+ startColor: string,+ endColor: string,+): CanvasGradient {+ const g = uPlotInstance.ctx.createLinearGradient(+ 0,+ 0,+ 0,+ uPlotInstance.bbox.height,+ );+ g.addColorStop(0, `${startColor}70`);+ g.addColorStop(0.6, `${startColor}40`);+ g.addColorStop(1, endColor);+ return g;+}diff --git a/frontend/src/types/api/dashboard/getAll.ts b/frontend/src/types/api/dashboard/getAll.tsindex 5862b53bdf..c55dd2a31c 100644--- a/frontend/src/types/api/dashboard/getAll.ts+++ b/frontend/src/types/api/dashboard/getAll.ts@@ -5,6 +5,11 @@ import { PANEL_GROUP_TYPES, PANEL_TYPES } from 'constants/queryBuilder';import { ThresholdProps } from 'container/NewWidget/RightContainer/Threshold/types';import { timePreferenceType } from 'container/NewWidget/RightContainer/timeItems';import { QueryTableProps } from 'container/QueryTable/QueryTable.intefaces';+import {+ FillMode,+ LineInterpolation,+ LineStyle,+} from 'lib/uPlotV2/config/types';import { Query } from 'types/api/queryBuilder/queryBuilderData';import { IField } from '../logs/fields';@@ -132,6 +137,10 @@ export interface IBaseWidget {legendPosition?: LegendPosition;customLegendColors?: Record<string, string>;contextLinks?: ContextLinksData;+ lineInterpolation?: LineInterpolation;+ showPoints?: boolean;+ lineStyle?: LineStyle;+ fillMode?: FillMode;}export interface Widgets extends IBaseWidget {query: Query;diff --git a/frontend/yarn.lock b/frontend/yarn.lockindex 61dd6a46ca..4b19935d89 100644--- a/frontend/yarn.lock+++ b/frontend/yarn.lock@@ -5646,7 +5646,7 @@tailwind-merge "^2.5.2"tailwindcss-animate "^1.0.7"-"@signozhq/toggle-group@^0.0.1":+"@signozhq/[email protected]":version "0.0.1"resolved "https://registry.yarnpkg.com/@signozhq/toggle-group/-/toggle-group-0.0.1.tgz#c82ff1da34e77b24da53c2d595ad6b4a0d1b1de4"integrity sha512-871bQayL5MaqsuNOFHKexidu9W2Hlg1y4xmH8C5mGmlfZ4bd0ovJ9OweQrM6Puys3jeMwi69xmJuesYCfKQc1g==