Skip to main content

addTemplates()

Add a new subDomain template

addTemplates(Template[] | Template): void;

Arguments

Return

  • void
caution

This method have to be called before paint().

What is a template?

See the Templates section for more informations.


Usage

// Create a template
// Content skipped, see the Templates section for full template example
const quarterTemplate = () => {};

const cal = new CalHeatmap();
// Add the template
cal.addTemplates(quarterTemplate);

cal.paint({
range: 2,
domain: { type: 'year', gutter: 10, label: { textAlign: 'start' } },
subDomain: {
// Use the template
type: 'quarter',
width: 60,
height: 15,
label: '[Quarter] Q',
radius: 3,
},
});