algenty / grafana-flowcharting

Flowcharting, plugin for Grafana to create complexe visio's draws style like technical architectures, floorplan, diagrams, hierarchical schema based on draw.io
Apache License 2.0
973 stars 148 forks source link

Problem with regex in text Mapping #365

Open pico977 opened 2 years ago

pico977 commented 2 years ago

Hi, I am making a panel and I need to change the label text of a connector. I made the model with draft.io, and the label is set with the text "GE":

<mxCell id="myID_10" value="GE" ...

So I made a rule to change the content of the label, and this works. The value represented in the label can be negative or positive, and I want the connector color to change based on the sign. I configured a threshold with condition "value" set to "/.-./" and then I configured the "color mapping" and this also works fine. The last step is to represent the absolute value of the number in the label. I thought about using the "Label / text Mappings" function:

WHAT: myID_10 WHEN: When Metric Displayed HOW: Substring WITH: /[^-]/

But this doesn't work! Do you have any suggestions?