@material-vega/core
Version:
Material Design stylized themes for Vega Lite visualizations
14 lines (13 loc) • 531 B
JavaScript
import { extendDefaults } from '../options';
import { themes } from './themes';
import { mergeConfig } from 'vega';
/**
* Create a Material Vega chart theme
* The result is a Vega/Vega Lite Config object to be passed to vegaEmbed or included in a spec
*/
export function createTheme(options, theme) {
var opts = extendDefaults(options);
var configGenerators = themes[theme];
var configs = configGenerators.map(function (createConfig) { return createConfig(opts); });
return mergeConfig.apply(void 0, configs);
}