|
|
@@ -1,10 +1,11 @@ |
|
|
|
import { getBarHeightAndYAttr } from './draw-utils'; |
|
|
|
import { getBarHeightAndYAttr, truncateString } from './draw-utils'; |
|
|
|
import { getStringWidth } from './helpers'; |
|
|
|
import { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants'; |
|
|
|
import { lightenDarkenColor } from './colors'; |
|
|
|
|
|
|
|
export const AXIS_TICK_LENGTH = 6; |
|
|
|
const LABEL_MARGIN = 4; |
|
|
|
const LABEL_MAX_CHARS = 15; |
|
|
|
export const FONT_SIZE = 10; |
|
|
|
const BASE_LINE_COLOR = '#dadada'; |
|
|
|
const FONT_FILL = '#555b51'; |
|
|
@@ -182,7 +183,9 @@ export function heatSquare(className, x, y, size, fill='none', data={}) { |
|
|
|
return createSVG("rect", args); |
|
|
|
} |
|
|
|
|
|
|
|
export function legendBar(x, y, size, fill='none', label) { |
|
|
|
export function legendBar(x, y, size, fill='none', label, truncate=false) { |
|
|
|
label = truncate ? truncateString(label, LABEL_MAX_CHARS) : label; |
|
|
|
|
|
|
|
let args = { |
|
|
|
className: 'legend-bar', |
|
|
|
x: 0, |
|
|
|