Extending WorldMap plugin


#1

Hi,
I am quite new to Grafana, but it seems like a powerful tool.
I have connected the WorldMap with my data in PostgreSql with success.
We are in the beginning phase of evaluating what system to use for our metric data and one of my concerns is the flexibility of the map i Grafana.

With my limited knowledge of building/extending plugins I expected to find a grunt file in github, but none exists.
How do I build what I have extended the WorldMap with to test it?

Thanks,
Helge


#2

the worldmap plugin is using webpack and yarn, take a look at the package.json file in the section “scripts”.

you’ll need to do a “yarn install” (to install packages into node_modules" and “yarn build” to build the plugin.
“yarn dev” can be used to have it recompile when you make changes.
“yarn test” for jest-based testing.

Here’s what is in the package.json

"scripts": {
    "build": "node --max-old-space-size=8192 ./node_modules/.bin/webpack --config webpack.config.prod.js",
    "dev": "webpack --mode development",
    "watch": "webpack --mode development --watch",
    "test": "jest --config jest.config.js"
  },

#3

Thanks, as you understand I am pretty new to this.

I have been able to modify the Worldmap panel, rebuild it, build a new docker image with this new plugin and run the docker image. The new plugin I get is my plugin - Great!

-helge