Skip to content
Snippets Groups Projects
Commit d212c18d authored by florenttorregrosa's avatar florenttorregrosa Committed by Daniel Cothran
Browse files

Issue #2879200 by Grimreaper, andileco: Improve installation of JS chart libraries

parent cb48f3ce
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,38 @@ Using Composer:
There are numerous tutorials on Drupal.org and elsewhere on the web if you are
looking for more information about how to use Composer with Drupal 8.
Using Composer and wikimedia/composer-merge-plugin:
1: Ensure that you have the 'wikimedia/composer-merge-plugin` package installed.
2: Ensure that you have the `oomphinc/composer-installers-extender` package
installed.
3: Add an "installer-types" section in the "extra" of your project composer.json
file, make sure you have "bower-asset" and "npm-asset" listed.
For example:
"installer-types": [
"bower-asset",
"npm-asset"
],
4: In the "installer-paths" section in the "extra" of your project composer.json
file, ensure you have an the types drupal-library, bower-asset, and npm-asset.
For example:
"web/libraries/{$name}": [
"type:drupal-library",
"type:bower-asset",
"type:npm-asset"
],
5: Add a "merge-plugin" section in the "extra" of your project composer.json
file, so that the composer.json file of the sub-modules you want is included.
For example:
"merge-plugin": {
"include": [
"web/modules/contrib/charts/modules/charts_highcharts/composer.json"
]
},
6: Run 'composer install' or 'composer update' or the 'composer require'
Creating Charts in the UI
-------------------------
......
{
"name": "drupal/charts_c3",
"description": "Charts module integration with C3 Charts.",
"type": "drupal-module",
"homepage": "http://drupal.org/project/charts",
"support": {
"issues": "https://www.drupal.org/project/issues/charts"
},
"license": "GPL-2.0+",
"require": {
"bower-asset/c3": "0.4.*",
"bower-asset/d3": "3.5.*"
},
"repositories": {
"asset-packagist": {
"type": "composer",
"url": "https://asset-packagist.org"
}
}
}
{
"name": "drupal/charts_google",
"description": "Charts module integration with Google Charts.",
"type": "drupal-module",
"homepage": "http://drupal.org/project/charts",
"support": {
"issues": "https://www.drupal.org/project/issues/charts"
},
"license": "GPL-2.0+",
"require": {
"google/charts": "45"
},
"repositories": {
"google_charts": {
"type": "package",
"package": {
"name": "google/charts",
"version": "45",
"type": "drupal-library",
"extra": {
"installer-name": "google_charts"
},
"dist": {
"url": "https://www.gstatic.com/charts/loader.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
}
}
}
{
"name": "drupal/charts_highcharts",
"description": "Charts module integration with Highcharts library.",
"type": "drupal-module",
"homepage": "http://drupal.org/project/charts",
"support": {
"issues": "https://www.drupal.org/project/issues/charts"
},
"license": "GPL-2.0+",
"require": {
"highcharts/3d": "6.0.4",
"highcharts/accessibility": "6.0.4",
"highcharts/export-data": "6.0.4",
"highcharts/exporting": "6.0.4",
"highcharts/highcharts": "6.0.4",
"highcharts/more": "6.0.4"
},
"repositories": {
"highcharts": {
"type": "package",
"package": {
"name": "highcharts/highcharts",
"version": "6.0.4",
"type": "drupal-library",
"extra": {
"installer-name": "highcharts"
},
"dist": {
"url": "https://code.highcharts.com/6.0.4/highcharts.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
},
"highcharts_3d": {
"type": "package",
"package": {
"name": "highcharts/3d",
"version": "6.0.4",
"type": "drupal-library",
"extra": {
"installer-name": "highcharts_3d"
},
"dist": {
"url": "https://code.highcharts.com/6.0.4/highcharts-3d.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
},
"highcharts_accessibility": {
"type": "package",
"package": {
"name": "highcharts/accessibility",
"version": "6.0.4",
"type": "drupal-library",
"extra": {
"installer-name": "highcharts_accessibility"
},
"dist": {
"url": "https://code.highcharts.com/6.0.4/modules/accessibility.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
},
"highcharts_export_data": {
"type": "package",
"package": {
"name": "highcharts/export-data",
"version": "6.0.4",
"type": "drupal-library",
"extra": {
"installer-name": "highcharts_export-data"
},
"dist": {
"url": "https://code.highcharts.com/6.0.4/modules/export-data.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
},
"highcharts_exporting": {
"type": "package",
"package": {
"name": "highcharts/exporting",
"version": "6.0.4",
"type": "drupal-library",
"extra": {
"installer-name": "highcharts_exporting"
},
"dist": {
"url": "https://code.highcharts.com/6.0.4/modules/exporting.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
},
"highcharts_more": {
"type": "package",
"package": {
"name": "highcharts/more",
"version": "6.0.4",
"type": "drupal-library",
"extra": {
"installer-name": "highcharts_more"
},
"dist": {
"url": "https://code.highcharts.com/6.0.4/highcharts-more.js",
"type": "file"
},
"require": {
"composer/installers": "~1.0"
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment