Is it possible in community visualization that I have one Javascript visualization file that contains multiple charts implementation and shared in central location in google cloud and that shared file could be used by multiple charts? If it is possible how can I do it in community visualization?

2

There are 2 best solutions below

0
On

If all of your visualizations share the exact same JavaScript, you can have the same "js" referenced in each of your resource listings in the manifest. However, there's not a good way for you to differentiate what code from the "main" file runs in each chart, so I recommend that you have a single, separate JavaScript file per chart.

0
On

I think if this "main" file depends on a style setting, this could very well possible.

Example: Create a drop-down with several options: * Bar chart * Line chart * Area chart

And depending on the choice a different part of your JS file is executed.

This might actually be more efficient than loading three graphics into DS, because most likely the biggest part of your JS file is D3 or any other dependency.

Only your script becomes more complex to maintain.