From 3edd2257a2c21416ed98ca30cb1cd4a417b8f59e Mon Sep 17 00:00:00 2001 From: Andy McHugh Date: Wed, 14 Feb 2024 17:24:35 +0000 Subject: [PATCH] non dataframe support This calls toDataFrame on all incoming data to standardize it. It also adds a simple bespoke logo in place of the default one. Increments version to 1.0.1 --- package.json | 2 +- src/components/FlowPanel.tsx | 5 +++-- src/img/logo.svg | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 23e14f8..a020c76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flow", - "version": "1.0.0", + "version": "1.0.1", "description": "Svg flowchart visualization", "scripts": { "build": "webpack -c ./webpack.config.ts --env production", diff --git a/src/components/FlowPanel.tsx b/src/components/FlowPanel.tsx index 7ee249b..f8e9405 100644 --- a/src/components/FlowPanel.tsx +++ b/src/components/FlowPanel.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react'; import { css, cx } from '@emotion/css'; import { useStyles2, useTheme2 } from '@grafana/ui'; import { getTemplateSrv } from '@grafana/runtime'; -import { GrafanaTheme2, PanelProps } from '@grafana/data'; +import { GrafanaTheme2, PanelProps, toDataFrame } from '@grafana/data'; import { FlowOptions, TroubleshootingCtrs } from '../types'; import { configInit, Link, panelConfigFactory, PanelConfig, siteConfigFactory, SiteConfig } from 'components/Config'; import { loadSvg, loadYaml } from 'components/Loader'; @@ -111,7 +111,8 @@ export const FlowPanel: React.FC = ({ options, data, width, height, timeZ const templateSrv = getTemplateSrv(); const timeMin = Number(templateSrv.replace("${__from}")); const timeMax = Number(templateSrv.replace("${__to}")); - let tsData = seriesTransform(data.series, timeMin, timeMax); + const dataFrames = data.series ? data.series.map((item) => toDataFrame(item)) : []; + let tsData = seriesTransform(dataFrames, timeMin, timeMax); if (options.testDataEnabled) { seriesExtend(tsData, timeMin, timeMax); diff --git a/src/img/logo.svg b/src/img/logo.svg index 3d284de..2d2b525 100644 --- a/src/img/logo.svg +++ b/src/img/logo.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + +
 3 pps
 3 pps
Example tooltip for the Inbox Depth. These are defined inside the SVG. From draw.io select the widget -> Edit -> Edit TooltipExample tooltip for the Inbox Depth. These are defined inside the SVG. From draw.io select the widget -> Edit -> Edit Tooltip
Inbox Depth
12
Inbox Depth...
Active Workers
234
Active Workers...
Transactions
820 ops
Transactions...
Text is not SVG - cannot display
\ No newline at end of file