You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@@ -122,56 +95,57 @@ Once cedar is loaded you can create and show the chart at a designated element a
122
95
"source":"schools"
123
96
}];
124
97
125
-
//optinally override any of the cart type's default styles
98
+
//optionally override any of the cart type's default styles
126
99
var overrides = {
127
100
"categoryAxis": {
128
101
"labelRotation":-45
129
102
}
130
103
}
131
104
132
105
//create a cedar chart using the known 'bar' type
133
-
var chart =newcedar.Chart({"type":"bar"})
106
+
var elementId ='chart';
107
+
var chart =newcedar.Chart(elementId, {"type":"bar"})
134
108
.datasets(datasets)
135
109
.series(series)
136
110
.overrides(overrides);
137
111
138
112
// render the chart
139
-
var elementId ='chart';
140
-
chart.show(elementId);
113
+
chart.show();
114
+
</script>
141
115
```
142
116
143
-
<!-- See the [tutorial](http://esri.github.io/cedar/tutorial) to learn more. -->
144
-
145
-
<!-- TODO: demos -->
146
-
<!--
147
117
## Demos
148
118
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)
151
126
152
127
## Components of a Cedar Chart
153
128
154
129
Cedar charts are defined by the following ingredients:
155
130
156
131
- 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
160
135
- and `overrides` are specific modifications to the cart type's default styles
161
136
162
137
<!-- TODO: API docs -->
163
138
<!-- See the [API documentation](http://esri.github.io/cedar/api) for further details. -->
164
139
165
140
### Development Instructions
166
141
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)
168
143
169
144
1. Fork this repository and clone 'cedar' locally
170
145
1.`cd` into the `cedar` folder
171
-
1. Install the dependencies with `yarn`
146
+
1. Install the dependencies and initialize the monorepo with `yarn`
172
147
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`
175
149
176
150
### Tests
177
151
@@ -203,7 +177,7 @@ For more information on SemVer, please visit <http://semver.org/>.
203
177
204
178
205
179
### Licensing
206
-
Copyright 2017 Esri
180
+
Copyright 2018 Esri
207
181
208
182
Licensed under the Apache License, Version 2.0 (the "License");
209
183
you may not use this file except in compliance with the License.
0 commit comments