grafana-diagram: Diagram from URL does not load

When using a diagram URL, the error _this.substituteHashPrefixedNotation is not a function is thrown. (Full stack trace below.) This causes the diagram to never be displayed. If you visit the URL manually and copy-paste the text into the content field, it loads fine. As per the documentation, the URL returns a text/plain string.

I’m running version 1.4.4, cloned directly from this repo. (commit: 440689793ab6da82019c5ee43b49438dfef976d5)

Stack Trace:

TypeError: _this.substituteHashPrefixedNotation is not a function (vendor.2305a8e1d478628b1297.js:43)
    at DiagramCtrl.updateDiagram_cont (diagramControl.js:292)
    at successCallback (diagramControl.js:317)
    at u (vendor.2305a8e1d478628b1297.js:43)
    at vendor.2305a8e1d478628b1297.js:43
    at f.$digest (vendor.2305a8e1d478628b1297.js:43)
    at f.$apply (vendor.2305a8e1d478628b1297.js:43)
    at vendor.2305a8e1d478628b1297.js:43
    at i (vendor.2305a8e1d478628b1297.js:43)
    at vendor.2305a8e1d478628b1297.js:43 "Possibly unhandled rejection: {}"

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 22 (5 by maintainers)

Most upvoted comments

Thank you very much for the fix! I’m excited to start using it.

I think if a cache was added it would need to be configurable. My use case for using a URL is that the diagram layout changes regularly. A cache would make it no better than a hard-coded diagram.

Something like what grafana does with template vars could be okay though Refresh:

  • Never
  • On Dashboard Load
  • On Time Range Change

I have the fix ready and tested with remote urls and local diagrams. I noticed the remote diagrams was not populating the node colors, that’s been fixed also.

A cache mechanism would be useful for the URL method too to prevent pulling the mermaid file on every refresh.

Not sure if related, but will leave this here for anyone else that may encounter this.

It looks like there is a bug when you’re using the url section, if you don’t have any graphs defined in the content section, then it fails to load and render the contents from the url. Once I added some dummy data into the content section, then switched back to url it works fine.

Plugin Version: 1.6.2, Grafana Version: 6.5.3

Hi,

I am just new with grafana and your diagram… i faced the same issue with the latest version 1.6.1 with grafana v6.6.1.

Thanks