@unovis/ts 1.5.1-xplg.4 → 1.6.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/annotations/style.js.map +1 -1
- package/components/area/config.d.ts +7 -3
- package/components/area/config.js +1 -1
- package/components/area/config.js.map +1 -1
- package/components/area/index.js +25 -9
- package/components/area/index.js.map +1 -1
- package/components/area/style.js.map +1 -1
- package/components/axis/index.d.ts +1 -0
- package/components/axis/index.js +10 -2
- package/components/axis/index.js.map +1 -1
- package/components/axis/style.js.map +1 -1
- package/components/brush/config.d.ts +1 -1
- package/components/brush/config.js.map +1 -1
- package/components/brush/style.js.map +1 -1
- package/components/bullet-legend/style.js.map +1 -1
- package/components/chord-diagram/index.js +3 -1
- package/components/chord-diagram/index.js.map +1 -1
- package/components/chord-diagram/style.js.map +1 -1
- package/components/crosshair/style.js.map +1 -1
- package/components/donut/style.js.map +1 -1
- package/components/flow-legend/style.js.map +1 -1
- package/components/free-brush/style.js.map +1 -1
- package/components/graph/index.js +3 -4
- package/components/graph/index.js.map +1 -1
- package/components/graph/modules/link/index.js +1 -2
- package/components/graph/modules/link/index.js.map +1 -1
- package/components/graph/modules/link/style.js.map +1 -1
- package/components/graph/modules/node/style.js.map +1 -1
- package/components/graph/modules/panel/style.js.map +1 -1
- package/components/graph/style.js.map +1 -1
- package/components/grouped-bar/style.js.map +1 -1
- package/components/leaflet-flow-map/config.js +0 -1
- package/components/leaflet-flow-map/config.js.map +1 -1
- package/components/leaflet-flow-map/shaders.js.map +1 -1
- package/components/leaflet-map/config.js +0 -1
- package/components/leaflet-map/config.js.map +1 -1
- package/components/leaflet-map/modules/map.js +3 -3
- package/components/leaflet-map/modules/map.js.map +1 -1
- package/components/leaflet-map/renderer/leaflet-maplibre-gl.js.map +1 -1
- package/components/leaflet-map/style.js.map +1 -1
- package/components/line/config.d.ts +5 -0
- package/components/line/config.js +1 -1
- package/components/line/config.js.map +1 -1
- package/components/line/index.js +41 -2
- package/components/line/index.js.map +1 -1
- package/components/line/style.d.ts +1 -0
- package/components/line/style.js +12 -1
- package/components/line/style.js.map +1 -1
- package/components/line/types.d.ts +1 -0
- package/components/nested-donut/config.d.ts +1 -1
- package/components/nested-donut/config.js.map +1 -1
- package/components/nested-donut/style.js.map +1 -1
- package/components/sankey/modules/label.js.map +1 -1
- package/components/sankey/modules/link.js.map +1 -1
- package/components/sankey/style.js.map +1 -1
- package/components/scatter/style.js.map +1 -1
- package/components/stacked-bar/style.js.map +1 -1
- package/components/timeline/config.d.ts +14 -65
- package/components/timeline/config.js +1 -15
- package/components/timeline/config.js.map +1 -1
- package/components/timeline/index.d.ts +10 -21
- package/components/timeline/index.js +93 -379
- package/components/timeline/index.js.map +1 -1
- package/components/timeline/style.d.ts +0 -7
- package/components/timeline/style.js +1 -40
- package/components/timeline/style.js.map +1 -1
- package/components/tooltip/config.d.ts +6 -4
- package/components/tooltip/config.js +3 -1
- package/components/tooltip/config.js.map +1 -1
- package/components/tooltip/index.d.ts +7 -3
- package/components/tooltip/index.js +39 -9
- package/components/tooltip/index.js.map +1 -1
- package/components/tooltip/style.js.map +1 -1
- package/components/topojson-map/index.js.map +1 -1
- package/components/topojson-map/style.js.map +1 -1
- package/components/vis-controls/style.js.map +1 -1
- package/components/xy-labels/style.js.map +1 -1
- package/components.d.ts +0 -4
- package/components.js +0 -2
- package/components.js.map +1 -1
- package/containers/single-container/config.d.ts +0 -3
- package/containers/single-container/config.js.map +1 -1
- package/containers/single-container/index.js +1 -2
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/config.d.ts +0 -5
- package/containers/xy-container/config.js +1 -1
- package/containers/xy-container/config.js.map +1 -1
- package/containers/xy-container/index.d.ts +0 -1
- package/containers/xy-container/index.js +11 -15
- package/containers/xy-container/index.js.map +1 -1
- package/core/container/config.js +0 -1
- package/core/container/config.js.map +1 -1
- package/index.js +3 -5
- package/index.js.map +1 -1
- package/maps/ind-regions.json.js +1 -1
- package/maps/us-counties.json.js +8 -8
- package/package.json +6 -5
- package/styles/index.js.map +1 -1
- package/styles/patterns.js.map +1 -1
- package/styles/sizes.js.map +1 -1
- package/types/position.d.ts +1 -2
- package/types/position.js +0 -1
- package/types/position.js.map +1 -1
- package/types.d.ts +0 -2
- package/types.js +1 -4
- package/types.js.map +1 -1
- package/utils/color.d.ts +0 -14
- package/utils/color.js +2 -26
- package/utils/color.js.map +1 -1
- package/utils/data.d.ts +1 -1
- package/utils/data.js +1 -1
- package/utils/data.js.map +1 -1
- package/utils/index.js +3 -3
- package/utils/path.d.ts +0 -8
- package/utils/path.js +1 -109
- package/utils/path.js.map +1 -1
- package/utils/text.d.ts +1 -2
- package/utils/text.js +2 -10
- package/utils/text.js.map +1 -1
- package/components/rolling-pin-legend/config.d.ts +0 -19
- package/components/rolling-pin-legend/config.js +0 -9
- package/components/rolling-pin-legend/config.js.map +0 -1
- package/components/rolling-pin-legend/index.d.ts +0 -16
- package/components/rolling-pin-legend/index.js +0 -63
- package/components/rolling-pin-legend/index.js.map +0 -1
- package/components/rolling-pin-legend/style.d.ts +0 -5
- package/components/rolling-pin-legend/style.js +0 -40
- package/components/rolling-pin-legend/style.js.map +0 -1
- package/components/rolling-pin-legend/types.d.ts +0 -1
- package/components/timeline/constants.d.ts +0 -3
- package/components/timeline/constants.js +0 -6
- package/components/timeline/constants.js.map +0 -1
- package/components/timeline/types.d.ts +0 -62
- package/components/timeline/types.js +0 -2
- package/components/timeline/types.js.map +0 -1
- package/components/timeline/utils.d.ts +0 -2
- package/components/timeline/utils.js +0 -16
- package/components/timeline/utils.js.map +0 -1
- package/components/treemap/config.d.ts +0 -44
- package/components/treemap/config.js +0 -6
- package/components/treemap/config.js.map +0 -1
- package/components/treemap/index.d.ts +0 -16
- package/components/treemap/index.js +0 -263
- package/components/treemap/index.js.map +0 -1
- package/components/treemap/style.d.ts +0 -22
- package/components/treemap/style.js +0 -62
- package/components/treemap/style.js.map +0 -1
- package/components/treemap/types.d.ts +0 -11
- package/components/treemap/types.js +0 -2
- package/components/treemap/types.js.map +0 -1
package/utils/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../src/utils/text.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { sum } from 'd3-array'\nimport striptags from 'striptags'\n\n// Types\nimport { TextAlign, TrimMode, UnovisText, UnovisTextFrameOptions, UnovisTextOptions, UnovisWrappedText, VerticalAlign } from 'types/text'\n\n// Utils\nimport { flatten, isArray, merge } from 'utils/data'\nimport { getTextAnchorFromTextAlign } from 'types/svg'\n\n// Styles\nimport { getFontWidthToHeightRatio, UNOVIS_TEXT_DEFAULT, UNOVIS_TEXT_SEPARATOR_DEFAULT, UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT } from 'styles/index'\n\nexport const textAlignToAnchor = (textAlign: TextAlign): string | null => {\n switch (textAlign) {\n case TextAlign.Left: return 'start'\n case TextAlign.Right: return 'end'\n case TextAlign.Center: return 'middle'\n default: return null\n }\n}\n\n/**\n * Converts a kebab-case string to camelCase.\n *\n * @param {string} str - The kebab-case string to be converted.\n * @returns {string} The resulting camelCase string.\n */\nexport function kebabCaseToCamel (str: string): string {\n return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())\n}\n\n/**\n * Converts a given string to kebab-case.\n * @param {string} str - The input string to be converted to kebab-case.\n * @returns {string} - The kebab-cased string.\n */\nexport function kebabCase (str: string): string {\n return str.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g)\n ?.filter(Boolean)\n .map(x => x.toLowerCase())\n .join('-')\n}\n\nexport function escapeStringKeepHash (str: string): string {\n return str\n .replace(/['\"]/g, ''') // Escapes quotes with '\n // eslint-disable-next-line no-control-regex\n .replace(/\\u0000/g, '\\\\0') // Escapes null characters\n .replace(/\\n/g, '\\\\n') // Escapes new lines\n .replace(/\\r/g, '\\\\r') // Escapes carriage returns\n .replace(/\\v/g, '\\\\v') // Escapes vertical tabs\n .replace(/\\t/g, '\\\\t') // Escapes horizontal tabs\n .replace(/\\f/g, '\\\\f') // Escapes form feeds\n}\n\n/**\n * Trims the input string from the start, leaving only the specified maximum length.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [maxLength=15] - The maximum allowed length of the trimmed string.\n * @returns {string} - The trimmed string.\n */\nexport function trimStringStart (str: string | undefined, maxLength = 15): string {\n if (!str) return ''\n return str.length > maxLength ? `…${str.substr(str.length - maxLength, maxLength)}` : str\n}\n\n/**\n * Trims the input string from the middle, leaving only the specified maximum length.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [maxLength=15] - The maximum allowed length of the trimmed string.\n * @returns {string} - The trimmed string.\n */\nexport function trimStringMiddle (str: string | undefined, maxLength = 15): string {\n if (!str) return ''\n\n const dist = Math.floor((maxLength - 3) / 2)\n return str.length > maxLength ? `${str.substr(0, dist)}…${str.substr(-dist, dist)}` : str\n}\n\n/**\n * Trims the input string from the end, leaving only the specified maximum length.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [maxLength=15] - The maximum allowed length of the trimmed string.\n * @returns {string} - The trimmed string.\n */\nexport function trimStringEnd (str: string | undefined, maxLength = 15): string {\n if (!str) return ''\n\n return str.length > maxLength ? `${str.substr(0, maxLength)}…` : str\n}\n\n/**\n * Trims the input string according to the specified trim mode.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [length=15] - The maximum allowed length of the trimmed string.\n * @param {TrimMode} [type=TrimMode.Middle] - The trim mode to be applied.\n * @returns {string} - The trimmed string.\n */\nexport function trimString (str: string | undefined, length = 15, type = TrimMode.Middle): string {\n if (!str) return ''\n\n let result = trimStringEnd(str, length)\n if (type === TrimMode.Start) result = trimStringStart(str, length)\n else if (type === TrimMode.Middle) result = trimStringMiddle(str, length)\n return result\n}\n\n/**\n * Splits the input string according to the specified separators.\n * @param {string} text - The input string to be split.\n * @param {string[]} [separators=[' ']] - The array of separators to be used for splitting.\n * @returns {string[]} - The array of split words.\n */\nexport function splitString (text: string, separators = [' ']): string[] {\n let result = [text] as Array<string | string[]>\n for (let i = 0; i < separators.length; i++) {\n const sep = separators[i]\n result.forEach((d, index) => {\n const separated = (d as string).split(sep)\n const words = separated.map((word, j) => `${word}${j === separated.length - 1 ? '' : sep}`)\n result[index] = words\n })\n result = flatten(result)\n }\n\n return result as string[]\n}\n\n/**\n * Wraps an SVG text element to fit within the specified width.\n * @param {Selection<SVGTextElement, any, SVGElement, any>} textElement - The SVG text element to be wrapped.\n * @param {number} width - The maximum allowed width for the text element.\n * @param {(string | string[])} [separator=[' ', '-', '.', ',']] - The separator(s) to be used for wrapping.\n */\nexport function wrapSVGText (\n textElement: Selection<SVGTextElement, any, SVGElement, any>,\n width: number,\n separator: string | string[] = [' ', '-', '.', ',']\n): void {\n const text = textElement.text()\n if (!text) return\n\n // Wrap\n const separators = (isArray(separator) ? separator : [separator]) as string[]\n const words = splitString(text, separators)\n const x = parseFloat(textElement.attr('x')) || 0\n\n textElement.text('')\n let tspan = textElement.append('tspan').attr('x', x)\n let tspanContent = `${words[0]}`\n tspan.text(tspanContent)\n\n words.forEach((word, i) => {\n if (i === 0) return\n\n const tspanText = `${tspanContent}${word}`\n tspan.text(tspanText)\n const tspanWidth = tspan.node().getComputedTextLength()\n if (tspanWidth > width) {\n tspan.text(tspanContent.trim())\n\n tspan = textElement.append('tspan')\n .attr('x', x)\n .attr('dy', '1.2em')\n .text(word)\n\n tspanContent = word\n } else tspanContent += word\n })\n}\n\n/**\n * Trims an SVG text element based on the specified max width, trim type, and other options.\n * @param {Selection<SVGTextElement, any, SVGElement, any>} svgTextSelection - The D3 selection of the SVG text element to be trimmed.\n * @param {number} [maxWidth=50] - The maximum width of the text element.\n * @param {TrimMode} [trimType=TrimMode.Middle] - The type of trim (start, middle, or end).\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method for text length calculation.\n * @param {number} [fontSize=0] - The font size of the text.\n * @param {number} [fontWidthToHeightRatio=getFontWidthToHeightRatio()] - The font width to height ratio.\n * @returns {boolean} True if the text was trimmed, false otherwise.\n */\nexport function trimSVGText (\n svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>,\n maxWidth = 50,\n trimType = TrimMode.Middle,\n fastMode = true,\n fontSize = +window.getComputedStyle(svgTextSelection.node())?.fontSize || 0,\n fontWidthToHeightRatio = getFontWidthToHeightRatio()\n): boolean {\n const text = svgTextSelection.text()\n const textLength = text.length\n\n const textWidth = fastMode ? fontSize * textLength * fontWidthToHeightRatio : svgTextSelection.node().getComputedTextLength()\n const tolerance = 1.1\n const maxCharacters = Math.ceil(textLength * maxWidth / (tolerance * textWidth))\n if (maxCharacters < textLength) {\n svgTextSelection.text(trimString(text, maxCharacters, trimType))\n return true\n }\n\n return false\n}\n\n/**\n * Estimates the length of a string in pixels.\n * @param {string} str - The string to be measured.\n * @param {number} fontSize - The font size of the string.\n * @param {number} [fontWidthToHeightRatio=getFontWidthToHeightRatio()] - The font width to height ratio.\n * @returns {number} The estimated length of the string in pixels.\n */\nexport function estimateStringPixelLength (\n str: string,\n fontSize: number,\n fontWidthToHeightRatio = getFontWidthToHeightRatio()\n): number {\n return str.length * fontSize * fontWidthToHeightRatio || 0\n}\n\n/**\n * Calculates the precise length of a string in pixels.\n * @param {string} str - The string to be measured.\n * @param {string} [fontFamily] - The font family of the string.\n * @param {(string | number)} [fontSize] - The font size of the string.\n * @returns {number} The precise length of the string in pixels.\n */\nexport function getPreciseStringLengthPx (str: string, fontFamily?: string, fontSize?: string | number): number {\n const svgNS = 'http://www.w3.org/2000/svg'\n const svg = document.createElementNS(svgNS, 'svg')\n const text = document.createElementNS(svgNS, 'text')\n\n text.textContent = str\n text.setAttribute('font-size', `${fontSize}`)\n text.setAttribute('font-family', fontFamily)\n\n svg.appendChild(text)\n document.body.appendChild(svg)\n const length = text.getComputedTextLength()\n document.body.removeChild(svg)\n\n return length\n}\n\n/**\n * Estimates the dimensions of an SVG text element.\n *\n * @export\n * @param {Selection<SVGTextElement, any, SVGElement, any>} svgTextSelection - The D3 selection of the SVG text element.\n * @param {number} fontSize - The font size.\n * @param {number} [dy=0.32] - The line height scaling factor.\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method or a more accurate one.\n * @param {number} [fontWidthToHeightRatio] - The font width-to-height ratio.\n * @returns {{width: number, height: number}} - The estimated dimensions of the text element.\n */\nexport function estimateTextSize (\n svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>,\n fontSize: number,\n dy = 0.32,\n fastMode = true,\n fontWidthToHeightRatio?: number\n): { width: number; height: number } {\n fontWidthToHeightRatio = fontWidthToHeightRatio || getFontWidthToHeightRatio()\n const tspanSelection = svgTextSelection.selectAll('tspan')\n\n const lines = tspanSelection.size() || 1\n const height = svgTextSelection.text() ? 0.85 * fontSize * lines * (1 + dy) - dy : 0\n\n let width = 0\n if (tspanSelection.empty()) {\n const textLength = svgTextSelection.text().length\n width = fastMode ? fontSize * textLength * fontWidthToHeightRatio : svgTextSelection.node().getComputedTextLength()\n } else {\n for (const tspan of tspanSelection.nodes()) {\n const tspanTextLength = (tspan as SVGTSpanElement).textContent.length\n const w = fastMode ? fontSize * tspanTextLength * fontWidthToHeightRatio : (tspan as SVGTSpanElement).getComputedTextLength()\n if (w > width) width = w\n }\n }\n\n return { width, height }\n}\n\n/**\n * Breaks a text block into lines based on the specified width.\n *\n * @param {UnovisText} textBlock - The text block to break into lines.\n * @param {number | undefined} [width=undefined] - The maximum width of a line in pixels.\n * @param {(number | undefined)} [height=undefined] - The height limit for the wrapped text in pixels.\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method or a more accurate one.\n * @param {string | string[]} [separator] - The word separators.\n * @returns {string[]} - The text split into lines.\n */\nfunction breakTextIntoLines (\n textBlock: UnovisText,\n width: number | undefined = undefined,\n fastMode = true,\n separator: string | string[] = UNOVIS_TEXT_SEPARATOR_DEFAULT,\n wordBreak = false\n): string[] {\n const text = `${textBlock.text}`\n if (!text) return []\n const separators = Array.isArray(separator) ? separator : [separator]\n\n const splitByNewLine = text.split('\\n')\n return splitByNewLine.map((str) => {\n const lines: string[] = []\n if (!width) return [str]\n\n const words = splitString(str, separators)\n let line = ''\n for (let i = 0; i < words.length; i += 1) {\n const textLengthPx = fastMode\n ? estimateStringPixelLength(line + words[i], textBlock.fontSize, textBlock.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(line + words[i], textBlock.fontFamily, textBlock.fontSize)\n\n if (textLengthPx < width || i === 0) {\n line += words[i]\n } else {\n lines.push(line.trim())\n line = words[i]\n }\n\n // Word break functionality\n const minCharactersOnLine = 2\n if (wordBreak) {\n while (line.trim().length > minCharactersOnLine) {\n const subLineLengthPx = fastMode\n ? estimateStringPixelLength(line, textBlock.fontSize, textBlock.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(line, textBlock.fontFamily, textBlock.fontSize)\n\n if (subLineLengthPx > width) {\n let breakIndex = (line.trim()).length - minCharactersOnLine // Place at least `minCharactersOnLine` characters onto the next line\n while (breakIndex > 0) {\n const subLine = `${line.substring(0, breakIndex)}${UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT}` // Use hyphen when force breaking words\n const subLinePx = fastMode\n ? estimateStringPixelLength(subLine, textBlock.fontSize, textBlock.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(subLine, textBlock.fontFamily, textBlock.fontSize)\n\n // If the subline is less than the width, or just one character left, break the line\n if (subLinePx <= width || breakIndex === 1) {\n lines.push(subLine.trim())\n line = line.substring(breakIndex)\n break\n }\n breakIndex--\n }\n } else {\n break\n }\n }\n }\n }\n\n // Adding the final line after the loop\n if (line) lines.push(line.trim())\n\n return lines\n }).flat()\n}\n\n/**\n * Wraps a text or array of texts to fit within specified width and height, if provided.\n *\n * @export\n * @param {UnovisText | UnovisText[]} text - The text or array of texts to wrap.\n * @param {number | undefined} [width=undefined] - The maximum width of a line in pixels.\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method or a more accurate one.\n * @param {string | string[]} [separator] - The word separators.\n * @returns {UnovisWrappedText[]} - The wrapped texts.\n */\nexport function getWrappedText (\n text: UnovisText | UnovisText[],\n width: number | undefined = undefined,\n height: number | undefined = undefined,\n fastMode = true,\n separator: string | string[] = UNOVIS_TEXT_SEPARATOR_DEFAULT,\n wordBreak = false\n): UnovisWrappedText[] {\n // Merge input text with default values and convert it to an array if it's not already\n const textArrays = Array.isArray(text) ? text.map(t => merge(UNOVIS_TEXT_DEFAULT, t)) : [merge(UNOVIS_TEXT_DEFAULT, text)]\n\n // Break input text into lines based on width and separator\n const textWrapped: Array<string[]> = textArrays.map(block => breakTextIntoLines(block, width, fastMode, separator, wordBreak))\n\n const firstBlock = textArrays[0]\n let h = -firstBlock.fontSize * (firstBlock.lineHeight - 1)\n const blocks: UnovisWrappedText[] = []\n\n // Process each text block and its lines based on height limit\n textArrays.forEach((text, i) => {\n let lines = textWrapped[i]\n\n const prevBlock = i > 0 ? blocks[i - 1] : undefined\n const prevBlockMarginBottomPx = prevBlock ? prevBlock.marginBottom : 0\n const marginTopPx = text.marginTop\n const effectiveMarginPx = Math.max(prevBlockMarginBottomPx, marginTopPx)\n\n h += effectiveMarginPx\n const dh = text.fontSize * text.lineHeight\n let maxWidth = 0\n // Iterate over lines and handle text overflow based on the height limit if provided\n for (let k = 0; k < lines.length; k += 1) {\n let line = lines[k]\n h += dh\n\n const lineWithEllipsis = `${line} …`\n const textLengthPx = fastMode\n ? estimateStringPixelLength(lineWithEllipsis, text.fontSize, text.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(lineWithEllipsis, text.fontFamily, text.fontSize)\n\n maxWidth = Math.max(textLengthPx, maxWidth)\n if (height && (h + dh) > height && (k !== lines.length - 1)) {\n // Remove hyphen character from the end of the line if it's there\n const lastCharacter = line.charAt(line.length - 1)\n if (lastCharacter === UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT) {\n line = line.substr(0, lines[k].length - 1)\n }\n\n if (textLengthPx < width) {\n lines[k] = lineWithEllipsis\n } else {\n lines[k] = `${lines[k].substr(0, lines[k].length - 2)}…`\n }\n\n lines = lines.slice(0, k + 1)\n break\n }\n }\n\n // Create wrapped text block with its calculated properties\n blocks.push({ ...text, _lines: lines, _estimatedHeight: h - (prevBlock?._estimatedHeight || 0), _maxWidth: Math.max(maxWidth, prevBlock?._maxWidth ?? 0) })\n })\n\n return blocks\n}\n\n\n/**\n * Renders a text or array of texts to SVG tspan strings.\n *\n * @param {UnovisWrappedText[]} blocks - The wrapped text blocks.\n * @param {number} [x=0] - The x-coordinate for the tspan elements.\n * @param {number} [y] - The y-coordinate for the tspan elements.\n * @returns {string[]} - The SVG tspan strings.\n */\nfunction renderTextToTspanStrings (blocks: UnovisWrappedText[], x = 0, y?: number): string[] {\n return blocks.map((b, i) => {\n const prevBlock = i > 0 ? blocks[i - 1] : undefined\n const prevBlockMarginBottomEm = prevBlock ? prevBlock.marginBottom / prevBlock.fontSize : 0\n const marginTopEm = b.marginTop / b.fontSize\n const marginEm = Math.max(prevBlockMarginBottomEm, marginTopEm)\n const attributes = {\n fontSize: b.fontSize,\n fontFamily: b.fontFamily,\n fontWeight: b.fontWeight,\n fill: b.color,\n y: (i === 0) && y,\n }\n\n const attributesString = Object.entries(attributes)\n .filter(([_, value]) => value)\n .map(([key, value]) => `${kebabCase(key)}=\"${escapeStringKeepHash(value.toString())}\"`)\n .join(' ')\n\n return `<tspan xmlns=\"http://www.w3.org/2000/svg\" ${attributesString}>${b._lines.map((line, k) => {\n let dy: number\n if (i === 0 && k === 0) dy = 0.8 + marginEm\n else if (k === 0) dy = marginEm + b.lineHeight\n else dy = b.lineHeight\n\n return `<tspan x=\"${x}\" dy=\"${dy}em\">${line.length ? line : ' '}</tspan>`\n }).join('')}</tspan>`\n })\n}\n\n/**\n * Estimates the height of wrapped text blocks.\n *\n * @export\n * @param {UnovisWrappedText[]} blocks - The wrapped text blocks.\n * @returns {number} - The estimated height of the wrapped text blocks.\n */\nexport function estimateWrappedTextHeight (blocks: UnovisWrappedText[]): number {\n return sum(blocks, b => b._estimatedHeight)\n}\n\nexport const allowedSvgTextTags = ['text', 'tspan', 'textPath', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'glyphRef', 'textRef', 'textArea']\n\n/**\n * Renders a text or array of texts to an SVG text element.\n * Calling this function will replace the contents of the specified SVG text element.\n *\n * @export\n * @param {SVGTextElement} textElement - The SVG text element to render the text into.\n * @param {UnovisText | UnovisText[]} text - The text or array of texts to render.\n * @param {UnovisTextOptions} options - The text options.\n */\nexport function renderTextToSvgTextElement (\n textElement: SVGTextElement,\n text: UnovisText | UnovisText[],\n options: UnovisTextOptions,\n trimmed?: boolean\n): void {\n const wrappedText = getWrappedText(text, options.width, undefined, options.fastMode, options.separator, options.wordBreak)\n const textElementX = options.x ?? +textElement.getAttribute('x')\n const textElementY = options.y ?? +textElement.getAttribute('y')\n const x = textElementX ?? 0\n let y = textElementY ?? 0\n if (options.textAlign) {\n textElement.setAttribute('text-anchor', getTextAnchorFromTextAlign(options.textAlign))\n }\n\n if (options.verticalAlign && options.verticalAlign !== VerticalAlign.Top) {\n const height = estimateWrappedTextHeight(wrappedText)\n const dy = options.verticalAlign === VerticalAlign.Middle ? -height / 2\n : options.verticalAlign === VerticalAlign.Bottom ? -height : 0\n\n y += dy\n }\n if (options.textRotationAngle) {\n textElement.setAttribute('transform', `rotate(${(options.textRotationAngle === 0 || options.textRotationAngle) ? options.textRotationAngle : 0} ${x} ${y})`)\n } else {\n textElement.removeAttribute('transform')\n }\n\n if (!trimmed) {\n const parser = new DOMParser()\n textElement.textContent = ''\n wrappedText.forEach(block => {\n const svgCode = renderTextToTspanStrings([block], x, y).join('')\n const svgCodeSanitized = striptags(svgCode, allowedSvgTextTags)\n const parsedSvgCode = parser.parseFromString(svgCodeSanitized, 'image/svg+xml').firstChild\n textElement.appendChild(parsedSvgCode)\n })\n }\n}\n\n/**\n * Renders a text or array of texts into a frame.\n * Calling this function will replace the contents of the specified SVG group.\n *\n * @export\n * @param {SVGGElement} group - The SVG group element to render the text into.\n * @param {UnovisText | UnovisText[]} text - The text or array of texts to render.\n * @param {UnovisTextFrameOptions} frameOptions - The text frame options.\n */\nexport function renderTextIntoFrame (\n group: SVGGElement,\n text: UnovisText | UnovisText[],\n frameOptions: UnovisTextFrameOptions\n): void {\n const wrappedText = getWrappedText(text, frameOptions.width, frameOptions.height, frameOptions.fastMode, frameOptions.separator, frameOptions.wordBreak)\n\n const x = frameOptions.textAlign === TextAlign.Center ? frameOptions.width / 2\n : frameOptions.textAlign === TextAlign.Right ? frameOptions.width : 0\n\n let y = 0\n const height = estimateWrappedTextHeight(wrappedText)\n\n // If the frame has height, the text will be vertically aligned within the frame.\n // If not, the text will be aligned against the `y` position of the frame.\n const dh = frameOptions.height - height\n y = frameOptions.verticalAlign === VerticalAlign.Middle ? dh / 2\n : frameOptions.verticalAlign === VerticalAlign.Bottom ? dh : 0\n\n\n const translate = (frameOptions.x || frameOptions.y)\n ? `transform=\"translate(${frameOptions.x ?? 0},${frameOptions.y ?? 0})\"`\n : ''\n\n const svgCode =\n `<text\n xmlns=\"http://www.w3.org/2000/svg\"\n text-anchor=\"${getTextAnchorFromTextAlign(frameOptions.textAlign)}\"\n ${translate}\n >\n ${renderTextToTspanStrings(wrappedText, x, y).join('')}\n </text>`\n\n const parser = new DOMParser()\n const svgCodeSanitized = striptags(svgCode, allowedSvgTextTags)\n const parsedSvgCode = parser.parseFromString(svgCodeSanitized, 'image/svg+xml').firstChild\n\n group.textContent = ''\n group.appendChild(parsedSvgCode)\n}\n\n"],"names":[],"mappings":";;;;;;;AAca,MAAA,iBAAiB,GAAG,CAAC,SAAoB,KAAmB;AACvE,IAAA,QAAQ,SAAS;AACf,QAAA,KAAK,SAAS,CAAC,IAAI,EAAE,OAAO,OAAO,CAAA;AACnC,QAAA,KAAK,SAAS,CAAC,KAAK,EAAE,OAAO,KAAK,CAAA;AAClC,QAAA,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,QAAQ,CAAA;AACtC,QAAA,SAAS,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C,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA,CAAA,EAAI,MAAA,YAAY,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAI,EAAA,CAAA;UACtE,EAAE,CAAA;AAEN,IAAA,MAAM,OAAO,GACb,CAAA;;AAEiB,iBAAA,EAAA,0BAA0B,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;MAC/D,SAAS;;MAET,wBAAwB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;UAChD,CAAA;AAER,IAAA,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAA;IAC9B,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;AAC/D,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC,UAAU,CAAA;AAE1F,IAAA,KAAK,CAAC,WAAW,GAAG,EAAE,CAAA;AACtB,IAAA,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;AAClC;;;;"}
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../src/utils/text.ts"],"sourcesContent":["import { Selection } from 'd3-selection'\nimport { sum } from 'd3-array'\nimport striptags from 'striptags'\n\n// Types\nimport { TextAlign, TrimMode, UnovisText, UnovisTextFrameOptions, UnovisTextOptions, UnovisWrappedText, VerticalAlign } from 'types/text'\n\n// Utils\nimport { flatten, isArray, merge } from 'utils/data'\nimport { getTextAnchorFromTextAlign } from 'types/svg'\n\n// Styles\nimport { getFontWidthToHeightRatio, UNOVIS_TEXT_DEFAULT, UNOVIS_TEXT_SEPARATOR_DEFAULT, UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT } from 'styles/index'\n\n/**\n * Converts a kebab-case string to camelCase.\n *\n * @param {string} str - The kebab-case string to be converted.\n * @returns {string} The resulting camelCase string.\n */\nexport function kebabCaseToCamel (str: string): string {\n return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase())\n}\n\n/**\n * Converts a given string to kebab-case.\n * @param {string} str - The input string to be converted to kebab-case.\n * @returns {string} - The kebab-cased string.\n */\nexport function kebabCase (str: string): string {\n return str.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g)\n ?.filter(Boolean)\n .map(x => x.toLowerCase())\n .join('-')\n}\n\nexport function escapeStringKeepHash (str: string): string {\n return str\n .replace(/['\"]/g, ''') // Escapes quotes with '\n // eslint-disable-next-line no-control-regex\n .replace(/\\u0000/g, '\\\\0') // Escapes null characters\n .replace(/\\n/g, '\\\\n') // Escapes new lines\n .replace(/\\r/g, '\\\\r') // Escapes carriage returns\n .replace(/\\v/g, '\\\\v') // Escapes vertical tabs\n .replace(/\\t/g, '\\\\t') // Escapes horizontal tabs\n .replace(/\\f/g, '\\\\f') // Escapes form feeds\n}\n\n/**\n * Trims the input string from the start, leaving only the specified maximum length.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [maxLength=15] - The maximum allowed length of the trimmed string.\n * @returns {string} - The trimmed string.\n */\nexport function trimStringStart (str: string | undefined, maxLength = 15): string {\n if (!str) return ''\n return str.length > maxLength ? `…${str.substr(str.length - maxLength, maxLength)}` : str\n}\n\n/**\n * Trims the input string from the middle, leaving only the specified maximum length.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [maxLength=15] - The maximum allowed length of the trimmed string.\n * @returns {string} - The trimmed string.\n */\nexport function trimStringMiddle (str: string | undefined, maxLength = 15): string {\n if (!str) return ''\n\n const dist = Math.floor((maxLength - 3) / 2)\n return str.length > maxLength ? `${str.substr(0, dist)}…${str.substr(-dist, dist)}` : str\n}\n\n/**\n * Trims the input string from the end, leaving only the specified maximum length.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [maxLength=15] - The maximum allowed length of the trimmed string.\n * @returns {string} - The trimmed string.\n */\nexport function trimStringEnd (str: string | undefined, maxLength = 15): string {\n if (!str) return ''\n\n return str.length > maxLength ? `${str.substr(0, maxLength)}…` : str\n}\n\n/**\n * Trims the input string according to the specified trim mode.\n * @param {string} str - The input string to be trimmed.\n * @param {number} [length=15] - The maximum allowed length of the trimmed string.\n * @param {TrimMode} [type=TrimMode.Middle] - The trim mode to be applied.\n * @returns {string} - The trimmed string.\n */\nexport function trimString (str: string | undefined, length = 15, type = TrimMode.Middle): string {\n if (!str) return ''\n\n let result = trimStringEnd(str, length)\n if (type === TrimMode.Start) result = trimStringStart(str, length)\n else if (type === TrimMode.Middle) result = trimStringMiddle(str, length)\n return result\n}\n\n/**\n * Splits the input string according to the specified separators.\n * @param {string} text - The input string to be split.\n * @param {string[]} [separators=[' ']] - The array of separators to be used for splitting.\n * @returns {string[]} - The array of split words.\n */\nexport function splitString (text: string, separators = [' ']): string[] {\n let result = [text] as Array<string | string[]>\n for (let i = 0; i < separators.length; i++) {\n const sep = separators[i]\n result.forEach((d, index) => {\n const separated = (d as string).split(sep)\n const words = separated.map((word, j) => `${word}${j === separated.length - 1 ? '' : sep}`)\n result[index] = words\n })\n result = flatten(result)\n }\n\n return result as string[]\n}\n\n/**\n * Wraps an SVG text element to fit within the specified width.\n * @param {Selection<SVGTextElement, any, SVGElement, any>} textElement - The SVG text element to be wrapped.\n * @param {number} width - The maximum allowed width for the text element.\n * @param {(string | string[])} [separator=[' ', '-', '.', ',']] - The separator(s) to be used for wrapping.\n */\nexport function wrapSVGText (\n textElement: Selection<SVGTextElement, any, SVGElement, any>,\n width: number,\n separator: string | string[] = [' ', '-', '.', ',']\n): void {\n const text = textElement.text()\n if (!text) return\n\n // Wrap\n const separators = (isArray(separator) ? separator : [separator]) as string[]\n const words = splitString(text, separators)\n const x = parseFloat(textElement.attr('x')) || 0\n\n textElement.text('')\n let tspan = textElement.append('tspan').attr('x', x)\n let tspanContent = `${words[0]}`\n tspan.text(tspanContent)\n\n words.forEach((word, i) => {\n if (i === 0) return\n\n const tspanText = `${tspanContent}${word}`\n tspan.text(tspanText)\n const tspanWidth = tspan.node().getComputedTextLength()\n if (tspanWidth > width) {\n tspan.text(tspanContent.trim())\n\n tspan = textElement.append('tspan')\n .attr('x', x)\n .attr('dy', '1.2em')\n .text(word)\n\n tspanContent = word\n } else tspanContent += word\n })\n}\n\n/**\n * Trims an SVG text element based on the specified max width, trim type, and other options.\n * @param {Selection<SVGTextElement, any, SVGElement, any>} svgTextSelection - The D3 selection of the SVG text element to be trimmed.\n * @param {number} [maxWidth=50] - The maximum width of the text element.\n * @param {TrimMode} [trimType=TrimMode.Middle] - The type of trim (start, middle, or end).\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method for text length calculation.\n * @param {number} [fontSize=0] - The font size of the text.\n * @param {number} [fontWidthToHeightRatio=getFontWidthToHeightRatio()] - The font width to height ratio.\n * @returns {boolean} True if the text was trimmed, false otherwise.\n */\nexport function trimSVGText (\n svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>,\n maxWidth = 50,\n trimType = TrimMode.Middle,\n fastMode = true,\n fontSize = +window.getComputedStyle(svgTextSelection.node())?.fontSize || 0,\n fontWidthToHeightRatio = getFontWidthToHeightRatio()\n): boolean {\n const text = svgTextSelection.text()\n const textLength = text.length\n\n const textWidth = fastMode ? fontSize * textLength * fontWidthToHeightRatio : svgTextSelection.node().getComputedTextLength()\n const tolerance = 1.1\n const maxCharacters = Math.ceil(textLength * maxWidth / (tolerance * textWidth))\n if (maxCharacters < textLength) {\n svgTextSelection.text(trimString(text, maxCharacters, trimType))\n return true\n }\n\n return false\n}\n\n/**\n * Estimates the length of a string in pixels.\n * @param {string} str - The string to be measured.\n * @param {number} fontSize - The font size of the string.\n * @param {number} [fontWidthToHeightRatio=getFontWidthToHeightRatio()] - The font width to height ratio.\n * @returns {number} The estimated length of the string in pixels.\n */\nexport function estimateStringPixelLength (\n str: string,\n fontSize: number,\n fontWidthToHeightRatio = getFontWidthToHeightRatio()\n): number {\n return str.length * fontSize * fontWidthToHeightRatio || 0\n}\n\n/**\n * Calculates the precise length of a string in pixels.\n * @param {string} str - The string to be measured.\n * @param {string} [fontFamily] - The font family of the string.\n * @param {(string | number)} [fontSize] - The font size of the string.\n * @returns {number} The precise length of the string in pixels.\n */\nexport function getPreciseStringLengthPx (str: string, fontFamily?: string, fontSize?: string | number): number {\n const svgNS = 'http://www.w3.org/2000/svg'\n const svg = document.createElementNS(svgNS, 'svg')\n const text = document.createElementNS(svgNS, 'text')\n\n text.textContent = str\n text.setAttribute('font-size', `${fontSize}`)\n text.setAttribute('font-family', fontFamily)\n\n svg.appendChild(text)\n document.body.appendChild(svg)\n const length = text.getComputedTextLength()\n document.body.removeChild(svg)\n\n return length\n}\n\n/**\n * Estimates the dimensions of an SVG text element.\n *\n * @export\n * @param {Selection<SVGTextElement, any, SVGElement, any>} svgTextSelection - The D3 selection of the SVG text element.\n * @param {number} fontSize - The font size.\n * @param {number} [dy=0.32] - The line height scaling factor.\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method or a more accurate one.\n * @param {number} [fontWidthToHeightRatio] - The font width-to-height ratio.\n * @returns {{width: number, height: number}} - The estimated dimensions of the text element.\n */\nexport function estimateTextSize (\n svgTextSelection: Selection<SVGTextElement, any, SVGElement, any>,\n fontSize: number,\n dy = 0.32,\n fastMode = true,\n fontWidthToHeightRatio?: number\n): { width: number; height: number } {\n fontWidthToHeightRatio = fontWidthToHeightRatio || getFontWidthToHeightRatio()\n const tspanSelection = svgTextSelection.selectAll('tspan')\n\n const lines = tspanSelection.size() || 1\n const height = svgTextSelection.text() ? 0.85 * fontSize * lines * (1 + dy) - dy : 0\n\n let width = 0\n if (tspanSelection.empty()) {\n const textLength = svgTextSelection.text().length\n width = fastMode ? fontSize * textLength * fontWidthToHeightRatio : svgTextSelection.node().getComputedTextLength()\n } else {\n for (const tspan of tspanSelection.nodes()) {\n const tspanTextLength = (tspan as SVGTSpanElement).textContent.length\n const w = fastMode ? fontSize * tspanTextLength * fontWidthToHeightRatio : (tspan as SVGTSpanElement).getComputedTextLength()\n if (w > width) width = w\n }\n }\n\n return { width, height }\n}\n\n/**\n * Breaks a text block into lines based on the specified width.\n *\n * @param {UnovisText} textBlock - The text block to break into lines.\n * @param {number | undefined} [width=undefined] - The maximum width of a line in pixels.\n * @param {(number | undefined)} [height=undefined] - The height limit for the wrapped text in pixels.\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method or a more accurate one.\n * @param {string | string[]} [separator] - The word separators.\n * @returns {string[]} - The text split into lines.\n */\nfunction breakTextIntoLines (\n textBlock: UnovisText,\n width: number | undefined = undefined,\n fastMode = true,\n separator: string | string[] = UNOVIS_TEXT_SEPARATOR_DEFAULT,\n wordBreak = false\n): string[] {\n const text = `${textBlock.text}`\n if (!text) return []\n const separators = Array.isArray(separator) ? separator : [separator]\n\n const splitByNewLine = text.split('\\n')\n return splitByNewLine.map((str) => {\n const lines: string[] = []\n if (!width) return [str]\n\n const words = splitString(str, separators)\n let line = ''\n for (let i = 0; i < words.length; i += 1) {\n const textLengthPx = fastMode\n ? estimateStringPixelLength(line + words[i], textBlock.fontSize, textBlock.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(line + words[i], textBlock.fontFamily, textBlock.fontSize)\n\n if (textLengthPx < width || i === 0) {\n line += words[i]\n } else {\n lines.push(line.trim())\n line = words[i]\n }\n\n // Word break functionality\n const minCharactersOnLine = 2\n if (wordBreak) {\n while (line.trim().length > minCharactersOnLine) {\n const subLineLengthPx = fastMode\n ? estimateStringPixelLength(line, textBlock.fontSize, textBlock.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(line, textBlock.fontFamily, textBlock.fontSize)\n\n if (subLineLengthPx > width) {\n let breakIndex = (line.trim()).length - minCharactersOnLine // Place at least `minCharactersOnLine` characters onto the next line\n while (breakIndex > 0) {\n const subLine = `${line.substring(0, breakIndex)}${UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT}` // Use hyphen when force breaking words\n const subLinePx = fastMode\n ? estimateStringPixelLength(subLine, textBlock.fontSize, textBlock.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(subLine, textBlock.fontFamily, textBlock.fontSize)\n\n // If the subline is less than the width, or just one character left, break the line\n if (subLinePx <= width || breakIndex === 1) {\n lines.push(subLine.trim())\n line = line.substring(breakIndex)\n break\n }\n breakIndex--\n }\n } else {\n break\n }\n }\n }\n }\n\n // Adding the final line after the loop\n if (line) lines.push(line.trim())\n\n return lines\n }).flat()\n}\n\n/**\n * Wraps a text or array of texts to fit within specified width and height, if provided.\n *\n * @export\n * @param {UnovisText | UnovisText[]} text - The text or array of texts to wrap.\n * @param {number | undefined} [width=undefined] - The maximum width of a line in pixels.\n * @param {boolean} [fastMode=true] - Whether to use a fast estimation method or a more accurate one.\n * @param {string | string[]} [separator] - The word separators.\n * @returns {UnovisWrappedText[]} - The wrapped texts.\n */\nexport function getWrappedText (\n text: UnovisText | UnovisText[],\n width: number | undefined = undefined,\n height: number | undefined = undefined,\n fastMode = true,\n separator: string | string[] = UNOVIS_TEXT_SEPARATOR_DEFAULT,\n wordBreak = false\n): UnovisWrappedText[] {\n // Merge input text with default values and convert it to an array if it's not already\n const textArrays = Array.isArray(text) ? text.map(t => merge(UNOVIS_TEXT_DEFAULT, t)) : [merge(UNOVIS_TEXT_DEFAULT, text)]\n\n // Break input text into lines based on width and separator\n const textWrapped: Array<string[]> = textArrays.map(block => breakTextIntoLines(block, width, fastMode, separator, wordBreak))\n\n const firstBlock = textArrays[0]\n let h = -firstBlock.fontSize * (firstBlock.lineHeight - 1)\n const blocks: UnovisWrappedText[] = []\n\n // Process each text block and its lines based on height limit\n textArrays.forEach((text, i) => {\n let lines = textWrapped[i]\n\n const prevBlock = i > 0 ? blocks[i - 1] : undefined\n const prevBlockMarginBottomPx = prevBlock ? prevBlock.marginBottom : 0\n const marginTopPx = text.marginTop\n const effectiveMarginPx = Math.max(prevBlockMarginBottomPx, marginTopPx)\n\n h += effectiveMarginPx\n const dh = text.fontSize * text.lineHeight\n let maxWidth = 0\n // Iterate over lines and handle text overflow based on the height limit if provided\n for (let k = 0; k < lines.length; k += 1) {\n let line = lines[k]\n h += dh\n\n const lineWithEllipsis = `${line} …`\n const textLengthPx = fastMode\n ? estimateStringPixelLength(lineWithEllipsis, text.fontSize, text.fontWidthToHeightRatio)\n : getPreciseStringLengthPx(lineWithEllipsis, text.fontFamily, text.fontSize)\n\n maxWidth = Math.max(textLengthPx, maxWidth)\n if (height && (h + dh) > height && (k !== lines.length - 1)) {\n // Remove hyphen character from the end of the line if it's there\n const lastCharacter = line.charAt(line.length - 1)\n if (lastCharacter === UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT) {\n line = line.substr(0, lines[k].length - 1)\n }\n\n if (textLengthPx < width) {\n lines[k] = lineWithEllipsis\n } else {\n lines[k] = `${lines[k].substr(0, lines[k].length - 2)}…`\n }\n\n lines = lines.slice(0, k + 1)\n break\n }\n }\n\n // Create wrapped text block with its calculated properties\n blocks.push({ ...text, _lines: lines, _estimatedHeight: h - (prevBlock?._estimatedHeight || 0), _maxWidth: Math.max(maxWidth, prevBlock?._maxWidth ?? 0) })\n })\n\n return blocks\n}\n\n\n/**\n * Renders a text or array of texts to SVG tspan strings.\n *\n * @param {UnovisWrappedText[]} blocks - The wrapped text blocks.\n * @param {number} [x=0] - The x-coordinate for the tspan elements.\n * @param {number} [y] - The y-coordinate for the tspan elements.\n * @returns {string[]} - The SVG tspan strings.\n */\nfunction renderTextToTspanStrings (blocks: UnovisWrappedText[], x = 0, y?: number): string[] {\n return blocks.map((b, i) => {\n const prevBlock = i > 0 ? blocks[i - 1] : undefined\n const prevBlockMarginBottomEm = prevBlock ? prevBlock.marginBottom / prevBlock.fontSize : 0\n const marginTopEm = b.marginTop / b.fontSize\n const marginEm = Math.max(prevBlockMarginBottomEm, marginTopEm)\n const attributes = {\n fontSize: b.fontSize,\n fontFamily: b.fontFamily,\n fontWeight: b.fontWeight,\n fill: b.color,\n y: (i === 0) && y,\n }\n\n const attributesString = Object.entries(attributes)\n .filter(([_, value]) => value)\n .map(([key, value]) => `${kebabCase(key)}=\"${escapeStringKeepHash(value.toString())}\"`)\n .join(' ')\n\n return `<tspan xmlns=\"http://www.w3.org/2000/svg\" ${attributesString}>${b._lines.map((line, k) => {\n let dy: number\n if (i === 0 && k === 0) dy = 0.8 + marginEm\n else if (k === 0) dy = marginEm + b.lineHeight\n else dy = b.lineHeight\n\n return `<tspan x=\"${x}\" dy=\"${dy}em\">${line.length ? line : ' '}</tspan>`\n }).join('')}</tspan>`\n })\n}\n\n/**\n * Estimates the height of wrapped text blocks.\n *\n * @export\n * @param {UnovisWrappedText[]} blocks - The wrapped text blocks.\n * @returns {number} - The estimated height of the wrapped text blocks.\n */\nexport function estimateWrappedTextHeight (blocks: UnovisWrappedText[]): number {\n return sum(blocks, b => b._estimatedHeight)\n}\n\nexport const allowedSvgTextTags = ['text', 'tspan', 'textPath', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'glyphRef', 'textRef', 'textArea']\n\n/**\n * Renders a text or array of texts to an SVG text element.\n * Calling this function will replace the contents of the specified SVG text element.\n *\n * @export\n * @param {SVGTextElement} textElement - The SVG text element to render the text into.\n * @param {UnovisText | UnovisText[]} text - The text or array of texts to render.\n * @param {UnovisTextOptions} options - The text options.\n */\nexport function renderTextToSvgTextElement (\n textElement: SVGTextElement,\n text: UnovisText | UnovisText[],\n options: UnovisTextOptions,\n trimmed?: boolean\n): void {\n const wrappedText = getWrappedText(text, options.width, undefined, options.fastMode, options.separator, options.wordBreak)\n const textElementX = options.x ?? +textElement.getAttribute('x')\n const textElementY = options.y ?? +textElement.getAttribute('y')\n const x = textElementX ?? 0\n let y = textElementY ?? 0\n if (options.textAlign) {\n textElement.setAttribute('text-anchor', getTextAnchorFromTextAlign(options.textAlign))\n }\n\n if (options.verticalAlign && options.verticalAlign !== VerticalAlign.Top) {\n const height = estimateWrappedTextHeight(wrappedText)\n const dy = options.verticalAlign === VerticalAlign.Middle ? -height / 2\n : options.verticalAlign === VerticalAlign.Bottom ? -height : 0\n\n y += dy\n }\n if (options.textRotationAngle) {\n textElement.setAttribute('transform', `rotate(${(options.textRotationAngle === 0 || options.textRotationAngle) ? options.textRotationAngle : 0} ${x} ${y})`)\n } else {\n textElement.removeAttribute('transform')\n }\n\n if (!trimmed) {\n const parser = new DOMParser()\n textElement.textContent = ''\n wrappedText.forEach(block => {\n const svgCode = renderTextToTspanStrings([block], x, y).join('')\n const svgCodeSanitized = striptags(svgCode, allowedSvgTextTags)\n const parsedSvgCode = parser.parseFromString(svgCodeSanitized, 'image/svg+xml').firstChild\n textElement.appendChild(parsedSvgCode)\n })\n }\n}\n\n/**\n * Renders a text or array of texts into a frame.\n * Calling this function will replace the contents of the specified SVG group.\n *\n * @export\n * @param {SVGGElement} group - The SVG group element to render the text into.\n * @param {UnovisText | UnovisText[]} text - The text or array of texts to render.\n * @param {UnovisTextFrameOptions} frameOptions - The text frame options.\n */\nexport function renderTextIntoFrame (\n group: SVGGElement,\n text: UnovisText | UnovisText[],\n frameOptions: UnovisTextFrameOptions\n): void {\n const wrappedText = getWrappedText(text, frameOptions.width, frameOptions.height, frameOptions.fastMode, frameOptions.separator, frameOptions.wordBreak)\n\n const x = frameOptions.textAlign === TextAlign.Center ? frameOptions.width / 2\n : frameOptions.textAlign === TextAlign.Right ? frameOptions.width : 0\n\n let y = 0\n const height = estimateWrappedTextHeight(wrappedText)\n\n // If the frame has height, the text will be vertically aligned within the frame.\n // If not, the text will be aligned against the `y` position of the frame.\n const dh = frameOptions.height - height\n y = frameOptions.verticalAlign === VerticalAlign.Middle ? dh / 2\n : frameOptions.verticalAlign === VerticalAlign.Bottom ? dh : 0\n\n\n const translate = (frameOptions.x || frameOptions.y)\n ? `transform=\"translate(${frameOptions.x ?? 0},${frameOptions.y ?? 0})\"`\n : ''\n\n const svgCode =\n `<text\n xmlns=\"http://www.w3.org/2000/svg\"\n text-anchor=\"${getTextAnchorFromTextAlign(frameOptions.textAlign)}\"\n ${translate}\n >\n ${renderTextToTspanStrings(wrappedText, x, y).join('')}\n </text>`\n\n const parser = new DOMParser()\n const svgCodeSanitized = striptags(svgCode, allowedSvgTextTags)\n const parsedSvgCode = parser.parseFromString(svgCodeSanitized, 'image/svg+xml').firstChild\n\n group.textContent = ''\n group.appendChild(parsedSvgCode)\n}\n"],"names":[],"mappings":";;;;;;;AAcA;;;;;AAKG;AACG,SAAU,gBAAgB,CAAE,GAAW,EAAA;AAC3C,IAAA,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;AACtE,CAAC;AAED;;;;AAIG;AACG,SAAU,SAAS,CAAE,GAAW,EAAA;;IACpC,OAAO,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,8DAA8D,CAAC,MAC5E,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,CAAC,OAAO,CACf,CAAA,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA,CACxB,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAEK,SAAU,oBAAoB,CAAE,GAAW,EAAA;AAC/C,IAAA,OAAO,GAAG;AACP,SAAA,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;;AAEzB,SAAA,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC;AACzB,SAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;AACrB,SAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;AACrB,SAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;AACrB,SAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;AACrB,SAAA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED;;;;;AAKG;SACa,eAA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GAAG,CAAC;AAC9D,UAAE,YAAY,CAAC,aAAa,KAAK,aAAa,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,CAAA;IAGhE,MAAM,SAAS,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC;AACjD,UAAE,CAAA,qBAAA,EAAwB,CAAA,EAAA,GAAA,YAAY,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA,CAAA,EAAI,MAAA,YAAY,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAI,EAAA,CAAA;UACtE,EAAE,CAAA;AAEN,IAAA,MAAM,OAAO,GACb,CAAA;;AAEiB,iBAAA,EAAA,0BAA0B,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;MAC/D,SAAS,CAAA;;MAET,wBAAwB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;UAChD,CAAA;AAER,IAAA,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAA;IAC9B,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;AAC/D,IAAA,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC,UAAU,CAAA;AAE1F,IAAA,KAAK,CAAC,WAAW,GAAG,EAAE,CAAA;AACtB,IAAA,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,CAAA;AAClC;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { RollingPinLegendItem } from "./types";
|
|
2
|
-
export interface RollingPinLegendConfigInterface {
|
|
3
|
-
/** Rects forming a legend. Array of `string`, representing colors.
|
|
4
|
-
*
|
|
5
|
-
* Default: `[]` */
|
|
6
|
-
rects: RollingPinLegendItem[];
|
|
7
|
-
/** Label on the left side of the legend. Default: `undefined` */
|
|
8
|
-
leftLabelText?: string;
|
|
9
|
-
/** Label on the right side of the legend. Default: `undefined` */
|
|
10
|
-
rightLabelText?: string;
|
|
11
|
-
/** Apply a specific class to the labels. Default: `''` */
|
|
12
|
-
labelClassName?: string;
|
|
13
|
-
/** Label text (<span> element) font-size CSS. Default: `null` */
|
|
14
|
-
labelFontSize?: string | null;
|
|
15
|
-
/** If set to true, the legend will be rendered directly into the HTML element provided to the constructor
|
|
16
|
-
* without creating additional `div` element. Default: `false` */
|
|
17
|
-
renderIntoProvidedDomNode?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const RollingPinLegendDefaultConfig: RollingPinLegendConfigInterface;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/rolling-pin-legend/config.ts"],"sourcesContent":["import { RollingPinLegendItem } from 'components/rolling-pin-legend/types'\n\nexport interface RollingPinLegendConfigInterface {\n /** Rects forming a legend. Array of `string`, representing colors.\n *\n * Default: `[]` */\n rects: RollingPinLegendItem[];\n /** Label on the left side of the legend. Default: `undefined` */\n leftLabelText?: string;\n /** Label on the right side of the legend. Default: `undefined` */\n rightLabelText?: string;\n /** Apply a specific class to the labels. Default: `''` */\n labelClassName?: string;\n /** Label text (<span> element) font-size CSS. Default: `null` */\n labelFontSize?: string | null;\n /** If set to true, the legend will be rendered directly into the HTML element provided to the constructor\n * without creating additional `div` element. Default: `false` */\n renderIntoProvidedDomNode?: boolean;\n}\n\nexport const RollingPinLegendDefaultConfig: RollingPinLegendConfigInterface = {\n rects: [],\n labelClassName: '',\n labelFontSize: null,\n renderIntoProvidedDomNode: false,\n}\n"],"names":[],"mappings":"AAoBa,MAAA,6BAA6B,GAAoC;AAC5E,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,cAAc,EAAE,EAAE;AAClB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,yBAAyB,EAAE,KAAK;;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { RollingPinLegendConfigInterface } from './config';
|
|
3
|
-
import * as s from './style';
|
|
4
|
-
export declare class RollingPinLegend {
|
|
5
|
-
static selectors: typeof s;
|
|
6
|
-
protected _defaultConfig: RollingPinLegendConfigInterface;
|
|
7
|
-
config: RollingPinLegendConfigInterface;
|
|
8
|
-
div: Selection<HTMLElement, unknown, null, undefined>;
|
|
9
|
-
element: HTMLElement;
|
|
10
|
-
prevConfig: RollingPinLegendConfigInterface;
|
|
11
|
-
protected _container: HTMLElement;
|
|
12
|
-
constructor(element: HTMLElement, config?: RollingPinLegendConfigInterface);
|
|
13
|
-
setConfig(config: RollingPinLegendConfigInterface): void;
|
|
14
|
-
render(): void;
|
|
15
|
-
destroy(): void;
|
|
16
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { select } from 'd3-selection';
|
|
2
|
-
import { merge } from '../../utils/data.js';
|
|
3
|
-
import { RollingPinLegendDefaultConfig } from './config.js';
|
|
4
|
-
import * as style from './style.js';
|
|
5
|
-
import { root, label, rectsContainer, rect } from './style.js';
|
|
6
|
-
|
|
7
|
-
class RollingPinLegend {
|
|
8
|
-
constructor(element, config) {
|
|
9
|
-
this._defaultConfig = RollingPinLegendDefaultConfig;
|
|
10
|
-
this.config = this._defaultConfig;
|
|
11
|
-
this._container = element;
|
|
12
|
-
this.div = (config === null || config === void 0 ? void 0 : config.renderIntoProvidedDomNode) ? select(this._container) : select(this._container).append('div');
|
|
13
|
-
this.div.classed(root, true);
|
|
14
|
-
this.element = this.div.node();
|
|
15
|
-
if (config)
|
|
16
|
-
this.setConfig(config);
|
|
17
|
-
}
|
|
18
|
-
setConfig(config) {
|
|
19
|
-
this.prevConfig = this.config;
|
|
20
|
-
this.config = merge(this._defaultConfig, config);
|
|
21
|
-
this.render();
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
const { config } = this;
|
|
25
|
-
const newRoot = this.div
|
|
26
|
-
.selectAll(`.${root}`)
|
|
27
|
-
.data([0])
|
|
28
|
-
.enter()
|
|
29
|
-
.append('div')
|
|
30
|
-
.attr('class', root);
|
|
31
|
-
newRoot
|
|
32
|
-
.append('span')
|
|
33
|
-
.attr('class', label);
|
|
34
|
-
newRoot
|
|
35
|
-
.append('div')
|
|
36
|
-
.attr('class', rectsContainer);
|
|
37
|
-
newRoot
|
|
38
|
-
.append('span')
|
|
39
|
-
.attr('class', label);
|
|
40
|
-
const root$1 = this.div
|
|
41
|
-
.select(`.${root}`);
|
|
42
|
-
root$1.selectAll(`.${label}`)
|
|
43
|
-
.data([config.leftLabelText, config.rightLabelText])
|
|
44
|
-
.text(d => d);
|
|
45
|
-
const rectsContainer$1 = root$1.select(`.${rectsContainer}`);
|
|
46
|
-
const rects = rectsContainer$1.selectAll(`.${rect}`).data(config.rects);
|
|
47
|
-
const rectsEnter = rects.enter()
|
|
48
|
-
.append('div')
|
|
49
|
-
.attr('class', rect);
|
|
50
|
-
const rectsMerged = rectsEnter.merge(rects);
|
|
51
|
-
rectsMerged
|
|
52
|
-
.style('background-color', d => d);
|
|
53
|
-
rects.exit().remove();
|
|
54
|
-
}
|
|
55
|
-
destroy() {
|
|
56
|
-
if (this.element !== this._container)
|
|
57
|
-
this.div.remove();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
RollingPinLegend.selectors = style;
|
|
61
|
-
|
|
62
|
-
export { RollingPinLegend };
|
|
63
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/rolling-pin-legend/index.ts"],"sourcesContent":["import { select, Selection } from 'd3-selection'\n\n// Utils\nimport { merge } from 'utils/data'\n\n// Config\nimport { RollingPinLegendConfigInterface, RollingPinLegendDefaultConfig } from './config'\n\n// Styles\nimport * as s from './style'\n\nexport class RollingPinLegend {\n static selectors = s\n protected _defaultConfig = RollingPinLegendDefaultConfig as RollingPinLegendConfigInterface\n public config: RollingPinLegendConfigInterface = this._defaultConfig\n\n div: Selection<HTMLElement, unknown, null, undefined>\n element: HTMLElement\n prevConfig: RollingPinLegendConfigInterface\n protected _container: HTMLElement\n\n constructor (element: HTMLElement, config?: RollingPinLegendConfigInterface) {\n this._container = element\n\n this.div = config?.renderIntoProvidedDomNode ? select(this._container) : select(this._container).append<HTMLElement>('div')\n this.div.classed(s.root, true)\n\n this.element = this.div.node()\n\n if (config) this.setConfig(config)\n }\n\n setConfig (config: RollingPinLegendConfigInterface): void {\n this.prevConfig = this.config\n this.config = merge(this._defaultConfig, config)\n this.render()\n }\n\n render (): void {\n const { config } = this\n\n const newRoot = this.div\n .selectAll<HTMLDivElement, unknown>(`.${s.root}`)\n .data([0])\n .enter()\n .append('div')\n .attr('class', s.root)\n\n newRoot\n .append('span')\n .attr('class', s.label)\n\n newRoot\n .append('div')\n .attr('class', s.rectsContainer)\n\n newRoot\n .append('span')\n .attr('class', s.label)\n\n const root = this.div\n .select<HTMLDivElement>(`.${s.root}`)\n\n root.selectAll<HTMLDivElement, unknown>(`.${s.label}`)\n .data([config.leftLabelText, config.rightLabelText])\n .text(d => d)\n\n const rectsContainer = root.select<HTMLDivElement>(`.${s.rectsContainer}`)\n\n const rects = rectsContainer.selectAll<HTMLDivElement, unknown>(`.${s.rect}`).data(config.rects)\n\n const rectsEnter = rects.enter()\n .append('div')\n .attr('class', s.rect)\n\n const rectsMerged = rectsEnter.merge(rects)\n rectsMerged\n .style('background-color', d => d)\n\n rects.exit().remove()\n }\n\n public destroy (): void {\n if (this.element !== this._container) this.div.remove()\n }\n}\n"],"names":["s.root","s.label","s.rectsContainer","root","rectsContainer","s.rect","s"],"mappings":";;;;;;MAWa,gBAAgB,CAAA;IAU3B,WAAa,CAAA,OAAoB,EAAE,MAAwC,EAAA;QARjE,IAAc,CAAA,cAAA,GAAG,6BAAgE,CAAA;AACpF,QAAA,IAAA,CAAA,MAAM,GAAoC,IAAI,CAAC,cAA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M,gBAAS,CAAA,SAAA,GAAGC,KAAC;;;;"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { css, injectGlobal } from '@emotion/css';
|
|
2
|
-
|
|
3
|
-
const root = css `
|
|
4
|
-
display: flex;
|
|
5
|
-
`;
|
|
6
|
-
const rectsContainer = css `
|
|
7
|
-
display: flex;
|
|
8
|
-
margin: 0 var(--vis-rolling-pin-legend-spacing);
|
|
9
|
-
`;
|
|
10
|
-
const label = css `
|
|
11
|
-
font-size: var(--vis-rolling-pin-legend-label-font-size);
|
|
12
|
-
max-width: var(--vis-rolling-pin-legend-label-max-width);
|
|
13
|
-
color: var(--vis-rolling-pin-legend-label-color);
|
|
14
|
-
`;
|
|
15
|
-
const rect = css `
|
|
16
|
-
display: inline-block;
|
|
17
|
-
flex: 1;
|
|
18
|
-
width: var(--vis-rolling-pin-legend-item-width);
|
|
19
|
-
`;
|
|
20
|
-
const variables = injectGlobal `
|
|
21
|
-
:root {
|
|
22
|
-
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
23
|
-
/* --vis-legend-font-family: */
|
|
24
|
-
|
|
25
|
-
--vis-rolling-pin-legend-label-color: #6c778c;
|
|
26
|
-
--vis-rolling-pin-legend-label-max-width: 300px;
|
|
27
|
-
--vis-rolling-pin-legend-label-font-size: 12px;
|
|
28
|
-
--vis-rolling-pin-legend-spacing: 4px;
|
|
29
|
-
--vis-rolling-pin-legend-item-width: 8px;
|
|
30
|
-
|
|
31
|
-
--vis-dark-rolling-pin-legend-label-color: #eee;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
body.theme-dark ${`.${root}`} {
|
|
35
|
-
--vis-rolling-pin-legend-label-color: var(--vis-dark-rolling-pin-legend-label-color);
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
export { label, rect, rectsContainer, root, variables };
|
|
40
|
-
//# sourceMappingURL=style.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../src/components/rolling-pin-legend/style.ts"],"sourcesContent":["import { css, injectGlobal } from '@emotion/css'\n\nexport const root = css`\n display: flex;\n`\n\nexport const rectsContainer = css`\n display: flex;\n margin: 0 var(--vis-rolling-pin-legend-spacing);\n`\n\nexport const label = css`\n font-size: var(--vis-rolling-pin-legend-label-font-size);\n max-width: var(--vis-rolling-pin-legend-label-max-width);\n color: var(--vis-rolling-pin-legend-label-color);\n`\n\nexport const rect = css`\n display: inline-block;\n flex: 1;\n width: var(--vis-rolling-pin-legend-item-width);\n`\n\nexport const variables = injectGlobal`\n :root {\n // Undefined by default to allow proper fallback to var(--vis-font-family)\n /* --vis-legend-font-family: */\n\n --vis-rolling-pin-legend-label-color: #6c778c;\n --vis-rolling-pin-legend-label-max-width: 300px;\n --vis-rolling-pin-legend-label-font-size: 12px;\n --vis-rolling-pin-legend-spacing: 4px;\n --vis-rolling-pin-legend-item-width: 8px;\n\n --vis-dark-rolling-pin-legend-label-color: #eee;\n }\n\n body.theme-dark ${`.${root}`} {\n --vis-rolling-pin-legend-label-color: var(--vis-dark-rolling-pin-legend-label-color);\n }\n`\n"],"names":[],"mappings":";;AAEO,MAAM,IAAI,GAAG,GAAG,CAAA;;EAEtB;AAEM,MAAM,cAAc,GAAG,GAAG,CAAA;;;EAGhC;AAEM,MAAM,KAAK,GAAG,GAAG,CAAA;;;;EAIvB;AAEM,MAAM,IAAI,GAAG,GAAG,CAAA;;;;EAItB;AAEM,MAAM,SAAS,GAAG,YAAY,CAAA;;;;;;;;;;;;;;AAcjB,kBAAA,EAAA,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type RollingPinLegendItem = string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const TIMELINE_DEFAULT_ARROW_HEAD_LENGTH = 8;
|
|
2
|
-
const TIMELINE_DEFAULT_ARROW_HEAD_WIDTH = 6;
|
|
3
|
-
const TIMELINE_DEFAULT_ARROW_MARGIN = 3;
|
|
4
|
-
|
|
5
|
-
export { TIMELINE_DEFAULT_ARROW_HEAD_LENGTH, TIMELINE_DEFAULT_ARROW_HEAD_WIDTH, TIMELINE_DEFAULT_ARROW_MARGIN };
|
|
6
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/components/timeline/constants.ts"],"sourcesContent":["export const TIMELINE_DEFAULT_ARROW_HEAD_LENGTH = 8\nexport const TIMELINE_DEFAULT_ARROW_HEAD_WIDTH = 6\nexport const TIMELINE_DEFAULT_ARROW_MARGIN = 3\n"],"names":[],"mappings":"AAAO,MAAM,kCAAkC,GAAG,EAAC;AAC5C,MAAM,iCAAiC,GAAG,EAAC;AAC3C,MAAM,6BAA6B,GAAG;;;;"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Arrangement } from "../../types/position";
|
|
2
|
-
export declare type TimelineRowIcon = {
|
|
3
|
-
href: string;
|
|
4
|
-
size: number;
|
|
5
|
-
color: string;
|
|
6
|
-
};
|
|
7
|
-
export declare type TimelineRowLabel<D> = {
|
|
8
|
-
label: string;
|
|
9
|
-
formattedLabel: string;
|
|
10
|
-
data: D[];
|
|
11
|
-
iconHref?: string;
|
|
12
|
-
iconSize?: number;
|
|
13
|
-
iconColor?: string;
|
|
14
|
-
};
|
|
15
|
-
export declare type TimelineArrow = {
|
|
16
|
-
id?: string;
|
|
17
|
-
/** The optional x position of the arrow start. By default the arrow will be placed at the source line's end */
|
|
18
|
-
xSource?: number;
|
|
19
|
-
/** The optional x position of the arrow end. By default the arrow will be placed at the target line's start */
|
|
20
|
-
xTarget?: number;
|
|
21
|
-
/** The horizontal offset of the arrow in pixels. Default: `undefined` */
|
|
22
|
-
xSourceOffsetPx?: number;
|
|
23
|
-
/** The horizontal offset of the arrow in pixels. Default: `undefined` */
|
|
24
|
-
xTargetOffsetPx?: number;
|
|
25
|
-
/** The id of the line start element. */
|
|
26
|
-
lineSourceId: string;
|
|
27
|
-
/** The id of the line end element. */
|
|
28
|
-
lineTargetId: string;
|
|
29
|
-
/** The margin between the line source and the arrow in pixels. Default: `undefined` */
|
|
30
|
-
lineSourceMarginPx?: number;
|
|
31
|
-
/** The margin between the line target and the arrow in pixels. Default: `undefined` */
|
|
32
|
-
lineTargetMarginPx?: number;
|
|
33
|
-
/** The length of the arrowhead in pixels. Default: `8` */
|
|
34
|
-
arrowHeadLength?: number;
|
|
35
|
-
/** The width of the arrowhead in pixels. Default: `6` */
|
|
36
|
-
arrowHeadWidth?: number;
|
|
37
|
-
};
|
|
38
|
-
export declare type TimelineArrowRenderState = {
|
|
39
|
-
_points: [number, number][];
|
|
40
|
-
};
|
|
41
|
-
export declare type TimelineLineRenderState = {
|
|
42
|
-
_id: string;
|
|
43
|
-
/** The x position of the line start pixels. */
|
|
44
|
-
_xPx: number;
|
|
45
|
-
/** The y position of the line in pixels. */
|
|
46
|
-
_yPx: number;
|
|
47
|
-
/** The x offset of the line in pixels. Applied the the lines is too short. See the `_lengthCorrected` property */
|
|
48
|
-
_xOffsetPx: number;
|
|
49
|
-
/** The height of the line in pixels. */
|
|
50
|
-
_height: number;
|
|
51
|
-
/** The length of the line in pixels. */
|
|
52
|
-
_length: number;
|
|
53
|
-
/** When the line is too short, the length is corrected to be
|
|
54
|
-
* at least the line height when `config.lineCap` is set to `true` */
|
|
55
|
-
_lengthCorrected: number;
|
|
56
|
-
_startIconSize: number;
|
|
57
|
-
_endIconSize: number;
|
|
58
|
-
_startIconColor: string;
|
|
59
|
-
_endIconColor: string;
|
|
60
|
-
_startIconArrangement: `${Arrangement}`;
|
|
61
|
-
_endIconArrangement: `${Arrangement}`;
|
|
62
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
2
|
-
export declare const getIconBleed: <Datum>(datum: Datum, idx: number, icon: StringAccessor<Datum>, iconSize: NumericAccessor<Datum>, iconArrangement: StringAccessor<Datum>, rowHeight: number) => number;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Arrangement } from '../../types/position.js';
|
|
2
|
-
import { getString, getNumber, getValue } from '../../utils/data.js';
|
|
3
|
-
|
|
4
|
-
const getIconBleed = (datum, idx, icon, iconSize, iconArrangement, rowHeight) => {
|
|
5
|
-
const iconValue = getString(datum, icon, idx);
|
|
6
|
-
if (!iconValue)
|
|
7
|
-
return 0;
|
|
8
|
-
const size = getNumber(datum, iconSize, idx) || rowHeight / 2;
|
|
9
|
-
const arrangement = getValue(datum, iconArrangement, idx);
|
|
10
|
-
return (arrangement === Arrangement.Outside) ? size
|
|
11
|
-
: (arrangement === Arrangement.Center) ? size / 2
|
|
12
|
-
: 0;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { getIconBleed };
|
|
16
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/timeline/utils.ts"],"sourcesContent":["import type { NumericAccessor, StringAccessor } from 'types/accessor'\nimport { Arrangement } from 'types/position'\nimport { getNumber, getString, getValue } from 'utils/data'\n\nexport const getIconBleed = <Datum>(\n datum: Datum,\n idx: number,\n icon: StringAccessor<Datum>,\n iconSize: NumericAccessor<Datum>,\n iconArrangement: StringAccessor<Datum>,\n rowHeight: number\n): number => {\n const iconValue = getString(datum, icon, idx)\n if (!iconValue) return 0\n\n const size = getNumber(datum, iconSize, idx) || rowHeight / 2\n const arrangement = getValue(datum, iconArrangement, idx)\n\n return (arrangement === Arrangement.Outside) ? size\n : (arrangement === Arrangement.Center) ? size / 2\n : 0\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,YAAY,GAAG,CAC1B,KAAY,EACZ,GAAW,EACX,IAA2B,EAC3B,QAAgC,EAChC,eAAsC,EACtC,SAAiB,KACP;IACV,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;AAC7C,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,CAAC,CAAA;AAExB,IAAA,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC,CAAA;IAC7D,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CAAC,WAAW,KAAK,WAAW,CAAC,OAAO,IAAI,IAAI;AACjD,UAAE,CAAC,WAAW,KAAK,WAAW,CAAC,MAAM,IAAI,IAAI,GAAG,CAAC;cAC7C,CAAC,CAAA;AACT;;;;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ComponentConfigInterface } from "../../core/component/config";
|
|
2
|
-
import { ColorAccessor, NumericAccessor, StringAccessor } from "../../types/accessor";
|
|
3
|
-
import { TreemapNode } from './types';
|
|
4
|
-
export interface TreemapConfigInterface<Datum> extends ComponentConfigInterface {
|
|
5
|
-
id?: ((d: Datum, i: number) => string | number);
|
|
6
|
-
value?: NumericAccessor<Datum>;
|
|
7
|
-
/** Array of accessor functions to defined the nested groups. Default: `[]` */
|
|
8
|
-
layers: StringAccessor<Datum>[];
|
|
9
|
-
/** A function that accepts a value number and returns a string. Default: `undefined` */
|
|
10
|
-
numberFormat?: (value: number) => string;
|
|
11
|
-
/** Color accessor function for tiles. Default: `undefined` */
|
|
12
|
-
tileColor?: ColorAccessor<TreemapNode<Datum>>;
|
|
13
|
-
/** Padding passed to D3 treemap layout. Default: `2` */
|
|
14
|
-
tilePadding?: number;
|
|
15
|
-
/**
|
|
16
|
-
* Top padding passed to D3 treemap layout.
|
|
17
|
-
* Useful to make room for internal node labels.
|
|
18
|
-
* Default: `undefined`
|
|
19
|
-
*/
|
|
20
|
-
tilePaddingTop?: number;
|
|
21
|
-
/** Label internal nodes. Default: `false` */
|
|
22
|
-
labelInternalNodes?: boolean;
|
|
23
|
-
/** Label offset in the X direction. Default: `4` */
|
|
24
|
-
labelOffsetX?: number;
|
|
25
|
-
/** Label offset in the Y direction. Default: `4` */
|
|
26
|
-
labelOffsetY?: number;
|
|
27
|
-
/** Border radius of the tiles in pixels. Default: `2` */
|
|
28
|
-
tileBorderRadius?: number;
|
|
29
|
-
/** Minimum fraction of width for border radius. Default: `1/8` */
|
|
30
|
-
tileBorderRadiusFactor?: number;
|
|
31
|
-
/** Enable lightness variance for sibling tiles. Default: `false` */
|
|
32
|
-
enableLightnessVariance?: boolean;
|
|
33
|
-
/** Enable font size variation for leaf node labels based on value. Default: `false` */
|
|
34
|
-
enableTileLabelFontSizeVariation?: boolean;
|
|
35
|
-
/** Small font size for leaf labels (used when enableTileLabelFontSizeVariation is true). Default: `8` */
|
|
36
|
-
tileLabelSmallFontSize?: number;
|
|
37
|
-
/** Medium font size for leaf labels (used when enableTileLabelFontSizeVariation is true). Default: `12` */
|
|
38
|
-
tileLabelMediumFontSize?: number;
|
|
39
|
-
/** Large font size for leaf labels (used when enableTileLabelFontSizeVariation is true). Default: `24` */
|
|
40
|
-
tileLabelLargeFontSize?: number;
|
|
41
|
-
/** Flag for showing cursor:pointer to indicate leaf tiles are clickable. Default: `undefined` */
|
|
42
|
-
showTileClickAffordance?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export declare const TreemapDefaultConfig: TreemapConfigInterface<unknown>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentDefaultConfig } from '../../core/component/config.js';
|
|
2
|
-
|
|
3
|
-
const TreemapDefaultConfig = Object.assign(Object.assign({}, ComponentDefaultConfig), { id: (d, i) => { var _a; return (_a = d.id) !== null && _a !== void 0 ? _a : i; }, value: undefined, tileColor: undefined, layers: [], tilePadding: 2, tilePaddingTop: undefined, labelInternalNodes: false, labelOffsetX: 4, labelOffsetY: 4, tileBorderRadius: 2, tileBorderRadiusFactor: 1 / 8, enableLightnessVariance: false, enableTileLabelFontSizeVariation: true, tileLabelSmallFontSize: 8, tileLabelMediumFontSize: 12, tileLabelLargeFontSize: 22, showTileClickAffordance: false });
|
|
4
|
-
|
|
5
|
-
export { TreemapDefaultConfig };
|
|
6
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/components/treemap/config.ts"],"sourcesContent":["import { ComponentConfigInterface, ComponentDefaultConfig } from 'core/component/config'\nimport { ColorAccessor, NumericAccessor, StringAccessor } from 'types/accessor'\nimport { TreemapNode } from './types'\n\nexport interface TreemapConfigInterface<Datum> extends ComponentConfigInterface {\n id?: ((d: Datum, i: number) => string | number);\n /* Numeric accessor for segment size value. Default: `undefined`. */\n value?: NumericAccessor<Datum>;\n\n /** Array of accessor functions to defined the nested groups. Default: `[]` */\n layers: StringAccessor<Datum>[];\n\n /** A function that accepts a value number and returns a string. Default: `undefined` */\n numberFormat?: (value: number) => string;\n\n /** Color accessor function for tiles. Default: `undefined` */\n tileColor?: ColorAccessor<TreemapNode<Datum>>;\n\n /** Padding passed to D3 treemap layout. Default: `2` */\n tilePadding?: number;\n\n /**\n * Top padding passed to D3 treemap layout.\n * Useful to make room for internal node labels.\n * Default: `undefined`\n */\n tilePaddingTop?: number;\n\n /** Label internal nodes. Default: `false` */\n labelInternalNodes?: boolean;\n\n /** Label offset in the X direction. Default: `4` */\n labelOffsetX?: number;\n\n /** Label offset in the Y direction. Default: `4` */\n labelOffsetY?: number;\n\n /** Border radius of the tiles in pixels. Default: `2` */\n tileBorderRadius?: number;\n\n /** Minimum fraction of width for border radius. Default: `1/8` */\n tileBorderRadiusFactor?: number;\n\n /** Enable lightness variance for sibling tiles. Default: `false` */\n enableLightnessVariance?: boolean;\n\n /** Enable font size variation for leaf node labels based on value. Default: `false` */\n enableTileLabelFontSizeVariation?: boolean;\n\n /** Small font size for leaf labels (used when enableTileLabelFontSizeVariation is true). Default: `8` */\n tileLabelSmallFontSize?: number;\n\n /** Medium font size for leaf labels (used when enableTileLabelFontSizeVariation is true). Default: `12` */\n tileLabelMediumFontSize?: number;\n\n /** Large font size for leaf labels (used when enableTileLabelFontSizeVariation is true). Default: `24` */\n tileLabelLargeFontSize?: number;\n\n\n /** Flag for showing cursor:pointer to indicate leaf tiles are clickable. Default: `undefined` */\n showTileClickAffordance?: boolean;\n}\n\nexport const TreemapDefaultConfig: TreemapConfigInterface<unknown> = {\n ...ComponentDefaultConfig,\n id: (d: unknown, i: number): string | number => (d as { id: string }).id ?? i,\n value: undefined,\n tileColor: undefined,\n layers: [],\n tilePadding: 2,\n tilePaddingTop: undefined,\n labelInternalNodes: false,\n labelOffsetX: 4,\n labelOffsetY: 4,\n tileBorderRadius: 2,\n tileBorderRadiusFactor: 1 / 8,\n enableLightnessVariance: false,\n enableTileLabelFontSizeVariation: true,\n tileLabelSmallFontSize: 8,\n tileLabelMediumFontSize: 12,\n tileLabelLargeFontSize: 22,\n showTileClickAffordance: false,\n}\n"],"names":[],"mappings":";;AA+Da,MAAA,oBAAoB,mCAC5B,sBAAsB,CAAA,EAAA,EACzB,EAAE,EAAE,CAAC,CAAU,EAAE,CAAS,KAAqB,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAC,EAAA,GAAA,CAAoB,CAAC,EAAE,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,CAAC,CAAA,EAAA,EAC7E,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,EAAE,EACV,WAAW,EAAE,CAAC,EACd,cAAc,EAAE,SAAS,EACzB,kBAAkB,EAAE,KAAK,EACzB,YAAY,EAAE,CAAC,EACf,YAAY,EAAE,CAAC,EACf,gBAAgB,EAAE,CAAC,EACnB,sBAAsB,EAAE,CAAC,GAAG,CAAC,EAC7B,uBAAuB,EAAE,KAAK,EAC9B,gCAAgC,EAAE,IAAI,EACtC,sBAAsB,EAAE,CAAC,EACzB,uBAAuB,EAAE,EAAE,EAC3B,sBAAsB,EAAE,EAAE,EAC1B,uBAAuB,EAAE,KAAK;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Selection } from 'd3-selection';
|
|
2
|
-
import { ComponentCore } from "../../core/component";
|
|
3
|
-
import { SeriesDataModel } from "../../data-models/series";
|
|
4
|
-
import { TreemapConfigInterface } from './config';
|
|
5
|
-
import * as s from './style';
|
|
6
|
-
export declare class Treemap<Datum> extends ComponentCore<Datum[], TreemapConfigInterface<Datum>> {
|
|
7
|
-
static selectors: typeof s;
|
|
8
|
-
protected _defaultConfig: TreemapConfigInterface<Datum>;
|
|
9
|
-
config: TreemapConfigInterface<Datum>;
|
|
10
|
-
datamodel: SeriesDataModel<Datum>;
|
|
11
|
-
tiles: Selection<SVGGElement, unknown, SVGGElement, unknown>;
|
|
12
|
-
private isTileLargeEnough;
|
|
13
|
-
private getTileLightness;
|
|
14
|
-
constructor(config?: TreemapConfigInterface<Datum>);
|
|
15
|
-
_render(): void;
|
|
16
|
-
}
|