@d3fc/d3fc-chart
Advanced tools
Comparing version 5.0.5 to 5.0.6
@@ -114,3 +114,3 @@ (function (global, factory) { | ||
return function (selection) { | ||
return maybeTransition.selection ? selection.transition(maybeTransition) : selection; | ||
return d3fcDataJoin.isTransition(maybeTransition) ? selection.transition(maybeTransition) : selection; | ||
}; | ||
@@ -137,4 +137,4 @@ }; | ||
}).text(yLabel(data)); | ||
webglDataJoin(container, webglPlotArea ? [data] : []).attr('set-webgl-viewport', '').classed('plot-area', true).attr('use-device-pixel-ratio', useDevicePixelRatio).on('draw', function (d) { | ||
var _event$detail = d3Selection.event.detail, | ||
webglDataJoin(container, webglPlotArea ? [data] : []).attr('set-webgl-viewport', '').classed('plot-area', true).attr('use-device-pixel-ratio', useDevicePixelRatio).on('draw', function (event, d) { | ||
var _event$detail = event.detail, | ||
child = _event$detail.child, | ||
@@ -145,5 +145,5 @@ pixelRatio = _event$detail.pixelRatio; | ||
}); | ||
container.select('.webgl-plot-area>canvas').on('webglcontextlost', function () { | ||
container.select('.webgl-plot-area>canvas').on('webglcontextlost', function (event) { | ||
console.warn('WebGLRenderingContext lost'); | ||
d3Selection.event.preventDefault(); | ||
event.preventDefault(); | ||
isContextLost = true; | ||
@@ -156,4 +156,4 @@ container.node().requestRedraw(); | ||
}); | ||
canvasDataJoin(container, canvasPlotArea ? [data] : []).classed('plot-area', true).attr('use-device-pixel-ratio', useDevicePixelRatio).on('draw', function (d) { | ||
var _event$detail2 = d3Selection.event.detail, | ||
canvasDataJoin(container, canvasPlotArea ? [data] : []).classed('plot-area', true).attr('use-device-pixel-ratio', useDevicePixelRatio).on('draw', function (event, d) { | ||
var _event$detail2 = event.detail, | ||
child = _event$detail2.child, | ||
@@ -172,4 +172,4 @@ pixelRatio = _event$detail2.pixelRatio; | ||
}); | ||
svgDataJoin(container, svgPlotArea ? [data] : []).classed('plot-area', true).on('draw', function (d, i, nodes) { | ||
var child = d3Selection.event.detail.child; | ||
svgDataJoin(container, svgPlotArea ? [data] : []).classed('plot-area', true).on('draw', function (event, d) { | ||
var child = event.detail.child; | ||
svgPlotArea.xScale(xScale).yScale(yScale); | ||
@@ -180,4 +180,4 @@ transitionPropagator(d3Selection.select(child).datum(d)).call(svgPlotArea); | ||
return "x-axis ".concat(d, "-axis"); | ||
}).style('height', xAxisHeight(data)).on('measure', function (d) { | ||
var _event$detail3 = d3Selection.event.detail, | ||
}).style('height', xAxisHeight(data)).on('measure', function (event, d) { | ||
var _event$detail3 = event.detail, | ||
width = _event$detail3.width, | ||
@@ -192,4 +192,4 @@ height = _event$detail3.height, | ||
xScale.range([0, width]); | ||
}).on('draw', function (d) { | ||
var child = d3Selection.event.detail.child; | ||
}).on('draw', function (event, d) { | ||
var child = event.detail.child; | ||
var xAxisComponent = d === 'top' ? xAxis.top(xScale) : xAxis.bottom(xScale); | ||
@@ -201,4 +201,4 @@ xAxisComponent.decorate(xDecorate); | ||
return "y-axis ".concat(d, "-axis"); | ||
}).style('width', yAxisWidth(data)).on('measure', function (d) { | ||
var _event$detail4 = d3Selection.event.detail, | ||
}).style('width', yAxisWidth(data)).on('measure', function (event, d) { | ||
var _event$detail4 = event.detail, | ||
width = _event$detail4.width, | ||
@@ -213,4 +213,4 @@ height = _event$detail4.height, | ||
yScale.range([height, 0]); | ||
}).on('draw', function (d) { | ||
var child = d3Selection.event.detail.child; | ||
}).on('draw', function (event, d) { | ||
var child = event.detail.child; | ||
var yAxisComponent = d === 'left' ? yAxis.left(yScale) : yAxis.right(yScale); | ||
@@ -217,0 +217,0 @@ yAxisComponent.decorate(yDecorate); |
@@ -1,1 +0,1 @@ | ||
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("@d3fc/d3fc-rebind"),require("d3-selection"),require("d3-scale"),require("@d3fc/d3fc-axis"),require("@d3fc/d3fc-data-join"),require("@d3fc/d3fc-series")):"function"==typeof define&&define.amd?define(["exports","@d3fc/d3fc-rebind","d3-selection","d3-scale","@d3fc/d3fc-axis","@d3fc/d3fc-data-join","@d3fc/d3fc-series"],b):(a="undefined"==typeof globalThis?a||self:globalThis,b(a.fc=a.fc||{},a.fc,a.d3,a.d3,a.fc,a.fc,a.fc))})(this,function(a,b,c,d,e,f,g){'use strict';var h=function(){for(var a={},b=function(b){for(var c,d=0,e=Object.keys(a);d<e.length;d++)c=e[d],b[c].apply(null,a[c]);return b},c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];for(var f=function(){var c=h[g];b[c]=function(){for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length?(a[c]=e,b):a[c]}},g=0,h=d;g<h.length;g++)f();return b},i="d3fc-group.cartesian-chart{width:100%;height:100%;overflow:hidden;display:grid;display:-ms-grid;grid-template-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);grid-template-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);}\nd3fc-group.cartesian-chart>.top-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:1;-ms-grid-row:1;}\nd3fc-group.cartesian-chart>.top-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:2;-ms-grid-row:2;}\nd3fc-group.cartesian-chart>.left-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:1;-ms-grid-column:1;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.left-axis{width:3em;grid-column:2;-ms-grid-column:2;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.plot-area{overflow:hidden;grid-column:3;-ms-grid-column:3;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-axis{width:3em;grid-column:4;-ms-grid-column:4;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:5;-ms-grid-column:5;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.bottom-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:4;-ms-grid-row:4;}\nd3fc-group.cartesian-chart>.bottom-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:5;-ms-grid-row:5;}\nd3fc-group.cartesian-chart>.y-label{display:flex;transform:rotate(-90deg);width:1em;white-space:nowrap;justify-content:center;}",j=document.createElement("style");j.setAttribute("type","text/css"),document.querySelector("head").appendChild(j),j.styleSheet?j.styleSheet.cssText+=i:j.textContent+=i;var k=function(a){return"function"==typeof a?a:function(){return a}},l=function(){var a=m.apply(void 0,arguments),e=a.xScale,g=a.yScale,i=a.xAxis,j=a.yAxis,l=k(""),n=k(""),o=k(""),p=k(null),q=k(null),r=k("right"),s=k("bottom"),t=null,u=null,v=null,w=!1,x=!0,y=h("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),z=function(){},A=h("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),B=function(){},C=function(){},D=f.dataJoin("d3fc-group","cartesian-chart"),E=f.dataJoin("d3fc-canvas","webgl-plot-area"),F=f.dataJoin("d3fc-canvas","canvas-plot-area"),G=f.dataJoin("d3fc-svg","svg-plot-area"),H=f.dataJoin("d3fc-svg","x-axis").key(function(a){return a}),I=f.dataJoin("d3fc-svg","y-axis").key(function(a){return a}),J=f.dataJoin("div","chart-label"),K=f.dataJoin("div","x-label").key(function(a){return a}),L=f.dataJoin("div","y-label").key(function(a){return a}),M=function(a){return function(b){return a.selection?b.transition(a):b}},N=function(a){var b=M(a);a.each(function(a,d,f){var h=D(c.select(f[d]),[a]);h.enter().attr("auto-resize",""),J(h,[s(a)]).attr("class",function(a){return"top"===a?"chart-label bottom-label":"chart-label top-label"}).style("margin-bottom",function(a){return"top"===a?0:"1em"}).style("margin-top",function(a){return"top"===a?"1em":0}).text(l(a)),K(h,[s(a)]).attr("class",function(a){return"x-label ".concat(a,"-label")}).text(n(a)),L(h,[r(a)]).attr("class",function(a){return"y-label ".concat(a,"-label")}).text(o(a)),E(h,t?[a]:[]).attr("set-webgl-viewport","").classed("plot-area",!0).attr("use-device-pixel-ratio",x).on("draw",function(a){var b=c.event.detail,d=b.child,f=b.pixelRatio;t.context(w?null:d.getContext("webgl")).pixelRatio(f).xScale(e).yScale(g),t(a)}),h.select(".webgl-plot-area>canvas").on("webglcontextlost",function(){console.warn("WebGLRenderingContext lost"),c.event.preventDefault(),w=!0,h.node().requestRedraw()}).on("webglcontextrestored",function(){console.info("WebGLRenderingContext restored"),w=!1,h.node().requestRedraw()}),F(h,u?[a]:[]).classed("plot-area",!0).attr("use-device-pixel-ratio",x).on("draw",function(a){var b=c.event.detail,d=b.child,f=b.pixelRatio,h=d.getContext("2d");h.save(),x&&h.scale(f,f),u.context(h).xScale(e).yScale(g),u(a),h.restore()}),G(h,v?[a]:[]).classed("plot-area",!0).on("draw",function(a){var d=c.event.detail.child;v.xScale(e).yScale(g),b(c.select(d).datum(a)).call(v)}),H(h,[s(a)]).attr("class",function(a){return"x-axis ".concat(a,"-axis")}).style("height",p(a)).on("measure",function(a){var b=c.event.detail,d=b.width,f=b.height,g=b.child;"top"===a&&c.select(g).attr("viewBox","0 ".concat(-f," ").concat(d," ").concat(f)),e.range([0,d])}).on("draw",function(a){var d=c.event.detail.child,f="top"===a?i.top(e):i.bottom(e);f.decorate(z),b(c.select(d).datum(a)).call(y(f))}),I(h,[r(a)]).attr("class",function(a){return"y-axis ".concat(a,"-axis")}).style("width",q(a)).on("measure",function(a){var b=c.event.detail,d=b.width,e=b.height,f=b.child;"left"===a&&c.select(f).attr("viewBox","".concat(-d," 0 ").concat(d," ").concat(e)),g.range([e,0])}).on("draw",function(a){var d=c.event.detail.child,e="left"===a?j.left(g):j.right(g);e.decorate(B),b(c.select(d).datum(a)).call(A(e))}),h.each(function(a,b,c){return c[b].requestRedraw()}),C(h,a,d)})},O=b.exclude(/range\w*/,/tickFormat/);return b.rebindAll(N,e,O,b.prefix("x")),b.rebindAll(N,g,O,b.prefix("y")),b.rebindAll(N,y,b.prefix("x")),b.rebindAll(N,A,b.prefix("y")),N.xOrient=function(){return arguments.length?(s=k(0>=arguments.length?void 0:arguments[0]),N):s},N.yOrient=function(){return arguments.length?(r=k(0>=arguments.length?void 0:arguments[0]),N):r},N.xDecorate=function(){return arguments.length?(z=0>=arguments.length?void 0:arguments[0],N):z},N.yDecorate=function(){return arguments.length?(B=0>=arguments.length?void 0:arguments[0],N):B},N.chartLabel=function(){return arguments.length?(l=k(0>=arguments.length?void 0:arguments[0]),N):l},N.xLabel=function(){return arguments.length?(n=k(0>=arguments.length?void 0:arguments[0]),N):n},N.yLabel=function(){return arguments.length?(o=k(0>=arguments.length?void 0:arguments[0]),N):o},N.xAxisHeight=function(){return arguments.length?(p=k(0>=arguments.length?void 0:arguments[0]),N):p},N.yAxisWidth=function(){return arguments.length?(q=k(0>=arguments.length?void 0:arguments[0]),N):q},N.webglPlotArea=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],N):t},N.canvasPlotArea=function(){return arguments.length?(u=0>=arguments.length?void 0:arguments[0],N):u},N.svgPlotArea=function(){return arguments.length?(v=0>=arguments.length?void 0:arguments[0],N):v},N.decorate=function(){return arguments.length?(C=0>=arguments.length?void 0:arguments[0],N):C},N.useDevicePixelRatio=function(){return arguments.length?(x=0>=arguments.length?void 0:arguments[0],N):x},N},m=function(){for(var a={xScale:d.scaleIdentity(),yScale:d.scaleIdentity(),xAxis:{bottom:e.axisBottom,top:e.axisTop},yAxis:{right:e.axisRight,left:e.axisLeft}},b=arguments.length,c=Array(b),f=0;f<b;f++)c[f]=arguments[f];return 1!==c.length||c[0].domain||c[0].range?Object.assign(a,{xScale:c[0]||a.xScale,yScale:c[1]||a.yScale}):Object.assign(a,c[0])},n=function(a){return"function"==typeof a?a:function(){return a}},o=function(a,c){return function(){var d=n(""),e=c,f=function(){},g=l.apply(void 0,arguments),h=function(b){a(g,e),g.decorate(function(a,b,c){a.enter().select(".x-label").style("height","1em").style("line-height","1em");var e=g.yOrient()(b);a.enter().append("div").attr("class","y-label-container").style("grid-column","left"===e?1:5).style("-ms-grid-column","left"===e?1:5).style("grid-row",3).style("-ms-grid-row",3).style("width","1em").style("display","flex").style("align-items","center").style("justify-content","center").style("white-space","nowrap").append("div").attr("class","y-label").style("transform","rotate(-90deg)"),a.select(".y-label-container>.y-label").text(d),f(a,b,c)}),b.call(g)};return b.rebindAll(h,g,b.include(/^x/,/^y/,"chartLabel")),h.yLabel=function(){return arguments.length?(d=n(0>=arguments.length?void 0:arguments[0]),h):d},h.plotArea=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],h):e},h.decorate=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],h):f},h}},p=o(function(a,b){return a.svgPlotArea(b)},g.seriesSvgLine),q=o(function(a,b){return a.canvasPlotArea(b)},g.seriesCanvasLine);a.chartCanvasCartesian=q,a.chartCartesian=l,a.chartSvgCartesian=p,Object.defineProperty(a,"__esModule",{value:!0})}); | ||
(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports,require("@d3fc/d3fc-rebind"),require("d3-selection"),require("d3-scale"),require("@d3fc/d3fc-axis"),require("@d3fc/d3fc-data-join"),require("@d3fc/d3fc-series")):"function"==typeof define&&define.amd?define(["exports","@d3fc/d3fc-rebind","d3-selection","d3-scale","@d3fc/d3fc-axis","@d3fc/d3fc-data-join","@d3fc/d3fc-series"],b):(a="undefined"==typeof globalThis?a||self:globalThis,b(a.fc=a.fc||{},a.fc,a.d3,a.d3,a.fc,a.fc,a.fc))})(this,function(a,b,c,d,e,f,g){'use strict';var h=function(){for(var a={},b=function(b){for(var c,d=0,e=Object.keys(a);d<e.length;d++)c=e[d],b[c].apply(null,a[c]);return b},c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];for(var f=function(){var c=h[g];b[c]=function(){for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length?(a[c]=e,b):a[c]}},g=0,h=d;g<h.length;g++)f();return b},i="d3fc-group.cartesian-chart{width:100%;height:100%;overflow:hidden;display:grid;display:-ms-grid;grid-template-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-columns:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);grid-template-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);-ms-grid-rows:minmax(1em,max-content) auto 1fr auto minmax(1em,max-content);}\nd3fc-group.cartesian-chart>.top-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:1;-ms-grid-row:1;}\nd3fc-group.cartesian-chart>.top-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:2;-ms-grid-row:2;}\nd3fc-group.cartesian-chart>.left-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:1;-ms-grid-column:1;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.left-axis{width:3em;grid-column:2;-ms-grid-column:2;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.plot-area{overflow:hidden;grid-column:3;-ms-grid-column:3;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-axis{width:3em;grid-column:4;-ms-grid-column:4;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.right-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:5;-ms-grid-column:5;grid-row:3;-ms-grid-row:3;}\nd3fc-group.cartesian-chart>.bottom-axis{height:2em;grid-column:3;-ms-grid-column:3;grid-row:4;-ms-grid-row:4;}\nd3fc-group.cartesian-chart>.bottom-label{align-self:center;-ms-grid-column-align:center;justify-self:center;-ms-grid-row-align:center;grid-column:3;-ms-grid-column:3;grid-row:5;-ms-grid-row:5;}\nd3fc-group.cartesian-chart>.y-label{display:flex;transform:rotate(-90deg);width:1em;white-space:nowrap;justify-content:center;}",j=document.createElement("style");j.setAttribute("type","text/css"),document.querySelector("head").appendChild(j),j.styleSheet?j.styleSheet.cssText+=i:j.textContent+=i;var k=function(a){return"function"==typeof a?a:function(){return a}},l=function(){var a=m.apply(void 0,arguments),e=a.xScale,g=a.yScale,i=a.xAxis,j=a.yAxis,l=k(""),n=k(""),o=k(""),p=k(null),q=k(null),r=k("right"),s=k("bottom"),t=null,u=null,v=null,w=!1,x=!0,y=h("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),z=function(){},A=h("tickFormat","ticks","tickArguments","tickSize","tickSizeInner","tickSizeOuter","tickValues","tickPadding","tickCenterLabel"),B=function(){},C=function(){},D=f.dataJoin("d3fc-group","cartesian-chart"),E=f.dataJoin("d3fc-canvas","webgl-plot-area"),F=f.dataJoin("d3fc-canvas","canvas-plot-area"),G=f.dataJoin("d3fc-svg","svg-plot-area"),H=f.dataJoin("d3fc-svg","x-axis").key(function(a){return a}),I=f.dataJoin("d3fc-svg","y-axis").key(function(a){return a}),J=f.dataJoin("div","chart-label"),K=f.dataJoin("div","x-label").key(function(a){return a}),L=f.dataJoin("div","y-label").key(function(a){return a}),M=function(a){return function(b){return f.isTransition(a)?b.transition(a):b}},N=function(a){var b=M(a);a.each(function(a,d,f){var h=D(c.select(f[d]),[a]);h.enter().attr("auto-resize",""),J(h,[s(a)]).attr("class",function(a){return"top"===a?"chart-label bottom-label":"chart-label top-label"}).style("margin-bottom",function(a){return"top"===a?0:"1em"}).style("margin-top",function(a){return"top"===a?"1em":0}).text(l(a)),K(h,[s(a)]).attr("class",function(a){return"x-label ".concat(a,"-label")}).text(n(a)),L(h,[r(a)]).attr("class",function(a){return"y-label ".concat(a,"-label")}).text(o(a)),E(h,t?[a]:[]).attr("set-webgl-viewport","").classed("plot-area",!0).attr("use-device-pixel-ratio",x).on("draw",function(a,b){var c=a.detail,d=c.child,f=c.pixelRatio;t.context(w?null:d.getContext("webgl")).pixelRatio(f).xScale(e).yScale(g),t(b)}),h.select(".webgl-plot-area>canvas").on("webglcontextlost",function(a){console.warn("WebGLRenderingContext lost"),a.preventDefault(),w=!0,h.node().requestRedraw()}).on("webglcontextrestored",function(){console.info("WebGLRenderingContext restored"),w=!1,h.node().requestRedraw()}),F(h,u?[a]:[]).classed("plot-area",!0).attr("use-device-pixel-ratio",x).on("draw",function(a,b){var c=a.detail,d=c.child,f=c.pixelRatio,h=d.getContext("2d");h.save(),x&&h.scale(f,f),u.context(h).xScale(e).yScale(g),u(b),h.restore()}),G(h,v?[a]:[]).classed("plot-area",!0).on("draw",function(a,f){var d=a.detail.child;v.xScale(e).yScale(g),b(c.select(d).datum(f)).call(v)}),H(h,[s(a)]).attr("class",function(a){return"x-axis ".concat(a,"-axis")}).style("height",p(a)).on("measure",function(a,b){var d=a.detail,f=d.width,g=d.height,h=d.child;"top"===b&&c.select(h).attr("viewBox","0 ".concat(-g," ").concat(f," ").concat(g)),e.range([0,f])}).on("draw",function(a,f){var d=a.detail.child,g="top"===f?i.top(e):i.bottom(e);g.decorate(z),b(c.select(d).datum(f)).call(y(g))}),I(h,[r(a)]).attr("class",function(a){return"y-axis ".concat(a,"-axis")}).style("width",q(a)).on("measure",function(a,b){var d=a.detail,e=d.width,f=d.height,h=d.child;"left"===b&&c.select(h).attr("viewBox","".concat(-e," 0 ").concat(e," ").concat(f)),g.range([f,0])}).on("draw",function(a,e){var d=a.detail.child,f="left"===e?j.left(g):j.right(g);f.decorate(B),b(c.select(d).datum(e)).call(A(f))}),h.each(function(a,b,c){return c[b].requestRedraw()}),C(h,a,d)})},O=b.exclude(/range\w*/,/tickFormat/);return b.rebindAll(N,e,O,b.prefix("x")),b.rebindAll(N,g,O,b.prefix("y")),b.rebindAll(N,y,b.prefix("x")),b.rebindAll(N,A,b.prefix("y")),N.xOrient=function(){return arguments.length?(s=k(0>=arguments.length?void 0:arguments[0]),N):s},N.yOrient=function(){return arguments.length?(r=k(0>=arguments.length?void 0:arguments[0]),N):r},N.xDecorate=function(){return arguments.length?(z=0>=arguments.length?void 0:arguments[0],N):z},N.yDecorate=function(){return arguments.length?(B=0>=arguments.length?void 0:arguments[0],N):B},N.chartLabel=function(){return arguments.length?(l=k(0>=arguments.length?void 0:arguments[0]),N):l},N.xLabel=function(){return arguments.length?(n=k(0>=arguments.length?void 0:arguments[0]),N):n},N.yLabel=function(){return arguments.length?(o=k(0>=arguments.length?void 0:arguments[0]),N):o},N.xAxisHeight=function(){return arguments.length?(p=k(0>=arguments.length?void 0:arguments[0]),N):p},N.yAxisWidth=function(){return arguments.length?(q=k(0>=arguments.length?void 0:arguments[0]),N):q},N.webglPlotArea=function(){return arguments.length?(t=0>=arguments.length?void 0:arguments[0],N):t},N.canvasPlotArea=function(){return arguments.length?(u=0>=arguments.length?void 0:arguments[0],N):u},N.svgPlotArea=function(){return arguments.length?(v=0>=arguments.length?void 0:arguments[0],N):v},N.decorate=function(){return arguments.length?(C=0>=arguments.length?void 0:arguments[0],N):C},N.useDevicePixelRatio=function(){return arguments.length?(x=0>=arguments.length?void 0:arguments[0],N):x},N},m=function(){for(var a={xScale:d.scaleIdentity(),yScale:d.scaleIdentity(),xAxis:{bottom:e.axisBottom,top:e.axisTop},yAxis:{right:e.axisRight,left:e.axisLeft}},b=arguments.length,c=Array(b),f=0;f<b;f++)c[f]=arguments[f];return 1!==c.length||c[0].domain||c[0].range?Object.assign(a,{xScale:c[0]||a.xScale,yScale:c[1]||a.yScale}):Object.assign(a,c[0])},n=function(a){return"function"==typeof a?a:function(){return a}},o=function(a,c){return function(){var d=n(""),e=c,f=function(){},g=l.apply(void 0,arguments),h=function(b){a(g,e),g.decorate(function(a,b,c){a.enter().select(".x-label").style("height","1em").style("line-height","1em");var e=g.yOrient()(b);a.enter().append("div").attr("class","y-label-container").style("grid-column","left"===e?1:5).style("-ms-grid-column","left"===e?1:5).style("grid-row",3).style("-ms-grid-row",3).style("width","1em").style("display","flex").style("align-items","center").style("justify-content","center").style("white-space","nowrap").append("div").attr("class","y-label").style("transform","rotate(-90deg)"),a.select(".y-label-container>.y-label").text(d),f(a,b,c)}),b.call(g)};return b.rebindAll(h,g,b.include(/^x/,/^y/,"chartLabel")),h.yLabel=function(){return arguments.length?(d=n(0>=arguments.length?void 0:arguments[0]),h):d},h.plotArea=function(){return arguments.length?(e=0>=arguments.length?void 0:arguments[0],h):e},h.decorate=function(){return arguments.length?(f=0>=arguments.length?void 0:arguments[0],h):f},h}},p=o(function(a,b){return a.svgPlotArea(b)},g.seriesSvgLine),q=o(function(a,b){return a.canvasPlotArea(b)},g.seriesCanvasLine);a.chartCanvasCartesian=q,a.chartCartesian=l,a.chartSvgCartesian=p,Object.defineProperty(a,"__esModule",{value:!0})}); |
@@ -6,2 +6,14 @@ # Change Log | ||
## [5.0.6](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@5.0.5...@d3fc/d3fc-chart@5.0.6) (2020-09-23) | ||
### Bug Fixes | ||
* d3v6 removal of d3.event ([6c14c8e](https://github.com/d3fc/d3fc/commit/6c14c8e)) | ||
* d3v6 selection.selection changes ([c0175ae](https://github.com/d3fc/d3fc/commit/c0175ae)) | ||
## [5.0.5](https://github.com/d3fc/d3fc/compare/@d3fc/d3fc-chart@5.0.4...@d3fc/d3fc-chart@5.0.5) (2020-09-16) | ||
@@ -8,0 +20,0 @@ |
{ | ||
"name": "@d3fc/d3fc-chart", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"description": "A simple Cartesian chart component that renders to canvas or SVG.", | ||
@@ -24,7 +24,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@d3fc/d3fc-axis": "^3.0.4", | ||
"@d3fc/d3fc-data-join": "^6.0.2", | ||
"@d3fc/d3fc-element": "^6.1.1", | ||
"@d3fc/d3fc-axis": "^3.0.5", | ||
"@d3fc/d3fc-data-join": "^6.0.3", | ||
"@d3fc/d3fc-element": "^6.1.2", | ||
"@d3fc/d3fc-rebind": "^6.0.1", | ||
"@d3fc/d3fc-series": "^6.0.3" | ||
"@d3fc/d3fc-series": "^6.0.4" | ||
}, | ||
@@ -38,3 +38,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "03c76aba48931e9ab149cc11dcaabc93f2e9d0c1" | ||
"gitHead": "a7f1db4d1fd44f696c7ead067284851953c18e6c" | ||
} |
@@ -175,9 +175,9 @@ # d3fc-chart | ||
// when there's a measure event (namespaced to avoid removing existing handlers) | ||
.on('measure.z-axis', () => { | ||
.on('measure.z-axis', (event) => { | ||
// set the range on the scale to the elements height | ||
zScale.range([d3.event.detail.height, 0]); | ||
zScale.range([event.detail.height, 0]); | ||
}) | ||
.on('draw.z-axis', (d, i, nodes) => { | ||
.on('draw.z-axis', (event,d) => { | ||
// draw the axis into the svg within the d3fc-svg element | ||
d3.select(nodes[i]) | ||
d3.select(event.currentTarget) | ||
.select('svg') | ||
@@ -200,5 +200,5 @@ .call(zAxis); | ||
// listen for the draw event (using a namespace to avoid removing any existing handlers) | ||
.on('draw.move-axis', (d, i, nodes) => { | ||
.on('draw.move-axis', (event, d) => { | ||
// select the x-axis | ||
d3.select(nodes[i]) | ||
d3.select(event.currentTarget) | ||
// apply a top margin to the axis to align it to 0 on the y-axis | ||
@@ -205,0 +205,0 @@ .style('margin-top', `${yScale(0)}px`); |
@@ -1,5 +0,5 @@ | ||
import { select, event } from 'd3-selection'; | ||
import { select } from 'd3-selection'; | ||
import { scaleIdentity } from 'd3-scale'; | ||
import { axisBottom, axisRight, axisLeft, axisTop } from '@d3fc/d3fc-axis'; | ||
import { dataJoin } from '@d3fc/d3fc-data-join'; | ||
import { dataJoin, isTransition } from '@d3fc/d3fc-data-join'; | ||
import { rebindAll, exclude, prefix } from '@d3fc/d3fc-rebind'; | ||
@@ -48,3 +48,3 @@ import store from './store'; | ||
const propagateTransition = maybeTransition => selection => | ||
maybeTransition.selection ? selection.transition(maybeTransition) : selection; | ||
isTransition(maybeTransition) ? selection.transition(maybeTransition) : selection; | ||
@@ -79,3 +79,3 @@ const cartesian = (selection) => { | ||
.attr('use-device-pixel-ratio', useDevicePixelRatio) | ||
.on('draw', (d) => { | ||
.on('draw', (event, d) => { | ||
const { child, pixelRatio } = event.detail; | ||
@@ -90,3 +90,3 @@ webglPlotArea.context(isContextLost ? null : child.getContext('webgl')) | ||
container.select('.webgl-plot-area>canvas') | ||
.on('webglcontextlost', () => { | ||
.on('webglcontextlost', event => { | ||
console.warn('WebGLRenderingContext lost'); | ||
@@ -106,3 +106,3 @@ event.preventDefault(); | ||
.attr('use-device-pixel-ratio', useDevicePixelRatio) | ||
.on('draw', (d) => { | ||
.on('draw', (event, d) => { | ||
const { child, pixelRatio } = event.detail; | ||
@@ -123,3 +123,3 @@ const context = child.getContext('2d'); | ||
.classed('plot-area', true) | ||
.on('draw', (d, i, nodes) => { | ||
.on('draw', (event, d) => { | ||
const { child } = event.detail; | ||
@@ -135,3 +135,3 @@ svgPlotArea.xScale(xScale) | ||
.style('height', xAxisHeight(data)) | ||
.on('measure', (d) => { | ||
.on('measure', (event, d) => { | ||
const { width, height, child } = event.detail; | ||
@@ -144,3 +144,3 @@ if (d === 'top') { | ||
}) | ||
.on('draw', (d) => { | ||
.on('draw', (event, d) => { | ||
const { child } = event.detail; | ||
@@ -156,3 +156,3 @@ const xAxisComponent = d === 'top' ? xAxis.top(xScale) : xAxis.bottom(xScale); | ||
.style('width', yAxisWidth(data)) | ||
.on('measure', (d) => { | ||
.on('measure', (event, d) => { | ||
const { width, height, child } = event.detail; | ||
@@ -165,3 +165,3 @@ if (d === 'left') { | ||
}) | ||
.on('draw', (d) => { | ||
.on('draw', (event, d) => { | ||
const { child } = event.detail; | ||
@@ -168,0 +168,0 @@ const yAxisComponent = d === 'left' ? yAxis.left(yScale) : yAxis.right(yScale); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85746
Updated@d3fc/d3fc-axis@^3.0.5
Updated@d3fc/d3fc-data-join@^6.0.3
Updated@d3fc/d3fc-element@^6.1.2
Updated@d3fc/d3fc-series@^6.0.4