Closed peishaofeng closed 2 years ago
Thank you for this PR! DataFrames support is a long-awaited feature.
I've got some findings about data frames and Grafana versions (not precise, sorry):
@grafana/data
module appears in plugins with migration to PanelEvents
.import @grafana/data
make plugin not working in Grafana <=6.3. It is not possible to check if module is not injected and change plugin behavior for that older versions.How these facts affect your PR?
this.useDataFrames = true
and remove onDataReceived.PanelEvents
and CoreEvents
from @grafana/data, no need to fallback to string-based events. Remove all Polygrafill hackery: fallbackToStringEvents
, ./util/grafana/events
, etc.Do you have time to make these changes?
Yes, I'd like to be of help to make this panel plugin better. Also need to prepare both v6 & v7 environment to verify modification, next week should have spare time to do further optimization as you mentioned above.
submit changes according your suggestion, the same plugin build are verified on v6.7.1/v7.4.2/v8.2.5
1. convert DataFrame to series list
useDataFrames
for version > v7.0DataProcessor
to convert query result in type of DataFrame to series list(TimeSeries2)dataFramesReceived
& dataSnapshotLoad
for DataFrame type2. remove string-based events polyfill
fallbackToStringEvents
statusmap
Grafana v6.* has built-in graphHover
and graphHoverClear
defined which cause event name conflict with self-defined events.
3. move renderComplete to utils/grafana/events/events.ts
utils/grafana/events/events.ts
4. fix prettier warnings
arrowParens
warning5. README.md
6. plugin.json
"dependencies": {
"grafanaDependency": ">=6.7.0",
"grafanaVersion": "6.7+",
"plugins": [ ]
}
Overview
~8.2.5
What this PR does / why we need it
To fix issue #227 Empty results in status map panel post grafana version upgrade from v7.4 to v8.1. #227
Special notes for your reviewer
1. auto-convert data format according Grafana version
on v7 keep existing data format, no conversion.
on v8 made changes below:
I have verified the same plugin package build on both Grafana v8.0.6 and v7.4.2, it works fine.
2. SDK 8.3.0 report fail
@grafana SDK 8.3.0 report error, so i use 8.2.5 instead
Does this PR introduce a user-facing change?