g1 issueshttps://code.gramener.com/cto/g1/-/issues2018-05-24T16:16:25Zhttps://code.gramener.com/cto/g1/-/issues/31Create g1.scale to build a scale using configurations2018-05-24T16:16:25ZS AnandCreate g1.scale to build a scale using configurations### Summary
`g1.scale()` is a function that takes a dataset and a configuration, and returns a scale function. For example:
```js
var scale = g1.scale(data, { // Rename scales to scale
metric: 'age',
scale: 'Linear', ...### Summary
`g1.scale()` is a function that takes a dataset and a configuration, and returns a scale function. For example:
```js
var scale = g1.scale(data, { // Rename scales to scale
metric: 'age',
scale: 'Linear', // This should be case insensitive (linear / LINEAR / Linear should all work)
domain: [0, 100],
range: ['red', 'blue'],
scheme: 'RdYlGn',
})
var result = scale(data[0])
```
### Benefits
This is used by `g1.sanddance` and `g1.mapviewer` for configuration-based d3 transformations.1.32Elango BharathiElango Bharathihttps://code.gramener.com/cto/g1/-/issues/14Add a type detection function for JavaScript Dataframes2018-05-24T16:16:25ZS AnandAdd a type detection function for JavaScript Dataframes- [x] Test cases and scaffolding @s.anand - by 5 Feb 2018
- [x] Basic implementation @abinesh.lal - by 7 Feb 2018
- [x] Testing & bug fixes @abinesh.lal - by 9 Feb 2018
- [x] Merge @s.anand - by 9 Feb 2018- [x] Test cases and scaffolding @s.anand - by 5 Feb 2018
- [x] Basic implementation @abinesh.lal - by 7 Feb 2018
- [x] Testing & bug fixes @abinesh.lal - by 9 Feb 2018
- [x] Merge @s.anand - by 9 Feb 20181.32Abinesh LalAbinesh Lal