UNPKG

plotly.js

Version:

The open source javascript graphing library that powers plotly

52 lines (51 loc) • 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OPPOSITE_SIDE = exports.MID_SHIFT = exports.CAP_SHIFT = exports.LINE_SPACING = exports.FROM_BR = exports.FROM_TL = exports.FROM_BL = void 0; // From bottom left: this is the origin of our paper-reference // positioning system exports.FROM_BL = { left: 0, center: 0.5, right: 1, bottom: 0, middle: 0.5, top: 1 }; // From top left: this is the screen pixel positioning origin exports.FROM_TL = { left: 0, center: 0.5, right: 1, bottom: 1, middle: 0.5, top: 0 }; // From bottom right: sometimes you just need the opposite of ^^ exports.FROM_BR = { left: 1, center: 0.5, right: 0, bottom: 0, middle: 0.5, top: 1 }; // Multiple of fontSize to get the vertical offset between lines exports.LINE_SPACING = 1.3; // Multiple of fontSize to shift from the baseline // to the cap (captical letter) line // (to use when we don't calculate this shift from Drawing.bBox) // This is an approximation since in reality cap height can differ // from font to font. However, according to Wikipedia // an "average" font might have a cap height of 70% of the em // https://en.wikipedia.org/wiki/Em_(typography)#History exports.CAP_SHIFT = 0.70; // Half the cap height (distance between baseline and cap line) // of an "average" font (for more info see above). exports.MID_SHIFT = 0.35; /** The side facing the opposite direction, for each side name */ exports.OPPOSITE_SIDE = { left: 'right', right: 'left', top: 'bottom', bottom: 'top' };