Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3plus-text

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3plus-text - npm Package Compare versions

Comparing version 0.9.27 to 0.9.28

1689

build/d3plus-text.js
/*
d3plus-text v0.9.27
d3plus-text v0.9.28
A smart SVG text box with line wrapping and automatic font size scaling.

@@ -67,1017 +67,1030 @@ Copyright (c) 2018 D3plus - https://d3plus.org

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-selection'), require('d3-array'), require('d3-transition'), require('d3plus-common')) :
typeof define === 'function' && define.amd ? define('d3plus-text', ['exports', 'd3-selection', 'd3-array', 'd3-transition', 'd3plus-common'], factory) :
(factory((global.d3plus = {}),global.d3Selection,global.d3Array,global.d3Transition,global.d3plusCommon));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-selection'), require('d3-array'), require('d3-transition'), require('d3plus-common')) :
typeof define === 'function' && define.amd ? define('d3plus-text', ['exports', 'd3-selection', 'd3-array', 'd3-transition', 'd3plus-common'], factory) :
(factory((global.d3plus = {}),global.d3Selection,global.d3Array,global.d3Transition,global.d3plusCommon));
}(this, (function (exports,d3Selection,d3Array,d3Transition,d3plusCommon) { 'use strict';
/**
@function textWidth
@desc Given a text string, returns the predicted pixel width of the string when placed into DOM.
@param {String|Array} text Can be either a single string or an array of strings to analyze.
@param {Object} [style] An object of CSS font styles to apply. Accepts any of the valid [CSS font property](http://www.w3schools.com/cssref/pr_font_font.asp) values.
*/
function measure(text, style) {
/**
@function textWidth
@desc Given a text string, returns the predicted pixel width of the string when placed into DOM.
@param {String|Array} text Can be either a single string or an array of strings to analyze.
@param {Object} [style] An object of CSS font styles to apply. Accepts any of the valid [CSS font property](http://www.w3schools.com/cssref/pr_font_font.asp) values.
*/
function measure(text, style) {
style = Object.assign({
"font-size": 10,
"font-family": "sans-serif",
"font-style": "normal",
"font-weight": 400,
"font-variant": "normal"
}, style);
style = Object.assign({
"font-size": 10,
"font-family": "sans-serif",
"font-style": "normal",
"font-weight": 400,
"font-variant": "normal"
}, style);
var context = document.createElement("canvas").getContext("2d");
var context = document.createElement("canvas").getContext("2d");
var font = [];
font.push(style["font-style"]);
font.push(style["font-variant"]);
font.push(style["font-weight"]);
font.push(typeof style["font-size"] === "string" ? style["font-size"] : ((style["font-size"]) + "px"));
// let s = `${style["font-size"]}px`;
// if ("line-height" in style) s += `/${style["line-height"]}px`;
// font.push(s);
font.push(style["font-family"]);
var font = [];
font.push(style["font-style"]);
font.push(style["font-variant"]);
font.push(style["font-weight"]);
font.push(typeof style["font-size"] === "string" ? style["font-size"] : ((style["font-size"]) + "px"));
// let s = `${style["font-size"]}px`;
// if ("line-height" in style) s += `/${style["line-height"]}px`;
// font.push(s);
font.push(style["font-family"]);
context.font = font.join(" ");
context.font = font.join(" ");
if (text instanceof Array) { return text.map(function (t) { return context.measureText(t).width; }); }
return context.measureText(text).width;
if (text instanceof Array) { return text.map(function (t) { return context.measureText(t).width; }); }
return context.measureText(text).width;
}
}
/**
@function trim
@desc Cross-browser implementation of [trim](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim).
@param {String} str
*/
function trim(str) {
return str.replace(/^\s+|\s+$/g, "");
}
/**
@function trim
@desc Cross-browser implementation of [trim](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim).
@param {String} str
*/
function trim(str) {
return str.replace(/^\s+|\s+$/g, "");
}
/**
@function trimLeft
@desc Cross-browser implementation of [trimLeft](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/TrimLeft).
@param {String} str
*/
function trimLeft(str) {
return str.replace(/^\s+/, "");
}
/**
@function trimLeft
@desc Cross-browser implementation of [trimLeft](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/TrimLeft).
@param {String} str
*/
function trimLeft(str) {
return str.replace(/^\s+/, "");
}
/**
@function trimRight
@desc Cross-browser implementation of [trimRight](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/TrimRight).
@param {String} str
*/
function trimRight(str) {
return str.replace(/\s+$/, "");
}
/**
@function trimRight
@desc Cross-browser implementation of [trimRight](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/TrimRight).
@param {String} str
*/
function trimRight(str) {
return str.replace(/\s+$/, "");
}
var alpha = "abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890",
checked = {},
height = 32;
var alpha = "abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890",
checked = {},
height = 32;
var dejavu, macos, monospace, proportional;
var dejavu, macos, monospace, proportional;
/**
@function fontExists
@desc Given either a single font-family or a list of fonts, returns the name of the first font that can be rendered, or `false` if none are installed on the user's machine.
@param {String|Array} font Can be either a valid CSS font-family string (single or comma-separated names) or an Array of string names.
*/
var fontExists = function (font) {
/**
@function fontExists
@desc Given either a single font-family or a list of fonts, returns the name of the first font that can be rendered, or `false` if none are installed on the user's machine.
@param {String|Array} font Can be either a valid CSS font-family string (single or comma-separated names) or an Array of string names.
*/
var fontExists = function (font) {
if (!dejavu) {
dejavu = measure(alpha, {"font-family": "DejaVuSans", "font-size": height});
macos = measure(alpha, {"font-family": "-apple-system", "font-size": height});
monospace = measure(alpha, {"font-family": "monospace", "font-size": height});
proportional = measure(alpha, {"font-family": "sans-serif", "font-size": height});
}
if (!dejavu) {
dejavu = measure(alpha, {"font-family": "DejaVuSans", "font-size": height});
macos = measure(alpha, {"font-family": "-apple-system", "font-size": height});
monospace = measure(alpha, {"font-family": "monospace", "font-size": height});
proportional = measure(alpha, {"font-family": "sans-serif", "font-size": height});
}
if (!(font instanceof Array)) { font = font.split(","); }
font = font.map(function (f) { return trim(f); });
if (!(font instanceof Array)) { font = font.split(","); }
font = font.map(function (f) { return trim(f); });
for (var i = 0; i < font.length; i++) {
var fam = font[i];
if (checked[fam] || ["-apple-system", "monospace", "sans-serif", "DejaVuSans"].includes(fam)) { return fam; }
else if (checked[fam] === false) { continue; }
var width = measure(alpha, {"font-family": fam, "font-size": height});
checked[fam] = width !== monospace;
if (checked[fam]) { checked[fam] = width !== proportional; }
if (macos && checked[fam]) { checked[fam] = width !== macos; }
if (dejavu && checked[fam]) { checked[fam] = width !== dejavu; }
if (checked[fam]) { return fam; }
}
for (var i = 0; i < font.length; i++) {
var fam = font[i];
if (checked[fam] || ["-apple-system", "monospace", "sans-serif", "DejaVuSans"].includes(fam)) { return fam; }
else if (checked[fam] === false) { continue; }
var width = measure(alpha, {"font-family": fam, "font-size": height});
checked[fam] = width !== monospace;
if (checked[fam]) { checked[fam] = width !== proportional; }
if (macos && checked[fam]) { checked[fam] = width !== macos; }
if (dejavu && checked[fam]) { checked[fam] = width !== dejavu; }
if (checked[fam]) { return fam; }
}
return false;
return false;
};
};
/**
@function rtl
@desc Returns `true` if the HTML or body element has either the "dir" HTML attribute or the "direction" CSS property set to "rtl".
*/
function detectRTL () { return d3Selection.select("html").attr("dir") === "rtl" ||
d3Selection.select("body").attr("dir") === "rtl" ||
d3Selection.select("html").style("direction") === "rtl" ||
d3Selection.select("body").style("direction") === "rtl"; }
/**
@function rtl
@desc Returns `true` if the HTML or body element has either the "dir" HTML attribute or the "direction" CSS property set to "rtl".
*/
function detectRTL () { return d3Selection.select("html").attr("dir") === "rtl" ||
d3Selection.select("body").attr("dir") === "rtl" ||
d3Selection.select("html").style("direction") === "rtl" ||
d3Selection.select("body").style("direction") === "rtl"; }
/**
@function stringify
@desc Coerces value into a String.
@param {String} value
*/
function stringify(value) {
if (value === void 0) { value = "undefined"; }
else if (!(typeof value === "string" || value instanceof String)) { value = JSON.stringify(value); }
return value;
}
/**
@function stringify
@desc Coerces value into a String.
@param {String} value
*/
function stringify(value) {
if (value === void 0) { value = "undefined"; }
else if (!(typeof value === "string" || value instanceof String)) { value = JSON.stringify(value); }
return value;
}
// great unicode list: http://asecuritysite.com/coding/asc2
// great unicode list: http://asecuritysite.com/coding/asc2
var diacritics = [
[/[\300-\305]/g, "A"], [/[\340-\345]/g, "a"],
[/[\306]/g, "AE"], [/[\346]/g, "ae"],
[/[\337]/g, "B"],
[/[\307]/g, "C"], [/[\347]/g, "c"],
[/[\320\336\376]/g, "D"], [/[\360]/g, "d"],
[/[\310-\313]/g, "E"], [/[\350-\353]/g, "e"],
[/[\314-\317]/g, "I"], [/[\354-\357]/g, "i"],
[/[\321]/g, "N"], [/[\361]/g, "n"],
[/[\322-\326\330]/g, "O"], [/[\362-\366\370]/g, "o"],
[/[\331-\334]/g, "U"], [/[\371-\374]/g, "u"],
[/[\327]/g, "x"],
[/[\335]/g, "Y"], [/[\375\377]/g, "y"]
];
var diacritics = [
[/[\300-\305]/g, "A"], [/[\340-\345]/g, "a"],
[/[\306]/g, "AE"], [/[\346]/g, "ae"],
[/[\337]/g, "B"],
[/[\307]/g, "C"], [/[\347]/g, "c"],
[/[\320\336\376]/g, "D"], [/[\360]/g, "d"],
[/[\310-\313]/g, "E"], [/[\350-\353]/g, "e"],
[/[\314-\317]/g, "I"], [/[\354-\357]/g, "i"],
[/[\321]/g, "N"], [/[\361]/g, "n"],
[/[\322-\326\330]/g, "O"], [/[\362-\366\370]/g, "o"],
[/[\331-\334]/g, "U"], [/[\371-\374]/g, "u"],
[/[\327]/g, "x"],
[/[\335]/g, "Y"], [/[\375\377]/g, "y"]
];
/**
@function strip
@desc Removes all non ASCII characters from a string.
@param {String} value
*/
function strip(value) {
/**
@function strip
@desc Removes all non ASCII characters from a string.
@param {String} value
*/
function strip(value) {
return ("" + value).replace(/[^A-Za-z0-9\-_]/g, function (char) {
return ("" + value).replace(/[^A-Za-z0-9\-_]/g, function (char) {
if (char === " ") { return "-"; }
if (char === " ") { return "-"; }
var ret = false;
for (var d = 0; d < diacritics.length; d++) {
if (new RegExp(diacritics[d][0]).test(char)) {
ret = diacritics[d][1];
break;
var ret = false;
for (var d = 0; d < diacritics.length; d++) {
if (new RegExp(diacritics[d][0]).test(char)) {
ret = diacritics[d][1];
break;
}
}
}
return ret || "";
return ret || "";
});
}
});
}
// scraped from http://www.fileformat.info/info/unicode/category/Mc/list.htm
// and http://www.fileformat.info/info/unicode/category/Mn/list.htm
// JSON.stringify([].slice.call(document.getElementsByClassName("table-list")[0].getElementsByTagName("tr")).filter(function(d){ return d.getElementsByTagName("a").length && d.getElementsByTagName("a")[0].innerHTML.length === 6; }).map(function(d){ return d.getElementsByTagName("a")[0].innerHTML.replace("U", "u").replace("+", ""); }).sort());
// The following unicode characters combine to form new characters and should never be split from surrounding characters.
var a = ["u0903", "u093B", "u093E", "u093F", "u0940", "u0949", "u094A", "u094B", "u094C", "u094E", "u094F", "u0982", "u0983", "u09BE", "u09BF", "u09C0", "u09C7", "u09C8", "u09CB", "u09CC", "u09D7", "u0A03", "u0A3E", "u0A3F", "u0A40", "u0A83", "u0ABE", "u0ABF", "u0AC0", "u0AC9", "u0ACB", "u0ACC", "u0B02", "u0B03", "u0B3E", "u0B40", "u0B47", "u0B48", "u0B4B", "u0B4C", "u0B57", "u0BBE", "u0BBF", "u0BC1", "u0BC2", "u0BC6", "u0BC7", "u0BC8", "u0BCA", "u0BCB", "u0BCC", "u0BD7", "u0C01", "u0C02", "u0C03", "u0C41", "u0C42", "u0C43", "u0C44", "u0C82", "u0C83", "u0CBE", "u0CC0", "u0CC1", "u0CC2", "u0CC3", "u0CC4", "u0CC7", "u0CC8", "u0CCA", "u0CCB", "u0CD5", "u0CD6", "u0D02", "u0D03", "u0D3E", "u0D3F", "u0D40", "u0D46", "u0D47", "u0D48", "u0D4A", "u0D4B", "u0D4C", "u0D57", "u0D82", "u0D83", "u0DCF", "u0DD0", "u0DD1", "u0DD8", "u0DD9", "u0DDA", "u0DDB", "u0DDC", "u0DDD", "u0DDE", "u0DDF", "u0DF2", "u0DF3", "u0F3E", "u0F3F", "u0F7F", "u102B", "u102C", "u1031", "u1038", "u103B", "u103C", "u1056", "u1057", "u1062", "u1063", "u1064", "u1067", "u1068", "u1069", "u106A", "u106B", "u106C", "u106D", "u1083", "u1084", "u1087", "u1088", "u1089", "u108A", "u108B", "u108C", "u108F", "u109A", "u109B", "u109C", "u17B6", "u17BE", "u17BF", "u17C0", "u17C1", "u17C2", "u17C3", "u17C4", "u17C5", "u17C7", "u17C8", "u1923", "u1924", "u1925", "u1926", "u1929", "u192A", "u192B", "u1930", "u1931", "u1933", "u1934", "u1935", "u1936", "u1937", "u1938", "u1A19", "u1A1A", "u1A55", "u1A57", "u1A61", "u1A63", "u1A64", "u1A6D", "u1A6E", "u1A6F", "u1A70", "u1A71", "u1A72", "u1B04", "u1B35", "u1B3B", "u1B3D", "u1B3E", "u1B3F", "u1B40", "u1B41", "u1B43", "u1B44", "u1B82", "u1BA1", "u1BA6", "u1BA7", "u1BAA", "u1BE7", "u1BEA", "u1BEB", "u1BEC", "u1BEE", "u1BF2", "u1BF3", "u1C24", "u1C25", "u1C26", "u1C27", "u1C28", "u1C29", "u1C2A", "u1C2B", "u1C34", "u1C35", "u1CE1", "u1CF2", "u1CF3", "u302E", "u302F", "uA823", "uA824", "uA827", "uA880", "uA881", "uA8B4", "uA8B5", "uA8B6", "uA8B7", "uA8B8", "uA8B9", "uA8BA", "uA8BB", "uA8BC", "uA8BD", "uA8BE", "uA8BF", "uA8C0", "uA8C1", "uA8C2", "uA8C3", "uA952", "uA953", "uA983", "uA9B4", "uA9B5", "uA9BA", "uA9BB", "uA9BD", "uA9BE", "uA9BF", "uA9C0", "uAA2F", "uAA30", "uAA33", "uAA34", "uAA4D", "uAA7B", "uAA7D", "uAAEB", "uAAEE", "uAAEF", "uAAF5", "uABE3", "uABE4", "uABE6", "uABE7", "uABE9", "uABEA", "uABEC"];
var b = ["u0300", "u0301", "u0302", "u0303", "u0304", "u0305", "u0306", "u0307", "u0308", "u0309", "u030A", "u030B", "u030C", "u030D", "u030E", "u030F", "u0310", "u0311", "u0312", "u0313", "u0314", "u0315", "u0316", "u0317", "u0318", "u0319", "u031A", "u031B", "u031C", "u031D", "u031E", "u031F", "u0320", "u0321", "u0322", "u0323", "u0324", "u0325", "u0326", "u0327", "u0328", "u0329", "u032A", "u032B", "u032C", "u032D", "u032E", "u032F", "u0330", "u0331", "u0332", "u0333", "u0334", "u0335", "u0336", "u0337", "u0338", "u0339", "u033A", "u033B", "u033C", "u033D", "u033E", "u033F", "u0340", "u0341", "u0342", "u0343", "u0344", "u0345", "u0346", "u0347", "u0348", "u0349", "u034A", "u034B", "u034C", "u034D", "u034E", "u034F", "u0350", "u0351", "u0352", "u0353", "u0354", "u0355", "u0356", "u0357", "u0358", "u0359", "u035A", "u035B", "u035C", "u035D", "u035E", "u035F", "u0360", "u0361", "u0362", "u0363", "u0364", "u0365", "u0366", "u0367", "u0368", "u0369", "u036A", "u036B", "u036C", "u036D", "u036E", "u036F", "u0483", "u0484", "u0485", "u0486", "u0487", "u0591", "u0592", "u0593", "u0594", "u0595", "u0596", "u0597", "u0598", "u0599", "u059A", "u059B", "u059C", "u059D", "u059E", "u059F", "u05A0", "u05A1", "u05A2", "u05A3", "u05A4", "u05A5", "u05A6", "u05A7", "u05A8", "u05A9", "u05AA", "u05AB", "u05AC", "u05AD", "u05AE", "u05AF", "u05B0", "u05B1", "u05B2", "u05B3", "u05B4", "u05B5", "u05B6", "u05B7", "u05B8", "u05B9", "u05BA", "u05BB", "u05BC", "u05BD", "u05BF", "u05C1", "u05C2", "u05C4", "u05C5", "u05C7", "u0610", "u0611", "u0612", "u0613", "u0614", "u0615", "u0616", "u0617", "u0618", "u0619", "u061A", "u064B", "u064C", "u064D", "u064E", "u064F", "u0650", "u0651", "u0652", "u0653", "u0654", "u0655", "u0656", "u0657", "u0658", "u0659", "u065A", "u065B", "u065C", "u065D", "u065E", "u065F", "u0670", "u06D6", "u06D7", "u06D8", "u06D9", "u06DA", "u06DB", "u06DC", "u06DF", "u06E0", "u06E1", "u06E2", "u06E3", "u06E4", "u06E7", "u06E8", "u06EA", "u06EB", "u06EC", "u06ED", "u0711", "u0730", "u0731", "u0732", "u0733", "u0734", "u0735", "u0736", "u0737", "u0738", "u0739", "u073A", "u073B", "u073C", "u073D", "u073E", "u073F", "u0740", "u0741", "u0742", "u0743", "u0744", "u0745", "u0746", "u0747", "u0748", "u0749", "u074A", "u07A6", "u07A7", "u07A8", "u07A9", "u07AA", "u07AB", "u07AC", "u07AD", "u07AE", "u07AF", "u07B0", "u07EB", "u07EC", "u07ED", "u07EE", "u07EF", "u07F0", "u07F1", "u07F2", "u07F3", "u0816", "u0817", "u0818", "u0819", "u081B", "u081C", "u081D", "u081E", "u081F", "u0820", "u0821", "u0822", "u0823", "u0825", "u0826", "u0827", "u0829", "u082A", "u082B", "u082C", "u082D", "u0859", "u085A", "u085B", "u08E3", "u08E4", "u08E5", "u08E6", "u08E7", "u08E8", "u08E9", "u08EA", "u08EB", "u08EC", "u08ED", "u08EE", "u08EF", "u08F0", "u08F1", "u08F2", "u08F3", "u08F4", "u08F5", "u08F6", "u08F7", "u08F8", "u08F9", "u08FA", "u08FB", "u08FC", "u08FD", "u08FE", "u08FF", "u0900", "u0901", "u0902", "u093A", "u093C", "u0941", "u0942", "u0943", "u0944", "u0945", "u0946", "u0947", "u0948", "u094D", "u0951", "u0952", "u0953", "u0954", "u0955", "u0956", "u0957", "u0962", "u0963", "u0981", "u09BC", "u09C1", "u09C2", "u09C3", "u09C4", "u09CD", "u09E2", "u09E3", "u0A01", "u0A02", "u0A3C", "u0A41", "u0A42", "u0A47", "u0A48", "u0A4B", "u0A4C", "u0A4D", "u0A51", "u0A70", "u0A71", "u0A75", "u0A81", "u0A82", "u0ABC", "u0AC1", "u0AC2", "u0AC3", "u0AC4", "u0AC5", "u0AC7", "u0AC8", "u0ACD", "u0AE2", "u0AE3", "u0B01", "u0B3C", "u0B3F", "u0B41", "u0B42", "u0B43", "u0B44", "u0B4D", "u0B56", "u0B62", "u0B63", "u0B82", "u0BC0", "u0BCD", "u0C00", "u0C3E", "u0C3F", "u0C40", "u0C46", "u0C47", "u0C48", "u0C4A", "u0C4B", "u0C4C", "u0C4D", "u0C55", "u0C56", "u0C62", "u0C63", "u0C81", "u0CBC", "u0CBF", "u0CC6", "u0CCC", "u0CCD", "u0CE2", "u0CE3", "u0D01", "u0D41", "u0D42", "u0D43", "u0D44", "u0D4D", "u0D62", "u0D63", "u0DCA", "u0DD2", "u0DD3", "u0DD4", "u0DD6", "u0E31", "u0E34", "u0E35", "u0E36", "u0E37", "u0E38", "u0E39", "u0E3A", "u0E47", "u0E48", "u0E49", "u0E4A", "u0E4B", "u0E4C", "u0E4D", "u0E4E", "u0EB1", "u0EB4", "u0EB5", "u0EB6", "u0EB7", "u0EB8", "u0EB9", "u0EBB", "u0EBC", "u0EC8", "u0EC9", "u0ECA", "u0ECB", "u0ECC", "u0ECD", "u0F18", "u0F19", "u0F35", "u0F37", "u0F39", "u0F71", "u0F72", "u0F73", "u0F74", "u0F75", "u0F76", "u0F77", "u0F78", "u0F79", "u0F7A", "u0F7B", "u0F7C", "u0F7D", "u0F7E", "u0F80", "u0F81", "u0F82", "u0F83", "u0F84", "u0F86", "u0F87", "u0F8D", "u0F8E", "u0F8F", "u0F90", "u0F91", "u0F92", "u0F93", "u0F94", "u0F95", "u0F96", "u0F97", "u0F99", "u0F9A", "u0F9B", "u0F9C", "u0F9D", "u0F9E", "u0F9F", "u0FA0", "u0FA1", "u0FA2", "u0FA3", "u0FA4", "u0FA5", "u0FA6", "u0FA7", "u0FA8", "u0FA9", "u0FAA", "u0FAB", "u0FAC", "u0FAD", "u0FAE", "u0FAF", "u0FB0", "u0FB1", "u0FB2", "u0FB3", "u0FB4", "u0FB5", "u0FB6", "u0FB7", "u0FB8", "u0FB9", "u0FBA", "u0FBB", "u0FBC", "u0FC6", "u102D", "u102E", "u102F", "u1030", "u1032", "u1033", "u1034", "u1035", "u1036", "u1037", "u1039", "u103A", "u103D", "u103E", "u1058", "u1059", "u105E", "u105F", "u1060", "u1071", "u1072", "u1073", "u1074", "u1082", "u1085", "u1086", "u108D", "u109D", "u135D", "u135E", "u135F", "u1712", "u1713", "u1714", "u1732", "u1733", "u1734", "u1752", "u1753", "u1772", "u1773", "u17B4", "u17B5", "u17B7", "u17B8", "u17B9", "u17BA", "u17BB", "u17BC", "u17BD", "u17C6", "u17C9", "u17CA", "u17CB", "u17CC", "u17CD", "u17CE", "u17CF", "u17D0", "u17D1", "u17D2", "u17D3", "u17DD", "u180B", "u180C", "u180D", "u18A9", "u1920", "u1921", "u1922", "u1927", "u1928", "u1932", "u1939", "u193A", "u193B", "u1A17", "u1A18", "u1A1B", "u1A56", "u1A58", "u1A59", "u1A5A", "u1A5B", "u1A5C", "u1A5D", "u1A5E", "u1A60", "u1A62", "u1A65", "u1A66", "u1A67", "u1A68", "u1A69", "u1A6A", "u1A6B", "u1A6C", "u1A73", "u1A74", "u1A75", "u1A76", "u1A77", "u1A78", "u1A79", "u1A7A", "u1A7B", "u1A7C", "u1A7F", "u1AB0", "u1AB1", "u1AB2", "u1AB3", "u1AB4", "u1AB5", "u1AB6", "u1AB7", "u1AB8", "u1AB9", "u1ABA", "u1ABB", "u1ABC", "u1ABD", "u1B00", "u1B01", "u1B02", "u1B03", "u1B34", "u1B36", "u1B37", "u1B38", "u1B39", "u1B3A", "u1B3C", "u1B42", "u1B6B", "u1B6C", "u1B6D", "u1B6E", "u1B6F", "u1B70", "u1B71", "u1B72", "u1B73", "u1B80", "u1B81", "u1BA2", "u1BA3", "u1BA4", "u1BA5", "u1BA8", "u1BA9", "u1BAB", "u1BAC", "u1BAD", "u1BE6", "u1BE8", "u1BE9", "u1BED", "u1BEF", "u1BF0", "u1BF1", "u1C2C", "u1C2D", "u1C2E", "u1C2F", "u1C30", "u1C31", "u1C32", "u1C33", "u1C36", "u1C37", "u1CD0", "u1CD1", "u1CD2", "u1CD4", "u1CD5", "u1CD6", "u1CD7", "u1CD8", "u1CD9", "u1CDA", "u1CDB", "u1CDC", "u1CDD", "u1CDE", "u1CDF", "u1CE0", "u1CE2", "u1CE3", "u1CE4", "u1CE5", "u1CE6", "u1CE7", "u1CE8", "u1CED", "u1CF4", "u1CF8", "u1CF9", "u1DC0", "u1DC1", "u1DC2", "u1DC3", "u1DC4", "u1DC5", "u1DC6", "u1DC7", "u1DC8", "u1DC9", "u1DCA", "u1DCB", "u1DCC", "u1DCD", "u1DCE", "u1DCF", "u1DD0", "u1DD1", "u1DD2", "u1DD3", "u1DD4", "u1DD5", "u1DD6", "u1DD7", "u1DD8", "u1DD9", "u1DDA", "u1DDB", "u1DDC", "u1DDD", "u1DDE", "u1DDF", "u1DE0", "u1DE1", "u1DE2", "u1DE3", "u1DE4", "u1DE5", "u1DE6", "u1DE7", "u1DE8", "u1DE9", "u1DEA", "u1DEB", "u1DEC", "u1DED", "u1DEE", "u1DEF", "u1DF0", "u1DF1", "u1DF2", "u1DF3", "u1DF4", "u1DF5", "u1DFC", "u1DFD", "u1DFE", "u1DFF", "u20D0", "u20D1", "u20D2", "u20D3", "u20D4", "u20D5", "u20D6", "u20D7", "u20D8", "u20D9", "u20DA", "u20DB", "u20DC", "u20E1", "u20E5", "u20E6", "u20E7", "u20E8", "u20E9", "u20EA", "u20EB", "u20EC", "u20ED", "u20EE", "u20EF", "u20F0", "u2CEF", "u2CF0", "u2CF1", "u2D7F", "u2DE0", "u2DE1", "u2DE2", "u2DE3", "u2DE4", "u2DE5", "u2DE6", "u2DE7", "u2DE8", "u2DE9", "u2DEA", "u2DEB", "u2DEC", "u2DED", "u2DEE", "u2DEF", "u2DF0", "u2DF1", "u2DF2", "u2DF3", "u2DF4", "u2DF5", "u2DF6", "u2DF7", "u2DF8", "u2DF9", "u2DFA", "u2DFB", "u2DFC", "u2DFD", "u2DFE", "u2DFF", "u302A", "u302B", "u302C", "u302D", "u3099", "u309A", "uA66F", "uA674", "uA675", "uA676", "uA677", "uA678", "uA679", "uA67A", "uA67B", "uA67C", "uA67D", "uA69E", "uA69F", "uA6F0", "uA6F1", "uA802", "uA806", "uA80B", "uA825", "uA826", "uA8C4", "uA8E0", "uA8E1", "uA8E2", "uA8E3", "uA8E4", "uA8E5", "uA8E6", "uA8E7", "uA8E8", "uA8E9", "uA8EA", "uA8EB", "uA8EC", "uA8ED", "uA8EE", "uA8EF", "uA8F0", "uA8F1", "uA926", "uA927", "uA928", "uA929", "uA92A", "uA92B", "uA92C", "uA92D", "uA947", "uA948", "uA949", "uA94A", "uA94B", "uA94C", "uA94D", "uA94E", "uA94F", "uA950", "uA951", "uA980", "uA981", "uA982", "uA9B3", "uA9B6", "uA9B7", "uA9B8", "uA9B9", "uA9BC", "uA9E5", "uAA29", "uAA2A", "uAA2B", "uAA2C", "uAA2D", "uAA2E", "uAA31", "uAA32", "uAA35", "uAA36", "uAA43", "uAA4C", "uAA7C", "uAAB0", "uAAB2", "uAAB3", "uAAB4", "uAAB7", "uAAB8", "uAABE", "uAABF", "uAAC1", "uAAEC", "uAAED", "uAAF6", "uABE5", "uABE8", "uABED", "uFB1E", "uFE00", "uFE01", "uFE02", "uFE03", "uFE04", "uFE05", "uFE06", "uFE07", "uFE08", "uFE09", "uFE0A", "uFE0B", "uFE0C", "uFE0D", "uFE0E", "uFE0F", "uFE20", "uFE21", "uFE22", "uFE23", "uFE24", "uFE25", "uFE26", "uFE27", "uFE28", "uFE29", "uFE2A", "uFE2B", "uFE2C", "uFE2D", "uFE2E", "uFE2F"];
var combiningMarks = a.concat(b);
// scraped from http://www.fileformat.info/info/unicode/category/Mc/list.htm
// and http://www.fileformat.info/info/unicode/category/Mn/list.htm
// JSON.stringify([].slice.call(document.getElementsByClassName("table-list")[0].getElementsByTagName("tr")).filter(function(d){ return d.getElementsByTagName("a").length && d.getElementsByTagName("a")[0].innerHTML.length === 6; }).map(function(d){ return d.getElementsByTagName("a")[0].innerHTML.replace("U", "u").replace("+", ""); }).sort());
// The following unicode characters combine to form new characters and should never be split from surrounding characters.
var a = ["u0903", "u093B", "u093E", "u093F", "u0940", "u0949", "u094A", "u094B", "u094C", "u094E", "u094F", "u0982", "u0983", "u09BE", "u09BF", "u09C0", "u09C7", "u09C8", "u09CB", "u09CC", "u09D7", "u0A03", "u0A3E", "u0A3F", "u0A40", "u0A83", "u0ABE", "u0ABF", "u0AC0", "u0AC9", "u0ACB", "u0ACC", "u0B02", "u0B03", "u0B3E", "u0B40", "u0B47", "u0B48", "u0B4B", "u0B4C", "u0B57", "u0BBE", "u0BBF", "u0BC1", "u0BC2", "u0BC6", "u0BC7", "u0BC8", "u0BCA", "u0BCB", "u0BCC", "u0BD7", "u0C01", "u0C02", "u0C03", "u0C41", "u0C42", "u0C43", "u0C44", "u0C82", "u0C83", "u0CBE", "u0CC0", "u0CC1", "u0CC2", "u0CC3", "u0CC4", "u0CC7", "u0CC8", "u0CCA", "u0CCB", "u0CD5", "u0CD6", "u0D02", "u0D03", "u0D3E", "u0D3F", "u0D40", "u0D46", "u0D47", "u0D48", "u0D4A", "u0D4B", "u0D4C", "u0D57", "u0D82", "u0D83", "u0DCF", "u0DD0", "u0DD1", "u0DD8", "u0DD9", "u0DDA", "u0DDB", "u0DDC", "u0DDD", "u0DDE", "u0DDF", "u0DF2", "u0DF3", "u0F3E", "u0F3F", "u0F7F", "u102B", "u102C", "u1031", "u1038", "u103B", "u103C", "u1056", "u1057", "u1062", "u1063", "u1064", "u1067", "u1068", "u1069", "u106A", "u106B", "u106C", "u106D", "u1083", "u1084", "u1087", "u1088", "u1089", "u108A", "u108B", "u108C", "u108F", "u109A", "u109B", "u109C", "u17B6", "u17BE", "u17BF", "u17C0", "u17C1", "u17C2", "u17C3", "u17C4", "u17C5", "u17C7", "u17C8", "u1923", "u1924", "u1925", "u1926", "u1929", "u192A", "u192B", "u1930", "u1931", "u1933", "u1934", "u1935", "u1936", "u1937", "u1938", "u1A19", "u1A1A", "u1A55", "u1A57", "u1A61", "u1A63", "u1A64", "u1A6D", "u1A6E", "u1A6F", "u1A70", "u1A71", "u1A72", "u1B04", "u1B35", "u1B3B", "u1B3D", "u1B3E", "u1B3F", "u1B40", "u1B41", "u1B43", "u1B44", "u1B82", "u1BA1", "u1BA6", "u1BA7", "u1BAA", "u1BE7", "u1BEA", "u1BEB", "u1BEC", "u1BEE", "u1BF2", "u1BF3", "u1C24", "u1C25", "u1C26", "u1C27", "u1C28", "u1C29", "u1C2A", "u1C2B", "u1C34", "u1C35", "u1CE1", "u1CF2", "u1CF3", "u302E", "u302F", "uA823", "uA824", "uA827", "uA880", "uA881", "uA8B4", "uA8B5", "uA8B6", "uA8B7", "uA8B8", "uA8B9", "uA8BA", "uA8BB", "uA8BC", "uA8BD", "uA8BE", "uA8BF", "uA8C0", "uA8C1", "uA8C2", "uA8C3", "uA952", "uA953", "uA983", "uA9B4", "uA9B5", "uA9BA", "uA9BB", "uA9BD", "uA9BE", "uA9BF", "uA9C0", "uAA2F", "uAA30", "uAA33", "uAA34", "uAA4D", "uAA7B", "uAA7D", "uAAEB", "uAAEE", "uAAEF", "uAAF5", "uABE3", "uABE4", "uABE6", "uABE7", "uABE9", "uABEA", "uABEC"];
var b = ["u0300", "u0301", "u0302", "u0303", "u0304", "u0305", "u0306", "u0307", "u0308", "u0309", "u030A", "u030B", "u030C", "u030D", "u030E", "u030F", "u0310", "u0311", "u0312", "u0313", "u0314", "u0315", "u0316", "u0317", "u0318", "u0319", "u031A", "u031B", "u031C", "u031D", "u031E", "u031F", "u0320", "u0321", "u0322", "u0323", "u0324", "u0325", "u0326", "u0327", "u0328", "u0329", "u032A", "u032B", "u032C", "u032D", "u032E", "u032F", "u0330", "u0331", "u0332", "u0333", "u0334", "u0335", "u0336", "u0337", "u0338", "u0339", "u033A", "u033B", "u033C", "u033D", "u033E", "u033F", "u0340", "u0341", "u0342", "u0343", "u0344", "u0345", "u0346", "u0347", "u0348", "u0349", "u034A", "u034B", "u034C", "u034D", "u034E", "u034F", "u0350", "u0351", "u0352", "u0353", "u0354", "u0355", "u0356", "u0357", "u0358", "u0359", "u035A", "u035B", "u035C", "u035D", "u035E", "u035F", "u0360", "u0361", "u0362", "u0363", "u0364", "u0365", "u0366", "u0367", "u0368", "u0369", "u036A", "u036B", "u036C", "u036D", "u036E", "u036F", "u0483", "u0484", "u0485", "u0486", "u0487", "u0591", "u0592", "u0593", "u0594", "u0595", "u0596", "u0597", "u0598", "u0599", "u059A", "u059B", "u059C", "u059D", "u059E", "u059F", "u05A0", "u05A1", "u05A2", "u05A3", "u05A4", "u05A5", "u05A6", "u05A7", "u05A8", "u05A9", "u05AA", "u05AB", "u05AC", "u05AD", "u05AE", "u05AF", "u05B0", "u05B1", "u05B2", "u05B3", "u05B4", "u05B5", "u05B6", "u05B7", "u05B8", "u05B9", "u05BA", "u05BB", "u05BC", "u05BD", "u05BF", "u05C1", "u05C2", "u05C4", "u05C5", "u05C7", "u0610", "u0611", "u0612", "u0613", "u0614", "u0615", "u0616", "u0617", "u0618", "u0619", "u061A", "u064B", "u064C", "u064D", "u064E", "u064F", "u0650", "u0651", "u0652", "u0653", "u0654", "u0655", "u0656", "u0657", "u0658", "u0659", "u065A", "u065B", "u065C", "u065D", "u065E", "u065F", "u0670", "u06D6", "u06D7", "u06D8", "u06D9", "u06DA", "u06DB", "u06DC", "u06DF", "u06E0", "u06E1", "u06E2", "u06E3", "u06E4", "u06E7", "u06E8", "u06EA", "u06EB", "u06EC", "u06ED", "u0711", "u0730", "u0731", "u0732", "u0733", "u0734", "u0735", "u0736", "u0737", "u0738", "u0739", "u073A", "u073B", "u073C", "u073D", "u073E", "u073F", "u0740", "u0741", "u0742", "u0743", "u0744", "u0745", "u0746", "u0747", "u0748", "u0749", "u074A", "u07A6", "u07A7", "u07A8", "u07A9", "u07AA", "u07AB", "u07AC", "u07AD", "u07AE", "u07AF", "u07B0", "u07EB", "u07EC", "u07ED", "u07EE", "u07EF", "u07F0", "u07F1", "u07F2", "u07F3", "u0816", "u0817", "u0818", "u0819", "u081B", "u081C", "u081D", "u081E", "u081F", "u0820", "u0821", "u0822", "u0823", "u0825", "u0826", "u0827", "u0829", "u082A", "u082B", "u082C", "u082D", "u0859", "u085A", "u085B", "u08E3", "u08E4", "u08E5", "u08E6", "u08E7", "u08E8", "u08E9", "u08EA", "u08EB", "u08EC", "u08ED", "u08EE", "u08EF", "u08F0", "u08F1", "u08F2", "u08F3", "u08F4", "u08F5", "u08F6", "u08F7", "u08F8", "u08F9", "u08FA", "u08FB", "u08FC", "u08FD", "u08FE", "u08FF", "u0900", "u0901", "u0902", "u093A", "u093C", "u0941", "u0942", "u0943", "u0944", "u0945", "u0946", "u0947", "u0948", "u094D", "u0951", "u0952", "u0953", "u0954", "u0955", "u0956", "u0957", "u0962", "u0963", "u0981", "u09BC", "u09C1", "u09C2", "u09C3", "u09C4", "u09CD", "u09E2", "u09E3", "u0A01", "u0A02", "u0A3C", "u0A41", "u0A42", "u0A47", "u0A48", "u0A4B", "u0A4C", "u0A4D", "u0A51", "u0A70", "u0A71", "u0A75", "u0A81", "u0A82", "u0ABC", "u0AC1", "u0AC2", "u0AC3", "u0AC4", "u0AC5", "u0AC7", "u0AC8", "u0ACD", "u0AE2", "u0AE3", "u0B01", "u0B3C", "u0B3F", "u0B41", "u0B42", "u0B43", "u0B44", "u0B4D", "u0B56", "u0B62", "u0B63", "u0B82", "u0BC0", "u0BCD", "u0C00", "u0C3E", "u0C3F", "u0C40", "u0C46", "u0C47", "u0C48", "u0C4A", "u0C4B", "u0C4C", "u0C4D", "u0C55", "u0C56", "u0C62", "u0C63", "u0C81", "u0CBC", "u0CBF", "u0CC6", "u0CCC", "u0CCD", "u0CE2", "u0CE3", "u0D01", "u0D41", "u0D42", "u0D43", "u0D44", "u0D4D", "u0D62", "u0D63", "u0DCA", "u0DD2", "u0DD3", "u0DD4", "u0DD6", "u0E31", "u0E34", "u0E35", "u0E36", "u0E37", "u0E38", "u0E39", "u0E3A", "u0E47", "u0E48", "u0E49", "u0E4A", "u0E4B", "u0E4C", "u0E4D", "u0E4E", "u0EB1", "u0EB4", "u0EB5", "u0EB6", "u0EB7", "u0EB8", "u0EB9", "u0EBB", "u0EBC", "u0EC8", "u0EC9", "u0ECA", "u0ECB", "u0ECC", "u0ECD", "u0F18", "u0F19", "u0F35", "u0F37", "u0F39", "u0F71", "u0F72", "u0F73", "u0F74", "u0F75", "u0F76", "u0F77", "u0F78", "u0F79", "u0F7A", "u0F7B", "u0F7C", "u0F7D", "u0F7E", "u0F80", "u0F81", "u0F82", "u0F83", "u0F84", "u0F86", "u0F87", "u0F8D", "u0F8E", "u0F8F", "u0F90", "u0F91", "u0F92", "u0F93", "u0F94", "u0F95", "u0F96", "u0F97", "u0F99", "u0F9A", "u0F9B", "u0F9C", "u0F9D", "u0F9E", "u0F9F", "u0FA0", "u0FA1", "u0FA2", "u0FA3", "u0FA4", "u0FA5", "u0FA6", "u0FA7", "u0FA8", "u0FA9", "u0FAA", "u0FAB", "u0FAC", "u0FAD", "u0FAE", "u0FAF", "u0FB0", "u0FB1", "u0FB2", "u0FB3", "u0FB4", "u0FB5", "u0FB6", "u0FB7", "u0FB8", "u0FB9", "u0FBA", "u0FBB", "u0FBC", "u0FC6", "u102D", "u102E", "u102F", "u1030", "u1032", "u1033", "u1034", "u1035", "u1036", "u1037", "u1039", "u103A", "u103D", "u103E", "u1058", "u1059", "u105E", "u105F", "u1060", "u1071", "u1072", "u1073", "u1074", "u1082", "u1085", "u1086", "u108D", "u109D", "u135D", "u135E", "u135F", "u1712", "u1713", "u1714", "u1732", "u1733", "u1734", "u1752", "u1753", "u1772", "u1773", "u17B4", "u17B5", "u17B7", "u17B8", "u17B9", "u17BA", "u17BB", "u17BC", "u17BD", "u17C6", "u17C9", "u17CA", "u17CB", "u17CC", "u17CD", "u17CE", "u17CF", "u17D0", "u17D1", "u17D2", "u17D3", "u17DD", "u180B", "u180C", "u180D", "u18A9", "u1920", "u1921", "u1922", "u1927", "u1928", "u1932", "u1939", "u193A", "u193B", "u1A17", "u1A18", "u1A1B", "u1A56", "u1A58", "u1A59", "u1A5A", "u1A5B", "u1A5C", "u1A5D", "u1A5E", "u1A60", "u1A62", "u1A65", "u1A66", "u1A67", "u1A68", "u1A69", "u1A6A", "u1A6B", "u1A6C", "u1A73", "u1A74", "u1A75", "u1A76", "u1A77", "u1A78", "u1A79", "u1A7A", "u1A7B", "u1A7C", "u1A7F", "u1AB0", "u1AB1", "u1AB2", "u1AB3", "u1AB4", "u1AB5", "u1AB6", "u1AB7", "u1AB8", "u1AB9", "u1ABA", "u1ABB", "u1ABC", "u1ABD", "u1B00", "u1B01", "u1B02", "u1B03", "u1B34", "u1B36", "u1B37", "u1B38", "u1B39", "u1B3A", "u1B3C", "u1B42", "u1B6B", "u1B6C", "u1B6D", "u1B6E", "u1B6F", "u1B70", "u1B71", "u1B72", "u1B73", "u1B80", "u1B81", "u1BA2", "u1BA3", "u1BA4", "u1BA5", "u1BA8", "u1BA9", "u1BAB", "u1BAC", "u1BAD", "u1BE6", "u1BE8", "u1BE9", "u1BED", "u1BEF", "u1BF0", "u1BF1", "u1C2C", "u1C2D", "u1C2E", "u1C2F", "u1C30", "u1C31", "u1C32", "u1C33", "u1C36", "u1C37", "u1CD0", "u1CD1", "u1CD2", "u1CD4", "u1CD5", "u1CD6", "u1CD7", "u1CD8", "u1CD9", "u1CDA", "u1CDB", "u1CDC", "u1CDD", "u1CDE", "u1CDF", "u1CE0", "u1CE2", "u1CE3", "u1CE4", "u1CE5", "u1CE6", "u1CE7", "u1CE8", "u1CED", "u1CF4", "u1CF8", "u1CF9", "u1DC0", "u1DC1", "u1DC2", "u1DC3", "u1DC4", "u1DC5", "u1DC6", "u1DC7", "u1DC8", "u1DC9", "u1DCA", "u1DCB", "u1DCC", "u1DCD", "u1DCE", "u1DCF", "u1DD0", "u1DD1", "u1DD2", "u1DD3", "u1DD4", "u1DD5", "u1DD6", "u1DD7", "u1DD8", "u1DD9", "u1DDA", "u1DDB", "u1DDC", "u1DDD", "u1DDE", "u1DDF", "u1DE0", "u1DE1", "u1DE2", "u1DE3", "u1DE4", "u1DE5", "u1DE6", "u1DE7", "u1DE8", "u1DE9", "u1DEA", "u1DEB", "u1DEC", "u1DED", "u1DEE", "u1DEF", "u1DF0", "u1DF1", "u1DF2", "u1DF3", "u1DF4", "u1DF5", "u1DFC", "u1DFD", "u1DFE", "u1DFF", "u20D0", "u20D1", "u20D2", "u20D3", "u20D4", "u20D5", "u20D6", "u20D7", "u20D8", "u20D9", "u20DA", "u20DB", "u20DC", "u20E1", "u20E5", "u20E6", "u20E7", "u20E8", "u20E9", "u20EA", "u20EB", "u20EC", "u20ED", "u20EE", "u20EF", "u20F0", "u2CEF", "u2CF0", "u2CF1", "u2D7F", "u2DE0", "u2DE1", "u2DE2", "u2DE3", "u2DE4", "u2DE5", "u2DE6", "u2DE7", "u2DE8", "u2DE9", "u2DEA", "u2DEB", "u2DEC", "u2DED", "u2DEE", "u2DEF", "u2DF0", "u2DF1", "u2DF2", "u2DF3", "u2DF4", "u2DF5", "u2DF6", "u2DF7", "u2DF8", "u2DF9", "u2DFA", "u2DFB", "u2DFC", "u2DFD", "u2DFE", "u2DFF", "u302A", "u302B", "u302C", "u302D", "u3099", "u309A", "uA66F", "uA674", "uA675", "uA676", "uA677", "uA678", "uA679", "uA67A", "uA67B", "uA67C", "uA67D", "uA69E", "uA69F", "uA6F0", "uA6F1", "uA802", "uA806", "uA80B", "uA825", "uA826", "uA8C4", "uA8E0", "uA8E1", "uA8E2", "uA8E3", "uA8E4", "uA8E5", "uA8E6", "uA8E7", "uA8E8", "uA8E9", "uA8EA", "uA8EB", "uA8EC", "uA8ED", "uA8EE", "uA8EF", "uA8F0", "uA8F1", "uA926", "uA927", "uA928", "uA929", "uA92A", "uA92B", "uA92C", "uA92D", "uA947", "uA948", "uA949", "uA94A", "uA94B", "uA94C", "uA94D", "uA94E", "uA94F", "uA950", "uA951", "uA980", "uA981", "uA982", "uA9B3", "uA9B6", "uA9B7", "uA9B8", "uA9B9", "uA9BC", "uA9E5", "uAA29", "uAA2A", "uAA2B", "uAA2C", "uAA2D", "uAA2E", "uAA31", "uAA32", "uAA35", "uAA36", "uAA43", "uAA4C", "uAA7C", "uAAB0", "uAAB2", "uAAB3", "uAAB4", "uAAB7", "uAAB8", "uAABE", "uAABF", "uAAC1", "uAAEC", "uAAED", "uAAF6", "uABE5", "uABE8", "uABED", "uFB1E", "uFE00", "uFE01", "uFE02", "uFE03", "uFE04", "uFE05", "uFE06", "uFE07", "uFE08", "uFE09", "uFE0A", "uFE0B", "uFE0C", "uFE0D", "uFE0E", "uFE0F", "uFE20", "uFE21", "uFE22", "uFE23", "uFE24", "uFE25", "uFE26", "uFE27", "uFE28", "uFE29", "uFE2A", "uFE2B", "uFE2C", "uFE2D", "uFE2E", "uFE2F"];
var combiningMarks = a.concat(b);
var splitChars = ["-", "/", ";", ":", "&",
"u0E2F", // thai character pairannoi
"u0EAF", // lao ellipsis
"u0EC6", // lao ko la (word repetition)
"u0ECC", // lao cancellation mark
"u104A", // myanmar sign little section
"u104B", // myanmar sign section
"u104C", // myanmar symbol locative
"u104D", // myanmar symbol completed
"u104E", // myanmar symbol aforementioned
"u104F", // myanmar symbol genitive
"u2013", // en dash
"u2014", // em dash
"u2027", // simplified chinese hyphenation point
"u3000", // simplified chinese ideographic space
"u3001", // simplified chinese ideographic comma
"u3002", // simplified chinese ideographic full stop
"uFF0C", // full-width comma
"uFF5E" // wave dash
];
var splitChars = ["-", "/", ";", ":", "&",
"u0E2F", // thai character pairannoi
"u0EAF", // lao ellipsis
"u0EC6", // lao ko la (word repetition)
"u0ECC", // lao cancellation mark
"u104A", // myanmar sign little section
"u104B", // myanmar sign section
"u104C", // myanmar symbol locative
"u104D", // myanmar symbol completed
"u104E", // myanmar symbol aforementioned
"u104F", // myanmar symbol genitive
"u2013", // en dash
"u2014", // em dash
"u2027", // simplified chinese hyphenation point
"u3000", // simplified chinese ideographic space
"u3001", // simplified chinese ideographic comma
"u3002", // simplified chinese ideographic full stop
"uFF0C", // full-width comma
"uFF5E" // wave dash
];
var prefixChars = ["'", "<", "(", "{", "[",
"u00AB", // left-pointing double angle quotation mark
"u300A", // left double angle bracket
"u3008" // left angle bracket
];
var prefixChars = ["'", "<", "(", "{", "[",
"u00AB", // left-pointing double angle quotation mark
"u300A", // left double angle bracket
"u3008" // left angle bracket
];
var suffixChars = ["'", ">", ")", "}", "]", ".", "!", "?",
"u00BB", // right-pointing double angle quotation mark
"u300B", // right double angle bracket
"u3009" // right angle bracket
].concat(splitChars);
var suffixChars = ["'", ">", ")", "}", "]", ".", "!", "?",
"u00BB", // right-pointing double angle quotation mark
"u300B", // right double angle bracket
"u3009" // right angle bracket
].concat(splitChars);
var burmeseRange = "\u1000-\u102A\u103F-\u1049\u1050-\u1055";
var japaneseRange = "\u3040-\u309f\u30a0-\u30ff\uff00-\uff0b\uff0d-\uff5d\uff5f-\uff9f\u3400-\u4dbf";
var chineseRange = "\u3400-\u9FBF";
var laoRange = "\u0E81-\u0EAE\u0EB0-\u0EC4\u0EC8-\u0ECB\u0ECD-\u0EDD";
var burmeseRange = "\u1000-\u102A\u103F-\u1049\u1050-\u1055";
var japaneseRange = "\u3040-\u309f\u30a0-\u30ff\uff00-\uff0b\uff0d-\uff5d\uff5f-\uff9f\u3400-\u4dbf";
var chineseRange = "\u3400-\u9FBF";
var laoRange = "\u0E81-\u0EAE\u0EB0-\u0EC4\u0EC8-\u0ECB\u0ECD-\u0EDD";
var noSpaceRange = burmeseRange + chineseRange + laoRange;
var noSpaceRange = burmeseRange + chineseRange + laoRange;
var splitWords = new RegExp(("(\\" + (splitChars.join("|\\")) + ")*[^\\s|\\" + (splitChars.join("|\\")) + "]*(\\" + (splitChars.join("|\\")) + ")*"), "g");
var japaneseChars = new RegExp(("[" + japaneseRange + "]"));
var noSpaceLanguage = new RegExp(("[" + noSpaceRange + "]"));
var splitAllChars = new RegExp(("(\\" + (prefixChars.join("|\\")) + ")*[" + noSpaceRange + "](\\" + (suffixChars.join("|\\")) + "|\\" + (combiningMarks.join("|\\")) + ")*|[a-z0-9]+"), "gi");
var splitWords = new RegExp(("(\\" + (splitChars.join("|\\")) + ")*[^\\s|\\" + (splitChars.join("|\\")) + "]*(\\" + (splitChars.join("|\\")) + ")*"), "g");
var japaneseChars = new RegExp(("[" + japaneseRange + "]"));
var noSpaceLanguage = new RegExp(("[" + noSpaceRange + "]"));
var splitAllChars = new RegExp(("(\\" + (prefixChars.join("|\\")) + ")*[" + noSpaceRange + "](\\" + (suffixChars.join("|\\")) + "|\\" + (combiningMarks.join("|\\")) + ")*|[a-z0-9]+"), "gi");
/**
@function textSplit
@desc Splits a given sentence into an array of words.
@param {String} sentence
*/
function textSplit(sentence) {
if (!noSpaceLanguage.test(sentence)) { return stringify(sentence).match(splitWords).filter(function (w) { return w.length; }); }
return d3Array.merge(stringify(sentence).match(splitWords).map(function (d) {
if (!japaneseChars.test(d) && noSpaceLanguage.test(d)) { return d.match(splitAllChars); }
return [d];
}));
}
/**
@function textSplit
@desc Splits a given sentence into an array of words.
@param {String} sentence
*/
function textSplit(sentence) {
if (!noSpaceLanguage.test(sentence)) { return stringify(sentence).match(splitWords).filter(function (w) { return w.length; }); }
return d3Array.merge(stringify(sentence).match(splitWords).map(function (d) {
if (!japaneseChars.test(d) && noSpaceLanguage.test(d)) { return d.match(splitAllChars); }
return [d];
}));
}
/**
@function textWrap
@desc Based on the defined styles and dimensions, breaks a string into an array of strings for each line of text.
*/
function wrap() {
var fontFamily = "sans-serif",
fontSize = 10,
fontWeight = 400,
height = 200,
lineHeight,
overflow = false,
split = textSplit,
width = 200;
/**
The inner return object and wraps the text and returns the line data array.
@private
@function textWrap
@desc Based on the defined styles and dimensions, breaks a string into an array of strings for each line of text.
*/
function textWrap(sentence) {
function wrap() {
sentence = stringify(sentence);
var fontFamily = "sans-serif",
fontSize = 10,
fontWeight = 400,
height = 200,
lineHeight,
overflow = false,
split = textSplit,
width = 200;
if (lineHeight === void 0) { lineHeight = Math.ceil(fontSize * 1.4); }
/**
The inner return object and wraps the text and returns the line data array.
@private
*/
function textWrap(sentence) {
var words = split(sentence);
sentence = stringify(sentence);
var style = {
"font-family": fontFamily,
"font-size": fontSize,
"font-weight": fontWeight,
"line-height": lineHeight
};
if (lineHeight === void 0) { lineHeight = Math.ceil(fontSize * 1.4); }
var line = 1,
textProg = "",
truncated = false,
widthProg = 0;
var words = split(sentence);
var lineData = [],
sizes = measure(words, style),
space = measure(" ", style);
var style = {
"font-family": fontFamily,
"font-size": fontSize,
"font-weight": fontWeight,
"line-height": lineHeight
};
for (var i = 0; i < words.length; i++) {
var word = words[i];
var wordWidth = sizes[words.indexOf(word)];
word += sentence.slice(textProg.length + word.length).match("^( |\n)*", "g")[0];
if (textProg.slice(-1) === "\n" || widthProg + wordWidth > width) {
if (!i && !overflow) {
truncated = true;
break;
var line = 1,
textProg = "",
truncated = false,
widthProg = 0;
var lineData = [],
sizes = measure(words, style),
space = measure(" ", style);
for (var i = 0; i < words.length; i++) {
var word = words[i];
var wordWidth = sizes[words.indexOf(word)];
word += sentence.slice(textProg.length + word.length).match("^( |\n)*", "g")[0];
if (textProg.slice(-1) === "\n" || widthProg + wordWidth > width) {
if (!i && !overflow) {
truncated = true;
break;
}
lineData[line - 1] = trimRight(lineData[line - 1]);
line++;
if (lineHeight * line > height || wordWidth > width && !overflow) {
truncated = true;
break;
}
widthProg = 0;
lineData.push(word);
}
lineData[line - 1] = trimRight(lineData[line - 1]);
line++;
if (lineHeight * line > height || wordWidth > width && !overflow) {
truncated = true;
break;
}
widthProg = 0;
lineData.push(word);
else if (!i) { lineData[0] = word; }
else { lineData[line - 1] += word; }
textProg += word;
widthProg += wordWidth;
widthProg += word.match(/[\s]*$/g)[0].length * space;
}
else if (!i) { lineData[0] = word; }
else { lineData[line - 1] += word; }
textProg += word;
widthProg += wordWidth;
widthProg += word.match(/[\s]*$/g)[0].length * space;
return {
lines: lineData,
sentence: sentence, truncated: truncated,
widths: measure(lineData, style),
words: words
};
}
return {
lines: lineData,
sentence: sentence, truncated: truncated,
widths: measure(lineData, style),
words: words
/**
@memberof textWrap
@desc If *value* is specified, sets the font family accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current font family.
@param {Function|String} [*value* = "sans-serif"]
*/
textWrap.fontFamily = function(_) {
return arguments.length ? (fontFamily = _, textWrap) : fontFamily;
};
}
/**
@memberof textWrap
@desc If *value* is specified, sets the font size accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current font size.
@param {Function|Number} [*value* = 10]
*/
textWrap.fontSize = function(_) {
return arguments.length ? (fontSize = _, textWrap) : fontSize;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the font family accessor to the specified function or string and returns this generator. If *value* is not specified, returns the current font family.
@param {Function|String} [*value* = "sans-serif"]
*/
textWrap.fontFamily = function(_) {
return arguments.length ? (fontFamily = _, textWrap) : fontFamily;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the font weight accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current font weight.
@param {Function|Number|String} [*value* = 400]
*/
textWrap.fontWeight = function(_) {
return arguments.length ? (fontWeight = _, textWrap) : fontWeight;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the font size accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current font size.
@param {Function|Number} [*value* = 10]
*/
textWrap.fontSize = function(_) {
return arguments.length ? (fontSize = _, textWrap) : fontSize;
};
/**
@memberof textWrap
@desc If *value* is specified, sets height limit to the specified value and returns this generator. If *value* is not specified, returns the current value.
@param {Number} [*value* = 200]
*/
textWrap.height = function(_) {
return arguments.length ? (height = _, textWrap) : height;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the font weight accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current font weight.
@param {Function|Number|String} [*value* = 400]
*/
textWrap.fontWeight = function(_) {
return arguments.length ? (fontWeight = _, textWrap) : fontWeight;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the line height accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current line height accessor, which is 1.1 times the [font size](#textWrap.fontSize) by default.
@param {Function|Number} [*value*]
*/
textWrap.lineHeight = function(_) {
return arguments.length ? (lineHeight = _, textWrap) : lineHeight;
};
/**
@memberof textWrap
@desc If *value* is specified, sets height limit to the specified value and returns this generator. If *value* is not specified, returns the current value.
@param {Number} [*value* = 200]
*/
textWrap.height = function(_) {
return arguments.length ? (height = _, textWrap) : height;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the overflow to the specified boolean and returns this generator. If *value* is not specified, returns the current overflow value.
@param {Boolean} [*value* = false]
*/
textWrap.overflow = function(_) {
return arguments.length ? (overflow = _, textWrap) : overflow;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the line height accessor to the specified function or number and returns this generator. If *value* is not specified, returns the current line height accessor, which is 1.1 times the [font size](#textWrap.fontSize) by default.
@param {Function|Number} [*value*]
*/
textWrap.lineHeight = function(_) {
return arguments.length ? (lineHeight = _, textWrap) : lineHeight;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the word split function to the specified function and returns this generator. If *value* is not specified, returns the current word split function.
@param {Function} [*value*] A function that, when passed a string, is expected to return that string split into an array of words to textWrap. The default split function splits strings on the following characters: `-`, `/`, `;`, `:`, `&`
*/
textWrap.split = function(_) {
return arguments.length ? (split = _, textWrap) : split;
};
/**
@memberof textWrap
@desc If *value* is specified, sets the overflow to the specified boolean and returns this generator. If *value* is not specified, returns the current overflow value.
@param {Boolean} [*value* = false]
*/
textWrap.overflow = function(_) {
return arguments.length ? (overflow = _, textWrap) : overflow;
};
/**
@memberof textWrap
@desc If *value* is specified, sets width limit to the specified value and returns this generator. If *value* is not specified, returns the current value.
@param {Number} [*value* = 200]
*/
textWrap.width = function(_) {
return arguments.length ? (width = _, textWrap) : width;
};
return textWrap;
}
/**
@memberof textWrap
@desc If *value* is specified, sets the word split function to the specified function and returns this generator. If *value* is not specified, returns the current word split function.
@param {Function} [*value*] A function that, when passed a string, is expected to return that string split into an array of words to textWrap. The default split function splits strings on the following characters: `-`, `/`, `;`, `:`, `&`
@external BaseClass
@see https://github.com/d3plus/d3plus-common#BaseClass
*/
textWrap.split = function(_) {
return arguments.length ? (split = _, textWrap) : split;
};
/**
@memberof textWrap
@desc If *value* is specified, sets width limit to the specified value and returns this generator. If *value* is not specified, returns the current value.
@param {Number} [*value* = 200]
@class TextBox
@extends external:BaseClass
@desc Creates a wrapped text box for each point in an array of data. See [this example](https://d3plus.org/examples/d3plus-text/getting-started/) for help getting started using the TextBox class.
*/
textWrap.width = function(_) {
return arguments.length ? (width = _, textWrap) : width;
};
var TextBox = (function (BaseClass) {
function TextBox() {
var this$1 = this;
return textWrap;
}
BaseClass.call(this);
/**
@external BaseClass
@see https://github.com/d3plus/d3plus-common#BaseClass
*/
this._delay = 0;
this._duration = 0;
this._ellipsis = function (text, line) { return line ? ((text.replace(/\.|,$/g, "")) + "...") : ""; };
this._fontColor = d3plusCommon.constant("black");
this._fontFamily = d3plusCommon.constant(["Roboto", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]);
this._fontMax = d3plusCommon.constant(50);
this._fontMin = d3plusCommon.constant(8);
this._fontOpacity = d3plusCommon.constant(1);
this._fontResize = d3plusCommon.constant(false);
this._fontSize = d3plusCommon.constant(10);
this._fontWeight = d3plusCommon.constant(400);
this._height = d3plusCommon.accessor("height", 200);
this._id = function (d, i) { return d.id || ("" + i); };
this._lineHeight = function (d, i) { return this$1._fontSize(d, i) * 1.2; };
this._on = {};
this._overflow = d3plusCommon.constant(false);
this._padding = d3plusCommon.constant(0);
this._pointerEvents = d3plusCommon.constant("auto");
this._rotate = d3plusCommon.constant(0);
this._rotateAnchor = function (d) { return [d.w / 2, d.h / 2]; };
this._split = textSplit;
this._text = d3plusCommon.accessor("text");
this._textAnchor = d3plusCommon.constant("start");
this._verticalAlign = d3plusCommon.constant("top");
this._width = d3plusCommon.accessor("width", 200);
this._x = d3plusCommon.accessor("x", 0);
this._y = d3plusCommon.accessor("y", 0);
/**
@class TextBox
@extends external:BaseClass
@desc Creates a wrapped text box for each point in an array of data. See [this example](https://d3plus.org/examples/d3plus-text/getting-started/) for help getting started using the TextBox class.
*/
var TextBox = (function (BaseClass) {
function TextBox() {
var this$1 = this;
}
if ( BaseClass ) TextBox.__proto__ = BaseClass;
TextBox.prototype = Object.create( BaseClass && BaseClass.prototype );
TextBox.prototype.constructor = TextBox;
BaseClass.call(this);
/**
@memberof TextBox
@desc Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.
@param {Function} [*callback* = undefined]
*/
TextBox.prototype.render = function render (callback) {
var this$1 = this;
this._delay = 0;
this._duration = 0;
this._ellipsis = function (text, line) { return line ? ((text.replace(/\.|,$/g, "")) + "...") : ""; };
this._fontColor = d3plusCommon.constant("black");
this._fontFamily = d3plusCommon.constant(["Roboto", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]);
this._fontMax = d3plusCommon.constant(50);
this._fontMin = d3plusCommon.constant(8);
this._fontOpacity = d3plusCommon.constant(1);
this._fontResize = d3plusCommon.constant(false);
this._fontSize = d3plusCommon.constant(10);
this._fontWeight = d3plusCommon.constant(400);
this._height = d3plusCommon.accessor("height", 200);
this._id = function (d, i) { return d.id || ("" + i); };
this._lineHeight = function (d, i) { return this$1._fontSize(d, i) * 1.2; };
this._on = {};
this._overflow = d3plusCommon.constant(false);
this._padding = d3plusCommon.constant(0);
this._pointerEvents = d3plusCommon.constant("auto");
this._rotate = d3plusCommon.constant(0);
this._split = textSplit;
this._text = d3plusCommon.accessor("text");
this._textAnchor = d3plusCommon.constant("start");
this._verticalAlign = d3plusCommon.constant("top");
this._width = d3plusCommon.accessor("width", 200);
this._x = d3plusCommon.accessor("x", 0);
this._y = d3plusCommon.accessor("y", 0);
}
if (this._select === void 0) { this.select(d3Selection.select("body").append("svg").style("width", ((window.innerWidth) + "px")).style("height", ((window.innerHeight) + "px")).node()); }
if ( BaseClass ) TextBox.__proto__ = BaseClass;
TextBox.prototype = Object.create( BaseClass && BaseClass.prototype );
TextBox.prototype.constructor = TextBox;
var that = this;
/**
@memberof TextBox
@desc Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.
@param {Function} [*callback* = undefined]
*/
TextBox.prototype.render = function render (callback) {
var this$1 = this;
var boxes = this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function (arr, d, i) {
var t = this$1._text(d, i);
if (t === void 0) { return arr; }
if (this._select === void 0) { this.select(d3Selection.select("body").append("svg").style("width", ((window.innerWidth) + "px")).style("height", ((window.innerHeight) + "px")).node()); }
var resize = this$1._fontResize(d, i);
var lHRatio = this$1._lineHeight(d, i) / this$1._fontSize(d, i);
var that = this;
var fS = resize ? this$1._fontMax(d, i) : this$1._fontSize(d, i),
lH = resize ? fS * lHRatio : this$1._lineHeight(d, i),
line = 1,
lineData = [],
sizes,
wrapResults;
var boxes = this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function (arr, d, i) {
var style = {
"font-family": fontExists(this$1._fontFamily(d, i)),
"font-size": fS,
"font-weight": this$1._fontWeight(d, i),
"line-height": lH
};
var t = this$1._text(d, i);
if (t === void 0) { return arr; }
var padding = d3plusCommon.parseSides(this$1._padding(d, i));
var resize = this$1._fontResize(d, i);
var lHRatio = this$1._lineHeight(d, i) / this$1._fontSize(d, i);
var h = this$1._height(d, i) - (padding.top + padding.bottom),
w = this$1._width(d, i) - (padding.left + padding.right);
var fS = resize ? this$1._fontMax(d, i) : this$1._fontSize(d, i),
lH = resize ? fS * lHRatio : this$1._lineHeight(d, i),
line = 1,
lineData = [],
sizes,
wrapResults;
var wrapper = wrap()
.fontFamily(style["font-family"])
.fontSize(fS)
.fontWeight(style["font-weight"])
.lineHeight(lH)
.height(h)
.overflow(this$1._overflow(d, i))
.width(w);
var style = {
"font-family": fontExists(this$1._fontFamily(d, i)),
"font-size": fS,
"font-weight": this$1._fontWeight(d, i),
"line-height": lH
};
var fMax = this$1._fontMax(d, i),
fMin = this$1._fontMin(d, i),
vA = this$1._verticalAlign(d, i),
words = this$1._split(t, i);
var padding = d3plusCommon.parseSides(this$1._padding(d, i));
/**
Figures out the lineData to be used for wrapping.
@private
*/
function checkSize() {
var h = this$1._height(d, i) - (padding.top + padding.bottom),
w = this$1._width(d, i) - (padding.left + padding.right);
if (fS < fMin) {
lineData = [];
return;
}
else if (fS > fMax) { fS = fMax; }
var wrapper = wrap()
.fontFamily(style["font-family"])
.fontSize(fS)
.fontWeight(style["font-weight"])
.lineHeight(lH)
.height(h)
.overflow(this$1._overflow(d, i))
.width(w);
if (resize) {
lH = fS * lHRatio;
wrapper
.fontSize(fS)
.lineHeight(lH);
style["font-size"] = fS;
style["line-height"] = lH;
}
var fMax = this$1._fontMax(d, i),
fMin = this$1._fontMin(d, i),
vA = this$1._verticalAlign(d, i),
words = this$1._split(t, i);
wrapResults = wrapper(t);
lineData = wrapResults.lines.filter(function (l) { return l !== ""; });
line = lineData.length;
/**
Figures out the lineData to be used for wrapping.
@private
*/
function checkSize() {
if (wrapResults.truncated) {
if (fS < fMin) {
lineData = [];
return;
}
else if (fS > fMax) { fS = fMax; }
if (resize) {
fS--;
if (fS < fMin) { lineData = []; }
else { checkSize(); }
}
else if (line < 1) { lineData = [that._ellipsis("", line)]; }
else { lineData[line - 1] = that._ellipsis(lineData[line - 1], line); }
if (resize) {
lH = fS * lHRatio;
wrapper
.fontSize(fS)
.lineHeight(lH);
style["font-size"] = fS;
style["line-height"] = lH;
}
}
wrapResults = wrapper(t);
lineData = wrapResults.lines.filter(function (l) { return l !== ""; });
line = lineData.length;
if (w > fMin && (h > lH || resize && h > fMin * lHRatio)) {
if (wrapResults.truncated) {
if (resize) {
fS--;
if (fS < fMin) { lineData = []; }
else { checkSize(); }
}
else if (line < 1) { lineData = [that._ellipsis("", line)]; }
else { lineData[line - 1] = that._ellipsis(lineData[line - 1], line); }
}
sizes = measure(words, style);
var areaMod = 1.165 + w / h * 0.1,
boxArea = w * h,
maxWidth = d3Array.max(sizes),
textArea = d3Array.sum(sizes, function (d) { return d * lH; }) * areaMod;
}
if (maxWidth > w || textArea > boxArea) {
var areaRatio = Math.sqrt(boxArea / textArea),
widthRatio = w / maxWidth;
var sizeRatio = d3Array.min([areaRatio, widthRatio]);
fS = Math.floor(fS * sizeRatio);
}
if (w > fMin && (h > lH || resize && h > fMin * lHRatio)) {
var heightMax = Math.floor(h * 0.8);
if (fS > heightMax) { fS = heightMax; }
if (resize) {
}
sizes = measure(words, style);
checkSize();
var areaMod = 1.165 + w / h * 0.1,
boxArea = w * h,
maxWidth = d3Array.max(sizes),
textArea = d3Array.sum(sizes, function (d) { return d * lH; }) * areaMod;
}
if (maxWidth > w || textArea > boxArea) {
var areaRatio = Math.sqrt(boxArea / textArea),
widthRatio = w / maxWidth;
var sizeRatio = d3Array.min([areaRatio, widthRatio]);
fS = Math.floor(fS * sizeRatio);
}
if (lineData.length) {
var heightMax = Math.floor(h * 0.8);
if (fS > heightMax) { fS = heightMax; }
var tH = line * lH;
var yP = vA === "top" ? 0 : vA === "middle" ? h / 2 - tH / 2 : h - tH;
yP -= lH * 0.1;
arr.push({
data: d,
i: i,
lines: lineData,
fC: this$1._fontColor(d, i),
fF: style["font-family"],
fO: this$1._fontOpacity(d, i),
fW: style["font-weight"],
id: this$1._id(d, i),
tA: this$1._textAnchor(d, i),
widths: wrapResults.widths,
fS: fS, lH: lH, w: w, h: h,
x: this$1._x(d, i) + padding.left,
y: this$1._y(d, i) + yP + padding.top
});
}
checkSize();
return arr;
}
}, []), this._id);
if (lineData.length) {
var t = d3Transition.transition().duration(this._duration);
var tH = line * lH;
var yP = vA === "top" ? 0 : vA === "middle" ? h / 2 - tH / 2 : h - tH;
yP -= lH * 0.1;
if (this._duration === 0) {
arr.push({
data: d,
i: i,
lines: lineData,
fC: this$1._fontColor(d, i),
fF: style["font-family"],
fO: this$1._fontOpacity(d, i),
fW: style["font-weight"],
id: this$1._id(d, i),
tA: this$1._textAnchor(d, i),
widths: wrapResults.widths,
fS: fS, lH: lH, w: w, h: h,
x: this$1._x(d, i) + padding.left,
y: this$1._y(d, i) + yP + padding.top
});
boxes.exit().remove();
}
else {
return arr;
boxes.exit().transition().delay(this._duration).remove();
}, []), this._id);
boxes.exit().selectAll("text").transition(t)
.attr("opacity", 0);
var t = d3Transition.transition().duration(this._duration);
}
if (this._duration === 0) {
function rotate(text) {
text.attr("transform", function (d, i) {
var rotateAnchor = that._rotateAnchor(d, i);
return ("translate(" + (d.x) + ", " + (d.y) + ") rotate(" + (that._rotate(d, i)) + ", " + (rotateAnchor[0]) + ", " + (rotateAnchor[1]) + ")");
});
}
boxes.exit().remove();
var update = boxes.enter().append("g")
.attr("class", "d3plus-textBox")
.attr("id", function (d) { return ("d3plus-textBox-" + (strip(d.id))); })
.call(rotate)
.merge(boxes);
}
else {
var rtl = detectRTL();
boxes.exit().transition().delay(this._duration).remove();
update
.style("pointer-events", function (d) { return this$1._pointerEvents(d.data, d.i); })
.each(function(d) {
boxes.exit().selectAll("text").transition(t)
.attr("opacity", 0);
/**
Styles to apply to each <text> element.
@private
*/
function textStyle(text) {
text
.text(function (t) { return trimRight(t); })
.attr("dir", rtl ? "rtl" : "ltr")
.attr("fill", d.fC)
.attr("text-anchor", d.tA)
.attr("font-family", d.fF)
.style("font-family", d.fF)
.attr("font-size", ((d.fS) + "px"))
.style("font-size", ((d.fS) + "px"))
.attr("font-weight", d.fW)
.style("font-weight", d.fW)
.attr("opacity", d.fO)
.style("opacity", d.fO)
.attr("x", ((d.tA === "middle" ? d.w / 2 : rtl ? d.tA === "start" ? d.w : 0 : d.tA === "end" ? d.w : 0) + "px"))
.attr("y", function (t, i) { return (((i + 1) * d.lH - (d.lH - d.fS)) + "px"); });
}
}
var texts = d3Selection.select(this).selectAll("text").data(d.lines);
function rotate(text) {
text.attr("transform", function (d, i) { return ("rotate(" + (that._rotate(d, i)) + ", " + (d.x + d.w / 2) + ", " + (d.y + d.h / 2) + ")translate(" + (d.x) + ", " + (d.y) + ")"); });
}
if (that._duration === 0) {
var update = boxes.enter().append("g")
.attr("class", "d3plus-textBox")
.attr("id", function (d) { return ("d3plus-textBox-" + (strip(d.id))); })
.call(rotate)
.merge(boxes);
texts.call(textStyle);
var rtl = detectRTL();
texts.exit().remove();
update
.style("pointer-events", function (d) { return this$1._pointerEvents(d.data, d.i); })
.each(function(d) {
texts.enter().append("text")
.attr("dominant-baseline", "alphabetic")
.style("baseline-shift", "0%")
.attr("unicode-bidi", "bidi-override")
.call(textStyle);
/**
Styles to apply to each <text> element.
@private
*/
function textStyle(text) {
text
.text(function (t) { return trimRight(t); })
.attr("dir", rtl ? "rtl" : "ltr")
.attr("fill", d.fC)
.attr("text-anchor", d.tA)
.attr("font-family", d.fF)
.style("font-family", d.fF)
.attr("font-size", ((d.fS) + "px"))
.style("font-size", ((d.fS) + "px"))
.attr("font-weight", d.fW)
.style("font-weight", d.fW)
.attr("opacity", d.fO)
.style("opacity", d.fO)
.attr("x", ((d.tA === "middle" ? d.w / 2 : rtl ? d.tA === "start" ? d.w : 0 : d.tA === "end" ? d.w : 0) + "px"))
.attr("y", function (t, i) { return (((i + 1) * d.lH - (d.lH - d.fS)) + "px"); });
}
}
else {
var texts = d3Selection.select(this).selectAll("text").data(d.lines);
texts.transition(t).call(textStyle);
if (that._duration === 0) {
texts.exit().transition(t)
.attr("opacity", 0).remove();
texts.call(textStyle);
texts.enter().append("text")
.attr("dominant-baseline", "alphabetic")
.style("baseline-shift", "0%")
.attr("opacity", 0)
.call(textStyle)
.merge(texts).transition(t).delay(that._delay)
.call(textStyle)
.attr("opacity", 1);
texts.exit().remove();
}
texts.enter().append("text")
.attr("dominant-baseline", "alphabetic")
.style("baseline-shift", "0%")
.attr("unicode-bidi", "bidi-override")
.call(textStyle);
})
.transition(t).call(rotate);
}
else {
var events = Object.keys(this._on),
on = events.reduce(function (obj, e) {
obj[e] = function (d, i) { return this$1._on[e](d.data, i); };
return obj;
}, {});
for (var e = 0; e < events.length; e++) { update.on(events[e], on[events[e]]); }
texts.transition(t).call(textStyle);
if (callback) { setTimeout(callback, this._duration + 100); }
texts.exit().transition(t)
.attr("opacity", 0).remove();
return this;
texts.enter().append("text")
.attr("dominant-baseline", "alphabetic")
.style("baseline-shift", "0%")
.attr("opacity", 0)
.call(textStyle)
.merge(texts).transition(t).delay(that._delay)
.call(textStyle)
.attr("opacity", 1);
};
}
/**
@memberof TextBox
@desc Sets the data array to the specified array. A text box will be drawn for each object in the array.
@param {Array} [*data* = []]
*/
TextBox.prototype.data = function data (_) {
return arguments.length ? (this._data = _, this) : this._data;
};
})
.transition(t).call(rotate);
/**
@memberof TextBox
@desc Sets the animation delay to the specified number in milliseconds.
@param {Number} [*value* = 0]
*/
TextBox.prototype.delay = function delay (_) {
return arguments.length ? (this._delay = _, this) : this._delay;
};
var events = Object.keys(this._on),
on = events.reduce(function (obj, e) {
obj[e] = function (d, i) { return this$1._on[e](d.data, i); };
return obj;
}, {});
for (var e = 0; e < events.length; e++) { update.on(events[e], on[events[e]]); }
/**
@memberof TextBox
@desc Sets the animation duration to the specified number in milliseconds.
@param {Number} [*value* = 0]
*/
TextBox.prototype.duration = function duration (_) {
return arguments.length ? (this._duration = _, this) : this._duration;
};
if (callback) { setTimeout(callback, this._duration + 100); }
/**
@memberof TextBox
@desc Sets the function that handles what to do when a line is truncated. It should return the new value for the line, and is passed 2 arguments: the String of text for the line in question, and the number of the line. By default, an ellipsis is added to the end of any line except if it is the first word that cannot fit (in that case, an empty string is returned).
@param {Function|String} [*value*]
@example <caption>default accessor</caption>
function(text, line) {
return line ? text.replace(/\.|,$/g, "") + "..." : "";
}
*/
TextBox.prototype.ellipsis = function ellipsis (_) {
return arguments.length ? (this._ellipsis = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._ellipsis;
};
return this;
/**
@memberof TextBox
@desc Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default.
@param {Function|String} [*value* = "black"]
*/
TextBox.prototype.fontColor = function fontColor (_) {
return arguments.length ? (this._fontColor = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontColor;
};
};
/**
@memberof TextBox
@desc Defines the font-family to be used. The value passed can be either a *String* name of a font, a comma-separated list of font-family fallbacks, an *Array* of fallbacks, or a *Function* that returns either a *String* or an *Array*. If supplying multiple fallback fonts, the [fontExists](#fontExists) function will be used to determine the first available font on the client's machine.
@param {Array|Function|String} [*value* = ["Roboto", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]]
*/
TextBox.prototype.fontFamily = function fontFamily (_) {
return arguments.length ? (this._fontFamily = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontFamily;
};
/**
@memberof TextBox
@desc Sets the data array to the specified array. A text box will be drawn for each object in the array.
@param {Array} [*data* = []]
*/
TextBox.prototype.data = function data (_) {
return arguments.length ? (this._data = _, this) : this._data;
};
/**
@memberof TextBox
@desc Sets the maximum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
@param {Function|Number} [*value* = 50]
*/
TextBox.prototype.fontMax = function fontMax (_) {
return arguments.length ? (this._fontMax = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontMax;
};
/**
@memberof TextBox
@desc Sets the animation delay to the specified number in milliseconds.
@param {Number} [*value* = 0]
*/
TextBox.prototype.delay = function delay (_) {
return arguments.length ? (this._delay = _, this) : this._delay;
};
/**
@memberof TextBox
@desc Sets the minimum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
@param {Function|Number} [*value* = 8]
*/
TextBox.prototype.fontMin = function fontMin (_) {
return arguments.length ? (this._fontMin = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontMin;
};
/**
@memberof TextBox
@desc Sets the animation duration to the specified number in milliseconds.
@param {Number} [*value* = 0]
*/
TextBox.prototype.duration = function duration (_) {
return arguments.length ? (this._duration = _, this) : this._duration;
};
/**
@memberof TextBox
@desc Sets the font opacity to the specified accessor function or static number between 0 and 1.
@param {Function|Number} [*value* = 1]
*/
TextBox.prototype.fontOpacity = function fontOpacity (_) {
return arguments.length ? (this._fontOpacity = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontOpacity;
};
/**
@memberof TextBox
@desc Sets the function that handles what to do when a line is truncated. It should return the new value for the line, and is passed 2 arguments: the String of text for the line in question, and the number of the line. By default, an ellipsis is added to the end of any line except if it is the first word that cannot fit (in that case, an empty string is returned).
@param {Function|String} [*value*]
@example <caption>default accessor</caption>
function(text, line) {
return line ? text.replace(/\.|,$/g, "") + "..." : "";
}
*/
TextBox.prototype.ellipsis = function ellipsis (_) {
return arguments.length ? (this._ellipsis = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._ellipsis;
};
/**
@memberof TextBox
@desc Toggles font resizing, which can either be defined as a static boolean for all data points, or an accessor function that returns a boolean. See [this example](http://d3plus.org/examples/d3plus-text/resizing-text/) for a side-by-side comparison.
@param {Function|Boolean} [*value* = false]
*/
TextBox.prototype.fontResize = function fontResize (_) {
return arguments.length ? (this._fontResize = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontResize;
};
/**
@memberof TextBox
@desc Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default.
@param {Function|String} [*value* = "black"]
*/
TextBox.prototype.fontColor = function fontColor (_) {
return arguments.length ? (this._fontColor = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontColor;
};
/**
@memberof TextBox
@desc Sets the font size to the specified accessor function or static number (which corresponds to pixel units), which is inferred from the [DOM selection](#textBox.select) by default.
@param {Function|Number} [*value* = 10]
*/
TextBox.prototype.fontSize = function fontSize (_) {
return arguments.length ? (this._fontSize = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontSize;
};
/**
@memberof TextBox
@desc Defines the font-family to be used. The value passed can be either a *String* name of a font, a comma-separated list of font-family fallbacks, an *Array* of fallbacks, or a *Function* that returns either a *String* or an *Array*. If supplying multiple fallback fonts, the [fontExists](#fontExists) function will be used to determine the first available font on the client's machine.
@param {Array|Function|String} [*value* = ["Roboto", "Helvetica Neue", "HelveticaNeue", "Helvetica", "Arial", "sans-serif"]]
*/
TextBox.prototype.fontFamily = function fontFamily (_) {
return arguments.length ? (this._fontFamily = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontFamily;
};
/**
@memberof TextBox
@desc Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default.
@param {Function|Number|String} [*value* = 400]
*/
TextBox.prototype.fontWeight = function fontWeight (_) {
return arguments.length ? (this._fontWeight = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontWeight;
};
/**
@memberof TextBox
@desc Sets the maximum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
@param {Function|Number} [*value* = 50]
*/
TextBox.prototype.fontMax = function fontMax (_) {
return arguments.length ? (this._fontMax = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontMax;
};
/**
@memberof TextBox
@desc Sets the height for each box to the specified accessor function or static number.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.height || 200;
}
*/
TextBox.prototype.height = function height (_) {
return arguments.length ? (this._height = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._height;
};
/**
@memberof TextBox
@desc Sets the minimum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).
@param {Function|Number} [*value* = 8]
*/
TextBox.prototype.fontMin = function fontMin (_) {
return arguments.length ? (this._fontMin = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontMin;
};
/**
@memberof TextBox
@desc Defines the unique id for each box to the specified accessor function or static number.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d, i) {
return d.id || i + "";
}
*/
TextBox.prototype.id = function id (_) {
return arguments.length ? (this._id = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._id;
};
/**
@memberof TextBox
@desc Sets the font opacity to the specified accessor function or static number between 0 and 1.
@param {Function|Number} [*value* = 1]
*/
TextBox.prototype.fontOpacity = function fontOpacity (_) {
return arguments.length ? (this._fontOpacity = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontOpacity;
};
/**
@memberof TextBox
@desc Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default.
@param {Function|Number} [*value*]
*/
TextBox.prototype.lineHeight = function lineHeight (_) {
return arguments.length ? (this._lineHeight = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._lineHeight;
};
/**
@memberof TextBox
@desc Toggles font resizing, which can either be defined as a static boolean for all data points, or an accessor function that returns a boolean. See [this example](http://d3plus.org/examples/d3plus-text/resizing-text/) for a side-by-side comparison.
@param {Function|Boolean} [*value* = false]
*/
TextBox.prototype.fontResize = function fontResize (_) {
return arguments.length ? (this._fontResize = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontResize;
};
/**
@memberof TextBox
@desc Sets the text overflow to the specified accessor function or static boolean.
@param {Function|Boolean} [*value* = false]
*/
TextBox.prototype.overflow = function overflow (_) {
return arguments.length ? (this._overflow = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._overflow;
};
/**
@memberof TextBox
@desc Sets the font size to the specified accessor function or static number (which corresponds to pixel units), which is inferred from the [DOM selection](#textBox.select) by default.
@param {Function|Number} [*value* = 10]
*/
TextBox.prototype.fontSize = function fontSize (_) {
return arguments.length ? (this._fontSize = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontSize;
};
/**
@memberof TextBox
@desc Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default.
@param {Function|Number|String} [*value*]
*/
TextBox.prototype.padding = function padding (_) {
return arguments.length ? (this._padding = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._padding;
};
/**
@memberof TextBox
@desc Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default.
@param {Function|Number|String} [*value* = 400]
*/
TextBox.prototype.fontWeight = function fontWeight (_) {
return arguments.length ? (this._fontWeight = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._fontWeight;
};
/**
@memberof TextBox
@desc Sets the pointer-events to the specified accessor function or static string.
@param {Function|String} [*value* = "auto"]
*/
TextBox.prototype.pointerEvents = function pointerEvents (_) {
return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._pointerEvents;
};
/**
@memberof TextBox
@desc Sets the height for each box to the specified accessor function or static number.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.height || 200;
}
*/
TextBox.prototype.height = function height (_) {
return arguments.length ? (this._height = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._height;
};
/**
@memberof TextBox
@desc Sets the rotate percentage for each box to the specified accessor function or static string.
@param {Function|Number} [*value* = 0]
*/
TextBox.prototype.rotate = function rotate (_) {
return arguments.length ? (this._rotate = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._rotate;
};
/**
@memberof TextBox
@desc Defines the unique id for each box to the specified accessor function or static number.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d, i) {
return d.id || i + "";
}
*/
TextBox.prototype.id = function id (_) {
return arguments.length ? (this._id = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._id;
};
/**
@memberof TextBox
@desc Sets the anchor point around which to rotate the text box.
@param {Function|Number[]}
*/
TextBox.prototype.rotateAnchor = function rotateAnchor (_) {
return arguments.length ? (this._rotateAnchor = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._rotateAnchor;
};
/**
@memberof TextBox
@desc Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default.
@param {Function|Number} [*value*]
*/
TextBox.prototype.lineHeight = function lineHeight (_) {
return arguments.length ? (this._lineHeight = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._lineHeight;
};
/**
@memberof TextBox
@desc Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use.
@param {String|HTMLElement} [*selector*]
*/
TextBox.prototype.select = function select$1 (_) {
return arguments.length ? (this._select = d3Selection.select(_), this) : this._select;
};
/**
@memberof TextBox
@desc Sets the text overflow to the specified accessor function or static boolean.
@param {Function|Boolean} [*value* = false]
*/
TextBox.prototype.overflow = function overflow (_) {
return arguments.length ? (this._overflow = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._overflow;
};
/**
@memberof TextBox
@desc Sets the word split behavior to the specified function, which when passed a string is expected to return that string split into an array of words.
@param {Function} [*value*]
*/
TextBox.prototype.split = function split (_) {
return arguments.length ? (this._split = _, this) : this._split;
};
/**
@memberof TextBox
@desc Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default.
@param {Function|Number|String} [*value*]
*/
TextBox.prototype.padding = function padding (_) {
return arguments.length ? (this._padding = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._padding;
};
/**
@memberof TextBox
@desc Sets the text for each box to the specified accessor function or static string.
@param {Function|String} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.text;
}
*/
TextBox.prototype.text = function text (_) {
return arguments.length ? (this._text = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._text;
};
/**
@memberof TextBox
@desc Sets the pointer-events to the specified accessor function or static string.
@param {Function|String} [*value* = "auto"]
*/
TextBox.prototype.pointerEvents = function pointerEvents (_) {
return arguments.length ? (this._pointerEvents = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._pointerEvents;
};
/**
@memberof TextBox
@desc Sets the horizontal text anchor to the specified accessor function or static string, whose values are analagous to the SVG [text-anchor](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor) property.
@param {Function|String} [*value* = "start"]
*/
TextBox.prototype.textAnchor = function textAnchor (_) {
return arguments.length ? (this._textAnchor = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._textAnchor;
};
/**
@memberof TextBox
@desc Sets the rotate percentage for each box to the specified accessor function or static string.
@param {Function|Number} [*value* = 0]
*/
TextBox.prototype.rotate = function rotate (_) {
return arguments.length ? (this._rotate = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._rotate;
};
/**
@memberof TextBox
@desc Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`.
@param {Function|String} [*value* = "top"]
*/
TextBox.prototype.verticalAlign = function verticalAlign (_) {
return arguments.length ? (this._verticalAlign = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._verticalAlign;
};
/**
@memberof TextBox
@desc Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use.
@param {String|HTMLElement} [*selector*]
*/
TextBox.prototype.select = function select$1 (_) {
return arguments.length ? (this._select = d3Selection.select(_), this) : this._select;
};
/**
@memberof TextBox
@desc Sets the width for each box to the specified accessor function or static number.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.width || 200;
}
*/
TextBox.prototype.width = function width (_) {
return arguments.length ? (this._width = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._width;
};
/**
@memberof TextBox
@desc Sets the word split behavior to the specified function, which when passed a string is expected to return that string split into an array of words.
@param {Function} [*value*]
*/
TextBox.prototype.split = function split (_) {
return arguments.length ? (this._split = _, this) : this._split;
};
/**
@memberof TextBox
@desc Sets the x position for each box to the specified accessor function or static number. The number given should correspond to the left side of the textBox.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.x || 0;
}
*/
TextBox.prototype.x = function x (_) {
return arguments.length ? (this._x = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._x;
};
/**
@memberof TextBox
@desc Sets the text for each box to the specified accessor function or static string.
@param {Function|String} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.text;
}
*/
TextBox.prototype.text = function text (_) {
return arguments.length ? (this._text = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._text;
};
/**
@memberof TextBox
@desc Sets the y position for each box to the specified accessor function or static number. The number given should correspond to the top side of the textBox.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.y || 0;
}
*/
TextBox.prototype.y = function y (_) {
return arguments.length ? (this._y = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._y;
};
/**
@memberof TextBox
@desc Sets the horizontal text anchor to the specified accessor function or static string, whose values are analagous to the SVG [text-anchor](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor) property.
@param {Function|String} [*value* = "start"]
*/
TextBox.prototype.textAnchor = function textAnchor (_) {
return arguments.length ? (this._textAnchor = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._textAnchor;
};
return TextBox;
}(d3plusCommon.BaseClass));
/**
@memberof TextBox
@desc Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`.
@param {Function|String} [*value* = "top"]
*/
TextBox.prototype.verticalAlign = function verticalAlign (_) {
return arguments.length ? (this._verticalAlign = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._verticalAlign;
};
var lowercase = ["a", "an", "and", "as", "at", "but", "by", "for", "from", "if", "in", "into", "near", "nor", "of", "on", "onto", "or", "per", "that", "the", "to", "with", "via", "vs", "vs."];
var uppercase = ["CEO", "CFO", "CNC", "COO", "CPU", "GDP", "HVAC", "ID", "IT", "R&D", "TV", "UI"];
/**
@memberof TextBox
@desc Sets the width for each box to the specified accessor function or static number.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.width || 200;
}
@function titleCase
@desc Capitalizes the first letter of each word in a phrase/sentence.
@param {String} str The string to apply the title case logic.
*/
TextBox.prototype.width = function width (_) {
return arguments.length ? (this._width = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._width;
};
function titleCase(str) {
/**
@memberof TextBox
@desc Sets the x position for each box to the specified accessor function or static number. The number given should correspond to the left side of the textBox.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.x || 0;
}
*/
TextBox.prototype.x = function x (_) {
return arguments.length ? (this._x = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._x;
};
if (str === void 0) { return ""; }
/**
@memberof TextBox
@desc Sets the y position for each box to the specified accessor function or static number. The number given should correspond to the top side of the textBox.
@param {Function|Number} [*value*]
@example <caption>default accessor</caption>
function(d) {
return d.y || 0;
}
*/
TextBox.prototype.y = function y (_) {
return arguments.length ? (this._y = typeof _ === "function" ? _ : d3plusCommon.constant(_), this) : this._y;
};
var smalls = lowercase.map(function (s) { return s.toLowerCase(); });
return TextBox;
}(d3plusCommon.BaseClass));
var bigs = uppercase.slice();
bigs = bigs.concat(bigs.map(function (b) { return (b + "s"); }));
var biglow = bigs.map(function (b) { return b.toLowerCase(); });
var lowercase = ["a", "an", "and", "as", "at", "but", "by", "for", "from", "if", "in", "into", "near", "nor", "of", "on", "onto", "or", "per", "that", "the", "to", "with", "via", "vs", "vs."];
var uppercase = ["CEO", "CFO", "CNC", "COO", "CPU", "GDP", "HVAC", "ID", "IT", "R&D", "TV", "UI"];
var split = textSplit(str);
return split.map(function (s, i) {
if (s) {
var lower = s.toLowerCase();
var stripped = suffixChars.includes(lower.charAt(lower.length - 1)) ? lower.slice(0, -1) : lower;
var bigindex = biglow.indexOf(stripped);
if (bigindex >= 0) { return bigs[bigindex]; }
else if (smalls.includes(stripped) && i !== 0 && i !== split.length - 1) { return lower; }
else { return s.charAt(0).toUpperCase() + s.substr(1).toLowerCase(); }
}
else { return ""; }
}).reduce(function (ret, s, i) {
if (i && str.charAt(ret.length) === " ") { ret += " "; }
ret += s;
return ret;
}, "");
/**
@function titleCase
@desc Capitalizes the first letter of each word in a phrase/sentence.
@param {String} str The string to apply the title case logic.
*/
function titleCase(str) {
}
if (str === void 0) { return ""; }
exports.fontExists = fontExists;
exports.rtl = detectRTL;
exports.stringify = stringify;
exports.strip = strip;
exports.TextBox = TextBox;
exports.textSplit = textSplit;
exports.textWidth = measure;
exports.textWrap = wrap;
exports.titleCase = titleCase;
exports.trim = trim;
exports.trimLeft = trimLeft;
exports.trimRight = trimRight;
var smalls = lowercase.map(function (s) { return s.toLowerCase(); });
Object.defineProperty(exports, '__esModule', { value: true });
var bigs = uppercase.slice();
bigs = bigs.concat(bigs.map(function (b) { return (b + "s"); }));
var biglow = bigs.map(function (b) { return b.toLowerCase(); });
var split = textSplit(str);
return split.map(function (s, i) {
if (s) {
var lower = s.toLowerCase();
var stripped = suffixChars.includes(lower.charAt(lower.length - 1)) ? lower.slice(0, -1) : lower;
var bigindex = biglow.indexOf(stripped);
if (bigindex >= 0) { return bigs[bigindex]; }
else if (smalls.includes(stripped) && i !== 0 && i !== split.length - 1) { return lower; }
else { return s.charAt(0).toUpperCase() + s.substr(1).toLowerCase(); }
}
else { return ""; }
}).reduce(function (ret, s, i) {
if (i && str.charAt(ret.length) === " ") { ret += " "; }
ret += s;
return ret;
}, "");
}
exports.fontExists = fontExists;
exports.rtl = detectRTL;
exports.stringify = stringify;
exports.strip = strip;
exports.TextBox = TextBox;
exports.textSplit = textSplit;
exports.textWidth = measure;
exports.textWrap = wrap;
exports.titleCase = titleCase;
exports.trim = trim;
exports.trimLeft = trimLeft;
exports.trimRight = trimRight;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=d3plus-text.js.map
/*
d3plus-text v0.9.27
d3plus-text v0.9.28
A smart SVG text box with line wrapping and automatic font size scaling.

@@ -7,2 +7,2 @@ Copyright (c) 2018 D3plus - https://d3plus.org

*/
if(typeof Object.assign!=="function"){Object.defineProperty(Object,"assign",{value:function u(t){"use strict";if(t===null){throw new TypeError("Cannot convert undefined or null to object")}var n=Object(t);for(var e=1;e<arguments.length;e++){var i=arguments[e];if(i!==null){for(var o in i){if(Object.prototype.hasOwnProperty.call(i,o)){n[o]=i[o]}}}}return n},writable:true,configurable:true})}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function u(t,n){var e=Object(this);var i=e.length>>>0;if(i===0)return false;var o=n|0;var r=Math.max(o>=0?o:i-Math.abs(o),0);function A(u,t){return u===t||typeof u==="number"&&typeof t==="number"&&isNaN(u)&&isNaN(t)}while(r<i){if(A(e[r],t)){return true}r++}return false}})}(function(u,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports,require("d3-selection"),require("d3-array"),require("d3-transition"),require("d3plus-common")):typeof define==="function"&&define.amd?define("d3plus-text",["exports","d3-selection","d3-array","d3-transition","d3plus-common"],t):t(u.d3plus={},u.d3Selection,u.d3Array,u.d3Transition,u.d3plusCommon)})(this,function(u,t,n,e,i){"use strict";function o(u,t){t=Object.assign({"font-size":10,"font-family":"sans-serif","font-style":"normal","font-weight":400,"font-variant":"normal"},t);var n=document.createElement("canvas").getContext("2d");var e=[];e.push(t["font-style"]);e.push(t["font-variant"]);e.push(t["font-weight"]);e.push(typeof t["font-size"]==="string"?t["font-size"]:t["font-size"]+"px");e.push(t["font-family"]);n.font=e.join(" ");if(u instanceof Array){return u.map(function(u){return n.measureText(u).width})}return n.measureText(u).width}function r(u){return u.replace(/^\s+|\s+$/g,"")}function A(u){return u.replace(/^\s+/,"")}function s(u){return u.replace(/\s+$/,"")}var a="abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890",f={},C=32;var B,l,D,h;var E=function(u){if(!B){B=o(a,{"font-family":"DejaVuSans","font-size":C});l=o(a,{"font-family":"-apple-system","font-size":C});D=o(a,{"font-family":"monospace","font-size":C});h=o(a,{"font-family":"sans-serif","font-size":C})}if(!(u instanceof Array)){u=u.split(",")}u=u.map(function(u){return r(u)});for(var t=0;t<u.length;t++){var n=u[t];if(f[n]||["-apple-system","monospace","sans-serif","DejaVuSans"].includes(n)){return n}else if(f[n]===false){continue}var e=o(a,{"font-family":n,"font-size":C});f[n]=e!==D;if(f[n]){f[n]=e!==h}if(l&&f[n]){f[n]=e!==l}if(B&&f[n]){f[n]=e!==B}if(f[n]){return n}}return false};function c(){return t.select("html").attr("dir")==="rtl"||t.select("body").attr("dir")==="rtl"||t.select("html").style("direction")==="rtl"||t.select("body").style("direction")==="rtl"}function F(u){if(u===void 0){u="undefined"}else if(!(typeof u==="string"||u instanceof String)){u=JSON.stringify(u)}return u}var p=[[/[\300-\305]/g,"A"],[/[\340-\345]/g,"a"],[/[\306]/g,"AE"],[/[\346]/g,"ae"],[/[\337]/g,"B"],[/[\307]/g,"C"],[/[\347]/g,"c"],[/[\320\336\376]/g,"D"],[/[\360]/g,"d"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\322-\326\330]/g,"O"],[/[\362-\366\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\327]/g,"x"],[/[\335]/g,"Y"],[/[\375\377]/g,"y"]];function g(u){return(""+u).replace(/[^A-Za-z0-9\-_]/g,function(u){if(u===" "){return"-"}var t=false;for(var n=0;n<p.length;n++){if(new RegExp(p[n][0]).test(u)){t=p[n][1];break}}return t||""})}var y=["u0903","u093B","u093E","u093F","u0940","u0949","u094A","u094B","u094C","u094E","u094F","u0982","u0983","u09BE","u09BF","u09C0","u09C7","u09C8","u09CB","u09CC","u09D7","u0A03","u0A3E","u0A3F","u0A40","u0A83","u0ABE","u0ABF","u0AC0","u0AC9","u0ACB","u0ACC","u0B02","u0B03","u0B3E","u0B40","u0B47","u0B48","u0B4B","u0B4C","u0B57","u0BBE","u0BBF","u0BC1","u0BC2","u0BC6","u0BC7","u0BC8","u0BCA","u0BCB","u0BCC","u0BD7","u0C01","u0C02","u0C03","u0C41","u0C42","u0C43","u0C44","u0C82","u0C83","u0CBE","u0CC0","u0CC1","u0CC2","u0CC3","u0CC4","u0CC7","u0CC8","u0CCA","u0CCB","u0CD5","u0CD6","u0D02","u0D03","u0D3E","u0D3F","u0D40","u0D46","u0D47","u0D48","u0D4A","u0D4B","u0D4C","u0D57","u0D82","u0D83","u0DCF","u0DD0","u0DD1","u0DD8","u0DD9","u0DDA","u0DDB","u0DDC","u0DDD","u0DDE","u0DDF","u0DF2","u0DF3","u0F3E","u0F3F","u0F7F","u102B","u102C","u1031","u1038","u103B","u103C","u1056","u1057","u1062","u1063","u1064","u1067","u1068","u1069","u106A","u106B","u106C","u106D","u1083","u1084","u1087","u1088","u1089","u108A","u108B","u108C","u108F","u109A","u109B","u109C","u17B6","u17BE","u17BF","u17C0","u17C1","u17C2","u17C3","u17C4","u17C5","u17C7","u17C8","u1923","u1924","u1925","u1926","u1929","u192A","u192B","u1930","u1931","u1933","u1934","u1935","u1936","u1937","u1938","u1A19","u1A1A","u1A55","u1A57","u1A61","u1A63","u1A64","u1A6D","u1A6E","u1A6F","u1A70","u1A71","u1A72","u1B04","u1B35","u1B3B","u1B3D","u1B3E","u1B3F","u1B40","u1B41","u1B43","u1B44","u1B82","u1BA1","u1BA6","u1BA7","u1BAA","u1BE7","u1BEA","u1BEB","u1BEC","u1BEE","u1BF2","u1BF3","u1C24","u1C25","u1C26","u1C27","u1C28","u1C29","u1C2A","u1C2B","u1C34","u1C35","u1CE1","u1CF2","u1CF3","u302E","u302F","uA823","uA824","uA827","uA880","uA881","uA8B4","uA8B5","uA8B6","uA8B7","uA8B8","uA8B9","uA8BA","uA8BB","uA8BC","uA8BD","uA8BE","uA8BF","uA8C0","uA8C1","uA8C2","uA8C3","uA952","uA953","uA983","uA9B4","uA9B5","uA9BA","uA9BB","uA9BD","uA9BE","uA9BF","uA9C0","uAA2F","uAA30","uAA33","uAA34","uAA4D","uAA7B","uAA7D","uAAEB","uAAEE","uAAEF","uAAF5","uABE3","uABE4","uABE6","uABE7","uABE9","uABEA","uABEC"];var d=["u0300","u0301","u0302","u0303","u0304","u0305","u0306","u0307","u0308","u0309","u030A","u030B","u030C","u030D","u030E","u030F","u0310","u0311","u0312","u0313","u0314","u0315","u0316","u0317","u0318","u0319","u031A","u031B","u031C","u031D","u031E","u031F","u0320","u0321","u0322","u0323","u0324","u0325","u0326","u0327","u0328","u0329","u032A","u032B","u032C","u032D","u032E","u032F","u0330","u0331","u0332","u0333","u0334","u0335","u0336","u0337","u0338","u0339","u033A","u033B","u033C","u033D","u033E","u033F","u0340","u0341","u0342","u0343","u0344","u0345","u0346","u0347","u0348","u0349","u034A","u034B","u034C","u034D","u034E","u034F","u0350","u0351","u0352","u0353","u0354","u0355","u0356","u0357","u0358","u0359","u035A","u035B","u035C","u035D","u035E","u035F","u0360","u0361","u0362","u0363","u0364","u0365","u0366","u0367","u0368","u0369","u036A","u036B","u036C","u036D","u036E","u036F","u0483","u0484","u0485","u0486","u0487","u0591","u0592","u0593","u0594","u0595","u0596","u0597","u0598","u0599","u059A","u059B","u059C","u059D","u059E","u059F","u05A0","u05A1","u05A2","u05A3","u05A4","u05A5","u05A6","u05A7","u05A8","u05A9","u05AA","u05AB","u05AC","u05AD","u05AE","u05AF","u05B0","u05B1","u05B2","u05B3","u05B4","u05B5","u05B6","u05B7","u05B8","u05B9","u05BA","u05BB","u05BC","u05BD","u05BF","u05C1","u05C2","u05C4","u05C5","u05C7","u0610","u0611","u0612","u0613","u0614","u0615","u0616","u0617","u0618","u0619","u061A","u064B","u064C","u064D","u064E","u064F","u0650","u0651","u0652","u0653","u0654","u0655","u0656","u0657","u0658","u0659","u065A","u065B","u065C","u065D","u065E","u065F","u0670","u06D6","u06D7","u06D8","u06D9","u06DA","u06DB","u06DC","u06DF","u06E0","u06E1","u06E2","u06E3","u06E4","u06E7","u06E8","u06EA","u06EB","u06EC","u06ED","u0711","u0730","u0731","u0732","u0733","u0734","u0735","u0736","u0737","u0738","u0739","u073A","u073B","u073C","u073D","u073E","u073F","u0740","u0741","u0742","u0743","u0744","u0745","u0746","u0747","u0748","u0749","u074A","u07A6","u07A7","u07A8","u07A9","u07AA","u07AB","u07AC","u07AD","u07AE","u07AF","u07B0","u07EB","u07EC","u07ED","u07EE","u07EF","u07F0","u07F1","u07F2","u07F3","u0816","u0817","u0818","u0819","u081B","u081C","u081D","u081E","u081F","u0820","u0821","u0822","u0823","u0825","u0826","u0827","u0829","u082A","u082B","u082C","u082D","u0859","u085A","u085B","u08E3","u08E4","u08E5","u08E6","u08E7","u08E8","u08E9","u08EA","u08EB","u08EC","u08ED","u08EE","u08EF","u08F0","u08F1","u08F2","u08F3","u08F4","u08F5","u08F6","u08F7","u08F8","u08F9","u08FA","u08FB","u08FC","u08FD","u08FE","u08FF","u0900","u0901","u0902","u093A","u093C","u0941","u0942","u0943","u0944","u0945","u0946","u0947","u0948","u094D","u0951","u0952","u0953","u0954","u0955","u0956","u0957","u0962","u0963","u0981","u09BC","u09C1","u09C2","u09C3","u09C4","u09CD","u09E2","u09E3","u0A01","u0A02","u0A3C","u0A41","u0A42","u0A47","u0A48","u0A4B","u0A4C","u0A4D","u0A51","u0A70","u0A71","u0A75","u0A81","u0A82","u0ABC","u0AC1","u0AC2","u0AC3","u0AC4","u0AC5","u0AC7","u0AC8","u0ACD","u0AE2","u0AE3","u0B01","u0B3C","u0B3F","u0B41","u0B42","u0B43","u0B44","u0B4D","u0B56","u0B62","u0B63","u0B82","u0BC0","u0BCD","u0C00","u0C3E","u0C3F","u0C40","u0C46","u0C47","u0C48","u0C4A","u0C4B","u0C4C","u0C4D","u0C55","u0C56","u0C62","u0C63","u0C81","u0CBC","u0CBF","u0CC6","u0CCC","u0CCD","u0CE2","u0CE3","u0D01","u0D41","u0D42","u0D43","u0D44","u0D4D","u0D62","u0D63","u0DCA","u0DD2","u0DD3","u0DD4","u0DD6","u0E31","u0E34","u0E35","u0E36","u0E37","u0E38","u0E39","u0E3A","u0E47","u0E48","u0E49","u0E4A","u0E4B","u0E4C","u0E4D","u0E4E","u0EB1","u0EB4","u0EB5","u0EB6","u0EB7","u0EB8","u0EB9","u0EBB","u0EBC","u0EC8","u0EC9","u0ECA","u0ECB","u0ECC","u0ECD","u0F18","u0F19","u0F35","u0F37","u0F39","u0F71","u0F72","u0F73","u0F74","u0F75","u0F76","u0F77","u0F78","u0F79","u0F7A","u0F7B","u0F7C","u0F7D","u0F7E","u0F80","u0F81","u0F82","u0F83","u0F84","u0F86","u0F87","u0F8D","u0F8E","u0F8F","u0F90","u0F91","u0F92","u0F93","u0F94","u0F95","u0F96","u0F97","u0F99","u0F9A","u0F9B","u0F9C","u0F9D","u0F9E","u0F9F","u0FA0","u0FA1","u0FA2","u0FA3","u0FA4","u0FA5","u0FA6","u0FA7","u0FA8","u0FA9","u0FAA","u0FAB","u0FAC","u0FAD","u0FAE","u0FAF","u0FB0","u0FB1","u0FB2","u0FB3","u0FB4","u0FB5","u0FB6","u0FB7","u0FB8","u0FB9","u0FBA","u0FBB","u0FBC","u0FC6","u102D","u102E","u102F","u1030","u1032","u1033","u1034","u1035","u1036","u1037","u1039","u103A","u103D","u103E","u1058","u1059","u105E","u105F","u1060","u1071","u1072","u1073","u1074","u1082","u1085","u1086","u108D","u109D","u135D","u135E","u135F","u1712","u1713","u1714","u1732","u1733","u1734","u1752","u1753","u1772","u1773","u17B4","u17B5","u17B7","u17B8","u17B9","u17BA","u17BB","u17BC","u17BD","u17C6","u17C9","u17CA","u17CB","u17CC","u17CD","u17CE","u17CF","u17D0","u17D1","u17D2","u17D3","u17DD","u180B","u180C","u180D","u18A9","u1920","u1921","u1922","u1927","u1928","u1932","u1939","u193A","u193B","u1A17","u1A18","u1A1B","u1A56","u1A58","u1A59","u1A5A","u1A5B","u1A5C","u1A5D","u1A5E","u1A60","u1A62","u1A65","u1A66","u1A67","u1A68","u1A69","u1A6A","u1A6B","u1A6C","u1A73","u1A74","u1A75","u1A76","u1A77","u1A78","u1A79","u1A7A","u1A7B","u1A7C","u1A7F","u1AB0","u1AB1","u1AB2","u1AB3","u1AB4","u1AB5","u1AB6","u1AB7","u1AB8","u1AB9","u1ABA","u1ABB","u1ABC","u1ABD","u1B00","u1B01","u1B02","u1B03","u1B34","u1B36","u1B37","u1B38","u1B39","u1B3A","u1B3C","u1B42","u1B6B","u1B6C","u1B6D","u1B6E","u1B6F","u1B70","u1B71","u1B72","u1B73","u1B80","u1B81","u1BA2","u1BA3","u1BA4","u1BA5","u1BA8","u1BA9","u1BAB","u1BAC","u1BAD","u1BE6","u1BE8","u1BE9","u1BED","u1BEF","u1BF0","u1BF1","u1C2C","u1C2D","u1C2E","u1C2F","u1C30","u1C31","u1C32","u1C33","u1C36","u1C37","u1CD0","u1CD1","u1CD2","u1CD4","u1CD5","u1CD6","u1CD7","u1CD8","u1CD9","u1CDA","u1CDB","u1CDC","u1CDD","u1CDE","u1CDF","u1CE0","u1CE2","u1CE3","u1CE4","u1CE5","u1CE6","u1CE7","u1CE8","u1CED","u1CF4","u1CF8","u1CF9","u1DC0","u1DC1","u1DC2","u1DC3","u1DC4","u1DC5","u1DC6","u1DC7","u1DC8","u1DC9","u1DCA","u1DCB","u1DCC","u1DCD","u1DCE","u1DCF","u1DD0","u1DD1","u1DD2","u1DD3","u1DD4","u1DD5","u1DD6","u1DD7","u1DD8","u1DD9","u1DDA","u1DDB","u1DDC","u1DDD","u1DDE","u1DDF","u1DE0","u1DE1","u1DE2","u1DE3","u1DE4","u1DE5","u1DE6","u1DE7","u1DE8","u1DE9","u1DEA","u1DEB","u1DEC","u1DED","u1DEE","u1DEF","u1DF0","u1DF1","u1DF2","u1DF3","u1DF4","u1DF5","u1DFC","u1DFD","u1DFE","u1DFF","u20D0","u20D1","u20D2","u20D3","u20D4","u20D5","u20D6","u20D7","u20D8","u20D9","u20DA","u20DB","u20DC","u20E1","u20E5","u20E6","u20E7","u20E8","u20E9","u20EA","u20EB","u20EC","u20ED","u20EE","u20EF","u20F0","u2CEF","u2CF0","u2CF1","u2D7F","u2DE0","u2DE1","u2DE2","u2DE3","u2DE4","u2DE5","u2DE6","u2DE7","u2DE8","u2DE9","u2DEA","u2DEB","u2DEC","u2DED","u2DEE","u2DEF","u2DF0","u2DF1","u2DF2","u2DF3","u2DF4","u2DF5","u2DF6","u2DF7","u2DF8","u2DF9","u2DFA","u2DFB","u2DFC","u2DFD","u2DFE","u2DFF","u302A","u302B","u302C","u302D","u3099","u309A","uA66F","uA674","uA675","uA676","uA677","uA678","uA679","uA67A","uA67B","uA67C","uA67D","uA69E","uA69F","uA6F0","uA6F1","uA802","uA806","uA80B","uA825","uA826","uA8C4","uA8E0","uA8E1","uA8E2","uA8E3","uA8E4","uA8E5","uA8E6","uA8E7","uA8E8","uA8E9","uA8EA","uA8EB","uA8EC","uA8ED","uA8EE","uA8EF","uA8F0","uA8F1","uA926","uA927","uA928","uA929","uA92A","uA92B","uA92C","uA92D","uA947","uA948","uA949","uA94A","uA94B","uA94C","uA94D","uA94E","uA94F","uA950","uA951","uA980","uA981","uA982","uA9B3","uA9B6","uA9B7","uA9B8","uA9B9","uA9BC","uA9E5","uAA29","uAA2A","uAA2B","uAA2C","uAA2D","uAA2E","uAA31","uAA32","uAA35","uAA36","uAA43","uAA4C","uAA7C","uAAB0","uAAB2","uAAB3","uAAB4","uAAB7","uAAB8","uAABE","uAABF","uAAC1","uAAEC","uAAED","uAAF6","uABE5","uABE8","uABED","uFB1E","uFE00","uFE01","uFE02","uFE03","uFE04","uFE05","uFE06","uFE07","uFE08","uFE09","uFE0A","uFE0B","uFE0C","uFE0D","uFE0E","uFE0F","uFE20","uFE21","uFE22","uFE23","uFE24","uFE25","uFE26","uFE27","uFE28","uFE29","uFE2A","uFE2B","uFE2C","uFE2D","uFE2E","uFE2F"];var _=y.concat(d);var v=["-","/",";",":","&","u0E2F","u0EAF","u0EC6","u0ECC","u104A","u104B","u104C","u104D","u104E","u104F","u2013","u2014","u2027","u3000","u3001","u3002","uFF0C","uFF5E"];var m=["'","<","(","{","[","u00AB","u300A","u3008"];var x=["'",">",")","}","]",".","!","?","u00BB","u300B","u3009"].concat(v);var w="က-ဪဿ-၉ၐ-ၕ";var b="぀-ゟ゠-ヿ＀-+--}⦅-゚㐀-䶿";var z="㐀-龿";var O="ກ-ຮະ-ໄ່-໋ໍ-ໝ";var j=w+z+O;var S=new RegExp("(\\"+v.join("|\\")+")*[^\\s|\\"+v.join("|\\")+"]*(\\"+v.join("|\\")+")*","g");var H=new RegExp("["+b+"]");var M=new RegExp("["+j+"]");var R=new RegExp("(\\"+m.join("|\\")+")*["+j+"](\\"+x.join("|\\")+"|\\"+_.join("|\\")+")*|[a-z0-9]+","gi");function W(u){if(!M.test(u)){return F(u).match(S).filter(function(u){return u.length})}return n.merge(F(u).match(S).map(function(u){if(!H.test(u)&&M.test(u)){return u.match(R)}return[u]}))}function N(){var u="sans-serif",t=10,n=400,e=200,i,r=false,A=W,a=200;function f(f){f=F(f);if(i===void 0){i=Math.ceil(t*1.4)}var C=A(f);var B={"font-family":u,"font-size":t,"font-weight":n,"line-height":i};var l=1,D="",h=false,E=0;var c=[],p=o(C,B),g=o(" ",B);for(var y=0;y<C.length;y++){var d=C[y];var _=p[C.indexOf(d)];d+=f.slice(D.length+d.length).match("^( |\n)*","g")[0];if(D.slice(-1)==="\n"||E+_>a){if(!y&&!r){h=true;break}c[l-1]=s(c[l-1]);l++;if(i*l>e||_>a&&!r){h=true;break}E=0;c.push(d)}else if(!y){c[0]=d}else{c[l-1]+=d}D+=d;E+=_;E+=d.match(/[\s]*$/g)[0].length*g}return{lines:c,sentence:f,truncated:h,widths:o(c,B),words:C}}f.fontFamily=function(t){return arguments.length?(u=t,f):u};f.fontSize=function(u){return arguments.length?(t=u,f):t};f.fontWeight=function(u){return arguments.length?(n=u,f):n};f.height=function(u){return arguments.length?(e=u,f):e};f.lineHeight=function(u){return arguments.length?(i=u,f):i};f.overflow=function(u){return arguments.length?(r=u,f):r};f.split=function(u){return arguments.length?(A=u,f):A};f.width=function(u){return arguments.length?(a=u,f):a};return f}var T=function(u){function r(){var t=this;u.call(this);this._delay=0;this._duration=0;this._ellipsis=function(u,t){return t?u.replace(/\.|,$/g,"")+"...":""};this._fontColor=i.constant("black");this._fontFamily=i.constant(["Roboto","Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"]);this._fontMax=i.constant(50);this._fontMin=i.constant(8);this._fontOpacity=i.constant(1);this._fontResize=i.constant(false);this._fontSize=i.constant(10);this._fontWeight=i.constant(400);this._height=i.accessor("height",200);this._id=function(u,t){return u.id||""+t};this._lineHeight=function(u,n){return t._fontSize(u,n)*1.2};this._on={};this._overflow=i.constant(false);this._padding=i.constant(0);this._pointerEvents=i.constant("auto");this._rotate=i.constant(0);this._split=W;this._text=i.accessor("text");this._textAnchor=i.constant("start");this._verticalAlign=i.constant("top");this._width=i.accessor("width",200);this._x=i.accessor("x",0);this._y=i.accessor("y",0)}if(u)r.__proto__=u;r.prototype=Object.create(u&&u.prototype);r.prototype.constructor=r;r.prototype.render=function u(r){var A=this;if(this._select===void 0){this.select(t.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node())}var a=this;var f=this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function(u,t,e){var r=A._text(t,e);if(r===void 0){return u}var s=A._fontResize(t,e);var f=A._lineHeight(t,e)/A._fontSize(t,e);var C=s?A._fontMax(t,e):A._fontSize(t,e),B=s?C*f:A._lineHeight(t,e),l=1,D=[],h,c;var F={"font-family":E(A._fontFamily(t,e)),"font-size":C,"font-weight":A._fontWeight(t,e),"line-height":B};var p=i.parseSides(A._padding(t,e));var g=A._height(t,e)-(p.top+p.bottom),y=A._width(t,e)-(p.left+p.right);var d=N().fontFamily(F["font-family"]).fontSize(C).fontWeight(F["font-weight"]).lineHeight(B).height(g).overflow(A._overflow(t,e)).width(y);var _=A._fontMax(t,e),v=A._fontMin(t,e),m=A._verticalAlign(t,e),x=A._split(r,e);function w(){if(C<v){D=[];return}else if(C>_){C=_}if(s){B=C*f;d.fontSize(C).lineHeight(B);F["font-size"]=C;F["line-height"]=B}c=d(r);D=c.lines.filter(function(u){return u!==""});l=D.length;if(c.truncated){if(s){C--;if(C<v){D=[]}else{w()}}else if(l<1){D=[a._ellipsis("",l)]}else{D[l-1]=a._ellipsis(D[l-1],l)}}}if(y>v&&(g>B||s&&g>v*f)){if(s){h=o(x,F);var b=1.165+y/g*.1,z=y*g,O=n.max(h),j=n.sum(h,function(u){return u*B})*b;if(O>y||j>z){var S=Math.sqrt(z/j),H=y/O;var M=n.min([S,H]);C=Math.floor(C*M)}var R=Math.floor(g*.8);if(C>R){C=R}}w()}if(D.length){var W=l*B;var T=m==="top"?0:m==="middle"?g/2-W/2:g-W;T-=B*.1;u.push({data:t,i:e,lines:D,fC:A._fontColor(t,e),fF:F["font-family"],fO:A._fontOpacity(t,e),fW:F["font-weight"],id:A._id(t,e),tA:A._textAnchor(t,e),widths:c.widths,fS:C,lH:B,w:y,h:g,x:A._x(t,e)+p.left,y:A._y(t,e)+T+p.top})}return u},[]),this._id);var C=e.transition().duration(this._duration);if(this._duration===0){f.exit().remove()}else{f.exit().transition().delay(this._duration).remove();f.exit().selectAll("text").transition(C).attr("opacity",0)}function B(u){u.attr("transform",function(u,t){return"rotate("+a._rotate(u,t)+", "+(u.x+u.w/2)+", "+(u.y+u.h/2)+")translate("+u.x+", "+u.y+")"})}var l=f.enter().append("g").attr("class","d3plus-textBox").attr("id",function(u){return"d3plus-textBox-"+g(u.id)}).call(B).merge(f);var D=c();l.style("pointer-events",function(u){return A._pointerEvents(u.data,u.i)}).each(function(u){function n(t){t.text(function(u){return s(u)}).attr("dir",D?"rtl":"ltr").attr("fill",u.fC).attr("text-anchor",u.tA).attr("font-family",u.fF).style("font-family",u.fF).attr("font-size",u.fS+"px").style("font-size",u.fS+"px").attr("font-weight",u.fW).style("font-weight",u.fW).attr("opacity",u.fO).style("opacity",u.fO).attr("x",(u.tA==="middle"?u.w/2:D?u.tA==="start"?u.w:0:u.tA==="end"?u.w:0)+"px").attr("y",function(t,n){return(n+1)*u.lH-(u.lH-u.fS)+"px"})}var e=t.select(this).selectAll("text").data(u.lines);if(a._duration===0){e.call(n);e.exit().remove();e.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("unicode-bidi","bidi-override").call(n)}else{e.transition(C).call(n);e.exit().transition(C).attr("opacity",0).remove();e.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(n).merge(e).transition(C).delay(a._delay).call(n).attr("opacity",1)}}).transition(C).call(B);var h=Object.keys(this._on),F=h.reduce(function(u,t){u[t]=function(u,n){return A._on[t](u.data,n)};return u},{});for(var p=0;p<h.length;p++){l.on(h[p],F[h[p]])}if(r){setTimeout(r,this._duration+100)}return this};r.prototype.data=function u(t){return arguments.length?(this._data=t,this):this._data};r.prototype.delay=function u(t){return arguments.length?(this._delay=t,this):this._delay};r.prototype.duration=function u(t){return arguments.length?(this._duration=t,this):this._duration};r.prototype.ellipsis=function u(t){return arguments.length?(this._ellipsis=typeof t==="function"?t:i.constant(t),this):this._ellipsis};r.prototype.fontColor=function u(t){return arguments.length?(this._fontColor=typeof t==="function"?t:i.constant(t),this):this._fontColor};r.prototype.fontFamily=function u(t){return arguments.length?(this._fontFamily=typeof t==="function"?t:i.constant(t),this):this._fontFamily};r.prototype.fontMax=function u(t){return arguments.length?(this._fontMax=typeof t==="function"?t:i.constant(t),this):this._fontMax};r.prototype.fontMin=function u(t){return arguments.length?(this._fontMin=typeof t==="function"?t:i.constant(t),this):this._fontMin};r.prototype.fontOpacity=function u(t){return arguments.length?(this._fontOpacity=typeof t==="function"?t:i.constant(t),this):this._fontOpacity};r.prototype.fontResize=function u(t){return arguments.length?(this._fontResize=typeof t==="function"?t:i.constant(t),this):this._fontResize};r.prototype.fontSize=function u(t){return arguments.length?(this._fontSize=typeof t==="function"?t:i.constant(t),this):this._fontSize};r.prototype.fontWeight=function u(t){return arguments.length?(this._fontWeight=typeof t==="function"?t:i.constant(t),this):this._fontWeight};r.prototype.height=function u(t){return arguments.length?(this._height=typeof t==="function"?t:i.constant(t),this):this._height};r.prototype.id=function u(t){return arguments.length?(this._id=typeof t==="function"?t:i.constant(t),this):this._id};r.prototype.lineHeight=function u(t){return arguments.length?(this._lineHeight=typeof t==="function"?t:i.constant(t),this):this._lineHeight};r.prototype.overflow=function u(t){return arguments.length?(this._overflow=typeof t==="function"?t:i.constant(t),this):this._overflow};r.prototype.padding=function u(t){return arguments.length?(this._padding=typeof t==="function"?t:i.constant(t),this):this._padding};r.prototype.pointerEvents=function u(t){return arguments.length?(this._pointerEvents=typeof t==="function"?t:i.constant(t),this):this._pointerEvents};r.prototype.rotate=function u(t){return arguments.length?(this._rotate=typeof t==="function"?t:i.constant(t),this):this._rotate};r.prototype.select=function u(n){return arguments.length?(this._select=t.select(n),this):this._select};r.prototype.split=function u(t){return arguments.length?(this._split=t,this):this._split};r.prototype.text=function u(t){return arguments.length?(this._text=typeof t==="function"?t:i.constant(t),this):this._text};r.prototype.textAnchor=function u(t){return arguments.length?(this._textAnchor=typeof t==="function"?t:i.constant(t),this):this._textAnchor};r.prototype.verticalAlign=function u(t){return arguments.length?(this._verticalAlign=typeof t==="function"?t:i.constant(t),this):this._verticalAlign};r.prototype.width=function u(t){return arguments.length?(this._width=typeof t==="function"?t:i.constant(t),this):this._width};r.prototype.x=function u(t){return arguments.length?(this._x=typeof t==="function"?t:i.constant(t),this):this._x};r.prototype.y=function u(t){return arguments.length?(this._y=typeof t==="function"?t:i.constant(t),this):this._y};return r}(i.BaseClass);var P=["a","an","and","as","at","but","by","for","from","if","in","into","near","nor","of","on","onto","or","per","that","the","to","with","via","vs","vs."];var k=["CEO","CFO","CNC","COO","CPU","GDP","HVAC","ID","IT","R&D","TV","UI"];function q(u){if(u===void 0){return""}var t=P.map(function(u){return u.toLowerCase()});var n=k.slice();n=n.concat(n.map(function(u){return u+"s"}));var e=n.map(function(u){return u.toLowerCase()});var i=W(u);return i.map(function(u,o){if(u){var r=u.toLowerCase();var A=x.includes(r.charAt(r.length-1))?r.slice(0,-1):r;var s=e.indexOf(A);if(s>=0){return n[s]}else if(t.includes(A)&&o!==0&&o!==i.length-1){return r}else{return u.charAt(0).toUpperCase()+u.substr(1).toLowerCase()}}else{return""}}).reduce(function(t,n,e){if(e&&u.charAt(t.length)===" "){t+=" "}t+=n;return t},"")}u.fontExists=E;u.rtl=c;u.stringify=F;u.strip=g;u.TextBox=T;u.textSplit=W;u.textWidth=o;u.textWrap=N;u.titleCase=q;u.trim=r;u.trimLeft=A;u.trimRight=s;Object.defineProperty(u,"__esModule",{value:true})});
if(typeof Object.assign!=="function"){Object.defineProperty(Object,"assign",{value:function u(t){"use strict";if(t===null){throw new TypeError("Cannot convert undefined or null to object")}var n=Object(t);for(var e=1;e<arguments.length;e++){var i=arguments[e];if(i!==null){for(var o in i){if(Object.prototype.hasOwnProperty.call(i,o)){n[o]=i[o]}}}}return n},writable:true,configurable:true})}if(!Array.prototype.includes){Object.defineProperty(Array.prototype,"includes",{value:function u(t,n){var e=Object(this);var i=e.length>>>0;if(i===0)return false;var o=n|0;var r=Math.max(o>=0?o:i-Math.abs(o),0);function A(u,t){return u===t||typeof u==="number"&&typeof t==="number"&&isNaN(u)&&isNaN(t)}while(r<i){if(A(e[r],t)){return true}r++}return false}})}(function(u,t){typeof exports==="object"&&typeof module!=="undefined"?t(exports,require("d3-selection"),require("d3-array"),require("d3-transition"),require("d3plus-common")):typeof define==="function"&&define.amd?define("d3plus-text",["exports","d3-selection","d3-array","d3-transition","d3plus-common"],t):t(u.d3plus={},u.d3Selection,u.d3Array,u.d3Transition,u.d3plusCommon)})(this,function(u,f,M,C,R){"use strict";function W(u,t){t=Object.assign({"font-size":10,"font-family":"sans-serif","font-style":"normal","font-weight":400,"font-variant":"normal"},t);var n=document.createElement("canvas").getContext("2d");var e=[];e.push(t["font-style"]);e.push(t["font-variant"]);e.push(t["font-weight"]);e.push(typeof t["font-size"]==="string"?t["font-size"]:t["font-size"]+"px");e.push(t["font-family"]);n.font=e.join(" ");if(u instanceof Array){return u.map(function(u){return n.measureText(u).width})}return n.measureText(u).width}function i(u){return u.replace(/^\s+|\s+$/g,"")}function t(u){return u.replace(/^\s+/,"")}function y(u){return u.replace(/\s+$/,"")}var o="abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890",r={},A=32;var s,a,B,h;var N=function(u){if(!s){s=W(o,{"font-family":"DejaVuSans","font-size":A});a=W(o,{"font-family":"-apple-system","font-size":A});B=W(o,{"font-family":"monospace","font-size":A});h=W(o,{"font-family":"sans-serif","font-size":A})}if(!(u instanceof Array)){u=u.split(",")}u=u.map(function(u){return i(u)});for(var t=0;t<u.length;t++){var n=u[t];if(r[n]||["-apple-system","monospace","sans-serif","DejaVuSans"].includes(n)){return n}else if(r[n]===false){continue}var e=W(o,{"font-family":n,"font-size":A});r[n]=e!==B;if(r[n]){r[n]=e!==h}if(a&&r[n]){r[n]=e!==a}if(s&&r[n]){r[n]=e!==s}if(r[n]){return n}}return false};function l(){return f.select("html").attr("dir")==="rtl"||f.select("body").attr("dir")==="rtl"||f.select("html").style("direction")==="rtl"||f.select("body").style("direction")==="rtl"}function d(u){if(u===void 0){u="undefined"}else if(!(typeof u==="string"||u instanceof String)){u=JSON.stringify(u)}return u}var e=[[/[\300-\305]/g,"A"],[/[\340-\345]/g,"a"],[/[\306]/g,"AE"],[/[\346]/g,"ae"],[/[\337]/g,"B"],[/[\307]/g,"C"],[/[\347]/g,"c"],[/[\320\336\376]/g,"D"],[/[\360]/g,"d"],[/[\310-\313]/g,"E"],[/[\350-\353]/g,"e"],[/[\314-\317]/g,"I"],[/[\354-\357]/g,"i"],[/[\321]/g,"N"],[/[\361]/g,"n"],[/[\322-\326\330]/g,"O"],[/[\362-\366\370]/g,"o"],[/[\331-\334]/g,"U"],[/[\371-\374]/g,"u"],[/[\327]/g,"x"],[/[\335]/g,"Y"],[/[\375\377]/g,"y"]];function D(u){return(""+u).replace(/[^A-Za-z0-9\-_]/g,function(u){if(u===" "){return"-"}var t=false;for(var n=0;n<e.length;n++){if(new RegExp(e[n][0]).test(u)){t=e[n][1];break}}return t||""})}var n=["u0903","u093B","u093E","u093F","u0940","u0949","u094A","u094B","u094C","u094E","u094F","u0982","u0983","u09BE","u09BF","u09C0","u09C7","u09C8","u09CB","u09CC","u09D7","u0A03","u0A3E","u0A3F","u0A40","u0A83","u0ABE","u0ABF","u0AC0","u0AC9","u0ACB","u0ACC","u0B02","u0B03","u0B3E","u0B40","u0B47","u0B48","u0B4B","u0B4C","u0B57","u0BBE","u0BBF","u0BC1","u0BC2","u0BC6","u0BC7","u0BC8","u0BCA","u0BCB","u0BCC","u0BD7","u0C01","u0C02","u0C03","u0C41","u0C42","u0C43","u0C44","u0C82","u0C83","u0CBE","u0CC0","u0CC1","u0CC2","u0CC3","u0CC4","u0CC7","u0CC8","u0CCA","u0CCB","u0CD5","u0CD6","u0D02","u0D03","u0D3E","u0D3F","u0D40","u0D46","u0D47","u0D48","u0D4A","u0D4B","u0D4C","u0D57","u0D82","u0D83","u0DCF","u0DD0","u0DD1","u0DD8","u0DD9","u0DDA","u0DDB","u0DDC","u0DDD","u0DDE","u0DDF","u0DF2","u0DF3","u0F3E","u0F3F","u0F7F","u102B","u102C","u1031","u1038","u103B","u103C","u1056","u1057","u1062","u1063","u1064","u1067","u1068","u1069","u106A","u106B","u106C","u106D","u1083","u1084","u1087","u1088","u1089","u108A","u108B","u108C","u108F","u109A","u109B","u109C","u17B6","u17BE","u17BF","u17C0","u17C1","u17C2","u17C3","u17C4","u17C5","u17C7","u17C8","u1923","u1924","u1925","u1926","u1929","u192A","u192B","u1930","u1931","u1933","u1934","u1935","u1936","u1937","u1938","u1A19","u1A1A","u1A55","u1A57","u1A61","u1A63","u1A64","u1A6D","u1A6E","u1A6F","u1A70","u1A71","u1A72","u1B04","u1B35","u1B3B","u1B3D","u1B3E","u1B3F","u1B40","u1B41","u1B43","u1B44","u1B82","u1BA1","u1BA6","u1BA7","u1BAA","u1BE7","u1BEA","u1BEB","u1BEC","u1BEE","u1BF2","u1BF3","u1C24","u1C25","u1C26","u1C27","u1C28","u1C29","u1C2A","u1C2B","u1C34","u1C35","u1CE1","u1CF2","u1CF3","u302E","u302F","uA823","uA824","uA827","uA880","uA881","uA8B4","uA8B5","uA8B6","uA8B7","uA8B8","uA8B9","uA8BA","uA8BB","uA8BC","uA8BD","uA8BE","uA8BF","uA8C0","uA8C1","uA8C2","uA8C3","uA952","uA953","uA983","uA9B4","uA9B5","uA9BA","uA9BB","uA9BD","uA9BE","uA9BF","uA9C0","uAA2F","uAA30","uAA33","uAA34","uAA4D","uAA7B","uAA7D","uAAEB","uAAEE","uAAEF","uAAF5","uABE3","uABE4","uABE6","uABE7","uABE9","uABEA","uABEC"];var c=["u0300","u0301","u0302","u0303","u0304","u0305","u0306","u0307","u0308","u0309","u030A","u030B","u030C","u030D","u030E","u030F","u0310","u0311","u0312","u0313","u0314","u0315","u0316","u0317","u0318","u0319","u031A","u031B","u031C","u031D","u031E","u031F","u0320","u0321","u0322","u0323","u0324","u0325","u0326","u0327","u0328","u0329","u032A","u032B","u032C","u032D","u032E","u032F","u0330","u0331","u0332","u0333","u0334","u0335","u0336","u0337","u0338","u0339","u033A","u033B","u033C","u033D","u033E","u033F","u0340","u0341","u0342","u0343","u0344","u0345","u0346","u0347","u0348","u0349","u034A","u034B","u034C","u034D","u034E","u034F","u0350","u0351","u0352","u0353","u0354","u0355","u0356","u0357","u0358","u0359","u035A","u035B","u035C","u035D","u035E","u035F","u0360","u0361","u0362","u0363","u0364","u0365","u0366","u0367","u0368","u0369","u036A","u036B","u036C","u036D","u036E","u036F","u0483","u0484","u0485","u0486","u0487","u0591","u0592","u0593","u0594","u0595","u0596","u0597","u0598","u0599","u059A","u059B","u059C","u059D","u059E","u059F","u05A0","u05A1","u05A2","u05A3","u05A4","u05A5","u05A6","u05A7","u05A8","u05A9","u05AA","u05AB","u05AC","u05AD","u05AE","u05AF","u05B0","u05B1","u05B2","u05B3","u05B4","u05B5","u05B6","u05B7","u05B8","u05B9","u05BA","u05BB","u05BC","u05BD","u05BF","u05C1","u05C2","u05C4","u05C5","u05C7","u0610","u0611","u0612","u0613","u0614","u0615","u0616","u0617","u0618","u0619","u061A","u064B","u064C","u064D","u064E","u064F","u0650","u0651","u0652","u0653","u0654","u0655","u0656","u0657","u0658","u0659","u065A","u065B","u065C","u065D","u065E","u065F","u0670","u06D6","u06D7","u06D8","u06D9","u06DA","u06DB","u06DC","u06DF","u06E0","u06E1","u06E2","u06E3","u06E4","u06E7","u06E8","u06EA","u06EB","u06EC","u06ED","u0711","u0730","u0731","u0732","u0733","u0734","u0735","u0736","u0737","u0738","u0739","u073A","u073B","u073C","u073D","u073E","u073F","u0740","u0741","u0742","u0743","u0744","u0745","u0746","u0747","u0748","u0749","u074A","u07A6","u07A7","u07A8","u07A9","u07AA","u07AB","u07AC","u07AD","u07AE","u07AF","u07B0","u07EB","u07EC","u07ED","u07EE","u07EF","u07F0","u07F1","u07F2","u07F3","u0816","u0817","u0818","u0819","u081B","u081C","u081D","u081E","u081F","u0820","u0821","u0822","u0823","u0825","u0826","u0827","u0829","u082A","u082B","u082C","u082D","u0859","u085A","u085B","u08E3","u08E4","u08E5","u08E6","u08E7","u08E8","u08E9","u08EA","u08EB","u08EC","u08ED","u08EE","u08EF","u08F0","u08F1","u08F2","u08F3","u08F4","u08F5","u08F6","u08F7","u08F8","u08F9","u08FA","u08FB","u08FC","u08FD","u08FE","u08FF","u0900","u0901","u0902","u093A","u093C","u0941","u0942","u0943","u0944","u0945","u0946","u0947","u0948","u094D","u0951","u0952","u0953","u0954","u0955","u0956","u0957","u0962","u0963","u0981","u09BC","u09C1","u09C2","u09C3","u09C4","u09CD","u09E2","u09E3","u0A01","u0A02","u0A3C","u0A41","u0A42","u0A47","u0A48","u0A4B","u0A4C","u0A4D","u0A51","u0A70","u0A71","u0A75","u0A81","u0A82","u0ABC","u0AC1","u0AC2","u0AC3","u0AC4","u0AC5","u0AC7","u0AC8","u0ACD","u0AE2","u0AE3","u0B01","u0B3C","u0B3F","u0B41","u0B42","u0B43","u0B44","u0B4D","u0B56","u0B62","u0B63","u0B82","u0BC0","u0BCD","u0C00","u0C3E","u0C3F","u0C40","u0C46","u0C47","u0C48","u0C4A","u0C4B","u0C4C","u0C4D","u0C55","u0C56","u0C62","u0C63","u0C81","u0CBC","u0CBF","u0CC6","u0CCC","u0CCD","u0CE2","u0CE3","u0D01","u0D41","u0D42","u0D43","u0D44","u0D4D","u0D62","u0D63","u0DCA","u0DD2","u0DD3","u0DD4","u0DD6","u0E31","u0E34","u0E35","u0E36","u0E37","u0E38","u0E39","u0E3A","u0E47","u0E48","u0E49","u0E4A","u0E4B","u0E4C","u0E4D","u0E4E","u0EB1","u0EB4","u0EB5","u0EB6","u0EB7","u0EB8","u0EB9","u0EBB","u0EBC","u0EC8","u0EC9","u0ECA","u0ECB","u0ECC","u0ECD","u0F18","u0F19","u0F35","u0F37","u0F39","u0F71","u0F72","u0F73","u0F74","u0F75","u0F76","u0F77","u0F78","u0F79","u0F7A","u0F7B","u0F7C","u0F7D","u0F7E","u0F80","u0F81","u0F82","u0F83","u0F84","u0F86","u0F87","u0F8D","u0F8E","u0F8F","u0F90","u0F91","u0F92","u0F93","u0F94","u0F95","u0F96","u0F97","u0F99","u0F9A","u0F9B","u0F9C","u0F9D","u0F9E","u0F9F","u0FA0","u0FA1","u0FA2","u0FA3","u0FA4","u0FA5","u0FA6","u0FA7","u0FA8","u0FA9","u0FAA","u0FAB","u0FAC","u0FAD","u0FAE","u0FAF","u0FB0","u0FB1","u0FB2","u0FB3","u0FB4","u0FB5","u0FB6","u0FB7","u0FB8","u0FB9","u0FBA","u0FBB","u0FBC","u0FC6","u102D","u102E","u102F","u1030","u1032","u1033","u1034","u1035","u1036","u1037","u1039","u103A","u103D","u103E","u1058","u1059","u105E","u105F","u1060","u1071","u1072","u1073","u1074","u1082","u1085","u1086","u108D","u109D","u135D","u135E","u135F","u1712","u1713","u1714","u1732","u1733","u1734","u1752","u1753","u1772","u1773","u17B4","u17B5","u17B7","u17B8","u17B9","u17BA","u17BB","u17BC","u17BD","u17C6","u17C9","u17CA","u17CB","u17CC","u17CD","u17CE","u17CF","u17D0","u17D1","u17D2","u17D3","u17DD","u180B","u180C","u180D","u18A9","u1920","u1921","u1922","u1927","u1928","u1932","u1939","u193A","u193B","u1A17","u1A18","u1A1B","u1A56","u1A58","u1A59","u1A5A","u1A5B","u1A5C","u1A5D","u1A5E","u1A60","u1A62","u1A65","u1A66","u1A67","u1A68","u1A69","u1A6A","u1A6B","u1A6C","u1A73","u1A74","u1A75","u1A76","u1A77","u1A78","u1A79","u1A7A","u1A7B","u1A7C","u1A7F","u1AB0","u1AB1","u1AB2","u1AB3","u1AB4","u1AB5","u1AB6","u1AB7","u1AB8","u1AB9","u1ABA","u1ABB","u1ABC","u1ABD","u1B00","u1B01","u1B02","u1B03","u1B34","u1B36","u1B37","u1B38","u1B39","u1B3A","u1B3C","u1B42","u1B6B","u1B6C","u1B6D","u1B6E","u1B6F","u1B70","u1B71","u1B72","u1B73","u1B80","u1B81","u1BA2","u1BA3","u1BA4","u1BA5","u1BA8","u1BA9","u1BAB","u1BAC","u1BAD","u1BE6","u1BE8","u1BE9","u1BED","u1BEF","u1BF0","u1BF1","u1C2C","u1C2D","u1C2E","u1C2F","u1C30","u1C31","u1C32","u1C33","u1C36","u1C37","u1CD0","u1CD1","u1CD2","u1CD4","u1CD5","u1CD6","u1CD7","u1CD8","u1CD9","u1CDA","u1CDB","u1CDC","u1CDD","u1CDE","u1CDF","u1CE0","u1CE2","u1CE3","u1CE4","u1CE5","u1CE6","u1CE7","u1CE8","u1CED","u1CF4","u1CF8","u1CF9","u1DC0","u1DC1","u1DC2","u1DC3","u1DC4","u1DC5","u1DC6","u1DC7","u1DC8","u1DC9","u1DCA","u1DCB","u1DCC","u1DCD","u1DCE","u1DCF","u1DD0","u1DD1","u1DD2","u1DD3","u1DD4","u1DD5","u1DD6","u1DD7","u1DD8","u1DD9","u1DDA","u1DDB","u1DDC","u1DDD","u1DDE","u1DDF","u1DE0","u1DE1","u1DE2","u1DE3","u1DE4","u1DE5","u1DE6","u1DE7","u1DE8","u1DE9","u1DEA","u1DEB","u1DEC","u1DED","u1DEE","u1DEF","u1DF0","u1DF1","u1DF2","u1DF3","u1DF4","u1DF5","u1DFC","u1DFD","u1DFE","u1DFF","u20D0","u20D1","u20D2","u20D3","u20D4","u20D5","u20D6","u20D7","u20D8","u20D9","u20DA","u20DB","u20DC","u20E1","u20E5","u20E6","u20E7","u20E8","u20E9","u20EA","u20EB","u20EC","u20ED","u20EE","u20EF","u20F0","u2CEF","u2CF0","u2CF1","u2D7F","u2DE0","u2DE1","u2DE2","u2DE3","u2DE4","u2DE5","u2DE6","u2DE7","u2DE8","u2DE9","u2DEA","u2DEB","u2DEC","u2DED","u2DEE","u2DEF","u2DF0","u2DF1","u2DF2","u2DF3","u2DF4","u2DF5","u2DF6","u2DF7","u2DF8","u2DF9","u2DFA","u2DFB","u2DFC","u2DFD","u2DFE","u2DFF","u302A","u302B","u302C","u302D","u3099","u309A","uA66F","uA674","uA675","uA676","uA677","uA678","uA679","uA67A","uA67B","uA67C","uA67D","uA69E","uA69F","uA6F0","uA6F1","uA802","uA806","uA80B","uA825","uA826","uA8C4","uA8E0","uA8E1","uA8E2","uA8E3","uA8E4","uA8E5","uA8E6","uA8E7","uA8E8","uA8E9","uA8EA","uA8EB","uA8EC","uA8ED","uA8EE","uA8EF","uA8F0","uA8F1","uA926","uA927","uA928","uA929","uA92A","uA92B","uA92C","uA92D","uA947","uA948","uA949","uA94A","uA94B","uA94C","uA94D","uA94E","uA94F","uA950","uA951","uA980","uA981","uA982","uA9B3","uA9B6","uA9B7","uA9B8","uA9B9","uA9BC","uA9E5","uAA29","uAA2A","uAA2B","uAA2C","uAA2D","uAA2E","uAA31","uAA32","uAA35","uAA36","uAA43","uAA4C","uAA7C","uAAB0","uAAB2","uAAB3","uAAB4","uAAB7","uAAB8","uAABE","uAABF","uAAC1","uAAEC","uAAED","uAAF6","uABE5","uABE8","uABED","uFB1E","uFE00","uFE01","uFE02","uFE03","uFE04","uFE05","uFE06","uFE07","uFE08","uFE09","uFE0A","uFE0B","uFE0C","uFE0D","uFE0E","uFE0F","uFE20","uFE21","uFE22","uFE23","uFE24","uFE25","uFE26","uFE27","uFE28","uFE29","uFE2A","uFE2B","uFE2C","uFE2D","uFE2E","uFE2F"];var E=n.concat(c);var F=["-","/",";",":","&","u0E2F","u0EAF","u0EC6","u0ECC","u104A","u104B","u104C","u104D","u104E","u104F","u2013","u2014","u2027","u3000","u3001","u3002","uFF0C","uFF5E"];var p=["'","<","(","{","[","u00AB","u300A","u3008"];var g=["'",">",")","}","]",".","!","?","u00BB","u300B","u3009"].concat(F);var _="က-ဪဿ-၉ၐ-ၕ";var v="぀-ゟ゠-ヿ＀-+--}⦅-゚㐀-䶿";var m="㐀-龿";var x="ກ-ຮະ-ໄ່-໋ໍ-ໝ";var w=_+m+x;var b=new RegExp("(\\"+F.join("|\\")+")*[^\\s|\\"+F.join("|\\")+"]*(\\"+F.join("|\\")+")*","g");var z=new RegExp("["+v+"]");var O=new RegExp("["+w+"]");var j=new RegExp("(\\"+p.join("|\\")+")*["+w+"](\\"+g.join("|\\")+"|\\"+E.join("|\\")+")*|[a-z0-9]+","gi");function S(u){if(!O.test(u)){return d(u).match(b).filter(function(u){return u.length})}return M.merge(d(u).match(b).map(function(u){if(!z.test(u)&&O.test(u)){return u.match(j)}return[u]}))}function T(){var h="sans-serif",l=10,D=400,c=200,E,F=false,p=S,g=200;function t(u){u=d(u);if(E===void 0){E=Math.ceil(l*1.4)}var t=p(u);var n={"font-family":h,"font-size":l,"font-weight":D,"line-height":E};var e=1,i="",o=false,r=0;var A=[],s=W(t,n),a=W(" ",n);for(var f=0;f<t.length;f++){var C=t[f];var B=s[t.indexOf(C)];C+=u.slice(i.length+C.length).match("^( |\n)*","g")[0];if(i.slice(-1)==="\n"||r+B>g){if(!f&&!F){o=true;break}A[e-1]=y(A[e-1]);e++;if(E*e>c||B>g&&!F){o=true;break}r=0;A.push(C)}else if(!f){A[0]=C}else{A[e-1]+=C}i+=C;r+=B;r+=C.match(/[\s]*$/g)[0].length*a}return{lines:A,sentence:u,truncated:o,widths:W(A,n),words:t}}t.fontFamily=function(u){return arguments.length?(h=u,t):h};t.fontSize=function(u){return arguments.length?(l=u,t):l};t.fontWeight=function(u){return arguments.length?(D=u,t):D};t.height=function(u){return arguments.length?(c=u,t):c};t.lineHeight=function(u){return arguments.length?(E=u,t):E};t.overflow=function(u){return arguments.length?(F=u,t):F};t.split=function(u){return arguments.length?(p=u,t):p};t.width=function(u){return arguments.length?(g=u,t):g};return t}var H=function(u){function t(){var n=this;u.call(this);this._delay=0;this._duration=0;this._ellipsis=function(u,t){return t?u.replace(/\.|,$/g,"")+"...":""};this._fontColor=R.constant("black");this._fontFamily=R.constant(["Roboto","Helvetica Neue","HelveticaNeue","Helvetica","Arial","sans-serif"]);this._fontMax=R.constant(50);this._fontMin=R.constant(8);this._fontOpacity=R.constant(1);this._fontResize=R.constant(false);this._fontSize=R.constant(10);this._fontWeight=R.constant(400);this._height=R.accessor("height",200);this._id=function(u,t){return u.id||""+t};this._lineHeight=function(u,t){return n._fontSize(u,t)*1.2};this._on={};this._overflow=R.constant(false);this._padding=R.constant(0);this._pointerEvents=R.constant("auto");this._rotate=R.constant(0);this._rotateAnchor=function(u){return[u.w/2,u.h/2]};this._split=S;this._text=R.accessor("text");this._textAnchor=R.constant("start");this._verticalAlign=R.constant("top");this._width=R.accessor("width",200);this._x=R.accessor("x",0);this._y=R.accessor("y",0)}if(u)t.__proto__=u;t.prototype=Object.create(u&&u.prototype);t.prototype.constructor=t;t.prototype.render=function u(t){var S=this;if(this._select===void 0){this.select(f.select("body").append("svg").style("width",window.innerWidth+"px").style("height",window.innerHeight+"px").node())}var H=this;var n=this._select.selectAll(".d3plus-textBox").data(this._data.reduce(function(u,t,n){var e=S._text(t,n);if(e===void 0){return u}var i=S._fontResize(t,n);var o=S._lineHeight(t,n)/S._fontSize(t,n);var r=i?S._fontMax(t,n):S._fontSize(t,n),A=i?r*o:S._lineHeight(t,n),s=1,a=[],f,C;var B={"font-family":N(S._fontFamily(t,n)),"font-size":r,"font-weight":S._fontWeight(t,n),"line-height":A};var h=R.parseSides(S._padding(t,n));var l=S._height(t,n)-(h.top+h.bottom),D=S._width(t,n)-(h.left+h.right);var c=T().fontFamily(B["font-family"]).fontSize(r).fontWeight(B["font-weight"]).lineHeight(A).height(l).overflow(S._overflow(t,n)).width(D);var E=S._fontMax(t,n),F=S._fontMin(t,n),p=S._verticalAlign(t,n),g=S._split(e,n);function y(){if(r<F){a=[];return}else if(r>E){r=E}if(i){A=r*o;c.fontSize(r).lineHeight(A);B["font-size"]=r;B["line-height"]=A}C=c(e);a=C.lines.filter(function(u){return u!==""});s=a.length;if(C.truncated){if(i){r--;if(r<F){a=[]}else{y()}}else if(s<1){a=[H._ellipsis("",s)]}else{a[s-1]=H._ellipsis(a[s-1],s)}}}if(D>F&&(l>A||i&&l>F*o)){if(i){f=W(g,B);var d=1.165+D/l*.1,_=D*l,v=M.max(f),m=M.sum(f,function(u){return u*A})*d;if(v>D||m>_){var x=Math.sqrt(_/m),w=D/v;var b=M.min([x,w]);r=Math.floor(r*b)}var z=Math.floor(l*.8);if(r>z){r=z}}y()}if(a.length){var O=s*A;var j=p==="top"?0:p==="middle"?l/2-O/2:l-O;j-=A*.1;u.push({data:t,i:n,lines:a,fC:S._fontColor(t,n),fF:B["font-family"],fO:S._fontOpacity(t,n),fW:B["font-weight"],id:S._id(t,n),tA:S._textAnchor(t,n),widths:C.widths,fS:r,lH:A,w:D,h:l,x:S._x(t,n)+h.left,y:S._y(t,n)+j+h.top})}return u},[]),this._id);var e=C.transition().duration(this._duration);if(this._duration===0){n.exit().remove()}else{n.exit().transition().delay(this._duration).remove();n.exit().selectAll("text").transition(e).attr("opacity",0)}function i(u){u.attr("transform",function(u,t){var n=H._rotateAnchor(u,t);return"translate("+u.x+", "+u.y+") rotate("+H._rotate(u,t)+", "+n[0]+", "+n[1]+")"})}var o=n.enter().append("g").attr("class","d3plus-textBox").attr("id",function(u){return"d3plus-textBox-"+D(u.id)}).call(i).merge(n);var r=l();o.style("pointer-events",function(u){return S._pointerEvents(u.data,u.i)}).each(function(n){function u(u){u.text(function(u){return y(u)}).attr("dir",r?"rtl":"ltr").attr("fill",n.fC).attr("text-anchor",n.tA).attr("font-family",n.fF).style("font-family",n.fF).attr("font-size",n.fS+"px").style("font-size",n.fS+"px").attr("font-weight",n.fW).style("font-weight",n.fW).attr("opacity",n.fO).style("opacity",n.fO).attr("x",(n.tA==="middle"?n.w/2:r?n.tA==="start"?n.w:0:n.tA==="end"?n.w:0)+"px").attr("y",function(u,t){return(t+1)*n.lH-(n.lH-n.fS)+"px"})}var t=f.select(this).selectAll("text").data(n.lines);if(H._duration===0){t.call(u);t.exit().remove();t.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("unicode-bidi","bidi-override").call(u)}else{t.transition(e).call(u);t.exit().transition(e).attr("opacity",0).remove();t.enter().append("text").attr("dominant-baseline","alphabetic").style("baseline-shift","0%").attr("opacity",0).call(u).merge(t).transition(e).delay(H._delay).call(u).attr("opacity",1)}}).transition(e).call(i);var A=Object.keys(this._on),s=A.reduce(function(u,n){u[n]=function(u,t){return S._on[n](u.data,t)};return u},{});for(var a=0;a<A.length;a++){o.on(A[a],s[A[a]])}if(t){setTimeout(t,this._duration+100)}return this};t.prototype.data=function u(t){return arguments.length?(this._data=t,this):this._data};t.prototype.delay=function u(t){return arguments.length?(this._delay=t,this):this._delay};t.prototype.duration=function u(t){return arguments.length?(this._duration=t,this):this._duration};t.prototype.ellipsis=function u(t){return arguments.length?(this._ellipsis=typeof t==="function"?t:R.constant(t),this):this._ellipsis};t.prototype.fontColor=function u(t){return arguments.length?(this._fontColor=typeof t==="function"?t:R.constant(t),this):this._fontColor};t.prototype.fontFamily=function u(t){return arguments.length?(this._fontFamily=typeof t==="function"?t:R.constant(t),this):this._fontFamily};t.prototype.fontMax=function u(t){return arguments.length?(this._fontMax=typeof t==="function"?t:R.constant(t),this):this._fontMax};t.prototype.fontMin=function u(t){return arguments.length?(this._fontMin=typeof t==="function"?t:R.constant(t),this):this._fontMin};t.prototype.fontOpacity=function u(t){return arguments.length?(this._fontOpacity=typeof t==="function"?t:R.constant(t),this):this._fontOpacity};t.prototype.fontResize=function u(t){return arguments.length?(this._fontResize=typeof t==="function"?t:R.constant(t),this):this._fontResize};t.prototype.fontSize=function u(t){return arguments.length?(this._fontSize=typeof t==="function"?t:R.constant(t),this):this._fontSize};t.prototype.fontWeight=function u(t){return arguments.length?(this._fontWeight=typeof t==="function"?t:R.constant(t),this):this._fontWeight};t.prototype.height=function u(t){return arguments.length?(this._height=typeof t==="function"?t:R.constant(t),this):this._height};t.prototype.id=function u(t){return arguments.length?(this._id=typeof t==="function"?t:R.constant(t),this):this._id};t.prototype.lineHeight=function u(t){return arguments.length?(this._lineHeight=typeof t==="function"?t:R.constant(t),this):this._lineHeight};t.prototype.overflow=function u(t){return arguments.length?(this._overflow=typeof t==="function"?t:R.constant(t),this):this._overflow};t.prototype.padding=function u(t){return arguments.length?(this._padding=typeof t==="function"?t:R.constant(t),this):this._padding};t.prototype.pointerEvents=function u(t){return arguments.length?(this._pointerEvents=typeof t==="function"?t:R.constant(t),this):this._pointerEvents};t.prototype.rotate=function u(t){return arguments.length?(this._rotate=typeof t==="function"?t:R.constant(t),this):this._rotate};t.prototype.rotateAnchor=function u(t){return arguments.length?(this._rotateAnchor=typeof t==="function"?t:R.constant(t),this):this._rotateAnchor};t.prototype.select=function u(t){return arguments.length?(this._select=f.select(t),this):this._select};t.prototype.split=function u(t){return arguments.length?(this._split=t,this):this._split};t.prototype.text=function u(t){return arguments.length?(this._text=typeof t==="function"?t:R.constant(t),this):this._text};t.prototype.textAnchor=function u(t){return arguments.length?(this._textAnchor=typeof t==="function"?t:R.constant(t),this):this._textAnchor};t.prototype.verticalAlign=function u(t){return arguments.length?(this._verticalAlign=typeof t==="function"?t:R.constant(t),this):this._verticalAlign};t.prototype.width=function u(t){return arguments.length?(this._width=typeof t==="function"?t:R.constant(t),this):this._width};t.prototype.x=function u(t){return arguments.length?(this._x=typeof t==="function"?t:R.constant(t),this):this._x};t.prototype.y=function u(t){return arguments.length?(this._y=typeof t==="function"?t:R.constant(t),this):this._y};return t}(R.BaseClass);var P=["a","an","and","as","at","but","by","for","from","if","in","into","near","nor","of","on","onto","or","per","that","the","to","with","via","vs","vs."];var k=["CEO","CFO","CNC","COO","CPU","GDP","HVAC","ID","IT","R&D","TV","UI"];function q(e){if(e===void 0){return""}var o=P.map(function(u){return u.toLowerCase()});var r=k.slice();r=r.concat(r.map(function(u){return u+"s"}));var A=r.map(function(u){return u.toLowerCase()});var s=S(e);return s.map(function(u,t){if(u){var n=u.toLowerCase();var e=g.includes(n.charAt(n.length-1))?n.slice(0,-1):n;var i=A.indexOf(e);if(i>=0){return r[i]}else if(o.includes(e)&&t!==0&&t!==s.length-1){return n}else{return u.charAt(0).toUpperCase()+u.substr(1).toLowerCase()}}else{return""}}).reduce(function(u,t,n){if(n&&e.charAt(u.length)===" "){u+=" "}u+=t;return u},"")}u.fontExists=N;u.rtl=l;u.stringify=d;u.strip=D;u.TextBox=H;u.textSplit=S;u.textWidth=W;u.textWrap=T;u.titleCase=q;u.trim=i;u.trimLeft=t;u.trimRight=y;Object.defineProperty(u,"__esModule",{value:true})});

@@ -51,2 +51,3 @@ /**

this._rotate = constant(0);
this._rotateAnchor = function (d) { return [d.w / 2, d.h / 2]; };
this._split = textSplit;

@@ -232,3 +233,6 @@ this._text = accessor("text");

function rotate(text) {
text.attr("transform", function (d, i) { return ("rotate(" + (that._rotate(d, i)) + ", " + (d.x + d.w / 2) + ", " + (d.y + d.h / 2) + ")translate(" + (d.x) + ", " + (d.y) + ")"); });
text.attr("transform", function (d, i) {
var rotateAnchor = that._rotateAnchor(d, i);
return ("translate(" + (d.x) + ", " + (d.y) + ") rotate(" + (that._rotate(d, i)) + ", " + (rotateAnchor[0]) + ", " + (rotateAnchor[1]) + ")");
});
}

@@ -504,2 +508,11 @@

@memberof TextBox
@desc Sets the anchor point around which to rotate the text box.
@param {Function|Number[]}
*/
TextBox.prototype.rotateAnchor = function rotateAnchor (_) {
return arguments.length ? (this._rotateAnchor = typeof _ === "function" ? _ : constant(_), this) : this._rotateAnchor;
};
/**
@memberof TextBox
@desc Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use.

@@ -506,0 +519,0 @@ @param {String|HTMLElement} [*selector*]

{
"name": "d3plus-text",
"version": "0.9.27",
"version": "0.9.28",
"description": "A smart SVG text box with line wrapping and automatic font size scaling.",

@@ -29,3 +29,3 @@ "main": "build/d3plus-text.js",

"d3-transition": "^1.1.0",
"d3plus-common": "^0.6.33"
"d3plus-common": "^0.6.35"
},

@@ -42,3 +42,3 @@ "scripts": {

"devDependencies": {
"d3plus-dev": "^0.6.1"
"d3plus-dev": "^0.6.7"
},

@@ -45,0 +45,0 @@ "module": "es/index",

@@ -36,3 +36,2 @@ # d3plus-text

.fontSize(16)
.padding("10 20")
.width(200)

@@ -104,2 +103,3 @@ .x(function(d, i) { return i * 250; })

* [.rotate([*value*])](#TextBox.rotate)
* [.rotateAnchor(_)](#TextBox.rotateAnchor)
* [.select([*selector*])](#TextBox.select)

@@ -123,3 +123,3 @@ * [.split([*value*])](#TextBox.split)

<a name="TextBox.render" href="#TextBox.render">#</a> TextBox.**render**([*callback*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L70)
<a name="TextBox.render" href="#TextBox.render">#</a> TextBox.**render**([*callback*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L71)

@@ -132,3 +132,3 @@ Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing.

<a name="TextBox.data" href="#TextBox.data">#</a> TextBox.**data**([*data*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L320)
<a name="TextBox.data" href="#TextBox.data">#</a> TextBox.**data**([*data*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L324)

@@ -141,3 +141,3 @@ Sets the data array to the specified array. A text box will be drawn for each object in the array.

<a name="TextBox.delay" href="#TextBox.delay">#</a> TextBox.**delay**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L329)
<a name="TextBox.delay" href="#TextBox.delay">#</a> TextBox.**delay**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L333)

@@ -150,3 +150,3 @@ Sets the animation delay to the specified number in milliseconds.

<a name="TextBox.duration" href="#TextBox.duration">#</a> TextBox.**duration**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L338)
<a name="TextBox.duration" href="#TextBox.duration">#</a> TextBox.**duration**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L342)

@@ -159,3 +159,3 @@ Sets the animation duration to the specified number in milliseconds.

<a name="TextBox.ellipsis" href="#TextBox.ellipsis">#</a> TextBox.**ellipsis**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L351)
<a name="TextBox.ellipsis" href="#TextBox.ellipsis">#</a> TextBox.**ellipsis**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L355)

@@ -175,3 +175,3 @@ Sets the function that handles what to do when a line is truncated. It should return the new value for the line, and is passed 2 arguments: the String of text for the line in question, and the number of the line. By default, an ellipsis is added to the end of any line except if it is the first word that cannot fit (in that case, an empty string is returned).

<a name="TextBox.fontColor" href="#TextBox.fontColor">#</a> TextBox.**fontColor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L360)
<a name="TextBox.fontColor" href="#TextBox.fontColor">#</a> TextBox.**fontColor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L364)

@@ -184,3 +184,3 @@ Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default.

<a name="TextBox.fontFamily" href="#TextBox.fontFamily">#</a> TextBox.**fontFamily**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L369)
<a name="TextBox.fontFamily" href="#TextBox.fontFamily">#</a> TextBox.**fontFamily**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L373)

@@ -193,3 +193,3 @@ Defines the font-family to be used. The value passed can be either a *String* name of a font, a comma-separated list of font-family fallbacks, an *Array* of fallbacks, or a *Function* that returns either a *String* or an *Array*. If supplying multiple fallback fonts, the [fontExists](#fontExists) function will be used to determine the first available font on the client's machine.

<a name="TextBox.fontMax" href="#TextBox.fontMax">#</a> TextBox.**fontMax**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L378)
<a name="TextBox.fontMax" href="#TextBox.fontMax">#</a> TextBox.**fontMax**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L382)

@@ -202,3 +202,3 @@ Sets the maximum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).

<a name="TextBox.fontMin" href="#TextBox.fontMin">#</a> TextBox.**fontMin**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L387)
<a name="TextBox.fontMin" href="#TextBox.fontMin">#</a> TextBox.**fontMin**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L391)

@@ -211,3 +211,3 @@ Sets the minimum font size to the specified accessor function or static number (which corresponds to pixel units), which is used when [dynamically resizing fonts](#textBox.fontResize).

<a name="TextBox.fontOpacity" href="#TextBox.fontOpacity">#</a> TextBox.**fontOpacity**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L396)
<a name="TextBox.fontOpacity" href="#TextBox.fontOpacity">#</a> TextBox.**fontOpacity**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L400)

@@ -220,3 +220,3 @@ Sets the font opacity to the specified accessor function or static number between 0 and 1.

<a name="TextBox.fontResize" href="#TextBox.fontResize">#</a> TextBox.**fontResize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L405)
<a name="TextBox.fontResize" href="#TextBox.fontResize">#</a> TextBox.**fontResize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L409)

@@ -229,3 +229,3 @@ Toggles font resizing, which can either be defined as a static boolean for all data points, or an accessor function that returns a boolean. See [this example](http://d3plus.org/examples/d3plus-text/resizing-text/) for a side-by-side comparison.

<a name="TextBox.fontSize" href="#TextBox.fontSize">#</a> TextBox.**fontSize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L414)
<a name="TextBox.fontSize" href="#TextBox.fontSize">#</a> TextBox.**fontSize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L418)

@@ -238,3 +238,3 @@ Sets the font size to the specified accessor function or static number (which corresponds to pixel units), which is inferred from the [DOM selection](#textBox.select) by default.

<a name="TextBox.fontWeight" href="#TextBox.fontWeight">#</a> TextBox.**fontWeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L423)
<a name="TextBox.fontWeight" href="#TextBox.fontWeight">#</a> TextBox.**fontWeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L427)

@@ -247,3 +247,3 @@ Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default.

<a name="TextBox.height" href="#TextBox.height">#</a> TextBox.**height**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L436)
<a name="TextBox.height" href="#TextBox.height">#</a> TextBox.**height**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L440)

@@ -263,3 +263,3 @@ Sets the height for each box to the specified accessor function or static number.

<a name="TextBox.id" href="#TextBox.id">#</a> TextBox.**id**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L449)
<a name="TextBox.id" href="#TextBox.id">#</a> TextBox.**id**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L453)

@@ -279,3 +279,3 @@ Defines the unique id for each box to the specified accessor function or static number.

<a name="TextBox.lineHeight" href="#TextBox.lineHeight">#</a> TextBox.**lineHeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L458)
<a name="TextBox.lineHeight" href="#TextBox.lineHeight">#</a> TextBox.**lineHeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L462)

@@ -288,3 +288,3 @@ Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default.

<a name="TextBox.overflow" href="#TextBox.overflow">#</a> TextBox.**overflow**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L467)
<a name="TextBox.overflow" href="#TextBox.overflow">#</a> TextBox.**overflow**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L471)

@@ -297,3 +297,3 @@ Sets the text overflow to the specified accessor function or static boolean.

<a name="TextBox.padding" href="#TextBox.padding">#</a> TextBox.**padding**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L476)
<a name="TextBox.padding" href="#TextBox.padding">#</a> TextBox.**padding**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L480)

@@ -306,3 +306,3 @@ Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default.

<a name="TextBox.pointerEvents" href="#TextBox.pointerEvents">#</a> TextBox.**pointerEvents**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L485)
<a name="TextBox.pointerEvents" href="#TextBox.pointerEvents">#</a> TextBox.**pointerEvents**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L489)

@@ -315,3 +315,3 @@ Sets the pointer-events to the specified accessor function or static string.

<a name="TextBox.rotate" href="#TextBox.rotate">#</a> TextBox.**rotate**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L494)
<a name="TextBox.rotate" href="#TextBox.rotate">#</a> TextBox.**rotate**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L498)

@@ -324,4 +324,12 @@ Sets the rotate percentage for each box to the specified accessor function or static string.

<a name="TextBox.select" href="#TextBox.select">#</a> TextBox.**select**([*selector*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L503)
<a name="TextBox.rotateAnchor" href="#TextBox.rotateAnchor">#</a> TextBox.**rotateAnchor**(_) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L507)
Sets the anchor point around which to rotate the text box.
This is a static method of [<code>TextBox</code>](#TextBox).
<a name="TextBox.select" href="#TextBox.select">#</a> TextBox.**select**([*selector*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L516)
Sets the SVG container element to the specified d3 selector or DOM element. If not explicitly specified, an SVG element will be added to the page for use.

@@ -333,3 +341,3 @@

<a name="TextBox.split" href="#TextBox.split">#</a> TextBox.**split**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L512)
<a name="TextBox.split" href="#TextBox.split">#</a> TextBox.**split**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L525)

@@ -342,3 +350,3 @@ Sets the word split behavior to the specified function, which when passed a string is expected to return that string split into an array of words.

<a name="TextBox.text" href="#TextBox.text">#</a> TextBox.**text**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L525)
<a name="TextBox.text" href="#TextBox.text">#</a> TextBox.**text**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L538)

@@ -358,3 +366,3 @@ Sets the text for each box to the specified accessor function or static string.

<a name="TextBox.textAnchor" href="#TextBox.textAnchor">#</a> TextBox.**textAnchor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L534)
<a name="TextBox.textAnchor" href="#TextBox.textAnchor">#</a> TextBox.**textAnchor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L547)

@@ -367,3 +375,3 @@ Sets the horizontal text anchor to the specified accessor function or static string, whose values are analagous to the SVG [text-anchor](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor) property.

<a name="TextBox.verticalAlign" href="#TextBox.verticalAlign">#</a> TextBox.**verticalAlign**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L543)
<a name="TextBox.verticalAlign" href="#TextBox.verticalAlign">#</a> TextBox.**verticalAlign**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L556)

@@ -376,3 +384,3 @@ Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`.

<a name="TextBox.width" href="#TextBox.width">#</a> TextBox.**width**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L556)
<a name="TextBox.width" href="#TextBox.width">#</a> TextBox.**width**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L569)

@@ -392,3 +400,3 @@ Sets the width for each box to the specified accessor function or static number.

<a name="TextBox.x" href="#TextBox.x">#</a> TextBox.**x**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L569)
<a name="TextBox.x" href="#TextBox.x">#</a> TextBox.**x**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L582)

@@ -408,3 +416,3 @@ Sets the x position for each box to the specified accessor function or static number. The number given should correspond to the left side of the textBox.

<a name="TextBox.y" href="#TextBox.y">#</a> TextBox.**y**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L582)
<a name="TextBox.y" href="#TextBox.y">#</a> TextBox.**y**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L595)

@@ -618,2 +626,2 @@ Sets the y position for each box to the specified accessor function or static number. The number given should correspond to the top side of the textBox.

###### <sub>Documentation generated on Tue, 10 Apr 2018 20:18:30 GMT</sub>
###### <sub>Documentation generated on Mon, 07 May 2018 16:01:44 GMT</sub>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc