0.0.2 • Published 10 years ago
koto-config v0.0.2
Koto Config (WIP)
This is an optional decorator for KotoJS charts that allows chart authors to specify a validation schema (using JSON-SCHEMA). Attempting to set a property that is not valid will throw an Error.
Example Usage
// JSON SCHEMA
const schema = {
  type: 'object',
  properties: {
    height: {
      type: 'number',
      minimum: 500
    }
  }
};
@KotoConfig(schema)
class Chart extends Koto {
  constructor(selection) {
    super(selection);
    this.configs = {
      height: { value: 500 }
    };
  }
  preDraw() {
    console.log('predraw');
  }
}
const chart = new Chart(d3.select(document.body));
chart.config('height', 400); // => throws ErrorRepo Usage
- $ npm startto run webpack-dev-server
- $ npm testto run unit tests
- $ npm tddto continuously run tests
- $ npm run jshintto lint code
- $ npm run buildto build (and minify)
- $ npm version (patch|minor|major)to create git release