Closed yanisbinks closed 1 month ago
Cut down your svg and yaml to a minimal example. Use test data in your yaml. See if the debugging mappings explains the problem. If not post the minimal svg and yaml here and I can have a look
Hello. I have same question. It's not clear how to associate the data from the request with the SVG ID.
Sorry. I haven't finished reading the instructions. there is a description of how to do it, but when I added a time series panel called "test-flow" as a query and then changed 'db_transactions: dataRef: "test-data-large-sin"' to 'db_transactions: dataRef: "test-flow"' in the file "panel config" , nothing changed in the panel. How do I make it work? SVG file: https://raw.githubusercontent.com/andymchugh/andrewbmchugh-flow-panel/main/examples/darkThemeSvg1.svg Panel Config : https://raw.githubusercontent.com/mvadim85/grafana/refs/heads/master/panelConfig1.yaml
@yanisbinks Did u find the problem because i have the exact same problem.
@yanisbinks Did u find the problem because i have the exact same problem.
Hello no i still havnt found the solution
I'm happy to fix problems with the plugin or help people get going where they are finding it hard to follow the docs. But the starting point has to be a minimal coherent example. In this issue people are having trouble getting a data source to drive a cell. So a usable example would be the example1 svg and yaml with one of the yaml dataRefs changed over to your data source and a paste of what the Mappings and Data buttons dump to the console. If you want to speed up help more, then cut down the example1 svg and yaml to something minimal, i.e. just one widget in the svg and one cell in the yaml, that works with test data, but doesn't when changed to your data source. That way the Mappings and Data console dumps will be small and readable.
With what you've each posted so far, there is no way to help.
Hello here is my svg : dsd.txt And here's my YAML yamlrules.txt Here's what i get when i click on mapping : Debugging Mappings: abstract: Array [ "id=test, svgCellId=cell-test, dataRef=probe_success{instance='192.168.210.37'}" ] 0: "id=test, svgCellId=cell-test, dataRef=probe_success{instance='192.168.210.37'}" length: 1
ok, there's a few things that are wrong with your set of data but what really stands out is you must be changing many things at a time and expecting to be able to make it work. In this panel you've got to tie together svg -> yaml -> data-source and you'll only be able to do that if you just change one thing at a time . The moment you start changing many things you'll get lost.
As I understand it you are trying to get your data-source to feed into your picture. So you should be starting with the example-svg and the example-yaml and getting your data-source driving one of the cells in that working example using the Data and Mappings to understand how your datasource is named in the grafana dataframe that's given to the plugin. Once you understand how your queries feed into the panel you can start changing out the picture and yaml, one piece at a time.
Given what you've attached the following problems jump out:
Put all those things together and this adjusted yaml, driven off of test-data correctly drives the fillColor of the rect.
---
gradientMode: "hue"
cellIdPreamble: "cell-"
cells:
test:
dataRef: "test-data-small-cos"
label:
separator: "cr"
units: "none"
decimalPoints: 0
fillColor:
thresholds:
- {color: "green", level: 50}
- {color: "orange", level: 100}
- {color: "red", level: 200}
Does that give you enough to explore further? Can we close this out?
Thanks a lot for your help and work on that plugin I know where to look now, we can close the issue
Hello I am using Prometheus to monitor the switches on my network. I can set SVG IDs for my switches, but I’m having trouble figuring out how to make them change color (green if they’re up, red if they’re down).
How can I link the SVG IDs with a Prometheus query to achieve this?
Thanks in advance for your help!