diff --git a/README.md b/README.md index e64ad37..d419172 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,12 @@ This is a global class, and extends all of the methods and functionality of [# TextBox.**render**([*callback*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L81) +# TextBox.**render**([*callback*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L80) Renders the text boxes. If a *callback* is specified, it will be called once the shapes are done drawing. @@ -130,7 +135,7 @@ Renders the text boxes. If a *callback* is specified, it will be called once the This is a static method of [TextBox](#TextBox). -# TextBox.**ariaHidden**(*value*) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L377) +# TextBox.**ariaHidden**(*value*) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L376) If *value* is specified, sets the aria-hidden attribute to the specified function or string and returns the current class instance. @@ -138,7 +143,7 @@ If *value* is specified, sets the aria-hidden attribute to the specified functio This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**data**([*data*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L389) +# TextBox.**data**([*data*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L388) Sets the data array to the specified array. A text box will be drawn for each object in the array. @@ -146,7 +151,7 @@ Sets the data array to the specified array. A text box will be drawn for each ob This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**delay**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L399) +# TextBox.**delay**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L398) Sets the animation delay to the specified number in milliseconds. @@ -154,7 +159,7 @@ Sets the animation delay to the specified number in milliseconds. This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**duration**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L409) +# TextBox.**duration**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L408) Sets the animation duration to the specified number in milliseconds. @@ -162,7 +167,7 @@ Sets the animation duration to the specified number in milliseconds. This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**ellipsis**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L423) +# TextBox.**ellipsis**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L422) 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). @@ -177,7 +182,7 @@ function(text, line) { ``` -# TextBox.**fontColor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L433) +# TextBox.**fontColor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L432) Sets the font color to the specified accessor function or static string, which is inferred from the [DOM selection](#textBox.select) by default. @@ -185,7 +190,7 @@ Sets the font color to the specified accessor function or static string, which i This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontFamily**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L443) +# TextBox.**fontFamily**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L442) 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. @@ -193,7 +198,7 @@ Defines the font-family to be used. The value passed can be either a *String* na This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontMax**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L453) +# TextBox.**fontMax**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L452) 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). @@ -201,7 +206,7 @@ Sets the maximum font size to the specified accessor function or static number ( This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontMin**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L463) +# TextBox.**fontMin**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L462) 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). @@ -209,7 +214,7 @@ Sets the minimum font size to the specified accessor function or static number ( This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontOpacity**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L473) +# TextBox.**fontOpacity**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L472) Sets the font opacity to the specified accessor function or static number between 0 and 1. @@ -217,7 +222,7 @@ Sets the font opacity to the specified accessor function or static number betwee This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontResize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L483) +# TextBox.**fontResize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L482) 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. @@ -225,7 +230,7 @@ Toggles font resizing, which can either be defined as a static boolean for all d This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontSize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L493) +# TextBox.**fontSize**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L492) 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. @@ -233,7 +238,7 @@ Sets the font size to the specified accessor function or static number (which co This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**fontWeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L503) +# TextBox.**fontWeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L502) Sets the font weight to the specified accessor function or static number, which is inferred from the [DOM selection](#textBox.select) by default. @@ -241,7 +246,7 @@ Sets the font weight to the specified accessor function or static number, which This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**height**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L517) +# TextBox.**height**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L516) Sets the height for each box to the specified accessor function or static number. @@ -256,15 +261,20 @@ function(d) { ``` -# TextBox.**html**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L527) +# TextBox.**html**([*value* = { + i: 'font-style: italic;', + em: 'font-style: italic;', + b: 'font-weight: bold;', + strong: 'font-weight: bold;' + }]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L531) -Toggles the ability to render simple HTML tags. Currently supports ``, ``, ``, and ``. +Configures the ability to render simple HTML tags. Defaults to supporting ``, ``, ``, and ``, set to false to disable or provide a mapping of tags to svg styles This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**id**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L541) +# TextBox.**id**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L546) Defines the unique id for each box to the specified accessor function or static number. @@ -279,7 +289,7 @@ function(d, i) { ``` -# TextBox.**lineHeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L551) +# TextBox.**lineHeight**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L556) Sets the line height to the specified accessor function or static number, which is 1.2 times the [font size](#textBox.fontSize) by default. @@ -287,7 +297,7 @@ Sets the line height to the specified accessor function or static number, which This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**maxLines**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L561) +# TextBox.**maxLines**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L566) Restricts the maximum number of lines to wrap onto, which is null (unlimited) by default. @@ -295,7 +305,7 @@ Restricts the maximum number of lines to wrap onto, which is null (unlimited) by This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**overflow**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L571) +# TextBox.**overflow**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L576) Sets the text overflow to the specified accessor function or static boolean. @@ -303,7 +313,7 @@ Sets the text overflow to the specified accessor function or static boolean. This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**padding**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L581) +# TextBox.**padding**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L586) Sets the padding to the specified accessor function, CSS shorthand string, or static number, which is 0 by default. @@ -311,7 +321,7 @@ Sets the padding to the specified accessor function, CSS shorthand string, or st This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**pointerEvents**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L591) +# TextBox.**pointerEvents**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L596) Sets the pointer-events to the specified accessor function or static string. @@ -319,7 +329,7 @@ Sets the pointer-events to the specified accessor function or static string. This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**rotate**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L601) +# TextBox.**rotate**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L606) Sets the rotate percentage for each box to the specified accessor function or static string. @@ -327,7 +337,7 @@ Sets the rotate percentage for each box to the specified accessor function or st This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**rotateAnchor**(_) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L611) +# TextBox.**rotateAnchor**(_) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L616) Sets the anchor point around which to rotate the text box. @@ -335,7 +345,7 @@ Sets the anchor point around which to rotate the text box. This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**select**([*selector*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L621) +# TextBox.**select**([*selector*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L626) 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. @@ -343,7 +353,7 @@ Sets the SVG container element to the specified d3 selector or DOM element. If n This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**split**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L631) +# TextBox.**split**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L636) 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. @@ -351,7 +361,7 @@ Sets the word split behavior to the specified function, which when passed a stri This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**text**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L645) +# TextBox.**text**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L650) Sets the text for each box to the specified accessor function or static string. @@ -366,7 +376,7 @@ function(d) { ``` -# TextBox.**textAnchor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L655) +# TextBox.**textAnchor**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L660) 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. @@ -374,7 +384,7 @@ Sets the horizontal text anchor to the specified accessor function or static str This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**verticalAlign**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L665) +# TextBox.**verticalAlign**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L670) Sets the vertical alignment to the specified accessor function or static string. Accepts `"top"`, `"middle"`, and `"bottom"`. @@ -382,7 +392,7 @@ Sets the vertical alignment to the specified accessor function or static string. This is a static method of [TextBox](#TextBox), and is chainable with other methods of this Class. -# TextBox.**width**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L679) +# TextBox.**width**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L684) Sets the width for each box to the specified accessor function or static number. @@ -397,7 +407,7 @@ function(d) { ``` -# TextBox.**x**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L693) +# TextBox.**x**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L698) 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. @@ -412,7 +422,7 @@ function(d) { ``` -# TextBox.**y**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L707) +# TextBox.**y**([*value*]) [<>](https://github.com/d3plus/d3plus-text/blob/master/src/TextBox.js#L712) 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. @@ -640,4 +650,4 @@ This is a global function. -###### Documentation generated on Tue, 20 Aug 2019 19:56:09 GMT +###### Documentation generated on Thu, 22 Aug 2019 14:20:16 GMT