@material-vega/core
Version:
Material Design stylized themes for Vega Lite visualizations
70 lines (69 loc) • 1.66 kB
JavaScript
/**
* Create config common to all bar chart types
*/
export var createBarConfig = function (options) {
return {};
};
/**
* Create config common to vertical bar chart types
*/
export var createVerticalBarConfig = function (options) {
return {
axisBottom: {
// Extra thick bottom line
domain: true,
domainWidth: options.thickDomainLineWidth
},
bar: {
cornerRadiusTopLeft: options.barCornerRadius,
cornerRadiusTopRight: options.barCornerRadius
}
};
};
/**
* Create config common to horizontal bar chart types
*/
export var createHorizontalBarConfig = function (options) {
return {
axisLeft: {
// Extra thick left line
domain: true,
domainWidth: options.thickDomainLineWidth
},
axisY: {
// Fix orientation of the Y axis on horizontal bar charts
orient: 'left',
labelAlign: 'right'
},
bar: {
cornerRadiusTopRight: options.barCornerRadius,
cornerRadiusBottomRight: options.barCornerRadius
}
};
};
/**
* Create config common to axis-less "focused" bar chart types
*/
export var createFocusedBarConfig = function (options) {
return {
axis: {
labels: false,
ticks: false
},
axisBand: {
labels: true
},
axisBottom: {
domain: false
},
axisLeft: {
domain: false
},
axisY: {
grid: false
},
axisX: {
grid: false
}
};
};