@urban-toolkit/autk-grammar 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/autk-grammar.js +253 -1184
- package/dist/autk-grammar.js.map +1 -1
- package/dist/autk-grammar.umd.cjs +1 -1
- package/dist/autk-grammar.umd.cjs.map +1 -1
- package/dist/index.d.ts +385 -2
- package/package.json +10 -11
- package/dist/adapters/compute.d.ts +0 -3
- package/dist/adapters/data.d.ts +0 -3
- package/dist/adapters/map.d.ts +0 -3
- package/dist/adapters/plot.d.ts +0 -3
- package/dist/interfaces.d.ts +0 -1
- package/dist/main.d.ts +0 -50
- package/dist/types.d.ts +0 -36
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @urban-toolkit/autk-grammar
|
|
2
|
+
|
|
3
|
+
A declarative grammar for urban visual analytics, running on [Autark](https://autarkjs.org). Describe the data to load, the computations to run, and the maps and plots to draw in one spec, and the grammar wires them together in the browser.
|
|
4
|
+
|
|
5
|
+
- Documentation: https://autarkjs.org/grammar/
|
|
6
|
+
- Examples: https://autarkjs.org/grammar/examples/
|
|
7
|
+
- Source: https://github.com/urban-toolkit/autk-grammar
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @urban-toolkit/autk-grammar
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { AutkGrammar, UrbanSpec } from '@urban-toolkit/autk-grammar';
|
|
19
|
+
|
|
20
|
+
const spec: UrbanSpec = {
|
|
21
|
+
data: [{ type: 'csv', csvFileUrl: 'buildings.csv', outputTableName: 'buildings' }],
|
|
22
|
+
map: { layerRefs: [{ dataRef: 'buildings', isColorMap: true }] },
|
|
23
|
+
plot: { dataRef: 'buildings', mark: 'bar', axis: ['height', 'count'] }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const grammar = new AutkGrammar({ map: 'map', plot: 'plot' }); // ids of the map canvas and plot container
|
|
27
|
+
await grammar.run(spec);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT
|