Problem/Motivation
I'd like to be able to automatically generate something like a tag cloud or a word cloud using data derived from Drupal content. It seems that a few of the supported chart libraries offer this kind of functionality, but it doesn't seem to be exposed in the Drupal module UI anywhere?
I also can't seem to find docs that might help with further augmenting the Charts module to make use of these library-specific kinds of features, or how to add other code to these main libraries that are already supported. For example, I'd like to somehow incorporate this D3 library:
https://github.com/jasondavies/d3-cloud
As Charts seems to support C3/D3, it seems that this might be within reach, but not sure how to proceed?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | highcharts_wordcloud.png | 180.04 KB | andileco |
Comments
Comment #2
bluegeek9 commentedI think this would need to be a separate module extending charts with an additional chart type.
Comment #3
andileco commentedI'm going to close this, because I agree a custom module is the best solution for this for now. However, here's how you could do this:
MY_MODULE.info.yml
MY_MODULE.libraries.yml
MY_MODULE.module
MY_MODULE.charts_types.yml
MY_MODULE.routing.yml
src/Controller/MyModule.php
Comment #4
andileco commentedAdded a HowTo page: https://www.drupal.org/docs/8/modules/charts/charts-howtos-0/51x-extend-...
Comment #5
bluegeek9 commentedI am interested in making a Word cloud module using chartjs and the wordcloud library.
https://www.npmjs.com/package/chartjs-chart-wordcloud
What should the machine name be charts_chartjs_wordcloud ? I want to be consistent with the charts ecosystem.
Comment #6
andileco commentedWe don't have a convention for charts_library_type, but we do for charts_library_extendedfeature. Check out how Highcharts is handling additional files (JS modules) and the relatively new library+type method. We might not need a separate module.
Comment #7
andileco commentedClosing this. @bluegeek9 - if you end up building that module, please link to it from here.