Comments (5)
@abakirov Yes - looking at the Stack
- (Application)
- Cedar - JS Functions
- Vega - specification templates
- D3 - SceneGraph or JS Functions
We would like to keep the 'customization' as high-level as possible. By doing so we can make it easier to reuse charts as shared and trusted Items in hosted applications. We can do that because we are not running arbitrary Javascript code but only a JSON document that can be validated.
But as you are pointing out - the chart design may go beyond the Vega capabilities, though that may just be a challenge to the community craft such a document. :)
The pattern should be that through encapsulation you can 'swap out' Vega for a custom visualization engine that would then use D3. So then after loading the engine, the Cedar API continues to function.
For example mimicking this chart
and a service like
OBJECTID | Origin | Destination | Name | Date |
---|---|---|---|---|
1 | Sudan | Chad | Person 1 | 2012-01-02 |
2 | Somalia | Ethiopia | Person 1 | 2012-08-07 |
3 | Sudan | Chad | Person 1 | 2013-03-20 |
4 | Sudan | Uganda | Person 1 | 2013-07-14 |
etc.
<script type="text/javascript" src="/chord-graphic.js"></script>
<script>
//create a cedar chart, passing a url to a spec
var chart = new Cedar({"engine":"chord-graphic"});
var dataset = {
"url":"http://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Education_WebMercator/MapServer/5",
"mappings":{
"category1": {"field":"Origin","label":"Origin Country"},
"category2": {"field":"Destination","label":"Destination Country"}
}
};
//assign to the chart
chart.dataset = dataset;
//show the chart
chart.show({
elementId: "#chart"
});
</script>
z
from cedar.
And what will chord-graphic.js look in this example, something like this?
Cedar.registerEngine("chord-graphic", impl);
... where impl
is my own implementation of some well-defined interface?
from cedar.
@abakirov that's generally the idea. What would you think of that?
from cedar.
Sounds good to me. I would also add that OOTB vega engine implementation should probably use that same API Cedar.registerEngine("vega", ...)
. This way people will be able to look at vega implementation and use it as example for their own engine.
from cedar.
Similar example
http://jlord.us/sheetsee.js/docs/custom-charts.html
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.