ulogger-server/js/lib/chartist-plugin-axistitle.min.js.map
2019-05-22 15:41:39 +02:00

1 line
7.5 KiB
Plaintext

{"version":3,"sources":["chartist-plugin-axistitle.js"],"names":["root","factory","define","amd","Chartist","returnExportsGlobal","exports","module","require","this","window","document","axisDefaults","axisTitle","axisClass","offset","x","y","textAnchor","flipTitle","defaultOptions","axisX","axisY","getTitle","title","Function","getClasses","classes","plugins","ctAxisTitle","options","extend","chart","on","data","Error","xPos","yPos","chartPadding","normalizePadding","axisLength","left","top","position","Svg","addClass","text","attr","text-anchor","svg","append","transform"],"mappings":"CAAC,SAAUA,EAAMC,GACO,kBAAXC,SAAyBA,OAAOC,IAEzCD,QAAQ,YAAa,SAAUE,GAC7B,MAAQJ,GAAKK,oBAAsBJ,EAAQG,KAEjB,gBAAZE,SAIhBC,OAAOD,QAAUL,EAAQO,QAAQ,aAEjCR,EAAK,gCAAkCC,EAAQG,WAEjDK,KAAM,SAAUL,GAiIhB,MAzHC,UAAUM,EAAQC,EAAUP,GACzB,YAEA,IAAIQ,IACAC,UAAW,GACXC,UAAW,gBACXC,QACIC,EAAG,EACHC,EAAG,GAEPC,WAAY,SACZC,WAAW,GAGXC,GACAC,MAAOT,EACPU,MAAOV,GAGPW,EAAW,SAAUC,GACrB,MAAIA,aAAiBC,UACVD,IAEJA,GAGPE,EAAa,SAAUC,GACvB,MAAIA,aAAmBF,UACZE,IAEJA,EAGXvB,GAASwB,QAAUxB,EAASwB,YAC5BxB,EAASwB,QAAQC,YAAc,SAASC,GAIpC,MAFAA,GAAU1B,EAAS2B,UAAWX,EAAgBU,GAEvC,SAAqBE,GAExBA,EAAMC,GAAG,UAAW,SAASC,GAEzB,IAAKJ,EAAQT,MAAMR,YAAciB,EAAQR,MAAMT,UAC3C,KAAM,IAAIsB,OACN,gEAED,KAAKD,EAAKb,QAAUa,EAAKZ,MAC5B,KAAM,IAAIa,OACN,4EAIR,IAAIC,GACAC,EACAb,EACAc,EAAelC,EAASmC,iBAAiBL,EAAK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,MAAMJ,aAEjCgB,EAAKe,IAAIC,OAAO1B,GAAO,SAKzCd,OAAQC,SAAUP,GAEbA,EAASwB,QAAQC","file":"chartist-plugin-axistitle.min.js","sourcesContent":["(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"chartist\"], function (Chartist) {\n return (root.returnExportsGlobal = factory(Chartist));\n });\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like enviroments that support module.exports,\n // like Node.\n module.exports = factory(require(\"chartist\"));\n } else {\n root['Chartist.plugins.ctAxisTitle'] = factory(Chartist);\n }\n}(this, function (Chartist) {\n\n /**\n * Chartist.js plugin to display a title for 1 or 2 axes.\n * version 0.0.4\n * author: alex stanbury\n */\n /* global Chartist */\n (function (window, document, Chartist) {\n 'use strict';\n\n var axisDefaults = {\n axisTitle: '',\n axisClass: 'ct-axis-title',\n offset: {\n x: 0,\n y: 0\n },\n textAnchor: 'middle',\n flipTitle: false\n };\n\n var defaultOptions = {\n axisX: axisDefaults,\n axisY: axisDefaults\n };\n\n var getTitle = function (title) {\n if (title instanceof Function) {\n return title();\n }\n return title;\n };\n\n var getClasses = function (classes) {\n if (classes instanceof Function) {\n return classes();\n }\n return classes;\n };\n\n Chartist.plugins = Chartist.plugins || {};\n Chartist.plugins.ctAxisTitle = function(options) {\n\n options = Chartist.extend({}, defaultOptions, options);\n\n return function ctAxisTitle(chart) {\n\n chart.on('created', function(data) {\n\n if (!options.axisX.axisTitle && !options.axisY.axisTitle) {\n throw new Error(\n 'ctAxisTitle plugin - You must provide at least one axis title'\n );\n } else if (!data.axisX && !data.axisY) {\n throw new Error(\n 'ctAxisTitle plugin can only be used on charts that have at least one axis'\n );\n }\n\n var xPos,\n yPos,\n title,\n chartPadding = Chartist.normalizePadding(data.options.chartPadding); // normalize the padding in case the full padding object was not passed into the options\n\n //position axis X title\n if (options.axisX.axisTitle && data.axisX) {\n\n xPos = (data.axisX.axisLength / 2) + data.options.axisY.offset +\n chartPadding.left;\n\n yPos = chartPadding.top;\n\n if (data.options.axisY.position === 'end') {\n xPos -= data.options.axisY.offset;\n }\n\n if (data.options.axisX.position === 'end') {\n yPos += data.axisY.axisLength;\n }\n\n title = new Chartist.Svg(\"text\");\n title.addClass(getClasses(options.axisX.axisClass));\n title.text(getTitle(options.axisX.axisTitle));\n title.attr({\n x: xPos + options.axisX.offset.x,\n y: yPos + options.axisX.offset.y,\n \"text-anchor\": options.axisX.textAnchor\n });\n\n data.svg.append(title, true);\n\n }\n\n //position axis Y title\n if (options.axisY.axisTitle && data.axisY) {\n xPos = 0;\n\n\n yPos = (data.axisY.axisLength / 2) + chartPadding\n .top;\n\n if (data.options.axisX.position === 'start') {\n yPos += data.options.axisX.offset;\n }\n\n if (data.options.axisY.position === 'end') {\n xPos = data.axisX.axisLength;\n }\n\n var transform = 'rotate(' + (options.axisY.flipTitle ? -\n 90 : 90) + ', ' + xPos + ', ' + yPos + ')';\n\n title = new Chartist.Svg(\"text\");\n title.addClass(getClasses(options.axisY.axisClass));\n title.text(getTitle(options.axisY.axisTitle));\n title.attr({\n x: xPos + options.axisY.offset.x,\n y: yPos + options.axisY.offset.y,\n transform: transform,\n \"text-anchor\": options.axisY.textAnchor\n });\n data.svg.append(title, true);\n }\n });\n };\n };\n }(window, document, Chartist));\n\n return Chartist.plugins.ctAxisTitle;\n\n}));\n"]}