UNPKG

@gitlab/ui

Version:
65 lines (56 loc) 2.03 kB
/** * As of %12.10 all annotations are added as a decorations * by piggybacking a scatter series. The series should * have 'annotations' as name for the annotation tooltips * to work. * * More info here https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28825 * */ var ANNOTATIONS_SERIES_NAME = 'annotations'; /** * Annotations have a line (markLine) and an arrow (markPoint). * When the markPoint is hovered, a tooltip is displayed to * show the annotation description. * * All markPoints have this component type */ var ANNOTATIONS_COMPONENT_TYPE = 'markPoint'; /** * This is so that the mouse doesn't go over the * tooltip and call mouseout which will hide the * tooltip. */ var ANNOTATION_TOOLTIP_TOP_OFFSET = 10; /** * This is a slight offset that gets applied to the left * of the chart tooltips to ensure a correct position. */ var TOOLTIP_LEFT_OFFSET = 2; /** * This is an offset that gets applied between the mouse * cursor and the left of the chart data tooltips to provide * some spacing. */ var DATA_TOOLTIP_LEFT_OFFSET = 10; /** * These are the accepted values for the layout prop * of the chart legend component */ var LEGEND_LAYOUT_INLINE = 'inline'; var LEGEND_LAYOUT_TABLE = 'table'; /** * Default values for the chart legend field labels */ var LEGEND_AVERAGE_TEXT = 'Avg'; var LEGEND_CURRENT_TEXT = 'Current'; var LEGEND_MIN_TEXT = 'Min'; var LEGEND_MAX_TEXT = 'Max'; /** * These arrow symbols are used as markPoints under the annotations lines * within area and line charts. This icon doesn't exist in the svg * library yet. The below issue is to track the progress of the svg icon * https://gitlab.com/gitlab-org/gitlab-svgs/-/issues/118 */ var arrowSymbol = 'path://m5 229 5 8h-10z'; export { ANNOTATIONS_COMPONENT_TYPE, ANNOTATIONS_SERIES_NAME, ANNOTATION_TOOLTIP_TOP_OFFSET, DATA_TOOLTIP_LEFT_OFFSET, LEGEND_AVERAGE_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, TOOLTIP_LEFT_OFFSET, arrowSymbol };