t-viSNE: Interactive Assessment and Interpretation of t-SNE Projections https://doi.org/10.1109/TVCG.2020.2986996
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
t-viSNE/modules/d3-legend/docs/docs.min.js

2 lines
38 KiB

!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){b.exports='d3.**legendColor()**\n\nConstructs a new color legend. The legend component expects a d3 scale as the basic input, but also has a number of optional parameters for changing the default display such as vertical or horizontal orientation, shape of the symbol next to the label, symbol sizing, and label formatting.\n\nlegendColor.**scale(d3.scale)**\n\nCreates a new d3 legend based on the scale. The code determines the type of scale and generates the appropriate symbol and label pairs.\n\nlegendColor.**cells(number or [numbers])**\n\nThis parameter is only valid for continuous scales (like linear and log). When there is no indication from the domain or range for the number of steps in the legend you may want to display, it defaults to five steps in equal increments. You can pass the cells function a single number which will create equal increments for that number of steps, or an array of the [specific steps](#color-linear-custom) you want the legend to display.\n\nlegendColor.**cellFilter(function)**\n\nThis function is run as a filter function against the array of cells. If you have a function(d){ return true or false }, d has a .data and a .label property as it iterates over each cell it will display. Create a false condition for any cells you want to exclude from being displayed. An example: [Color - Ordinal Scale Legend, custom shape](#color-ordinal).\n\nlegendColor.**orient(string)**\n\nAccepts "vertical" or "horizontal" for legend orientation. Default set to "vertical."\n\nlegendColor.**ascending(boolean)**\n\nIf you pass this a true, it will reverse the order of the scale.\n\nlegendColor.**shape(string[, path-string])**\n\nAccepts "rect", "circle", "line", or "path". If you choose "path," you must also pass a second parameter as a path string. Defaults to "rect." An example: [Color - Ordinal Scale Legend, custom shape](#color-ordinal).\n\nlegendColor.**shapeWidth(number)**\n\nOnly applies to shape of "rect" or "line." Default set to 15px.\n\nlegendColor.**shapeHeight(number)**\n\nOnly applies to shape of "rect." Default set to 15px.\n\nlegendColor.**shapeRadius(number)**\n\nOnly applies to shape of "circle." Default set to 10px.\n\nlegendColor.**shapePadding(number)**\n\nApplies to all shapes. Determines vertical or horizontal spacing between shapes depending on the respective orient setting. Default set to 2px.\n\nlegendColor.**useClass(boolean)**\n\nThe default behavior is for the legend to set the fill of the legend\'s symbols (except for the "line" shape which uses stroke). If you set useClass to `true` then it will apply the scale\'s output as classes to the shapes instead of the fill or stroke. An example: [Color - Quantile Scale Legend](#color-quant).\n\nlegendColor.**classPrefix(string)**\n\nAdds this string to the beginning of all of the components of the legend that have a class. This allows for namespacing of the classes.\n\nlegendColor.**title(string)**\n\nSets the legend\'s title to the string. Automatically moves the legend cells down based on the size of the title. An example: [Symbol - Ordinal Scale](#symbol-ordinal).\n\nlegendColor.**titleWidth(number)**\n\nWill break the legend title into multiple lines based on the width in pixels. An example: [Color - Quantile Scale Legend](#color-quant).\n\nlegendColor.**labels([string] or function(options))**\n\nPassing a string:\nSets the legend labels to the array of strings passed to the legend. If the array is not the same length as the array the legend calculates, it merges the values and gives the calculated labels for the remaining items. An example: [Size - Linear Scale Legend, Lines](#size-line).\n\nPassing a function:\nThis function is called for each generated label and gives you the options:\n- i: current index\n- genLength: total length of generated labels\n- generatedLabels: array of generated labels\n- domain: array from input scale\n- range: array from input scale\nThis allows you to make any custom functions to handle labels. An example: [Color - Threshold Scale, Custom Labels](#color-threshold)\n\nList of [helper functions](#helpers).\n\nlegendColor.**labelAlign(string)**\n\nOnly used if the legend\'s orient is set to "horizontal." Accepts "start", "middle", or "end" as inputs to determine if the labels are aligned on the left, middle or right under the symbol in a horizontal legend. An example: [Size - Linear Scale Legend, Lines](#size-line).\n\nlegendColor.**labelFormat(d3.format or d3.format string)**\n\nTakes a [d3.format](https://github.com/mbostock/d3/wiki/Formatting) and applies that styling to the legend labels. Default is set to `d3.format(".01f")`.\n\nlegendColor.**locale(d3.format locale)**\n\nTakes a [d3.format locale](https://github.com/d3/d3-format/tree/master/locale) and applies it to the legend labels. Default is set to [US english](https://github.com/d3/d3-format/blob/master/locale/en-US.json).\n\nlegendColor.**labelOffset(number)**\n\nA value that determines how far the label is from the symbol in each legend item. Default set to 10px.\n\nlegendColor.**labelDelimiter(string)**\n\nChange the default "to" text when working with a quant scale.\n\nlegendColor.**labelWrap(number)**\n\nAdd text wrapping to the cell labels. In orient horizontal you can use this in combination with shapePadding to get the desired spacing. An exampe: [Size - Linear Scale](#size-line). In orient vertical this will automatically scale the cells to fit the label.An example: [Symbol - Ordinal Scale](#symbol-ordinal) \n\nlegendColor.**on(string, function)**\n\nThere are three custom event types you can bind to the legend: "cellover", "cellout", and "cellclick" An example: [Symbol - Ordinal Scale](#symbol-ordinal)\n'},{}],2:[function(a,b,c){b.exports="- [Color Legend](#color)\n - [Documentation](#color-doc)\n - [Examples](#color-examples)\n - [Quantile Scale Legend](#color-quant)\n - [Threshold Scale Legend](#color-threshold)\n - [Linear Scale Legend - Horizontal](#color-linear)\n - [Linear Scale Legend - 10 cells](#color-linear-10)\n - [Linear Scale Legend - Custom cells](#color-linear-custom)\n - [Ordinal Scale Legend - Custom shape](#color-ordinal)\n- [Size Legend](#size)\n - [Documentation](#size-doc)\n - [Examples](#size-examples)\n - [Linear Scale Legend - Circles](#size-linear)\n - [Linear Scale Legend - Lines](#size-line)\n\n- [Symbol Legend](#symbol)\n - [Documentation](#symbol-doc)\n - [Examples](#symbol-examples)\n - [Ordinal Scale Legend - Custom Symbols](#symbol-ordinal)\n\n- [Summary of Functions](#summary) - table of which functions are shared across legend types\n"},{}],3:[function(a,b,c){b.exports='d3.**legendHelpers()**\n\nConvenience functions for using this module\n\nlegendHelpers.**thresholdLabels**\n\nChanges the labels so the first one label says "Less than _first-threshold_" and the last one says "More than _last-threshold_".\nExample: [Color - Threshold Scale, Custom Labels](#color-threshold)\n'},{}],4:[function(a,b,c){var d=d3.select("#svg-color-quant"),e=d3.scaleQuantize().domain([0,.15]).range(d3.range(9).map(function(a){return"q"+a+"-9"}));d.append("g").attr("class","legendQuant").attr("transform","translate(20,20)");var f=d3.legendColor().labelFormat(d3.format(".2f")).useClass(!0).title("A really really really really really long title").titleWidth(100).scale(e);d.select(".legendQuant").call(f);var d=d3.select("#svg-color-threshold"),g=d3.scaleThreshold().domain([0,1e3,2500,5e3,1e4]).range(d3.range(6).map(function(a){return"q"+a+"-9"}));d.append("g").attr("class","legendThreshold").attr("transform","translate(20,20)");var f=d3.legendColor().labelFormat(d3.format(".2f")).labels(d3.legendHelpers.thresholdLabels).useClass(!0).shapeWidth(30).scale(g);d.select(".legendThreshold").call(f);var d=d3.select("#svg-color-log"),h=d3.scaleLog().domain([.1,100,1e3]).range(["rgb(46, 73, 123)","rgb(71, 187, 94)"]);d.append("g").attr("class","legendLog").attr("transform","translate(20,20)");var i=d3.legendColor().cells([.1,5,10,50,100,500,1e3]).scale(h);d.select(".legendLog").call(i);var j=d3.scaleLinear().domain([0,10]).range(["rgb(46, 73, 123)","rgb(71, 187, 94)"]);d=d3.select("#svg-color-linear"),d.append("g").attr("class","legendLinear").attr("transform","translate(20,20)");var k=d3.legendColor().shapeWidth(30).orient("horizontal").scale(j);d.select(".legendLinear").call(k),d=d3.select("#svg-color-linear-10"),d.append("g").attr("class","legendLinear").attr("transform","translate(20,20)"),k.cells(10),d.select(".legendLinear").call(k),d.select(".legendLinear").call(k),d=d3.select("#svg-color-linear-custom"),d.append("g").attr("class","legendLinear").attr("transform","translate(20,20)"),k.cells([1,2,3,6,8]),d.select(".legendLinear").call(k);var l=d3.scaleOrdinal().domain(["a","b","c","d","e"]).range(["rgb(153, 107, 195)","rgb(56, 106, 197)","rgb(93, 199, 76)","rgb(223, 199, 31)","rgb(234, 118, 47)"]);d=d3.select("#svg-color-ordinal"),d.append("g").attr("class","legendOrdinal").attr("transform","translate(20,20)");var m=d3.legendColor().shape("path",d3.symbol().type(d3.symbolTriangle).size(150)()).shapePadding(10).cellFilter(function(a){return"e"!==a.label}).scale(l);d.select(".legendOrdinal").call(m);var n=d3.scaleSequential(d3.interpolateRainbow).domain([0,10]);d=d3.select("#svg-color-sequential"),d.append("g").attr("class","legendSequential").attr("transform","translate(20,20)");var o=d3.legendColor().shapeWidth(30).cells(10).orient("horizontal").scale(n);d.select(".legendSequential").call(o);var p=d3.scaleLinear().domain([0,10]).range([10,30]);d=d3.select("#svg-size-linear"),d.append("g").attr("class","legendSize").attr("transform","translate(20, 40)");var q=d3.legendSize().scale(p).shape("circle").shapePadding(15).labelOffset(20).orient("horizontal").on("cellover",function(){console.log("cellover",d3.event,d3.event.type)});d.select(".legendSize").call(q);var r=d3.scaleLinear().domain([0,10]).range([2,10]);d=d3.select("#svg-size-line"),d.append("g").attr("class","legendSizeLine").attr("transform","translate(0, 20)");var s=d3.legendSize().scale(r).shape("line").orient("horizontal").labels(["tiny testing at the beginning","small","medium","large","grand, all the way long label"]).labelWrap(30).shapeWidth(50).labelAlign("start").shapePadding(10);d.select(".legendSizeLine").call(s),d=d3.select("#svg-symbol-ordinal"),d.append("g").attr("class","legendSymbol").attr("transform","translate(20, 20)");var t=d3.symbol().type(d3.symbolTriangle)(),u=d3.symbol().type(d3.symbolCircle)(),v=d3.symbol().type(d3.symbolCross)(),w=d3.symbol().type(d3.symbolDiamond)(),x=d3.symbol().type(d3.symbolStar)(),y=d3.scaleOrdinal().domain(["a longer label","b","c","d","e"]).range([t,u,v,w,x]),z=d3.legendSymbol().scale(y).labelWrap(30).title("Symbol Legend Title").on("cellclick",function(a){alert("clicked "+a)});d.select(".legendSymbol").call(z)},{}],5:[function(a,b,c){var d=a("marked"),e=a("./contents.md"),f=a("./color.md"),g=a("./size.md"),h=a("./symbol.md"),i=a("./helpers.md");document.getElementById("contents-md").innerHTML=d(e),document.getElementById("color-md").innerHTML=d(f),document.getElementById("size-md").innerHTML=d(g),document.getElementById("symbol-md").innerHTML=d(h),document.getElementById("helpers-md").innerHTML=d(i)},{"./color.md":1,"./contents.md":2,"./helpers.md":3,"./size.md":6,"./symbol.md":7,marked:8}],6:[function(a,b,c){b.exports='d3.**legendSize()**\n\nConstructs a new size legend. The legend component expects a d3 scale as the basic input, but also has a number of optional parameters for changing the default display such as vertical or horizontal orientation, shape of the symbol next to the label, symbol sizing, and label formatting.\n\nlegendSize.**scale(d3.scale)**\n\nCreates a new d3 legend based on the scale. The code determines the type of scale and generates the different symbol and label pairs. Expects a scale that has a numerical range.\n\nlegendSize.**cells(number or [numbers])**\n\nThis parameter is only valid for continuous scales (like linear and log). When there is no indication from the domain or range for the number of steps in the legend you may want to display, it defaults to five steps in equal increments. You can pass the cells function a single number which will create equal increments for that number of steps, or an array of the [specific steps](#color-linear-custom) you want the legend to display.\n\nlegendSize.**cellFilter(function)**\n\nThis function is run as a filter function against the array of cells. If you have a function(d){ return true or false }, d has a .data and a .label property as it iterates over each cell it will display. Create a false condition for any cells you want to exclude from being displayed. An example: [Color - Ordinal Scale Legend, custom shape](#color-ordinal).\n\nlegendSize.**orient(string)**\n\nAccepts "vertical" or "horizontal" for legend orientation. Default set to "vertical."\n\nlegendSize.**ascending(boolean)**\n\nIf you pass this a true, it will reverse the order of the scale.\n\nlegendSize.**shape(string)**\n\nAccepts "rect", "circle", or "line". Defaults to "rect." The assumption is that the scale\'s output will be used for the width and height if you select "rect," the radius if you select "circle," and the stroke-width if you select "line." If you want to have a custom shape of different sizes in your legend, use the symbol legend and make each path string for the sizes you want as the range array.\n\nlegendSize.**shapeWidth(number)**\n\nOnly applies to shape "line." Default set to 15px.\n\nlegendSize.**shapePadding(number)**\n\nApplies to all shapes. Determines vertical or horizontal spacing between shapes depending on the respective orient setting. Default set to 2px.\n\nlegendSize.**classPrefix(string)**\n\nAdds this string to the beginning of all of the components of the legend that have a class. This allows for namespacing of the classes.\n\nlegendSize.**title(string)**\n\nSets the legend\'s title to the string. Automatically moves the legend cells down based on the size of the title. An example: [Symbol - Ordinal Scale](#symbol-ordinal).\n\nlegendSize.**titleWidth(number)**\n\nWill break the legend title into multiple lines based on the width in pixels. An example: [Color - Quantile Scale Legend](#color-quant).\n\nlegendSize.**labels([string] or function(options))**\n\nPassing a string:\nSets the legend labels to the array of strings passed to the legend. If the array is not the same length as the array the legend calculates, it merges the values and gives the calculated labels for the remaining items. An example: [Size - Linear Scale Legend, Lines](#size-line).\n\nPassing a function:\nThis function is called for each generated label and gives you the options:\n- i: current index\n- genLength: total length of generated labels\n- generatedLabels: array of generated labels\n- domain: array from input scale\n- range: array from input scale\nThis allows you to make any custom functions to handle labels. An example: [Color - Threshold Scale, Custom Labels](#color-threshold)\n\nList of [helper functions](#helpers).\n\n\nlegendSize.**labelAlign(string)**\n\nOnly used if the legend\'s orient is set to "horizontal." Accepts "start", "middle", or "end" as inputs to determine if the labels are aligned on the left, middle or right under the symbol in a horizontal legend. An example: [Size - Linear Scale Legend, Lines](#size-line).\n\nlegendSize.**labelFormat(d3.format or d3.format string)**\n\n\nTakes a [d3.format](https://github.com/mbostock/d3/wiki/Formatting) and applies that styling to the legend labels. Default is set to `d3.format(".01f")`.\n\nlegendSize.**locale(d3.format locale)**\n\nTakes a [d3.format locale](https://github.com/d3/d3-format/tree/master/locale) and applies it to the legend labels. Default is set to [US english](https://github.com/d3/d3-format/blob/master/locale/en-US.json).\n\nlegendSize.**labelOffset(number)**\n\nA value that determines how far the label is from the symbol in each legend item. Default set to 10px.\n\nlegendSize.**labelDelimiter(string)**\n\nChange the default "to" text when working with a quant scale.\n\nlegendColor.**labelWrap(number)**\n\nAdd text wrapping to the cell labels. In orient horizontal you can use this in combination with shapePadding to get the desired spacing. An exampe: [Size - Linear Scale](#size-line). In orient vertical this will automatically scale the cells to fit the label.An example: [Symbol - Ordinal Scale](#symbol-ordinal) \n\nlegendSize.**on(string, function)**\n\nThere are three custom event types you can bind to the legend: "cellover", "cellout", and "cellclick" An exampe: [Symbol - Ordinal Scale](#symbol-ordinal)\n'},{}],7:[function(a,b,c){b.exports='d3.**legendSymbol()**\n\nConstructs a new symbol legend. The legend component expects a d3 scale as the basic input, but also has a number of optional parameters for changing the default display such as vertical or horizontal orientation, shape of the symbol next to the label, symbol sizing, and label formatting.\n\nlegendSymbol.**scale()**\n\nCreates a new d3 legend based on the scale. The code determines the type of scale and generates the different symbol and label pairs. The scale\'s range will be used as the d-attribute in an svg path for each symbol in the legend.\n\nlegendSymbol.**cells()**\n\nThis parameter is only valid for continuous scales (like linear and log). When there is no indication from the domain or range for the number of steps in the legend you may want to display, it defaults to five steps in equal increments. You can pass the cells function a single number which will create equal increments for that number of steps, or an array of the [specific steps](#color-linear-custom) you want the legend to display.\n\nlegendSymbol.**cellFilter(function)**\n\nThis function is run as a filter function against the array of cells. If you have a function(d){ return true or false }, d has a .data and a .label property as it iterates over each cell it will display. Create a false condition for any cells you want to exclude from being displayed. An example: [Color - Ordinal Scale Legend, custom shape](#color-ordinal).\n\nlegendSymbol.**orient(string)**\n\nAccepts "vertical" or "horizontal" for legend orientation. Default set to "vertical."\n\nlegendSymbol.**ascending(boolean)**\n\nIf you pass this a true, it will reverse the order of the scale.\n\nlegendSymbol.**shapePadding()**\n\nApplies to all shapes. Determines vertical or horizontal spacing between shapes depending on the respective orient setting. Default set to 2px.\n\nlegendSymbol.**classPrefix(string)**\n\nAdds this string to the beginning of all of the components of the legend that have a class. This allows for namespacing of the classes.\n\nlegendSymbol.**title(string)**\n\nSets the legend\'s title to the string. Automatically moves the legend cells down based on the size of the title. An example: [Symbol - Ordinal Scale](#symbol-ordinal).\n\nlegendSymbol.**titleWidth(number)**\n\nWill break the legend title into multiple lines based on the width in pixels. An example: [Color - Quantile Scale Legend](#color-quant).\n\nlegendSymbol.**labels([string] or function(options))**\n\nPassing a string:\nSets the legend labels to the array of strings passed to the legend. If the array is not the same length as the array the legend calculates, it merges the values and gives the calculated labels for the remaining items. An example: [Size - Linear Scale Legend, Lines](#size-line).\n\nPassing a function:\nThis function is called for each generated label and gives you the options:\n- i: current index\n- genLength: total length of generated labels\n- generatedLabels: array of generated labels\n- domain: array from input scale\n- range: array from input scale\nThis allows you to make any custom functions to handle labels. An example: [Color - Threshold Scale, Custom Labels](#color-threshold)\n\nList of [helper functions](#helpers).\n\nlegendSymbol.**labelAlign(string)**\n\nOnly used if the legend\'s orient is set to "horizontal." Accepts "start", "middle", or "end" as inputs to determine if the labels are aligned on the left, middle or right under the symbol in a horizontal legend. An example: [Size - Linear Scale Legend, Lines](#size-line).\n\nlegendSymbol.**labelFormat(d3.format or d3.format string)**\n\nTakes a [d3.format](https://github.com/mbostock/d3/wiki/Formatting) and applies that styling to the legend labels. Default is set to `d3.format(".01f")`.\n\nlegendSymbol.**locale(d3.format locale)**\n\nTakes a [d3.format locale](https://github.com/d3/d3-format/tree/master/locale) and applies it to the legend labels. Default is set to [US english](https://github.com/d3/d3-format/blob/master/locale/en-US.json).\n\nlegendSymbol.**labelOffset(number)**\n\nA value that determines how far the label is from the symbol in each legend item. Default set to 10px.\n\nlegendSymbol.**labelDelimiter(string)**\n\nChange the default "to" text when working with a quant scale.\n\nlegendColor.**labelWrap(number)**\n\nAdd text wrapping to the cell labels. In orient horizontal you can use this in combination with shapePadding to get the desired spacing. An exampe: [Size - Linear Scale](#size-line). In orient vertical this will automatically scale the cells to fit the label.An example: [Symbol - Ordinal Scale](#symbol-ordinal) \n\nlegendSymbol.**on(string, function)**\n\nThere are three custom event types you can bind to the legend: "cellover", "cellout", and "cellclick" An exampe: [Symbol - Ordinal Scale](#symbol-ordinal)\n'},{}],8:[function(a,b,c){(function(a){(function(){function a(a){this.tokens=[],this.tokens.links={},this.options=a||m.defaults,this.rules=n.normal,this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}function d(a,b){if(this.options=b||m.defaults,this.links=a,this.rules=o.normal,this.renderer=this.options.renderer||new e,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=o.breaks:this.rules=o.gfm:this.options.pedantic&&(this.rules=o.pedantic)}function e(a){this.options=a||{}}function f(a){this.tokens=[],this.token=null,this.options=a||m.defaults,this.options.renderer=this.options.renderer||new e,this.renderer=this.options.renderer,this.renderer.options=this.options}function g(a,b){return a.replace(b?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function h(a){return a.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(a,b){return b=b.toLowerCase(),"colon"===b?":":"#"===b.charAt(0)?"x"===b.charAt(1)?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""})}function i(a,b){return a=a.source,b=b||"",function c(d,e){return d?(e=e.source||e,e=e.replace(/(^|[^\[])\^/g,"$1"),a=a.replace(d,e),c):new RegExp(a,b)}}function j(a,b){return baseUrls[" "+a]||(/^[^:]+:\/*[^\/]*$/.test(a)?baseUrls[" "+a]=a+"/":baseUrls[" "+a]=a.replace(/[^\/]*$/,"")),a=baseUrls[" "+a],"//"===b.slice(0,2)?a.replace(/:[^]*/,":")+b:"/"===b.charAt(0)?a.replace(/(:\/*[^\/]*)[^]*/,"$1")+b:a+b}function k(){}function l(a){for(var b,c,d=1;d<arguments.length;d++){b=arguments[d];for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}return a}function m(b,c,d){if(d||"function"==typeof c){d||(d=c,c=null),c=l({},m.defaults,c||{});var e,h,i=c.highlight,j=0;try{e=a.lex(b,c)}catch(k){return d(k)}h=e.length;var n=function(a){if(a)return c.highlight=i,d(a);var b;try{b=f.parse(e,c)}catch(g){a=g}return c.highlight=i,a?d(a):d(null,b)};if(!i||i.length<3)return n();if(delete c.highlight,!h)return n();for(;j<e.length;j++)!function(a){return"code"!==a.type?--h||n():i(a.text,a.lang,function(b,c){return b?n(b):null==c||c===a.text?--h||n():(a.text=c,a.escaped=!0,void(--h||n()))})}(e[j])}else try{return c&&(c=l({},m.defaults,c)),f.parse(a.lex(b,c),c)}catch(k){if(k.message+="\nPlease report this to https://github.com/chjj/marked.",(c||m.defaults).silent)return"<p>An error occured:</p><pre>"+g(k.message+"",!0)+"</pre>";throw k}}var n={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:k,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:k,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:k,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};n.bullet=/(?:[*+-]|\d+\.)/,n.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,n.item=i(n.item,"gm")(/bull/g,n.bullet)(),n.list=i(n.list)(/bull/g,n.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+n.def.source+")")(),n._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",n.html=i(n.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,n._tag)(),n.paragraph=i(n.paragraph)("hr",n.hr)("heading",n.heading)("lheading",n.lheading)("blockquote",n.blockquote)("tag","<"+n._tag)("def",n.def)(),n.normal=l({},n),n.gfm=l({},n.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=i(n.paragraph)("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|")(),n.tables=l({},n.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=n,a.lex=function(b,c){var d=new a(c);return d.lex(b)},a.prototype.lex=function(a){return a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(a,!0)},a.prototype.token=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,a=a.replace(/^ +$/gm,"");a;)if((f=this.rules.newline.exec(a))&&(a=a.substring(f[0].length),f[0].length>1&&this.tokens.push({type:"space"})),f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?f:f.replace(/\n+$/,"")});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]||""});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")},k=0;k<i.align.length;k++)/^ *-+: *$/.test(i.align[k])?i.align[k]="right":/^ *:-+: *$/.test(i.align[k])?i.align[k]="center":/^ *:-+ *$/.test(i.align[k])?i.align[k]="left":i.align[k]=null;for(k=0;k<i.cells.length;k++)i.cells[k]=i.cells[k].split(/ *\| */);this.tokens.push(i)}else if(f=this.rules.lheading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:"="===f[2]?1:2,text:f[1]});else if(f=this.rules.hr.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"hr"});else if(f=this.rules.blockquote.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"blockquote_start"}),f=f[0].replace(/^ *> ?/gm,""),this.token(f,b,!0),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){for(a=a.substring(f[0].length),g=f[2],this.tokens.push({type:"list_start",ordered:g.length>1}),f=f[0].match(this.rules.item),d=!1,l=f.length,k=0;k<l;k++)i=f[k],j=i.length,i=i.replace(/^ *([*+-]|\d+\.) +/,""),~i.indexOf("\n ")&&(j-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+j+"}","gm"),"")),this.options.smartLists&&k!==l-1&&(h=n.bullet.exec(f[k+1])[0],g===h||g.length>1&&h.length>1||(a=f.slice(k+1).join("\n")+a,k=l-1)),e=d||/\n\n(?!\s*$)/.test(i),k!==l-1&&(d="\n"===i.charAt(i.length-1),e||(e=d)),this.tokens.push({type:e?"loose_item_start":"list_item_start"}),this.token(i,!1,c),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===f[1]||"script"===f[1]||"style"===f[1]),text:f[0]});else if(!c&&b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")},k=0;k<i.align.length;k++)/^ *-+: *$/.test(i.align[k])?i.align[k]="right":/^ *:-+: *$/.test(i.align[k])?i.align[k]="center":/^ *:-+ *$/.test(i.align[k])?i.align[k]="left":i.align[k]=null;for(k=0;k<i.cells.length;k++)i.cells[k]=i.cells[k].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(i)}else if(b&&(f=this.rules.paragraph.exec(a)))a=a.substring(f[0].length),this.tokens.push({type:"paragraph",text:"\n"===f[1].charAt(f[1].length-1)?f[1].slice(0,-1):f[1]});else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"text",text:f[0]});else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0));return this.tokens};var o={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:k,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:k,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};o._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,o._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,o.link=i(o.link)("inside",o._inside)("href",o._href)(),o.reflink=i(o.reflink)("inside",o._inside)(),o.normal=l({},o),o.pedantic=l({},o.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),o.gfm=l({},o.normal,{escape:i(o.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:i(o.text)("]|","~]|")("|","|https?://|")()}),o.breaks=l({},o.gfm,{br:i(o.br)("{2,}","*")(),text:i(o.gfm.text)("{2,}","*")()}),d.rules=o,d.output=function(a,b,c){var e=new d(b,c);return e.output(a)},d.prototype.output=function(a){for(var b,c,d,e,f="";a;)if(e=this.rules.escape.exec(a))a=a.substring(e[0].length),f+=e[1];else if(e=this.rules.autolink.exec(a))a=a.substring(e[0].length),"@"===e[2]?(c=g(":"===e[1].charAt(6)?this.mangle(e[1].substring(7)):this.mangle(e[1])),d=this.mangle("mailto:")+c):(c=g(e[1]),d=c),f+=this.renderer.link(d,null,c);else if(this.inLink||!(e=this.rules.url.exec(a))){if(e=this.rules.tag.exec(a))!this.inLink&&/^<a /i.test(e[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(e[0])&&(this.inLink=!1),a=a.substring(e[0].length),f+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):g(e[0]):e[0];else if(e=this.rules.link.exec(a))a=a.substring(e[0].length),this.inLink=!0,f+=this.outputLink(e,{href:e[2],title:e[3]
}),this.inLink=!1;else if((e=this.rules.reflink.exec(a))||(e=this.rules.nolink.exec(a))){if(a=a.substring(e[0].length),b=(e[2]||e[1]).replace(/\s+/g," "),b=this.links[b.toLowerCase()],!b||!b.href){f+=e[0].charAt(0),a=e[0].substring(1)+a;continue}this.inLink=!0,f+=this.outputLink(e,b),this.inLink=!1}else if(e=this.rules.strong.exec(a))a=a.substring(e[0].length),f+=this.renderer.strong(this.output(e[2]||e[1]));else if(e=this.rules.em.exec(a))a=a.substring(e[0].length),f+=this.renderer.em(this.output(e[2]||e[1]));else if(e=this.rules.code.exec(a))a=a.substring(e[0].length),f+=this.renderer.codespan(g(e[2].trim(),!0));else if(e=this.rules.br.exec(a))a=a.substring(e[0].length),f+=this.renderer.br();else if(e=this.rules.del.exec(a))a=a.substring(e[0].length),f+=this.renderer.del(this.output(e[1]));else if(e=this.rules.text.exec(a))a=a.substring(e[0].length),f+=this.renderer.text(g(this.smartypants(e[0])));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}else a=a.substring(e[0].length),c=g(e[1]),d=c,f+=this.renderer.link(d,null,c);return f},d.prototype.outputLink=function(a,b){var c=g(b.href),d=b.title?g(b.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(c,d,this.output(a[1])):this.renderer.image(c,d,g(a[1]))},d.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):a},d.prototype.mangle=function(a){if(!this.options.mangle)return a;for(var b,c="",d=a.length,e=0;e<d;e++)b=a.charCodeAt(e),Math.random()>.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},e.prototype.code=function(a,b,c){if(this.options.highlight){var d=this.options.highlight(a,b);null!=d&&d!==a&&(c=!0,a=d)}return b?'<pre><code class="'+this.options.langPrefix+g(b,!0)+'">'+(c?a:g(a,!0))+"\n</code></pre>\n":"<pre><code>"+(c?a:g(a,!0))+"\n</code></pre>"},e.prototype.blockquote=function(a){return"<blockquote>\n"+a+"</blockquote>\n"},e.prototype.html=function(a){return a},e.prototype.heading=function(a,b,c){return"<h"+b+' id="'+this.options.headerPrefix+c.toLowerCase().replace(/[^\w]+/g,"-")+'">'+a+"</h"+b+">\n"},e.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.prototype.list=function(a,b){var c=b?"ol":"ul";return"<"+c+">\n"+a+"</"+c+">\n"},e.prototype.listitem=function(a){return"<li>"+a+"</li>\n"},e.prototype.paragraph=function(a){return"<p>"+a+"</p>\n"},e.prototype.table=function(a,b){return"<table>\n<thead>\n"+a+"</thead>\n<tbody>\n"+b+"</tbody>\n</table>\n"},e.prototype.tablerow=function(a){return"<tr>\n"+a+"</tr>\n"},e.prototype.tablecell=function(a,b){var c=b.header?"th":"td",d=b.align?"<"+c+' style="text-align:'+b.align+'">':"<"+c+">";return d+a+"</"+c+">\n"},e.prototype.strong=function(a){return"<strong>"+a+"</strong>"},e.prototype.em=function(a){return"<em>"+a+"</em>"},e.prototype.codespan=function(a){return"<code>"+a+"</code>"},e.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.prototype.del=function(a){return"<del>"+a+"</del>"},e.prototype.link=function(a,b,c){if(this.options.sanitize){try{var d=decodeURIComponent(h(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===d.indexOf("javascript:")||0===d.indexOf("vbscript:")||0===d.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(a)&&(a=j(this.options.baseUrl,a));var f='<a href="'+a+'"';return b&&(f+=' title="'+b+'"'),f+=">"+c+"</a>"},e.prototype.image=function(a,b,c){this.options.baseUrl&&!originIndependentUrl.test(a)&&(a=j(this.options.baseUrl,a));var d='<img src="'+a+'" alt="'+c+'"';return b&&(d+=' title="'+b+'"'),d+=this.options.xhtml?"/>":">"},e.prototype.text=function(a){return a},f.parse=function(a,b,c){var d=new f(b,c);return d.parse(a)},f.prototype.parse=function(a){this.inline=new d(a.links,this.options,this.renderer),this.tokens=a.reverse();for(var b="";this.next();)b+=this.tok();return b},f.prototype.next=function(){return this.token=this.tokens.pop()},f.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},f.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},f.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var a,b,c,d,e,f="",g="";for(c="",a=0;a<this.token.header.length;a++)d={header:!0,align:this.token.align[a]},c+=this.renderer.tablecell(this.inline.output(this.token.header[a]),{header:!0,align:this.token.align[a]});for(f+=this.renderer.tablerow(c),a=0;a<this.token.cells.length;a++){for(b=this.token.cells[a],c="",e=0;e<b.length;e++)c+=this.renderer.tablecell(this.inline.output(b[e]),{header:!1,align:this.token.align[e]});g+=this.renderer.tablerow(c)}return this.renderer.table(f,g);case"blockquote_start":for(var g="";"blockquote_end"!==this.next().type;)g+=this.tok();return this.renderer.blockquote(g);case"list_start":for(var g="",h=this.token.ordered;"list_end"!==this.next().type;)g+=this.tok();return this.renderer.list(g,h);case"list_item_start":for(var g="";"list_item_end"!==this.next().type;)g+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(g);case"loose_item_start":for(var g="";"list_item_end"!==this.next().type;)g+=this.tok();return this.renderer.listitem(g);case"html":var i=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(i);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},baseUrls={},originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,k.exec=k,m.options=m.setOptions=function(a){return l(m.defaults,a),m},m.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new e,xhtml:!1,baseUrl:null},m.Parser=f,m.parser=f.parse,m.Renderer=e,m.Lexer=a,m.lexer=a.lex,m.InlineLexer=d,m.inlineLexer=d.output,m.parse=m,"undefined"!=typeof b&&"object"==typeof c?b.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):this.marked=m}).call(function(){return this||("undefined"!=typeof window?window:a)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[4,5]);