Comments (2)
{
"width": 700,
"height": 400,
"data": [
{
"name": "crimes",
"url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/FEEDS/CDW_Feeds/MapServer/8/query?where=1%3D1&outFields=REPORTDATETIME%2CWARD&returnGeometry=false&f=pjson",
"format": {"type": "json", "property": "features", "parse": {"attributes.REPORTDATETIME":"date"}}
}
],
"scales": [
{
"name": "x",
"type": "time",
"round": true,
"range": "width",
"domain": {"data": "crimes", "field": "data.attributes.REPORTDATETIME"}
},
{
"name": "y",
"type": "linear",
"nice": true,
"range": "width",
"domain": {"data": "crimes", "field": "data.attributes.WARD"}
},
{
"name": "c",
"type": "ordinal",
"range": "category10"
}
],
"axes": [
{"type": "x", "scale": "x"},
{"type": "y", "scale": "y"}
],
"marks": [
{
"type": "symbol",
"from": {"data": "crimes"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "data.attributes.REPORTDATETIME"},
"y": {"scale": "y", "field": "data.attributes.WARD"},
"size": {"value": 50},
"stroke": {"scale": "c", "field": "data.attributes.WARD"},
"strokeWidth": {"value": 2}
}
}
}
]
}
from cedar.
Another type:
{
"width": 700,
"height": 700,
"data": [
{
"name": "crimes",
"url": "http://maps2.dcgis.dc.gov/dcgis/rest/services/FEEDS/CDW_Feeds/MapServer/8/query?where=1%3D1&outFields=OFFENSE%2CSHIFT%2CREPORTDATETIME%2CWARD&returnGeometry=false&f=pjson",
"format": {"type": "json", "property": "features", "parse": {"attributes.REPORTDATETIME":"date"}}
},
{
"name": "variety",
"source": "crimes",
"transform": [
{"type": "facet", "keys": ["data.attributes.OFFENSE"]}
]
},
{
"name": "ward",
"source": "crimes",
"transform": [
{"type": "sort", "by": "data.attributes.WARD"},
{"type": "facet", "keys": ["data.attributes.WARD"]}
]
}
],
"scales": [
{
"name": "g",
"type": "ordinal",
"range": "height",
"padding": 0.15,
"domain": {"data": "ward", "field": "key"}
},
{
"name": "x",
"type": "time",
"round": true,
"range": "width",
"domain": {"data": "crimes", "field": "data.attributes.REPORTDATETIME"}
},
{
"name": "c",
"type": "ordinal",
"range": "category10"
}
],
"axes": [
{"type": "x", "scale": "x"}
],
"legends": [
{
"fill": "c",
"title": "Shift",
"offset": 0,
"properties": {
"symbols": {
"fillOpacity": {
"value": 0.5
},
"stroke": {
"value": "transparent"
}
}
}
}
],
"marks": [
{
"type": "text",
"from": {"data": "crimes"},
"properties": {
"enter": {
"x": {"group": "width", "mult": 0.5},
"y": {"scale": "g", "field": "data.attributes.WARD", "offset": -2},
"fontWeight": {"value": "bold"},
"text": {"field": "data.attributes.WARD"},
"align": {"value": "center"},
"baseline": {"value": "bottom"},
"fill": {"value": "#000"}
}
}
},
{
"type": "group",
"from": {"data": "ward"},
"scales": [
{
"name": "y",
"type": "ordinal",
"range": "height",
"points": true,
"padding": 1.2,
"domain": {"data": "variety", "field": "key"}
}
],
"axes": [
{
"type": "y",
"scale": "y",
"tickSize": 0,
"properties": {"axis": {"stroke": {"value": "transparent"}}}
}
],
"properties": {
"enter": {
"x": {"value": 0.5},
"y": {"scale": "g", "field": "key"},
"height": {"scale": "g", "band": true},
"width": {"group": "width"},
"stroke": {"value": "#ccc"}
}
},
"marks": [
{
"type": "symbol",
"properties": {
"enter": {
"x": {"scale": "x", "field": "data.attributes.REPORTDATETIME"},
"y": {"scale": "y", "field": "data.attributes.OFFENSE"},
"size": {"value": 50},
"stroke": {"scale": "c", "field": "data.attributes.SHIFT"},
"strokeWidth": {"value": 2}
}
}
}
]
}
]
}
from cedar.
Related Issues (20)
- Add to doc - examples of changing data formats HOT 1
- Please show examples using ArcGIS API for JavaScript version 4.x HOT 3
- Capability to Convert Between Units? HOT 2
- deploy v1 docs
- domains are not decoded for datasets that don't query features (i.e. use `data`)
- fetching chart JSON from "CDN" returns 404 for v0.x HOT 8
- give @jgravois the keys to publish arcgis-cedar on npm HOT 1
- definition should provide a way to specify or override default axis labels
- how to set up cedar properly to chart object arrays? HOT 2
- Cedar not working - TypeError: keys.reduce is not a function HOT 4
- add repository.directory to packakge.json
- Sparkline Support
- Chart not rendering data correctly HOT 2
- change color of data series
- Cedar with React HOT 3
- number format issue HOT 5
- export button HOT 1
- add function that converts the chart data/series to a feature set HOT 1
- Allow passing request options to query HOT 1
- UMD bundles include arcgis-rest-js dependencies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cedar.