import { baseGeometryChannels, basePostInference, basePreInference, createBandOffset, tooltip2d, visualMark, } from './utils'; export const Text = (options) => { const { cartesian = false } = options; if (cartesian) return visualMark; return ((index, scale, value, coordinate) => { const { x: X, y: Y } = value; const offset = createBandOffset(scale, value, options); const P = Array.from(index, (i) => { const p = [+X[i], +Y[i]]; return [coordinate.map(offset(p, i))]; }); return [index, P]; }); }; const shapes = ['text', 'badge']; Text.props = { defaultShape: 'text', defaultLabelShape: 'label', composite: false, channels: [ ...baseGeometryChannels({ shapes }), { name: 'x', required: true }, { name: 'y', required: true }, { name: 'text', scale: 'identity' }, { name: 'fontSize' }, { name: 'rotate' }, ], preInference: [ ...basePreInference(), { type: 'maybeTuple' }, { type: 'maybeVisualPosition' }, ], postInference: [...basePostInference(), ...tooltip2d()], }; //# sourceMappingURL=text.js.map