Mercurial > repos > fubar > jbrowse2
comparison x/static/js/3109.3173f682.chunk.js.map @ 125:49f3d3878413 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author | fubar |
---|---|
date | Sat, 05 Oct 2024 23:58:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
124:137e08517410 | 125:49f3d3878413 |
---|---|
1 {"version":3,"file":"static/js/3109.3173f682.chunk.js","mappings":"uGAaE,WACE,aAEA,IAAIA,EAAQC,EAAKC,EAAgBC,EAAeC,EAGhD,SAASC,EAAOC,EAAKC,GACjB,IAA8BC,EAA1BC,EAAOC,OAAOD,KAAKF,GACvB,IAAKC,EAAE,EAAGA,EAAEC,EAAKE,OAAQH,IACrBF,EAAMA,EAAIM,QAAQ,IAAIC,OAAO,MAAQJ,EAAKD,GAAK,MAAO,MAAOD,EAAKE,EAAKD,KAE3E,OAAOF,CACX,CAGA,SAASQ,EAAaC,GAClB,IAAWC,EAAcR,EACzB,IAAKO,EACD,MAAM,IAAIE,MAAM,iEAGpBD,EAAe,GACf,GAEI,IADAA,EAAe,GACVR,EAAI,EAAGA,EAAI,GAAIA,IAChBQ,GALA,sDAKsBE,KAAKC,MAAsBC,GAAhBF,KAAKG,iBAErCN,EAAOC,IAChB,OAAOA,CACX,CA0BA,SAASM,EAAoBC,GAEzB,IAAIC,EAAU,CAAC,WAAc,aAAc,QAAW,UAAW,IAAM,mBAAoB,OAAS,kBAAmB,OAAS,WAChI,OAAOA,EAAQD,IAAiBC,EAAQC,UAC5C,CAIArB,EA/BA,SAAqCsB,EAAOC,GACxC,IAAInB,EAAGoB,EAAqBC,EAAbC,EAAS,CAAC,EAIzB,IAHAJ,EAAQA,EAAMK,MAAM,KACpBJ,EAAQA,GAAS,GAEZnB,EAAI,EAAGA,EAAIkB,EAAMf,OAAQH,GAAK,EAC/BoB,EAAS,IAAMF,EAAMlB,EAAI,GAAK,IAC9BqB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AwB+I,EAAMG,YAAcH,EAAMlJ,aAAa,QACzEpC,EAAQD,YAAY6L,GACpB7M,KAAKsC,OAAOtB,YAAYC,IAClBsL,aAAiB7O,IACvBuD,EAAQD,YAAYuL,EAAMtM,OAAOmD,WAAW,IAC5CpD,KAAKsC,OAAOtB,YAAYC,IAErB,IAAIrD,EAAcqD,EAASjB,KACtC,EAKAtC,EAAIyC,UAAU2M,cAAgB,WAAW,EACzCpP,EAAIyC,UAAU4M,gBAAkB,WAAW,EAC3CrP,EAAIyC,UAAU6M,aAAe,WAAW,EACxCtP,EAAIyC,UAAU8M,aAAe,WAAW,EACxCvP,EAAIyC,UAAU+M,yBAA2B,WAAW,EACpDxP,EAAIyC,UAAUgN,aAAe,WAAW,EAGlB,iBAAXC,SACPA,OAAOC,IAAM3P,GAI2C,iBAAnB4P,EAAOC,UAC5CD,EAAOC,QAAU7P,EAGzB,CAplCC,E","sources":["../../../node_modules/canvas2svg/canvas2svg.js"],"sourcesContent":["/*!!\n * Canvas 2 Svg v1.0.15\n * A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Author:\n * Kerry Liu\n *\n * Copyright (c) 2014 Gliffy Inc.\n */\n\n;(function() {\n \"use strict\";\n\n var STYLES, ctx, CanvasGradient, CanvasPattern, namedEntities;\n\n //helper function to format a string\n function format(str, args) {\n var keys = Object.keys(args), i;\n for (i=0; i<keys.length; i++) {\n str = str.replace(new RegExp(\"\\\\{\" + keys[i] + \"\\\\}\", \"gi\"), args[keys[i]]);\n }\n return str;\n }\n\n //helper function that generates a random string\n function randomString(holder) {\n var chars, randomstring, i;\n if (!holder) {\n throw new Error(\"cannot create a random attribute name for an undefined object\");\n }\n chars = \"ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n randomstring = \"\";\n do {\n randomstring = \"\";\n for (i = 0; i < 12; i++) {\n randomstring += chars[Math.floor(Math.random() * chars.length)];\n }\n } while (holder[randomstring]);\n return randomstring;\n }\n\n //helper function to map named to numbered entities\n function createNamedToNumberedLookup(items, radix) {\n var i, entity, lookup = {}, base10, base16;\n items = items.split(',');\n radix = radix || 10;\n // Map from named to numbered entities.\n for (i = 0; i < items.length; i += 2) {\n entity = '&' + items[i + 1] + ';';\n base10 = parseInt(items[i], radix);\n lookup[entity] = '&#'+base10+';';\n }\n //FF and IE need to create a regex from hex values ie == \\xa0\n lookup[\"\\\\xa0\"] = ' ';\n return lookup;\n }\n\n //helper function to map canvas-textAlign to svg-textAnchor\n function getTextAnchor(textAlign) {\n //TODO: support rtl languages\n var mapping = {\"left\":\"start\", \"right\":\"end\", \"center\":\"middle\", \"start\":\"start\", \"end\":\"end\"};\n return mapping[textAlign] || mapping.start;\n }\n\n //helper function to map canvas-textBaseline to svg-dominantBaseline\n function getDominantBaseline(textBaseline) {\n //INFO: not supported in all browsers\n var mapping = {\"alphabetic\": \"alphabetic\", \"hanging\": \"hanging\", \"top\":\"text-before-edge\", \"bottom\":\"text-after-edge\", \"middle\":\"central\"};\n return mapping[textBaseline] || mapping.alphabetic;\n }\n\n // Unpack entities lookup where the numbers are in radix 32 to reduce the size\n // entity mapping courtesy of tinymce\n namedEntities = createNamedToNumberedLookup(\n '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' +\n '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' +\n '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' +\n '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' +\n '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' +\n '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' +\n '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' +\n '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' +\n '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' +\n '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' +\n 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' +\n 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' +\n 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' +\n 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' +\n 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' +\n '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' +\n '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' +\n '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' +\n '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' +\n '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' +\n 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' +\n 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' +\n 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' +\n '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' +\n '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);\n\n\n //Some basic mappings for attributes and default values.\n STYLES = {\n \"strokeStyle\":{\n svgAttr : \"stroke\", //corresponding svg attribute\n canvas : \"#000000\", //canvas default\n svg : \"none\", //svg default\n apply : \"stroke\" //apply on stroke() or fill()\n },\n \"fillStyle\":{\n svgAttr : \"fill\",\n canvas : \"#000000\",\n svg : null, //svg default is black, but we need to special case this to handle canvas stroke without fill\n apply : \"fill\"\n },\n \"lineCap\":{\n svgAttr : \"stroke-linecap\",\n canvas : \"butt\",\n svg : \"butt\",\n apply : \"stroke\"\n },\n \"lineJoin\":{\n svgAttr : \"stroke-linejoin\",\n canvas : \"miter\",\n svg : \"miter\",\n apply : \"stroke\"\n },\n \"miterLimit\":{\n svgAttr : \"stroke-miterlimit\",\n canvas : 10,\n svg : 4,\n apply : \"stroke\"\n },\n \"lineWidth\":{\n svgAttr : \"stroke-width\",\n canvas : 1,\n svg : 1,\n apply : \"stroke\"\n },\n \"globalAlpha\": {\n svgAttr : \"opacity\",\n canvas : 1,\n svg : 1,\n apply : \"fill stroke\"\n },\n \"font\":{\n //font converts to multiple svg attributes, there is custom logic for this\n canvas : \"10px sans-serif\"\n },\n \"shadowColor\":{\n canvas : \"#000000\"\n },\n \"shadowOffsetX\":{\n canvas : 0\n },\n \"shadowOffsetY\":{\n canvas : 0\n },\n \"shadowBlur\":{\n canvas : 0\n },\n \"textAlign\":{\n canvas : \"start\"\n },\n \"textBaseline\":{\n canvas : \"alphabetic\"\n }\n };\n\n /**\n *\n * @param gradientNode - reference to the gradient\n * @constructor\n */\n CanvasGradient = function(gradientNode, ctx) {\n this.__root = gradientNode;\n this.__ctx = ctx;\n };\n\n /**\n * Adds a color stop to the gradient root\n */\n CanvasGradient.prototype.addColorStop = function(offset, color) {\n var stop = this.__ctx.__createElement(\"stop\"), regex, matches;\n stop.setAttribute(\"offset\", offset);\n if(color.indexOf(\"rgba\") !== -1) {\n //separate alpha value, since webkit can't handle it\n regex = /rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/gi;\n matches = regex.exec(color);\n stop.setAttribute(\"stop-color\", format(\"rgb({r},{g},{b})\", {r:matches[1], g:matches[2], b:matches[3]}));\n stop.setAttribute(\"stop-opacity\", matches[4]);\n } else {\n stop.setAttribute(\"stop-color\", color);\n }\n this.__root.appendChild(stop);\n };\n\n CanvasPattern = function(pattern, ctx) {\n this.__root = pattern;\n this.__ctx = ctx;\n };\n\n /**\n * The mock canvas context\n * @param o - options include:\n * width - width of your canvas (defaults to 500)\n * height - height of your canvas (defaults to 500)\n * enableMirroring - enables canvas mirroring (get image data) (defaults to false)\n * document - the document object (defaults to the current document)\n */\n ctx = function(o) {\n\n var defaultOptions = { width:500, height:500, enableMirroring : false}, options;\n\n //keep support for this way of calling C2S: new C2S(width,height)\n if(arguments.length > 1) {\n options = defaultOptions;\n options.width = arguments[0];\n options.height = arguments[1];\n } else if( !o ) {\n options = defaultOptions;\n } else {\n options = o;\n }\n\n if(!(this instanceof ctx)) {\n //did someone call this without new?\n return new ctx(options);\n }\n\n //setup options\n this.width = options.width || defaultOptions.width;\n this.height = options.height || defaultOptions.height;\n this.enableMirroring = options.enableMirroring !== undefined ? options.enableMirroring : defaultOptions.enableMirroring;\n\n this.canvas = this; ///point back to this instance!\n this.__document = options.document || document;\n this.__canvas = this.__document.createElement(\"canvas\");\n this.__ctx = this.__canvas.getContext(\"2d\");\n\n this.__setDefaultStyles();\n this.__stack = [this.__getStyleState()];\n this.__groupStack = [];\n\n //the root svg element\n this.__root = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n this.__root.setAttribute(\"version\", 1.1);\n this.__root.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n this.__root.setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\n this.__root.setAttribute(\"width\", this.width);\n this.__root.setAttribute(\"height\", this.height);\n\n //make sure we don't generate the same ids in defs\n this.__ids = {};\n\n //defs tag\n this.__defs = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n this.__root.appendChild(this.__defs);\n\n //also add a group child. the svg element can't use the transform attribute\n this.__currentElement = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n this.__root.appendChild(this.__currentElement);\n };\n\n\n /**\n * Creates the specified svg element\n * @private\n */\n ctx.prototype.__createElement = function (elementName, properties, resetFill) {\n if (typeof properties === \"undefined\") {\n properties = {};\n }\n\n var element = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", elementName),\n keys = Object.keys(properties), i, key;\n if(resetFill) {\n //if fill or stroke is not specified, the svg element should not display. By default SVG's fill is black.\n element.setAttribute(\"fill\", \"none\");\n element.setAttribute(\"stroke\", \"none\");\n }\n for(i=0; i<keys.length; i++) {\n key = keys[i];\n element.setAttribute(key, properties[key]);\n }\n return element;\n };\n\n /**\n * Applies default canvas styles to the context\n * @private\n */\n ctx.prototype.__setDefaultStyles = function() {\n //default 2d canvas context properties see:http://www.w3.org/TR/2dcontext/\n var keys = Object.keys(STYLES), i, key;\n for(i=0; i<keys.length; i++) {\n key = keys[i];\n this[key] = STYLES[key].canvas;\n }\n };\n\n /**\n * Applies styles on restore\n * @param styleState\n * @private\n */\n ctx.prototype.__applyStyleState = function(styleState) {\n var keys = Object.keys(styleState), i, key;\n for(i=0; i<keys.length; i++) {\n key = keys[i];\n this[key] = styleState[key];\n }\n };\n\n /**\n * Gets the current style state\n * @return {Object}\n * @private\n */\n ctx.prototype.__getStyleState = function() {\n var i, styleState = {}, keys = Object.keys(STYLES), key;\n for(i=0; i<keys.length; i++) {\n key = keys[i];\n styleState[key] = this[key];\n }\n return styleState;\n };\n\n /**\n * Apples the current styles to the current SVG element. On \"ctx.fill\" or \"ctx.stroke\"\n * @param type\n * @private\n */\n ctx.prototype.__applyStyleToCurrentElement = function(type) {\n var keys = Object.keys(STYLES), i, style, value, id, regex, matches;\n for(i=0; i<keys.length; i++) {\n style = STYLES[keys[i]];\n value = this[keys[i]];\n if(style.apply) {\n //is this a gradient or pattern?\n if(style.apply.indexOf(\"fill\")!==-1 && value instanceof CanvasPattern) {\n //pattern\n if(value.__ctx) {\n //copy over defs\n while(value.__ctx.__defs.childNodes.length) {\n id = value.__ctx.__defs.childNodes[0].getAttribute(\"id\");\n this.__ids[id] = id;\n this.__defs.appendChild(value.__ctx.__defs.childNodes[0]);\n }\n }\n this.__currentElement.setAttribute(\"fill\", format(\"url(#{id})\", {id:value.__root.getAttribute(\"id\")}));\n }\n else if(style.apply.indexOf(\"fill\")!==-1 && value instanceof CanvasGradient) {\n //gradient\n this.__currentElement.setAttribute(\"fill\", format(\"url(#{id})\", {id:value.__root.getAttribute(\"id\")}));\n } else if(style.apply.indexOf(type)!==-1 && style.svg !== value) {\n if((style.svgAttr === \"stroke\" || style.svgAttr === \"fill\") && value.indexOf(\"rgba\") !== -1) {\n //separate alpha value, since illustrator can't handle it\n regex = /rgba\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d?\\.?\\d*)\\s*\\)/gi;\n matches = regex.exec(value);\n this.__currentElement.setAttribute(style.svgAttr, format(\"rgb({r},{g},{b})\", {r:matches[1], g:matches[2], b:matches[3]}));\n this.__currentElement.setAttribute(style.svgAttr+\"-opacity\", matches[4]);\n } else {\n //otherwise only update attribute if right type, and not svg default\n this.__currentElement.setAttribute(style.svgAttr, value);\n }\n }\n }\n }\n\n };\n\n /**\n * Will return the closest group or svg node. May return the current element.\n * @private\n */\n ctx.prototype.__closestGroupOrSvg = function(node) {\n node = node || this.__currentElement;\n if(node.nodeName === \"g\" || node.nodeName === \"svg\") {\n return node;\n } else {\n return this.__closestGroupOrSvg(node.parentNode);\n }\n };\n\n /**\n * Returns the serialized value of the svg so far\n * @param fixNamedEntities - Standalone SVG doesn't support named entities, which document.createTextNode encodes.\n * If true, we attempt to find all named entities and encode it as a numeric entity.\n * @return serialized svg\n */\n ctx.prototype.getSerializedSvg = function(fixNamedEntities) {\n var serialized = new XMLSerializer().serializeToString(this.__root),\n keys, i, key, value, regexp, xmlns;\n\n //IE search for a duplicate xmnls because they didn't implement setAttributeNS correctly\n xmlns = /xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg\".+xmlns=\"http:\\/\\/www\\.w3\\.org\\/2000\\/svg/gi;\n if(xmlns.test(serialized)) {\n serialized = serialized.replace('xmlns=\"http://www.w3.org/2000/svg','xmlns:xlink=\"http://www.w3.org/1999/xlink');\n }\n\n if(fixNamedEntities) {\n keys = Object.keys(namedEntities);\n //loop over each named entity and replace with the proper equivalent.\n for(i=0; i<keys.length; i++) {\n key = keys[i];\n value = namedEntities[key];\n regexp = new RegExp(key, \"gi\");\n if(regexp.test(serialized)) {\n serialized = serialized.replace(regexp, value);\n }\n }\n }\n\n return serialized;\n };\n\n\n /**\n * Returns the root svg\n * @return\n */\n ctx.prototype.getSvg = function() {\n return this.__root;\n };\n /**\n * Will generate a group tag.\n */\n ctx.prototype.save = function() {\n var group = this.__createElement(\"g\"), parent = this.__closestGroupOrSvg();\n this.__groupStack.push(parent);\n parent.appendChild(group);\n this.__currentElement = group;\n this.__stack.push(this.__getStyleState());\n };\n /**\n * Sets current element to parent, or just root if already root\n */\n ctx.prototype.restore = function(){\n this.__currentElement = this.__groupStack.pop();\n var state = this.__stack.pop();\n this.__applyStyleState(state);\n\n };\n\n /**\n * Helper method to add transform\n * @private\n */\n ctx.prototype.__addTransform = function(t) {\n\n //if the current element has siblings, add another group\n var parent = this.__closestGroupOrSvg();\n if(parent.childNodes.length > 0) {\n var group = this.__createElement(\"g\");\n parent.appendChild(group);\n this.__currentElement = group;\n }\n\n var transform = this.__currentElement.getAttribute(\"transform\");\n if(transform) {\n transform += \" \";\n } else {\n transform = \"\";\n }\n transform += t;\n this.__currentElement.setAttribute(\"transform\", transform);\n };\n\n /**\n * scales the current element\n */\n ctx.prototype.scale = function(x, y) {\n if(y === undefined) {\n y = x;\n }\n this.__addTransform(format(\"scale({x},{y})\", {x:x, y:y}));\n };\n\n /**\n * rotates the current element\n */\n ctx.prototype.rotate = function(angle){\n var degrees = (angle * 180 / Math.PI);\n this.__addTransform(format(\"rotate({angle},{cx},{cy})\", {angle:degrees, cx:0, cy:0}));\n };\n\n /**\n * translates the current element\n */\n ctx.prototype.translate = function(x, y){\n this.__addTransform(format(\"translate({x},{y})\", {x:x,y:y}));\n };\n\n /**\n * applies a transform to the current element\n */\n ctx.prototype.transform = function(a, b, c, d, e, f){\n this.__addTransform(format(\"matrix({a},{b},{c},{d},{e},{f})\", {a:a, b:b, c:c, d:d, e:e, f:f}));\n };\n\n /**\n * Create a new Path Element\n */\n ctx.prototype.beginPath = function(){\n var path, parent;\n\n // Note that there is only one current default path, it is not part of the drawing state.\n // See also: https://html.spec.whatwg.org/multipage/scripting.html#current-default-path\n this.__currentDefaultPath = \"\";\n this.__currentPosition = {};\n\n path = this.__createElement(\"path\", {}, true);\n parent = this.__closestGroupOrSvg();\n parent.appendChild(path);\n this.__currentElement = path;\n };\n\n /**\n * Helper function to apply currentDefaultPath to current path element\n * @private\n */\n ctx.prototype.__applyCurrentDefaultPath = function() {\n if(this.__currentElement.nodeName === \"path\") {\n var d = this.__currentDefaultPath;\n this.__currentElement.setAttribute(\"d\", d);\n } else {\n throw new Error(\"Attempted to apply path command to node \" + this.__currentElement.nodeName);\n }\n };\n\n /**\n * Helper function to add path command\n * @private\n */\n ctx.prototype.__addPathCommand = function(command){\n this.__currentDefaultPath += \" \";\n this.__currentDefaultPath += command;\n };\n\n /**\n * Adds the move command to the current path element,\n * if the currentPathElement is not empty create a new path element\n */\n ctx.prototype.moveTo = function(x,y){\n if(this.__currentElement.nodeName !== \"path\") {\n this.beginPath();\n }\n\n // creates a new subpath with the given point\n this.__currentPosition = {x: x, y: y};\n this.__addPathCommand(format(\"M {x} {y}\", {x:x, y:y}));\n };\n\n /**\n * Closes the current path\n */\n ctx.prototype.closePath = function(){\n this.__addPathCommand(\"Z\");\n };\n\n /**\n * Adds a line to command\n */\n ctx.prototype.lineTo = function(x, y){\n this.__currentPosition = {x: x, y: y};\n if (this.__currentDefaultPath.indexOf('M') > -1) {\n this.__addPathCommand(format(\"L {x} {y}\", {x:x, y:y}));\n } else {\n this.__addPathCommand(format(\"M {x} {y}\", {x:x, y:y}));\n }\n };\n\n /**\n * Add a bezier command\n */\n ctx.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {\n this.__currentPosition = {x: x, y: y};\n this.__addPathCommand(format(\"C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}\",\n {cp1x:cp1x, cp1y:cp1y, cp2x:cp2x, cp2y:cp2y, x:x, y:y}));\n };\n\n /**\n * Adds a quadratic curve to command\n */\n ctx.prototype.quadraticCurveTo = function(cpx, cpy, x, y){\n this.__currentPosition = {x: x, y: y};\n this.__addPathCommand(format(\"Q {cpx} {cpy} {x} {y}\", {cpx:cpx, cpy:cpy, x:x, y:y}));\n };\n\n\n /**\n * Return a new normalized vector of given vector\n */\n var normalize = function(vector) {\n var len = Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);\n return [vector[0] / len, vector[1] / len];\n };\n\n /**\n * Adds the arcTo to the current path\n *\n * @see http://www.w3.org/TR/2015/WD-2dcontext-20150514/#dom-context-2d-arcto\n */\n ctx.prototype.arcTo = function(x1, y1, x2, y2, radius) {\n // Let the point (x0, y0) be the last point in the subpath.\n var x0 = this.__currentPosition && this.__currentPosition.x;\n var y0 = this.__currentPosition && this.__currentPosition.y;\n\n // First ensure there is a subpath for (x1, y1).\n if (typeof x0 == \"undefined\" || typeof y0 == \"undefined\") {\n return;\n }\n\n // Negative values for radius must cause the implementation to throw an IndexSizeError exception.\n if (radius < 0) {\n throw new Error(\"IndexSizeError: The radius provided (\" + radius + \") is negative.\");\n }\n\n // If the point (x0, y0) is equal to the point (x1, y1),\n // or if the point (x1, y1) is equal to the point (x2, y2),\n // or if the radius radius is zero,\n // then the method must add the point (x1, y1) to the subpath,\n // and connect that point to the previous point (x0, y0) by a straight line.\n if (((x0 === x1) && (y0 === y1))\n || ((x1 === x2) && (y1 === y2))\n || (radius === 0)) {\n this.lineTo(x1, y1);\n return;\n }\n\n // Otherwise, if the points (x0, y0), (x1, y1), and (x2, y2) all lie on a single straight line,\n // then the method must add the point (x1, y1) to the subpath,\n // and connect that point to the previous point (x0, y0) by a straight line.\n var unit_vec_p1_p0 = normalize([x0 - x1, y0 - y1]);\n var unit_vec_p1_p2 = normalize([x2 - x1, y2 - y1]);\n if (unit_vec_p1_p0[0] * unit_vec_p1_p2[1] === unit_vec_p1_p0[1] * unit_vec_p1_p2[0]) {\n this.lineTo(x1, y1);\n return;\n }\n\n // Otherwise, let The Arc be the shortest arc given by circumference of the circle that has radius radius,\n // and that has one point tangent to the half-infinite line that crosses the point (x0, y0) and ends at the point (x1, y1),\n // and that has a different point tangent to the half-infinite line that ends at the point (x1, y1), and crosses the point (x2, y2).\n // The points at which this circle touches these two lines are called the start and end tangent points respectively.\n\n // note that both vectors are unit vectors, so the length is 1\n var cos = (unit_vec_p1_p0[0] * unit_vec_p1_p2[0] + unit_vec_p1_p0[1] * unit_vec_p1_p2[1]);\n var theta = Math.acos(Math.abs(cos));\n\n // Calculate origin\n var unit_vec_p1_origin = normalize([\n unit_vec_p1_p0[0] + unit_vec_p1_p2[0],\n unit_vec_p1_p0[1] + unit_vec_p1_p2[1]\n ]);\n var len_p1_origin = radius / Math.sin(theta / 2);\n var x = x1 + len_p1_origin * unit_vec_p1_origin[0];\n var y = y1 + len_p1_origin * unit_vec_p1_origin[1];\n\n // Calculate start angle and end angle\n // rotate 90deg clockwise (note that y axis points to its down)\n var unit_vec_origin_start_tangent = [\n -unit_vec_p1_p0[1],\n unit_vec_p1_p0[0]\n ];\n // rotate 90deg counter clockwise (note that y axis points to its down)\n var unit_vec_origin_end_tangent = [\n unit_vec_p1_p2[1],\n -unit_vec_p1_p2[0]\n ];\n var getAngle = function(vector) {\n // get angle (clockwise) between vector and (1, 0)\n var x = vector[0];\n var y = vector[1];\n if (y >= 0) { // note that y axis points to its down\n return Math.acos(x);\n } else {\n return -Math.acos(x);\n }\n };\n var startAngle = getAngle(unit_vec_origin_start_tangent);\n var endAngle = getAngle(unit_vec_origin_end_tangent);\n\n // Connect the point (x0, y0) to the start tangent point by a straight line\n this.lineTo(x + unit_vec_origin_start_tangent[0] * radius,\n y + unit_vec_origin_start_tangent[1] * radius);\n\n // Connect the start tangent point to the end tangent point by arc\n // and adding the end tangent point to the subpath.\n this.arc(x, y, radius, startAngle, endAngle);\n };\n\n /**\n * Sets the stroke property on the current element\n */\n ctx.prototype.stroke = function(){\n if(this.__currentElement.nodeName === \"path\") {\n this.__currentElement.setAttribute(\"paint-order\", \"fill stroke markers\");\n }\n this.__applyCurrentDefaultPath();\n this.__applyStyleToCurrentElement(\"stroke\");\n };\n\n /**\n * Sets fill properties on the current element\n */\n ctx.prototype.fill = function(){\n if(this.__currentElement.nodeName === \"path\") {\n this.__currentElement.setAttribute(\"paint-order\", \"stroke fill markers\");\n }\n this.__applyCurrentDefaultPath();\n this.__applyStyleToCurrentElement(\"fill\");\n };\n\n /**\n * Adds a rectangle to the path.\n */\n ctx.prototype.rect = function(x, y, width, height){\n if(this.__currentElement.nodeName !== \"path\") {\n this.beginPath();\n }\n this.moveTo(x, y);\n this.lineTo(x+width, y);\n this.lineTo(x+width, y+height);\n this.lineTo(x, y+height);\n this.lineTo(x, y);\n this.closePath();\n };\n\n\n /**\n * adds a rectangle element\n */\n ctx.prototype.fillRect = function(x, y, width, height){\n var rect, parent;\n rect = this.__createElement(\"rect\", {\n x : x,\n y : y,\n width : width,\n height : height\n }, true);\n parent = this.__closestGroupOrSvg();\n parent.appendChild(rect);\n this.__currentElement = rect;\n this.__applyStyleToCurrentElement(\"fill\");\n };\n\n /**\n * Draws a rectangle with no fill\n * @param x\n * @param y\n * @param width\n * @param height\n */\n ctx.prototype.strokeRect = function(x, y, width, height){\n var rect, parent;\n rect = this.__createElement(\"rect\", {\n x : x,\n y : y,\n width : width,\n height : height\n }, true);\n parent = this.__closestGroupOrSvg();\n parent.appendChild(rect);\n this.__currentElement = rect;\n this.__applyStyleToCurrentElement(\"stroke\");\n };\n\n\n /**\n * \"Clears\" a canvas by just drawing a white rectangle in the current group.\n */\n ctx.prototype.clearRect = function(x, y, width, height) {\n var rect, parent = this.__closestGroupOrSvg();\n rect = this.__createElement(\"rect\", {\n x : x,\n y : y,\n width : width,\n height : height,\n fill : \"#FFFFFF\"\n }, true);\n parent.appendChild(rect);\n };\n\n /**\n * Adds a linear gradient to a defs tag.\n * Returns a canvas gradient object that has a reference to it's parent def\n */\n ctx.prototype.createLinearGradient = function(x1, y1, x2, y2){\n var grad = this.__createElement(\"linearGradient\", {\n id : randomString(this.__ids),\n x1 : x1+\"px\",\n x2 : x2+\"px\",\n y1 : y1+\"px\",\n y2 : y2+\"px\",\n \"gradientUnits\" : \"userSpaceOnUse\"\n }, false);\n this.__defs.appendChild(grad);\n return new CanvasGradient(grad, this);\n };\n\n /**\n * Adds a radial gradient to a defs tag.\n * Returns a canvas gradient object that has a reference to it's parent def\n */\n ctx.prototype.createRadialGradient = function(x0, y0, r0, x1, y1, r1){\n var grad = this.__createElement(\"radialGradient\", {\n id : randomString(this.__ids),\n cx : x1+\"px\",\n cy : y1+\"px\",\n r : r1+\"px\",\n fx : x0+\"px\",\n fy : y0+\"px\",\n \"gradientUnits\" : \"userSpaceOnUse\"\n }, false);\n this.__defs.appendChild(grad);\n return new CanvasGradient(grad, this);\n\n };\n\n /**\n * Parses the font string and returns svg mapping\n * @private\n */\n ctx.prototype.__parseFont = function() {\n var regex = /^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-,\\\"\\sa-z]+?)\\s*$/i;\n var fontPart = regex.exec( this.font );\n var data = {\n style : fontPart[1] || 'normal',\n size : fontPart[4] || '10px',\n family : fontPart[6] || 'sans-serif',\n weight: fontPart[3] || 'normal',\n decoration : fontPart[2] || 'normal',\n href : null\n };\n\n //canvas doesn't support underline natively, but we can pass this attribute\n if(this.__fontUnderline === \"underline\") {\n data.decoration = \"underline\";\n }\n\n //canvas also doesn't support linking, but we can pass this as well\n if(this.__fontHref) {\n data.href = this.__fontHref;\n }\n\n return data;\n };\n\n /**\n * Helper to link text fragments\n * @param font\n * @param element\n * @return {*}\n * @private\n */\n ctx.prototype.__wrapTextLink = function(font, element) {\n if(font.href) {\n var a = this.__createElement(\"a\");\n a.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", font.href);\n a.appendChild(element);\n return a;\n }\n return element;\n };\n\n /**\n * Fills or strokes text\n * @param text\n * @param x\n * @param y\n * @param action - stroke or fill\n * @private\n */\n ctx.prototype.__applyText = function(text, x, y, action) {\n var font = this.__parseFont(),\n parent = this.__closestGroupOrSvg(),\n textElement = this.__createElement(\"text\", {\n \"font-family\" : font.family,\n \"font-size\" : font.size,\n \"font-style\" : font.style,\n \"font-weight\" : font.weight,\n \"text-decoration\" : font.decoration,\n \"x\" : x,\n \"y\" : y,\n \"text-anchor\": getTextAnchor(this.textAlign),\n \"dominant-baseline\": getDominantBaseline(this.textBaseline)\n }, true);\n\n textElement.appendChild(this.__document.createTextNode(text));\n this.__currentElement = textElement;\n this.__applyStyleToCurrentElement(action);\n parent.appendChild(this.__wrapTextLink(font,textElement));\n };\n\n /**\n * Creates a text element\n * @param text\n * @param x\n * @param y\n */\n ctx.prototype.fillText = function(text, x, y){\n this.__applyText(text, x, y, \"fill\");\n };\n\n /**\n * Strokes text\n * @param text\n * @param x\n * @param y\n */\n ctx.prototype.strokeText = function(text, x, y){\n this.__applyText(text, x, y, \"stroke\");\n };\n\n /**\n * No need to implement this for svg.\n * @param text\n * @return {TextMetrics}\n */\n ctx.prototype.measureText = function(text){\n this.__ctx.font = this.font;\n return this.__ctx.measureText(text);\n };\n\n /**\n * Arc command!\n */\n ctx.prototype.arc = function(x, y, radius, startAngle, endAngle, counterClockwise) {\n // in canvas no circle is drawn if no angle is provided.\n if (startAngle === endAngle) {\n return;\n }\n startAngle = startAngle % (2*Math.PI);\n endAngle = endAngle % (2*Math.PI);\n if(startAngle === endAngle) {\n //circle time! subtract some of the angle so svg is happy (svg elliptical arc can't draw a full circle)\n endAngle = ((endAngle + (2*Math.PI)) - 0.001 * (counterClockwise ? -1 : 1)) % (2*Math.PI);\n }\n var endX = x+radius*Math.cos(endAngle),\n endY = y+radius*Math.sin(endAngle),\n startX = x+radius*Math.cos(startAngle),\n startY = y+radius*Math.sin(startAngle),\n sweepFlag = counterClockwise ? 0 : 1,\n largeArcFlag = 0,\n diff = endAngle - startAngle;\n\n // https://github.com/gliffy/canvas2svg/issues/4\n if(diff < 0) {\n diff += 2*Math.PI;\n }\n\n if(counterClockwise) {\n largeArcFlag = diff > Math.PI ? 0 : 1;\n } else {\n largeArcFlag = diff > Math.PI ? 1 : 0;\n }\n\n this.lineTo(startX, startY);\n this.__addPathCommand(format(\"A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}\",\n {rx:radius, ry:radius, xAxisRotation:0, largeArcFlag:largeArcFlag, sweepFlag:sweepFlag, endX:endX, endY:endY}));\n\n this.__currentPosition = {x: endX, y: endY};\n };\n\n /**\n * Generates a ClipPath from the clip command.\n */\n ctx.prototype.clip = function(){\n var group = this.__closestGroupOrSvg(),\n clipPath = this.__createElement(\"clipPath\"),\n id = randomString(this.__ids),\n newGroup = this.__createElement(\"g\");\n\n group.removeChild(this.__currentElement);\n clipPath.setAttribute(\"id\", id);\n clipPath.appendChild(this.__currentElement);\n\n this.__defs.appendChild(clipPath);\n\n //set the clip path to this group\n group.setAttribute(\"clip-path\", format(\"url(#{id})\", {id:id}));\n\n //clip paths can be scaled and transformed, we need to add another wrapper group to avoid later transformations\n // to this path\n group.appendChild(newGroup);\n\n this.__currentElement = newGroup;\n\n };\n\n /**\n * Draws a canvas, image or mock context to this canvas.\n * Note that all svg dom manipulation uses node.childNodes rather than node.children for IE support.\n * http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage\n */\n ctx.prototype.drawImage = function(){\n //convert arguments to a real array\n var args = Array.prototype.slice.call(arguments),\n image=args[0],\n dx, dy, dw, dh, sx=0, sy=0, sw, sh, parent, svg, defs, group,\n currentElement, svgImage, canvas, context, id;\n\n if(args.length === 3) {\n dx = args[1];\n dy = args[2];\n sw = image.width;\n sh = image.height;\n dw = sw;\n dh = sh;\n } else if(args.length === 5) {\n dx = args[1];\n dy = args[2];\n dw = args[3];\n dh = args[4];\n sw = image.width;\n sh = image.height;\n } else if(args.length === 9) {\n sx = args[1];\n sy = args[2];\n sw = args[3];\n sh = args[4];\n dx = args[5];\n dy = args[6];\n dw = args[7];\n dh = args[8];\n } else {\n throw new Error(\"Inavlid number of arguments passed to drawImage: \" + arguments.length);\n }\n\n parent = this.__closestGroupOrSvg();\n currentElement = this.__currentElement;\n\n if(image instanceof ctx) {\n //canvas2svg mock canvas context. In the future we may want to clone nodes instead.\n //also I'm currently ignoring dw, dh, sw, sh, sx, sy for a mock context.\n svg = image.getSvg();\n defs = svg.childNodes[0];\n while(defs.childNodes.length) {\n id = defs.childNodes[0].getAttribute(\"id\");\n this.__ids[id] = id;\n this.__defs.appendChild(defs.childNodes[0]);\n }\n group = svg.childNodes[1];\n parent.appendChild(group);\n this.__currentElement = group;\n this.translate(dx, dy);\n this.__currentElement = currentElement;\n } else if(image.nodeName === \"CANVAS\" || image.nodeName === \"IMG\") {\n //canvas or image\n svgImage = this.__createElement(\"image\");\n svgImage.setAttribute(\"width\", dw);\n svgImage.setAttribute(\"height\", dh);\n svgImage.setAttribute(\"preserveAspectRatio\", \"none\");\n\n if(sx || sy || sw !== image.width || sh !== image.height) {\n //crop the image using a temporary canvas\n canvas = this.__document.createElement(\"canvas\");\n canvas.width = dw;\n canvas.height = dh;\n context = canvas.getContext(\"2d\");\n context.drawImage(image, sx, sy, sw, sh, 0, 0, dw, dh);\n image = canvas;\n }\n\n svgImage.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\",\n image.nodeName === \"CANVAS\" ? image.toDataURL() : image.getAttribute(\"src\"));\n parent.appendChild(svgImage);\n this.__currentElement = svgImage;\n this.translate(dx, dy);\n this.__currentElement = currentElement;\n }\n };\n\n /**\n * Generates a pattern tag\n */\n ctx.prototype.createPattern = function(image, repetition){\n var pattern = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"pattern\"), id = randomString(this.__ids),\n img;\n pattern.setAttribute(\"id\", id);\n pattern.setAttribute(\"width\", image.width);\n pattern.setAttribute(\"height\", image.height);\n if(image.nodeName === \"CANVAS\" || image.nodeName === \"IMG\") {\n img = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"image\");\n img.setAttribute(\"width\", image.width);\n img.setAttribute(\"height\", image.height);\n img.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\",\n image.nodeName === \"CANVAS\" ? image.toDataURL() : image.getAttribute(\"src\"));\n pattern.appendChild(img);\n this.__defs.appendChild(pattern);\n } else if(image instanceof ctx) {\n pattern.appendChild(image.__root.childNodes[1]);\n this.__defs.appendChild(pattern);\n }\n return new CanvasPattern(pattern, this);\n };\n\n /**\n * Not yet implemented\n */\n ctx.prototype.drawFocusRing = function(){};\n ctx.prototype.createImageData = function(){};\n ctx.prototype.getImageData = function(){};\n ctx.prototype.putImageData = function(){};\n ctx.prototype.globalCompositeOperation = function(){};\n ctx.prototype.setTransform = function(){};\n\n //add options for alternative namespace\n if (typeof window === \"object\") {\n window.C2S = ctx;\n }\n\n // CommonJS/Browserify\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = ctx;\n }\n\n}());\n"],"names":["STYLES","ctx","CanvasGradient","CanvasPattern","namedEntities","format","str","args","i","keys","Object","length","replace","RegExp","randomString","holder","randomstring","Error","Math","floor","chars","random","getDominantBaseline","textBaseline","mapping","alphabetic","items","radix","entity","base10","lookup","split","parseInt","createNamedToNumberedLookup","svgAttr","canvas","svg","apply","gradientNode","this","__root","__ctx","prototype","addColorStop","offset","color","matches","stop","__createElement","setAttribute","indexOf","exec","r","g","b","appendChild","pattern","o","options","defaultOptions","width","height","enableMirroring","arguments","undefined","__document","document","__canvas","createElement","getContext","__setDefaultStyles","__stack","__getStyleState","__groupStack","createElementNS","setAttributeNS","__ids","__defs","__currentElement","elementName","properties","resetFill","key","element","__applyStyleState","styleState","__applyStyleToCurrentElement","type","style","value","id","childNodes","getAttribute","__closestGroupOrSvg","node","nodeName","parentNode","getSerializedSvg","fixNamedEntities","regexp","serialized","XMLSerializer","serializeToString","test","getSvg","save","group","parent","push","restore","pop","state","__addTransform","t","transform","scale","x","y","rotate","angle","degrees","PI","cx","cy","translate","a","c","d","e","f","beginPath","path","__currentDefaultPath","__currentPosition","__applyCurrentDefaultPath","__addPathCommand","command","moveTo","closePath","lineTo","bezierCurveTo","cp1x","cp1y","cp2x","cp2y","quadraticCurveTo","cpx","cpy","normalize","vector","len","sqrt","arcTo","x1","y1","x2","y2","radius","x0","y0","unit_vec_p1_p0","unit_vec_p1_p2","cos","theta","acos","abs","unit_vec_p1_origin","len_p1_origin","sin","unit_vec_origin_start_tangent","unit_vec_origin_end_tangent","getAngle","startAngle","endAngle","arc","stroke","fill","rect","fillRect","strokeRect","clearRect","createLinearGradient","grad","createRadialGradient","r0","r1","fx","fy","__parseFont","fontPart","font","data","size","family","weight","decoration","href","__fontUnderline","__fontHref","__wrapTextLink","__applyText","text","action","textAlign","textElement","start","createTextNode","fillText","strokeText","measureText","counterClockwise","largeArcFlag","endX","endY","startX","startY","sweepFlag","diff","rx","ry","xAxisRotation","clip","clipPath","newGroup","removeChild","drawImage","dx","dy","dw","dh","sw","sh","defs","currentElement","svgImage","Array","slice","call","image","sx","sy","toDataURL","createPattern","repetition","img","drawFocusRing","createImageData","getImageData","putImageData","globalCompositeOperation","setTransform","window","C2S","module","exports"],"sourceRoot":""} |