Skip to content

Commit

Permalink
non dataframe support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
andymchugh committed Feb 14, 2024
1 parent cb8efef commit 3edd225
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/components/FlowPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -111,7 +111,8 @@ export const FlowPanel: React.FC<Props> = ({ 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);
Expand Down
5 changes: 4 additions & 1 deletion src/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3edd225

Please sign in to comment.