Skip to content

Commit

Permalink
Merge pull request #421 from Esri/chore/arcgis-rest-external
Browse files Browse the repository at this point in the history
treat arcgis-rest-js libraries as external
  • Loading branch information
tomwayson authored Mar 30, 2018
2 parents fe6a99e + 02249d9 commit 7f94401
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ You can load Cedar and its dependencies by including script tags that point to t
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<!-- in this case, we only need bar charts, so we'll load the appropriate amCharts script -->
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<!-- load the arcgis-rest-js scripts -->
<script src="https://unpkg.com/@esri/[email protected]/dist/umd/arcgis-rest-request.umd.js"></script>
<script src="https://unpkg.com/@esri/[email protected]/dist/umd/arcgis-rest-feature-service.umd.js"></script>
<!-- optionally load an amcharts theme; cedar provides a calcite theme -->
<script src="https://unpkg.com/@esri/cedar/dist/umd/themes/amCharts/calcite.js"></script>
<!-- load cedar -->
Expand Down Expand Up @@ -155,7 +158,7 @@ To run tests continually for any package as you update it's soruce code, `cd` in

### Dependencies

Cedar currently uses the [amCharts JavaScripts Charts](https://www.amcharts.com/javascript-charts/) library as it's charting engine. You will need to include this along with cedar in your application.
Cedar is a very thin wrapper around other libraries that do the heavy lifting. Cedar uses the [amCharts JavaScripts Charts](https://www.amcharts.com/javascript-charts/) library as it's charting engine. Cedar also uses [@esri/arcgis-rest-feature-service](https://esri.github.io/arcgis-rest-js/api/feature-service/) and [@esri/arcgis-rest-request](https://esri.github.io/arcgis-rest-js/api/request/) to query feature data. You will need to include these libraries along with cedar in your application. If you [install cedar using npm or yarn](#installing-cedar) these libraries will be installed for you, but you will have to make sure that your module bundler can resolve and include them in your application. If you are loading cedar from the CDN, please refer to the [loading cedar](#loading-cedar) section above for the `<script>` tags that you will need to include.

Cedar supports the [same browsers as ArcGIS Online](https://doc.arcgis.com/en/arcgis-online/reference/browsers.htm), however you may need to include polyfills for [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) and [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), if your application has to support browers that don't support [fetch](https://caniuse.com/#search=fetch) or [Promise](https://caniuse.com/#search=promise) (i.e. IE or older versions of Safari/Android).

Expand Down
3 changes: 3 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ <h3>Chart Type</h3>
<!-- optioinally load the amcharts plugin to export the chart as and image or table -->
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<!-- load the arcgis-rest-js scripts -->
<script src="https://unpkg.com/@esri/[email protected]/dist/umd/arcgis-rest-request.umd.js"></script>
<script src="https://unpkg.com/@esri/[email protected]/dist/umd/arcgis-rest-feature-service.umd.js"></script>
<!-- optionally load calcite theme -->
<script src="./scripts/themes/amCharts/calcite.js"></script>
<!-- load cedar -->
Expand Down
4 changes: 4 additions & 0 deletions packages/cedar-amcharts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Changed
- treat arcgis libraries as external

## [1.0.0-beta.3]
### Added
- legend.position determines the location (top, bottom, right, left) of a chart legend
Expand Down
4 changes: 4 additions & 0 deletions packages/cedar/profiles/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default {
entry: 'dist/esm/index.js',
moduleName: 'cedar',
format: 'umd',
external: ['@esri/arcgis-rest-feature-service'],
globals: {
'@esri/arcgis-rest-feature-service': 'arcgisRest'
},
// NOTE: using node resolve to bundle an older version of deepmerge
// if we move to latest, we _may_ want to make that external instead
plugins: [json(), resolve()],
Expand Down

0 comments on commit 7f94401

Please sign in to comment.