Skip to content

Commit fe6a99e

Browse files
committed
v1.0.0-beta.3
1 parent 3f7dcd3 commit fe6a99e

File tree

6 files changed

+42
-63
lines changed

6 files changed

+42
-63
lines changed

README.md

Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,10 @@ You can load Cedar and its dependencies by including script tags that point to t
4141
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
4242
<!-- in this case, we only need bar charts, so we'll load the appropriate amCharts script -->
4343
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
44-
<!-- optionally load an amcharts theme -->
45-
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
44+
<!-- optionally load an amcharts theme; cedar provides a calcite theme -->
45+
<script src="https://unpkg.com/@esri/cedar/dist/umd/themes/amCharts/calcite.js"></script>
4646
<!-- load cedar -->
4747
<script src="https://unpkg.com/@esri/cedar/dist/umd/cedar.js"></script>
48-
<script>
49-
var chart = new cedar.Chart({"type":"bar"});
50-
</script>
5148
```
5249

5350
If you need to use other chart types, or want to use amCharts plugins, load the appropriate amCharts scripts before loading cedar:
@@ -63,43 +60,19 @@ If you need to use other chart types, or want to use amCharts plugins, load the
6360
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
6461
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
6562
```
66-
<!-- TODO: JSAPI example -->
67-
<!--
68-
If you're using cedar with the [ArcGIS API for JavaScript](developers.arcgis.com/javascript/), you can declare packages for Cedar and its dependencies so that they can be loaded by Dojo's AMD loader:
63+
64+
### Using Cedar
65+
66+
Once cedar is loaded you can create and show the chart at a designated element. First create the element:
6967

7068
```html
71-
<link rel="stylesheet" href="https://js.arcgis.com/3.19/esri/css/esri.css">
72-
<script>
73-
window.dojoConfig = {
74-
async: true,
75-
packages: [
76-
{
77-
name: 'amCharts',
78-
location: 'https://www.amcharts.com/lib/3',
79-
main: 'amcharts'
80-
}, {
81-
name: 'cedar',
82-
location: 'https://unpkg.com/@esri/cedar/dist/umd/',
83-
main: 'cedar'
84-
}
85-
]
86-
};
87-
</script>
88-
<script src="https://js.arcgis.com/3.22/"></script>
89-
<script>
90-
require(['amCharts', 'cedar', 'amCharts/serial'], function(AmCharts, cedar) {
91-
var chart = new cedar.Chart({"type": "bar"});
92-
...
93-
});
94-
</script>
69+
<div id="chart" style="height: 400px;"></div>
9570
```
96-
-->
9771

98-
### Using Cedar
72+
Then add a script that will configure cedar and render the chart:
9973

100-
Once cedar is loaded you can create and show the chart at a designated element as follows:
101-
102-
```js
74+
```html
75+
<script>
10376
// connect to the data
10477
var datasets = [{
10578
"url": "https://services.arcgis.com/uDTUpUPbk8X8mXwl/arcgis/rest/services/Public_Schools_in_Onondaga_County/FeatureServer/0",
@@ -122,56 +95,57 @@ Once cedar is loaded you can create and show the chart at a designated element a
12295
"source": "schools"
12396
}];
12497
125-
// optinally override any of the cart type's default styles
98+
// optionally override any of the cart type's default styles
12699
var overrides = {
127100
"categoryAxis": {
128101
"labelRotation": -45
129102
}
130103
}
131104
132105
//create a cedar chart using the known 'bar' type
133-
var chart = new cedar.Chart({"type": "bar"})
106+
var elementId = 'chart';
107+
var chart = new cedar.Chart(elementId, {"type": "bar"})
134108
.datasets(datasets)
135109
.series(series)
136110
.overrides(overrides);
137111
138112
// render the chart
139-
var elementId = 'chart';
140-
chart.show(elementId);
113+
chart.show();
114+
</script>
141115
```
142116

143-
<!-- See the [tutorial](http://esri.github.io/cedar/tutorial) to learn more. -->
144-
145-
<!-- TODO: demos -->
146-
<!--
147117
## Demos
148118

149-
Here is are [an extensive set of demos](http://esri.github.io/cedar/examples) showing the concepts of Cedar.
150-
-->
119+
See [this code pen](https://codepen.io/tomwayson/pen/paxgeO) to try creating a simple bar chart like the one above.
120+
121+
You can then [see and modify the definitions for different types of charts](http://cedar-v1.surge.sh/).
122+
123+
You can also see how to use cedar with an ArcGIS API for JavaScript map in these examples:
124+
- [A chart that aggregates map data](https://codepen.io/tomwayson/pen/YaKGjZ)
125+
- [A chart using layer features as inline data](https://codepen.io/tomwayson/pen/mxdVqO)
151126

152127
## Components of a Cedar Chart
153128

154129
Cedar charts are defined by the following ingredients:
155130

156131
- an array of `datasets`, each has, either:
157-
- a `url` to an ArcGIS Feature Layer along with optional `query` parameters;
158-
- ...or `data` can be an array of inline features
159-
- an array of `series` that bind the Feature Layer attributes to bars, lines, points, etc on the chart
132+
- a `url` to an ArcGIS feature yayer along with optional `query` parameters;
133+
- ...or inline `data`, which can be a [feature set](https://esri.github.io/arcgis-rest-js/api/common-types/IFeatureSet/), or an array of [features](https://esri.github.io/arcgis-rest-js/api/common-types/IFeature/) or [POJO](http://blog.dreasgrech.com/2012/02/creating-pojos-in-javascript.html)s
134+
- an array of `series` that bind the data to the bars, lines, points, etc on the chart
160135
- and `overrides` are specific modifications to the cart type's default styles
161136

162137
<!-- TODO: API docs -->
163138
<!-- See the [API documentation](http://esri.github.io/cedar/api) for further details. -->
164139

165140
### Development Instructions
166141

167-
This repository is a monoreop managed using [lerna](https://github.com/lerna/lerna)
142+
This repository is a monorepo managed using [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) and [lerna](https://github.com/lerna/lerna)
168143

169144
1. Fork this repository and clone 'cedar' locally
170145
1. `cd` into the `cedar` folder
171-
1. Install the dependencies with `yarn`
146+
1. Install the dependencies and initialize the monorepo with `yarn`
172147
1. to run the docs site locally, start a web server at the root folder and visit `/docs`
173-
1. to rebuild the script files used by the docs page whenver the source code is updated, run `yarn`
174-
1. Create a [pull request](https://help.github.com/articles/creating-a-pull-request)
148+
1. to rebuild the script files used by the docs page whenever the source code is updated, run `yarn start`
175149

176150
### Tests
177151

@@ -203,7 +177,7 @@ For more information on SemVer, please visit <http://semver.org/>.
203177

204178

205179
### Licensing
206-
Copyright 2017 Esri
180+
Copyright 2018 Esri
207181

208182
Licensed under the Apache License, Version 2.0 (the "License");
209183
you may not use this file except in compliance with the License.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
],
66
"npmClient": "yarn",
77
"useWorkspaces": true,
8-
"version": "1.0.0-beta.2"
8+
"version": "1.0.0-beta.3"
99
}

packages/cedar-amcharts/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
## Unreleased
6+
## [1.0.0-beta.3]
77
### Added
88
- legend.position determines the location (top, bottom, right, left) of a chart legend
99
### Changed
1010
- legend.enable is now legend.visible
1111
- Text colors have been changed to pass color contrast ratio on white backgrounds
1212
- Pie charts default to legend off and inner radius 0
1313
- updated tests and added mocks for 100% code coverage
14+
- using yarn workspaces for monorepo
1415
### Fixed
1516
- Specifications that are passed in are actually supported
1617

packages/cedar-amcharts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@esri/cedar-amcharts",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0-beta.3",
44
"description": "amCharts engine for @esri/cedar",
55
"files": [
66
"dist"

packages/cedar/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
## [Unreleased]
6+
## [1.0.0-beta.3]
77
### Added
88
- One can now inline data as an array of attributes or array of objects
99
### Changed
1010
- use @esri/arcgis-rest-feature-service and remove query functions
1111
- updated tests and added mocks for 100% code coverage
12+
- using yarn workspaces for monorepo
13+
- added links for codepens for working with maps, etc to README
1214
### Fixed
1315
- remove extraneous dependency on amcharts in @esri/cedar
1416
- Specifications that are passed in are actually supported
1517
- fixed join logic so that records weren't getting assigned to wrong category
18+
- fixed Using Cedar instructions in the README
1619

1720
## [1.0.0-beta.2]
1821
### Fixed
@@ -224,7 +227,8 @@ Baseline version.
224227
- Basic interaction events: on, off, clicked
225228
- Map to Chart interaction demos
226229

227-
[Unreleased]: https://github.com/Esri/cedar/compare/v1.0.0-beta.2...master
230+
[Unreleased]: https://github.com/Esri/cedar/compare/v1.0.0-beta.3...master
231+
[1.0.0-beta.3]: https://github.com/Esri/cedar/compare/v1.0.0-beta.2...v1.0.0-beta.3
228232
[1.0.0-beta.2]: https://github.com/Esri/cedar/compare/v1.0.0-beta.1...v1.0.0-beta.2
229233
[1.0.0-beta.1]: https://github.com/Esri/cedar/compare/v1.0.0-beta.0...v1.0.0-beta.1
230234
[1.0.0-beta.0]: https://github.com/Esri/cedar/compare/v1.0.0-alpha.7...v1.0.0-beta.0

packages/cedar/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@esri/cedar",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0-beta.3",
44
"description": "Visualization framework for the ArcGIS Platform",
55
"files": [
66
"dist"
@@ -64,9 +64,9 @@
6464
},
6565
"dependencies": {
6666
"@esri/arcgis-rest-common-types": "^1.1.1",
67-
"@esri/arcgis-rest-request": "^1.1.1",
6867
"@esri/arcgis-rest-feature-service": "^1.1.1",
69-
"@esri/cedar-amcharts": "^1.0.0-beta.2"
68+
"@esri/arcgis-rest-request": "^1.1.1",
69+
"@esri/cedar-amcharts": "^1.0.0-beta.3"
7070
},
7171
"devDependencies": {
7272
"@types/jest": "20.0.2",

0 commit comments

Comments
 (0)