UNPKG

basicprimitives

Version:

Basic Primitives Diagrams for JavaScript - data visualization components library that implements organizational chart and multi-parent dependency diagrams, contains implementations of JavaScript Controls and PDF rendering plugins.

31 lines (25 loc) 620 B
/* jshint latedef: true, unused: false */ export default function AnnotationLabelTemplate() { function template() { return {}; } function getHashCode() { return 0; } function render(doc, position, data) { var annotationConfig = data.context; doc.save(); doc.font('Helvetica', 12) .text(annotationConfig.label, position.x, position.y, { width: position.width, height: position.height, align: 'center' }); doc.restore(); } return { template: template, getHashCode: getHashCode, render: render }; };