07_Choropleth_World_Map - export image from generic javascript view

Hello,

Can anyone help with the code needed to get an image out of the example 07_​Choropleth_​World_​Map workflow that I can send to a Birt report (the workflow uses google charts to create the map)? I’m not a coder and so I haven’t a clue where to begin. Any help would be much appreciated.

R.

p.s. I discovered Knime a couple of months ago and it’s AWESOME! Not being a data scientist or coder, my self-taught workflows look like they were built by Heath Robinson but they work.

2 Likes

Hi @Rich_ard

I forwarded this to my colleagues that have experience with the JS node.
They are currently not available but will come back to you in the next couple of days/next week.

Best,
Martyna

Hi Martyna,

Thanks so much for following this up.

Richard

Hello,

Just wondered if there was any advice on this?

Thanks,

Richard

Hi @Rich_ard,

I am sorry you had to wait for that long to get some answers here.

Unfortunately, I don’t have good news. The Maps library used to generate the image doesn’t play nicely with the Apache Commons library we use to parse our SVG images for the image output port. For this example generating an image using the node is not possible.

Sorry for not having better news here!

Best,
Martyna

Hi Martyna

That’s a pity, but thank you for looking into it and getting back to me.

Richard

1 Like

Just ran into this problem myself and tried to understand it better. The SVG generated by the Google Charts API contains XML elements and attributes not accepted by Batik, which is the SVG parser KNIME is using. This, however, can be fixed on the JS side like so:
svgElement.querySelectorAll('g').forEach(b=>b.removeAttribute('clip-path'));

I created a small example, which is available on the KNIME Hub.

3 Likes