Quite good looking graph derived from d3.js http://c3js.org
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.

1 line
617 KiB

{"version":3,"file":null,"sources":["src/axis/c3.axis.js","src/axis/axis.js","src/axis/index.js","src/internals/class.js","src/internals/util.js","src/internals/arc.js","src/internals/cache.js","src/internals/category.js","src/internals/clip.js","src/internals/color.js","src/internals/config.js","src/internals/data.convert.js","src/internals/data.js","src/internals/data.load.js","src/internals/domain.js","src/internals/drag.js","src/internals/flow.js","src/internals/format.js","src/internals/grid.js","src/internals/interaction.js","src/internals/legend.js","src/internals/region.js","src/internals/scale.js","src/internals/selection.js","src/internals/shape.bar.js","src/internals/shape.js","src/internals/shape.line.js","src/internals/size.js","src/internals/subchart.js","src/internals/text.js","src/internals/title.js","src/internals/tooltip.js","src/internals/transform.js","src/internals/type.js","src/internals/ua.js","src/internals/zoom.js","src/internals/index.js","src/chart/api.axis.js","src/chart/api.category.js","src/chart/api.chart.js","src/chart/api.color.js","src/chart/api.data.js","src/chart/api.flow.js","src/chart/api.focus.js","src/chart/api.grid.js","src/chart/api.group.js","src/chart/api.legend.js","src/chart/api.load.js","src/chart/api.region.js","src/chart/api.selection.js","src/chart/api.show.js","src/chart/api.tooltip.js","src/chart/api.transform.js","src/chart/api.x.js","src/chart/api.zoom.js","src/chart/index.js","src/rollup.entry.js"],"sourcesContent":["import d3 from 'd3';\n\nlet tickTextCharSize;\nfunction c3_axis(params) {\n let scale = d3.scale.linear();\n let orient = 'bottom';\n const innerTickSize = 6;\n const tickPadding = 3;\n let tickValues = null;\n let tickFormat;\n let tickArguments;\n\n let tickOffset = 0;\n let tickCulling = true;\n let tickCentered;\n\n params = params || {};\n\n const outerTickSize = params.withOuterTick ? 6 : 0;\n\n function axisX(selection, x) {\n selection.attr('transform', d => 'translate(' + Math.ceil(x(d) + tickOffset) + ', 0)');\n }\n function axisY(selection, y) {\n selection.attr('transform', d => 'translate(0,' + Math.ceil(y(d)) + ')');\n }\n function scaleExtent(domain) {\n const start = domain[0];\n const stop = domain[domain.length - 1];\n return start < stop ? [start, stop] : [stop, start];\n }\n function generateTicks(scale) { // eslint-disable-line no-shadow\n let i;\n const ticks = [];\n if (scale.ticks) {\n return scale.ticks.apply(scale, tickArguments);\n }\n const domain = scale.domain();\n for (i = Math.ceil(domain[0]); i < domain[1]; i++) {\n ticks.push(i);\n }\n if (ticks.length > 0 && ticks[0] > 0) {\n ticks.unshift(ticks[0] - (ticks[1] - ticks[0]));\n }\n return ticks;\n }\n function copyScale() {\n const newScale = scale.copy();\n let domain;\n if (params.isCategory) {\n domain = scale.domain();\n newScale.domain([domain[0], domain[1] - 1]);\n }\n return newScale;\n }\n function textFormatted(v) {\n const formatted = tickFormat ? tickFormat(v) : v;\n return typeof formatted !== 'undefined' ? formatted : '';\n }\n function getSizeFor1Char(tick) {\n if (tickTextCharSize) {\n return tickTextCharSize;\n }\n const size = {\n h: 11.5,\n w: 5.5,\n };\n tick.select('text').text(textFormatted).each(function (d) {\n let box = this.getBoundingClientRect(),\n text = textFormatted(d),\n h = box.height,\n w = text ? (box.width / text.length) : undefined;\n if (h && w) {\n size.h = h;\n size.w = w;\n }\n }).text('');\n tickTextCharSize = size;\n return size;\n }\n function transitionise(selection) {\n return params.withoutTransition ? selection : d3.transition(selection);\n