Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vizabi-barrankchart

Package Overview
Dependencies
Maintainers
3
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vizabi-barrankchart - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

4

build/barrankchart.js

@@ -88,3 +88,3 @@ /******/ (function(modules) { // webpackBootstrap

var VERSION_INFO = { version: "2.2.2", build: 1534516626644 };
var VERSION_INFO = { version: "2.3.0", build: 1544532806858 };

@@ -209,3 +209,3 @@ exports.default = Vizabi.Tool.extend("BarRankChart", {

},
"buttons": ["colors", "find", "moreoptions", "fullscreen", "presentation"],
"buttons": ["colors", "find", "moreoptions", "presentation", "sidebarcollapse", "fullscreen"],
"dialogs": {

@@ -212,0 +212,0 @@ "popup": ["timedisplay", "colors", "find", "moreoptions"],

@@ -1,2 +0,2 @@

!function(t){function e(a){if(i[a])return i[a].exports;var r=i[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,a){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=6)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(3);var a=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(a),n={version:"2.2.2",build:1534516626644};e.default=Vizabi.Tool.extend("BarRankChart",{init:function(t,e){this.name="barrankchart",this.components=[{component:r.default,placeholder:".vzb-tool-viz",model:["state.time","state.marker","locale","ui"]},{component:Vizabi.Component.get("timeslider"),placeholder:".vzb-tool-timeslider",model:["state.time","state.marker","ui"]},{component:Vizabi.Component.get("dialogs"),placeholder:".vzb-tool-dialogs",model:["state","ui","locale"]},{component:Vizabi.Component.get("buttonlist"),placeholder:".vzb-tool-buttonlist",model:["state","ui","locale"]},{component:Vizabi.Component.get("treemenu"),placeholder:".vzb-tool-treemenu",model:["state.marker","state.time","locale","ui"]},{component:Vizabi.Component.get("datanotes"),placeholder:".vzb-tool-datanotes",model:["state.marker","locale"]},{component:Vizabi.Component.get("datawarning"),placeholder:".vzb-tool-datawarning",model:["locale"]},{component:Vizabi.Component.get("steppedspeedslider"),placeholder:".vzb-tool-stepped-speed-slider",model:["state.time","locale"]}],this._super(t,e)},default_model:{state:{time:{autoconfig:{type:"time"}},entities:{autoconfig:{type:"entity_domain",excludeIDs:["tag"]}},entities_colorlegend:{autoconfig:{type:"entity_domain",excludeIDs:["tag"]}},marker:{space:["entities","time"],axis_x:{use:"indicator",autoconfig:{type:"measure"},allow:{scales:["linear","log"]}},label:{use:"property",autoconfig:{includeOnlyIDs:["name"],type:"string"}},color:{syncModels:["marker_colorlegend"],autoconfig:{}}},marker_colorlegend:{space:["entities_colorlegend"],label:{use:"property",which:"name"},hook_rank:{use:"property",which:"rank"},hook_geoshape:{use:"property",which:"shape_lores_svg"}}},locale:{},ui:{chart:{},datawarning:{doubtDomain:[],doubtRange:[]},buttons:["colors","find","moreoptions","fullscreen","presentation"],dialogs:{popup:["timedisplay","colors","find","moreoptions"],sidebar:["timedisplay","colors","find"],moreoptions:["opacity","speed","colors","presentation","about"]},presentation:!1}},versionInfo:n})},function(t,e,i){"use strict";function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var n,o=function(){function t(t,e){var i=[],a=!0,r=!1,n=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){r=!0,n=t}finally{try{!a&&s.return&&s.return()}finally{if(r)throw n}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=i(2),l=function(t){return t&&t.__esModule?t:{default:t}}(s),h=Vizabi.utils,c=Vizabi.helpers["d3.axisWithLabelPicker"],d=Vizabi.iconset.question,g=Vizabi.iconset.warn,u=Vizabi.Component.extend("barrankchart",(n={init:function(t,e){var a=this;this.name="barrankchart",this.template=i(4),this.model_expects=[{name:"time",type:"time"},{name:"marker",type:"marker"},{name:"locale",type:"locale"},{name:"ui",type:"ui"}],this.model_binds={"change:time.value":function(){a.model._ready&&a._readyOnce&&a.onTimeChange()},"change:marker.select":function(){a._readyOnce&&(a._selectBars(),a._updateOpacity(),a._updateDoubtOpacity(),a._scroll())},"change:marker.axis_x.scaleType":function(){a._readyOnce&&a.loadData()&&a.draw(!0)},"change:marker.color.palette":function(){a._drawColors()},"change:marker.highlight":function(){a._updateOpacity()},"change:marker.opacitySelectDim":function(){a._updateOpacity()},"change:marker.opacityRegular":function(){a._updateOpacity()}},this._super(t,e),this.xScale=null,this.cScale=d3.scaleOrdinal(d3.schemeCategory10),this.xAxis=c("bottom")},onTimeChange:function(){var t=this;this.model.marker.getFrame(this.model.time.value,function(e){t.values=e,t.values&&t.loadData()&&t.draw()})},readyOnce:function(){this.element=d3.select(this.element),this.header=this.element.select(".vzb-br-header"),this.infoEl=this.element.select(".vzb-br-axis-info"),this.barViewport=this.element.select(".vzb-br-barsviewport"),this.barSvg=this.element.select(".vzb-br-bars-svg"),this.barContainer=this.element.select(".vzb-br-bars"),this.dataWarningEl=this.element.select(".vzb-data-warning"),this.tooltipSvg=this.element.select(".vzb-br-tooltip-svg"),this.tooltip=this.element.select(".vzb-br-tooltip"),this.missedPositionsWarningEl=this.element.select(".vzb-data-warning-missed-positions");var t=this._createTooltipInteract(this.element,this.missedPositionsWarningEl);this.missedPositionsWarningEl.on("mouseover",t.mouseOver).on("mouseout",t.mouseOut),this.wScale=d3.scaleLinear().domain(this.model.ui.datawarning.doubtDomain).range(this.model.ui.datawarning.doubtRange),this.xAxis.tickFormat(this.model.marker.axis_x.getTickFormatter()),this._localeId=this.model.locale.id,this._entityLabels={},this._presentation=!this.model.ui.presentation,this._formatter=this.model.marker.axis_x.getTickFormatter(),this.ready(),this._selectBars()},ready:function(){var t=this;this.TIMEDIM=this.model.time.getDimension(),this.KEYS=h.unique(this.model.marker._getAllDimensions({exceptType:"time"})),this.KEY=this.KEYS.join(","),this.dataKeys=this.model.marker.getDataKeysPerHook(),this.labelNames=this.model.marker.getLabelHookNames(),this.model.marker.getFrame(this.model.time.value,function(e){t.values=e,t.values&&(t.markerKeys=t.model.marker.getKeys(),t.loadData()&&(t.draw(!0),t._updateOpacity(),t._drawColors()))})},resize:function(){this.draw(!0),this._drawColors()},loadData:function(){var t=this,e=this;this.translator=this.model.locale.getTFunction();var i=this.values.axis_x,a=Object.keys(i).length;if(!a)return!1;this.nullValuesCount=0,this.sortedEntities=this._sortByIndicator(i,this.dataKeys.axis_x),this.header.select(".vzb-br-title").select("text").on("click",function(){return t.parent.findChildByName("gapminder-treemenu").markerID("axis_x").alignX("left").alignY("top").updateView().toggle()}),this.xScale=this.model.marker.axis_x.getScale().copy(),this.cScale=this.model.marker.color.getScale(),h.setIcon(this.dataWarningEl,g).select("svg").attr("width",0).attr("height",0),this.dataWarningEl.append("text").text(this.translator("hints/dataWarning")),this.dataWarningEl.on("click",function(){return t.parent.findChildByName("gapminder-datawarning").toggle()}).on("mouseover",function(){return t._updateDoubtOpacity(1)}).on("mouseout",function(){return t._updateDoubtOpacity()}),this.missedPositionsWarningEl.classed("vzb-hidden",1-this.nullValuesCount/a>.85).select("text").attr("data-text",this.translator("hints/barrank/missedPositionsTooltip")).text(this.translator("hints/barrank/missedPositionsWarning"));var r=this.model.marker.axis_x.getConceptprops();return h.setIcon(this.infoEl,d).select("svg").attr("width",0).attr("height",0).style("opacity",Number(Boolean(r.description||r.sourceLink))),this.infoEl.on("click",function(){t.parent.findChildByName("gapminder-datanotes").pin()}),this.infoEl.on("mouseover",function(){var t=this.getBBox(),i=h.makeAbsoluteContext(this,this.farthestViewportElement),a=i(t.x-10,t.y+t.height+10);e.parent.findChildByName("gapminder-datanotes").setHook("axis_x").show().setPos(a.x,a.y)}),this.infoEl.on("mouseout",function(){e.parent.findChildByName("gapminder-datanotes").hide()}),!0},draw:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.time_1=null==this.time?this.model.time.value:this.time,this.time=this.model.time.value;var e=this.model.time.playing&&this.time-this.time_1>0?this.model.time.delayAnimations:0;this.drawAxes(e,t)||this.drawData(e,t)},drawAxes:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={small:{margin:{top:60,right:20,left:5,bottom:20},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:5,barHeight:18,barMargin:3,barLabelMargin:5,barValueMargin:5,barRankMargin:6,scrollMargin:25},medium:{margin:{top:60,right:25,left:5,bottom:20},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:5,barHeight:21,barMargin:3,barLabelMargin:5,barValueMargin:5,barRankMargin:10,scrollMargin:30},large:{margin:{top:60,right:30,left:5,bottom:20},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:5,barHeight:28,barMargin:4,barLabelMargin:5,barValueMargin:5,barRankMargin:10,scrollMargin:30}},i={medium:{margin:{top:60,right:30,left:10,bottom:40},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:25,infoElMargin:10,barHeight:25,barMargin:6},large:{margin:{top:60,right:35,left:10,bottom:40},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:10,barHeight:30,barMargin:6}};this.activeProfile=this.getActiveProfile(e,i);var a=this.activeProfile,r=a.margin,n=a.headerMargin,o=a.infoElHeight,s=a.infoElMargin;if(this.height=parseInt(this.element.style("height"),10)||0,this.width=parseInt(this.element.style("width"),10)||0,!this.height||!this.width)return h.warn("Dialog resize() abort: vizabi container is too little or has display:none");this.barViewport.style("height",this.height-r.bottom-r.top+"px"),this.header.attr("height",r.top);var l=this.header.select(".vzb-br-title"),c=this.model.marker.axis_x.getConceptprops(),d=c.name,g=c.unit,u=l.select("text");if(g){u.text(d+", "+g);n.left+l.node().getBBox().width+s+o>this.width-n.right&&u.text(d)}else u.text(d);var m=l.node().getBBox(),b=n.left,p=n.top+m.height;l.attr("transform","translate("+b+", "+p+")");var f=this.infoEl;f.select("svg").attr("width",o+"px").attr("height",o+"px");var v=b+l.node().getBBox().width+s,x=n.top+o/4;f.attr("transform","translate("+v+", "+x+")");var y=this.header.select(".vzb-br-total");t?y.select("text").transition("text").delay(t).text(this.model.time.formatDate(this.time)):y.select("text").interrupt().text(this.model.time.formatDate(this.time)),y.style("opacity",Number("large"!==this.getLayoutProfile()));var _=y.node().getBBox(),w=this.width-n.right-_.width,z=n.top+_.height;y.attr("transform","translate("+w+", "+z+")").classed("vzb-transparent",m.width+_.width+10>this.width),this.element.select(".vzb-data-warning-svg").style("height",r.bottom+"px");var k=this.dataWarningEl.select("text").node().getBBox();this.dataWarningEl.attr("transform","translate("+(this.width-r.right-k.width)+", "+k.height+")"),this.dataWarningEl.select("svg").attr("width",k.height).attr("height",k.height).attr("x",-k.height-5).attr("y",1-k.height),this.missedPositionsWarningEl.attr("transform","translate("+(this.width-r.right-k.width-3*k.height)+", "+k.height+")"),this._updateDoubtOpacity()},drawData:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.KEY;this._createAndDeleteBars(this.barContainer.selectAll(".vzb-br-bar").data(this.sortedEntities,function(t){return t[a]}));var n=this.model.ui.presentation,o=this._presentation!==n;o&&(this._presentation=n);var s="undefined"===typeof this._entitiesCount||this._entitiesCount!==this.sortedEntities.length;(o||s)&&s&&(this._entitiesCount=this.sortedEntities.length),this._resizeSvg(),this._scroll(e),this._drawColors();var l=this.activeProfile,h=l.barLabelMargin,c=l.barValueMargin,d=l.barRankMargin,g=l.scrollMargin,u=l.margin,m=this.model.marker.axis_x,b=m.getLimits(m.which),p=Math.abs(b.max)>=Math.abs(b.min),f=p?b.min<0:b.max>0,v=(this.width-u.right-u.left-h-g-(f?0:this._getWidestLabelWidth()))/(f?2:1);this.xScale.range([0,v]),"log"!==this.model.marker.axis_x.scaleType&&this.xScale.domain([0,Math.max.apply(Math,r(this.xScale.domain()))]);var x=f?v:this._getWidestLabelWidth(),y=function(e){return t.xScale(e)},_=function(t){return p?t>=0:t>0},w=function(t){return _(t)?"end":"start"},z=function(t){return _(t)?"start":"end"},k=function(t){return _(t)?-h:h},C=function(t){return _(t)?c:-c},E=this._getWidestLabelWidth(!0)+(p?u.left:u.right)<x;this.barContainer.attr("transform","translate("+(x+(p?u.left:u.right)+h)+", 0)"),this.sortedEntities.forEach(function(a){var r=a.value;if((i||o||a.isNew||a.changedValue)&&(a.barLabel.attr("x",k(r)).attr("y",t.activeProfile.barHeight/2).attr("text-anchor",w(r)).text(E?a.label:a.labelSmall),a.barRect.attr("rx",t.activeProfile.barHeight/4).attr("ry",t.activeProfile.barHeight/4).attr("height",t.activeProfile.barHeight),a.barValue.attr("x",C(r)).attr("y",t.activeProfile.barHeight/2).attr("text-anchor",z(r)),a.barRank.text(function(t,e){return r||0===r?"#"+t.rank:""}).attr("y",t.activeProfile.barHeight/2)),i||a.changedWidth||o){var n=Math.max(0,r&&y(Math.abs(r)))||0;(i||a.changedValue)&&(a.barValue.text(t._formatter(r)||t.translator("hints/nodata")),a.barValueWidth=c+a.barValue.node().getBBox().width),(i||a.changedWidth||o)&&(a.barRect.transition().duration(e).ease(d3.easeLinear).attr("width",n),a.barRank.transition().duration(e).ease(d3.easeLinear).attr("x",(Math.max(n,a.barValueWidth)+d)*(_(r)?1:-1)).attr("text-anchor",z(r))),a.barRect.attr("x",r<0?-n:0)}(i||a.changedIndex||o)&&(!e&&a.self.interrupt(),(e?a.self.transition().duration(e).ease(d3.easeLinear):a.self).attr("transform","translate(0, "+t._getBarPosition(a.index)+")"),a.barRank.text(function(t,e){return r||0===r?"#"+t.rank:""}))})},_resizeSvg:function(){var t=this.activeProfile,e=t.barHeight,i=t.barMargin;this.barSvg.attr("height",(e+i)*this.sortedEntities.length+"px")},_scroll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.barContainer.select(".vzb-selected");if(!e.empty()){var i=e.datum(),a=this._getBarPosition(i.index),r=this.activeProfile.margin,n=this.height-r.top-r.bottom,o=a-(n+this.activeProfile.barHeight)/2;this.barViewport.transition().duration(t).tween("scrollfor"+i.entity,this._scrollTopTween(o))}},_getLabelText:function(t,e,i){return this.KEYS.map(function(a){return t[e[a]]?t[e[a]][i[a]]:i[a]}).join(", ")},_createAndDeleteBars:function(t){var e=this,i=this.KEYS,a=(this.dataKeys,o(this.sortedEntities,1)),r=a[0];this._entityLabels[r.entity]||(this._entityLabels[r.entity]=r.label);var n=this._getLabelText(this.values,this.labelNames,r.entity),s=this._entityLabels[r.entity]!==n&&this.model.locale.id!==this._localeId;s&&(this._localeId=this.model.locale.id,this._entityLabels[r.entity]=n),t.exit().remove(),t=(s?t:t.enter().append("g")).each(function(t){var a=d3.select(this),r=t.label,n=r.length<12?r:r.substring(0,9)+"...",o=a.select(".vzb-br-label"),l=o.size()?o:a.append("text").attr("class","vzb-br-label").attr("dy",".325em"),c=l.text(r).node().getBBox().width,d=l.text(n).node().getBBox().width;if(Object.assign(t,{labelWidth:c,labelSmallWidth:d,labelSmall:n,barLabel:l}),!s){a.attr("class","vzb-br-bar").classed("vzb-selected",e.model.marker.isSelected(t.entity)).attr("id","vzb-br-bar-"+h.getKey(t.entity,i)+"-"+e._id).on("mousemove",function(t){return e.model.marker.highlightMarker(t.entity)}).on("mouseout",function(){return e.model.marker.clearHighlighted()}).on("click",function(t){e.model.marker.selectMarker(t.entity)});var g=a.append("rect").attr("stroke","transparent"),u=a.append("text").attr("class","vzb-br-value").attr("dy",".325em"),m=a.append("text").attr("class","vzb-br-rank").attr("dy",".325em");Object.assign(t,{self:a,isNew:!0,barRect:g,barValue:u,barRank:m})}}).merge(t)},_getWidestLabelWidth:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=t?"labelWidth":"labelSmallWidth",i=t?"label":"labelSmall",a=this.sortedEntities.reduce(function(t,i){return t[e]<i[e]?i:t}),r=a.barLabel.text(),n=a.barLabel.text(a[i]).node().getBBox().width;return a.barLabel.text(r),n},_drawColors:function(){var t=this,e=this,i=this.dataKeys;this.barContainer.selectAll(".vzb-br-bar>rect").each(function(t){var a=t.entity,r=d3.select(this),n=e.values.color[h.getKey(a,i.color)],o=n||0===n,s=o?String(e._getColor(n)):"rgb(253, 253, 253)",l=o?"transparent":"rgb(51, 51, 51)";r.style("fill")!==s&&r.style("fill",s),r.style("stroke")!==l&&r.style("stroke",l)}),this.barContainer.selectAll(".vzb-br-bar>text").style("fill",function(e){var a=e.entity;return t._getDarkerColor(t.values.color[h.getKey(a,i.color)]||null)})},_getColor:function(t){return d3.rgb(this.cScale(t))},_getDarkerColor:function(t){return this._getColor(t).darker(2)},_scrollTopTween:function(t){return function(){var e=this,i=d3.interpolateNumber(this.scrollTop,t);return function(t){e.scrollTop=i(t)}}},_getBarPosition:function(t){return(this.activeProfile.barHeight+this.activeProfile.barMargin)*t},_entities:{},_sortByIndicator:function(t,e){var i=this,r=this.KEYS;this.KEY,this.dataKeys;return this.markerKeys.map(function(n){var o,s=h.getKey(n,r),l=i._entities[s],c=t[h.getKey(n,e)];!c&&0!==c&&i.nullValuesCount++;var d=i._getLabelText(i.values,i.labelNames,n),g=i._formatter(c);return l?Object.assign(l,{value:c,label:d,formattedValue:g,changedValue:g!==l.formattedValue,changedWidth:c!==l.value,isNew:!1}):i._entities[s]=(o={entity:n,value:c,label:d,formattedValue:g},a(o,i.KEY,s),a(o,"changedValue",!0),a(o,"changedWidth",!0),a(o,"isNew",!0),o)}).sort(function(t,e){var i=t.value,a=e.value;return(a||(0===a?0:-1/0))-(i||(0===i?0:-1/0))}).map(function(t,e,i){return Object.assign(t,{index:e,rank:e&&i[e-1].formattedValue===t.formattedValue?i[e-1].rank:e+1,changedIndex:e!==t.index})})},_selectBars:function(){var t=this,e=this.KEYS,i=this.model.marker.select;this.barContainer.classed("vzb-dimmed-selected",!1),this.barContainer.selectAll(".vzb-br-bar.vzb-selected").classed("vzb-selected",!1),i.length&&(this.barContainer.classed("vzb-dimmed-selected",!0),i.forEach(function(i){t.barContainer.select("#vzb-br-bar-"+(0,l.default)(h.getKey(i,e))+"-"+t._id).classed("vzb-selected",!0)}))},_updateOpacity:function(){var t=this.model.marker,e=t.highlight,i=t.select,a=t.opacityHighlightDim,r=t.opacitySelectDim,n=t.opacityRegular,o=e.length>0,s=i.length>0;this.barContainer.selectAll(".vzb-br-bar").style("opacity",function(e){return o&&t.isHighlighted(e.entity)?1:s?t.isSelected(e.entity)?n:r:o?a:n})},_updateDoubtOpacity:function(t){this.dataWarningEl.style("opacity",t||(this.model.marker.select.length?1:this.wScale(+this.model.time.value.getUTCFullYear().toString())))}},a(n,"_getLabelText",function(t,e,i){return this.KEYS.map(function(a){return t[e[a]]?t[e[a]][i[a]]:i[a]}).join(", ")}),a(n,"_createTooltipInteract",function(t,e){var i=this;return{mouseOver:function(){var a=d3.event,r=d3.mouse(t.node()),n=e.node().getBBox(),o=d3.mouse(e.node());i.tooltipSvg.classed("vzb-hidden",!1),i._setTooltip(d3.select(a.target).attr("data-text"),r[0]-o[0],r[1]-o[1]+n.y)},mouseOut:function(){i.tooltipSvg.classed("vzb-hidden",!0),i._setTooltip()},tap:function(){}}}),a(n,"_setTooltip",function(t,e,i){if(t){this.tooltip.classed("vzb-hidden",!1).selectAll("text").text(t);var a=this.tooltip.select("text").node().getBBox();e-a.width<0?e=a.width+5:e-=5,i-a.height<0?i+=a.height:i-=11,this.tooltip.attr("transform","translate("+e+","+i+")"),this.tooltip.selectAll("rect").attr("width",a.width+8).attr("height",1.2*a.height).attr("x",-a.width-4).attr("y",.85*-a.height).attr("rx",.2*a.height).attr("ry",.2*a.height)}else this.tooltip.classed("vzb-hidden",!0)}),n));e.default=u},function(t,e,i){(function(e){!function(e,i){t.exports=i(e)}("undefined"!=typeof e?e:this,function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,i=String(t),a=i.length,r=-1,n="",o=i.charCodeAt(0);++r<a;)e=i.charCodeAt(r),n+=0!=e?e>=1&&e<=31||127==e||0==r&&e>=48&&e<=57||1==r&&e>=48&&e<=57&&45==o?"\\"+e.toString(16)+" ":(0!=r||1!=a||45!=e)&&(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?i.charAt(r):"\\"+i.charAt(r):"�";return n};return t.CSS||(t.CSS={}),t.CSS.escape=e,e})}).call(e,i(5))},function(t,e){},function(t,e){t.exports='\x3c!-- Bar Chart Component --\x3e\n<div class="vzb-barrankchart">\n <svg class="vzb-br-header">\n <g class="vzb-br-title">\n <text></text>\n </g>\n <g class="vzb-br-total">\n <text></text>\n </g>\n <g class="vzb-br-axis-info vzb-noexport"></g>\n </svg>\n\n <div class="vzb-br-barsviewport vzb-dialog-scrollable">\n <svg class="vzb-br-bars-svg vzb-export">\n <g class="vzb-br-bars"></g>\n </svg>\n </div>\n\n <svg class="vzb-data-warning-svg">\n <g class="vzb-data-warning vzb-noexport">\n <svg></svg>\n <text></text>\n </g>\n <g class="vzb-data-warning vzb-data-warning-missed-positions">\n <text></text>\n </g>\n </svg>\n\n <svg class="vzb-br-tooltip-svg vzb-hidden">\n <g class="vzb-br-tooltip vzb-hidden">\n <rect class="vzb-tooltip-border"></rect>\n <text class="vzb-tooltip-text"></text>\n </g>\n </svg>\n</div>\n'},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===typeof window&&(i=window)}t.exports=i},function(t,e,i){t.exports=i(0)}]);
!function(t){function e(a){if(i[a])return i[a].exports;var r=i[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,a){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=6)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(3);var a=i(1),r=function(t){return t&&t.__esModule?t:{default:t}}(a),n={version:"2.3.0",build:1544532806858};e.default=Vizabi.Tool.extend("BarRankChart",{init:function(t,e){this.name="barrankchart",this.components=[{component:r.default,placeholder:".vzb-tool-viz",model:["state.time","state.marker","locale","ui"]},{component:Vizabi.Component.get("timeslider"),placeholder:".vzb-tool-timeslider",model:["state.time","state.marker","ui"]},{component:Vizabi.Component.get("dialogs"),placeholder:".vzb-tool-dialogs",model:["state","ui","locale"]},{component:Vizabi.Component.get("buttonlist"),placeholder:".vzb-tool-buttonlist",model:["state","ui","locale"]},{component:Vizabi.Component.get("treemenu"),placeholder:".vzb-tool-treemenu",model:["state.marker","state.time","locale","ui"]},{component:Vizabi.Component.get("datanotes"),placeholder:".vzb-tool-datanotes",model:["state.marker","locale"]},{component:Vizabi.Component.get("datawarning"),placeholder:".vzb-tool-datawarning",model:["locale"]},{component:Vizabi.Component.get("steppedspeedslider"),placeholder:".vzb-tool-stepped-speed-slider",model:["state.time","locale"]}],this._super(t,e)},default_model:{state:{time:{autoconfig:{type:"time"}},entities:{autoconfig:{type:"entity_domain",excludeIDs:["tag"]}},entities_colorlegend:{autoconfig:{type:"entity_domain",excludeIDs:["tag"]}},marker:{space:["entities","time"],axis_x:{use:"indicator",autoconfig:{type:"measure"},allow:{scales:["linear","log"]}},label:{use:"property",autoconfig:{includeOnlyIDs:["name"],type:"string"}},color:{syncModels:["marker_colorlegend"],autoconfig:{}}},marker_colorlegend:{space:["entities_colorlegend"],label:{use:"property",which:"name"},hook_rank:{use:"property",which:"rank"},hook_geoshape:{use:"property",which:"shape_lores_svg"}}},locale:{},ui:{chart:{},datawarning:{doubtDomain:[],doubtRange:[]},buttons:["colors","find","moreoptions","presentation","sidebarcollapse","fullscreen"],dialogs:{popup:["timedisplay","colors","find","moreoptions"],sidebar:["timedisplay","colors","find"],moreoptions:["opacity","speed","colors","presentation","about"]},presentation:!1}},versionInfo:n})},function(t,e,i){"use strict";function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var n,o=function(){function t(t,e){var i=[],a=!0,r=!1,n=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){r=!0,n=t}finally{try{!a&&s.return&&s.return()}finally{if(r)throw n}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=i(2),l=function(t){return t&&t.__esModule?t:{default:t}}(s),h=Vizabi.utils,c=Vizabi.helpers["d3.axisWithLabelPicker"],d=Vizabi.iconset.question,g=Vizabi.iconset.warn,u=Vizabi.Component.extend("barrankchart",(n={init:function(t,e){var a=this;this.name="barrankchart",this.template=i(4),this.model_expects=[{name:"time",type:"time"},{name:"marker",type:"marker"},{name:"locale",type:"locale"},{name:"ui",type:"ui"}],this.model_binds={"change:time.value":function(){a.model._ready&&a._readyOnce&&a.onTimeChange()},"change:marker.select":function(){a._readyOnce&&(a._selectBars(),a._updateOpacity(),a._updateDoubtOpacity(),a._scroll())},"change:marker.axis_x.scaleType":function(){a._readyOnce&&a.loadData()&&a.draw(!0)},"change:marker.color.palette":function(){a._drawColors()},"change:marker.highlight":function(){a._updateOpacity()},"change:marker.opacitySelectDim":function(){a._updateOpacity()},"change:marker.opacityRegular":function(){a._updateOpacity()}},this._super(t,e),this.xScale=null,this.cScale=d3.scaleOrdinal(d3.schemeCategory10),this.xAxis=c("bottom")},onTimeChange:function(){var t=this;this.model.marker.getFrame(this.model.time.value,function(e){t.values=e,t.values&&t.loadData()&&t.draw()})},readyOnce:function(){this.element=d3.select(this.element),this.header=this.element.select(".vzb-br-header"),this.infoEl=this.element.select(".vzb-br-axis-info"),this.barViewport=this.element.select(".vzb-br-barsviewport"),this.barSvg=this.element.select(".vzb-br-bars-svg"),this.barContainer=this.element.select(".vzb-br-bars"),this.dataWarningEl=this.element.select(".vzb-data-warning"),this.tooltipSvg=this.element.select(".vzb-br-tooltip-svg"),this.tooltip=this.element.select(".vzb-br-tooltip"),this.missedPositionsWarningEl=this.element.select(".vzb-data-warning-missed-positions");var t=this._createTooltipInteract(this.element,this.missedPositionsWarningEl);this.missedPositionsWarningEl.on("mouseover",t.mouseOver).on("mouseout",t.mouseOut),this.wScale=d3.scaleLinear().domain(this.model.ui.datawarning.doubtDomain).range(this.model.ui.datawarning.doubtRange),this.xAxis.tickFormat(this.model.marker.axis_x.getTickFormatter()),this._localeId=this.model.locale.id,this._entityLabels={},this._presentation=!this.model.ui.presentation,this._formatter=this.model.marker.axis_x.getTickFormatter(),this.ready(),this._selectBars()},ready:function(){var t=this;this.TIMEDIM=this.model.time.getDimension(),this.KEYS=h.unique(this.model.marker._getAllDimensions({exceptType:"time"})),this.KEY=this.KEYS.join(","),this.dataKeys=this.model.marker.getDataKeysPerHook(),this.labelNames=this.model.marker.getLabelHookNames(),this.model.marker.getFrame(this.model.time.value,function(e){t.values=e,t.values&&(t.markerKeys=t.model.marker.getKeys(),t.loadData()&&(t.draw(!0),t._updateOpacity(),t._drawColors()))})},resize:function(){this.draw(!0),this._drawColors()},loadData:function(){var t=this,e=this;this.translator=this.model.locale.getTFunction();var i=this.values.axis_x,a=Object.keys(i).length;if(!a)return!1;this.nullValuesCount=0,this.sortedEntities=this._sortByIndicator(i,this.dataKeys.axis_x),this.header.select(".vzb-br-title").select("text").on("click",function(){return t.parent.findChildByName("gapminder-treemenu").markerID("axis_x").alignX("left").alignY("top").updateView().toggle()}),this.xScale=this.model.marker.axis_x.getScale().copy(),this.cScale=this.model.marker.color.getScale(),h.setIcon(this.dataWarningEl,g).select("svg").attr("width",0).attr("height",0),this.dataWarningEl.append("text").text(this.translator("hints/dataWarning")),this.dataWarningEl.on("click",function(){return t.parent.findChildByName("gapminder-datawarning").toggle()}).on("mouseover",function(){return t._updateDoubtOpacity(1)}).on("mouseout",function(){return t._updateDoubtOpacity()}),this.missedPositionsWarningEl.classed("vzb-hidden",1-this.nullValuesCount/a>.85).select("text").attr("data-text",this.translator("hints/barrank/missedPositionsTooltip")).text(this.translator("hints/barrank/missedPositionsWarning"));var r=this.model.marker.axis_x.getConceptprops();return h.setIcon(this.infoEl,d).select("svg").attr("width",0).attr("height",0).style("opacity",Number(Boolean(r.description||r.sourceLink))),this.infoEl.on("click",function(){t.parent.findChildByName("gapminder-datanotes").pin()}),this.infoEl.on("mouseover",function(){var t=this.getBBox(),i=h.makeAbsoluteContext(this,this.farthestViewportElement),a=i(t.x-10,t.y+t.height+10);e.parent.findChildByName("gapminder-datanotes").setHook("axis_x").show().setPos(a.x,a.y)}),this.infoEl.on("mouseout",function(){e.parent.findChildByName("gapminder-datanotes").hide()}),!0},draw:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.time_1=null==this.time?this.model.time.value:this.time,this.time=this.model.time.value;var e=this.model.time.playing&&this.time-this.time_1>0?this.model.time.delayAnimations:0;this.drawAxes(e,t)||this.drawData(e,t)},drawAxes:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e={small:{margin:{top:60,right:20,left:5,bottom:20},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:5,barHeight:18,barMargin:3,barLabelMargin:5,barValueMargin:5,barRankMargin:6,scrollMargin:25},medium:{margin:{top:60,right:25,left:5,bottom:20},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:5,barHeight:21,barMargin:3,barLabelMargin:5,barValueMargin:5,barRankMargin:10,scrollMargin:30},large:{margin:{top:60,right:30,left:5,bottom:20},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:5,barHeight:28,barMargin:4,barLabelMargin:5,barValueMargin:5,barRankMargin:10,scrollMargin:30}},i={medium:{margin:{top:60,right:30,left:10,bottom:40},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:25,infoElMargin:10,barHeight:25,barMargin:6},large:{margin:{top:60,right:35,left:10,bottom:40},headerMargin:{top:10,right:20,bottom:20,left:20},infoElHeight:16,infoElMargin:10,barHeight:30,barMargin:6}};this.activeProfile=this.getActiveProfile(e,i);var a=this.activeProfile,r=a.margin,n=a.headerMargin,o=a.infoElHeight,s=a.infoElMargin;if(this.height=parseInt(this.element.style("height"),10)||0,this.width=parseInt(this.element.style("width"),10)||0,!this.height||!this.width)return h.warn("Dialog resize() abort: vizabi container is too little or has display:none");this.barViewport.style("height",this.height-r.bottom-r.top+"px"),this.header.attr("height",r.top);var l=this.header.select(".vzb-br-title"),c=this.model.marker.axis_x.getConceptprops(),d=c.name,g=c.unit,u=l.select("text");if(g){u.text(d+", "+g);n.left+l.node().getBBox().width+s+o>this.width-n.right&&u.text(d)}else u.text(d);var m=l.node().getBBox(),b=n.left,p=n.top+m.height;l.attr("transform","translate("+b+", "+p+")");var f=this.infoEl;f.select("svg").attr("width",o+"px").attr("height",o+"px");var v=b+l.node().getBBox().width+s,x=n.top+o/4;f.attr("transform","translate("+v+", "+x+")");var y=this.header.select(".vzb-br-total");t?y.select("text").transition("text").delay(t).text(this.model.time.formatDate(this.time)):y.select("text").interrupt().text(this.model.time.formatDate(this.time)),y.style("opacity",Number("large"!==this.getLayoutProfile()));var _=y.node().getBBox(),w=this.width-n.right-_.width,z=n.top+_.height;y.attr("transform","translate("+w+", "+z+")").classed("vzb-transparent",m.width+_.width+10>this.width),this.element.select(".vzb-data-warning-svg").style("height",r.bottom+"px");var k=this.dataWarningEl.select("text").node().getBBox();this.dataWarningEl.attr("transform","translate("+(this.width-r.right-k.width)+", "+k.height+")"),this.dataWarningEl.select("svg").attr("width",k.height).attr("height",k.height).attr("x",-k.height-5).attr("y",1-k.height),this.missedPositionsWarningEl.attr("transform","translate("+(this.width-r.right-k.width-3*k.height)+", "+k.height+")"),this._updateDoubtOpacity()},drawData:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.KEY;this._createAndDeleteBars(this.barContainer.selectAll(".vzb-br-bar").data(this.sortedEntities,function(t){return t[a]}));var n=this.model.ui.presentation,o=this._presentation!==n;o&&(this._presentation=n);var s="undefined"===typeof this._entitiesCount||this._entitiesCount!==this.sortedEntities.length;(o||s)&&s&&(this._entitiesCount=this.sortedEntities.length),this._resizeSvg(),this._scroll(e),this._drawColors();var l=this.activeProfile,h=l.barLabelMargin,c=l.barValueMargin,d=l.barRankMargin,g=l.scrollMargin,u=l.margin,m=this.model.marker.axis_x,b=m.getLimits(m.which),p=Math.abs(b.max)>=Math.abs(b.min),f=p?b.min<0:b.max>0,v=(this.width-u.right-u.left-h-g-(f?0:this._getWidestLabelWidth()))/(f?2:1);this.xScale.range([0,v]),"log"!==this.model.marker.axis_x.scaleType&&this.xScale.domain([0,Math.max.apply(Math,r(this.xScale.domain()))]);var x=f?v:this._getWidestLabelWidth(),y=function(e){return t.xScale(e)},_=function(t){return p?t>=0:t>0},w=function(t){return _(t)?"end":"start"},z=function(t){return _(t)?"start":"end"},k=function(t){return _(t)?-h:h},C=function(t){return _(t)?c:-c},E=this._getWidestLabelWidth(!0)+(p?u.left:u.right)<x;this.barContainer.attr("transform","translate("+(x+(p?u.left:u.right)+h)+", 0)"),this.sortedEntities.forEach(function(a){var r=a.value;if((i||o||a.isNew||a.changedValue)&&(a.barLabel.attr("x",k(r)).attr("y",t.activeProfile.barHeight/2).attr("text-anchor",w(r)).text(E?a.label:a.labelSmall),a.barRect.attr("rx",t.activeProfile.barHeight/4).attr("ry",t.activeProfile.barHeight/4).attr("height",t.activeProfile.barHeight),a.barValue.attr("x",C(r)).attr("y",t.activeProfile.barHeight/2).attr("text-anchor",z(r)),a.barRank.text(function(t,e){return r||0===r?"#"+t.rank:""}).attr("y",t.activeProfile.barHeight/2)),i||a.changedWidth||o){var n=Math.max(0,r&&y(Math.abs(r)))||0;(i||a.changedValue)&&(a.barValue.text(t._formatter(r)||t.translator("hints/nodata")),a.barValueWidth=c+a.barValue.node().getBBox().width),(i||a.changedWidth||o)&&(a.barRect.transition().duration(e).ease(d3.easeLinear).attr("width",n),a.barRank.transition().duration(e).ease(d3.easeLinear).attr("x",(Math.max(n,a.barValueWidth)+d)*(_(r)?1:-1)).attr("text-anchor",z(r))),a.barRect.attr("x",r<0?-n:0)}(i||a.changedIndex||o)&&(!e&&a.self.interrupt(),(e?a.self.transition().duration(e).ease(d3.easeLinear):a.self).attr("transform","translate(0, "+t._getBarPosition(a.index)+")"),a.barRank.text(function(t,e){return r||0===r?"#"+t.rank:""}))})},_resizeSvg:function(){var t=this.activeProfile,e=t.barHeight,i=t.barMargin;this.barSvg.attr("height",(e+i)*this.sortedEntities.length+"px")},_scroll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.barContainer.select(".vzb-selected");if(!e.empty()){var i=e.datum(),a=this._getBarPosition(i.index),r=this.activeProfile.margin,n=this.height-r.top-r.bottom,o=a-(n+this.activeProfile.barHeight)/2;this.barViewport.transition().duration(t).tween("scrollfor"+i.entity,this._scrollTopTween(o))}},_getLabelText:function(t,e,i){return this.KEYS.map(function(a){return t[e[a]]?t[e[a]][i[a]]:i[a]}).join(", ")},_createAndDeleteBars:function(t){var e=this,i=this.KEYS,a=(this.dataKeys,o(this.sortedEntities,1)),r=a[0];this._entityLabels[r.entity]||(this._entityLabels[r.entity]=r.label);var n=this._getLabelText(this.values,this.labelNames,r.entity),s=this._entityLabels[r.entity]!==n&&this.model.locale.id!==this._localeId;s&&(this._localeId=this.model.locale.id,this._entityLabels[r.entity]=n),t.exit().remove(),t=(s?t:t.enter().append("g")).each(function(t){var a=d3.select(this),r=t.label,n=r.length<12?r:r.substring(0,9)+"...",o=a.select(".vzb-br-label"),l=o.size()?o:a.append("text").attr("class","vzb-br-label").attr("dy",".325em"),c=l.text(r).node().getBBox().width,d=l.text(n).node().getBBox().width;if(Object.assign(t,{labelWidth:c,labelSmallWidth:d,labelSmall:n,barLabel:l}),!s){a.attr("class","vzb-br-bar").classed("vzb-selected",e.model.marker.isSelected(t.entity)).attr("id","vzb-br-bar-"+h.getKey(t.entity,i)+"-"+e._id).on("mousemove",function(t){return e.model.marker.highlightMarker(t.entity)}).on("mouseout",function(){return e.model.marker.clearHighlighted()}).on("click",function(t){e.model.marker.selectMarker(t.entity)});var g=a.append("rect").attr("stroke","transparent"),u=a.append("text").attr("class","vzb-br-value").attr("dy",".325em"),m=a.append("text").attr("class","vzb-br-rank").attr("dy",".325em");Object.assign(t,{self:a,isNew:!0,barRect:g,barValue:u,barRank:m})}}).merge(t)},_getWidestLabelWidth:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=t?"labelWidth":"labelSmallWidth",i=t?"label":"labelSmall",a=this.sortedEntities.reduce(function(t,i){return t[e]<i[e]?i:t}),r=a.barLabel.text(),n=a.barLabel.text(a[i]).node().getBBox().width;return a.barLabel.text(r),n},_drawColors:function(){var t=this,e=this,i=this.dataKeys;this.barContainer.selectAll(".vzb-br-bar>rect").each(function(t){var a=t.entity,r=d3.select(this),n=e.values.color[h.getKey(a,i.color)],o=n||0===n,s=o?String(e._getColor(n)):"rgb(253, 253, 253)",l=o?"transparent":"rgb(51, 51, 51)";r.style("fill")!==s&&r.style("fill",s),r.style("stroke")!==l&&r.style("stroke",l)}),this.barContainer.selectAll(".vzb-br-bar>text").style("fill",function(e){var a=e.entity;return t._getDarkerColor(t.values.color[h.getKey(a,i.color)]||null)})},_getColor:function(t){return d3.rgb(this.cScale(t))},_getDarkerColor:function(t){return this._getColor(t).darker(2)},_scrollTopTween:function(t){return function(){var e=this,i=d3.interpolateNumber(this.scrollTop,t);return function(t){e.scrollTop=i(t)}}},_getBarPosition:function(t){return(this.activeProfile.barHeight+this.activeProfile.barMargin)*t},_entities:{},_sortByIndicator:function(t,e){var i=this,r=this.KEYS;this.KEY,this.dataKeys;return this.markerKeys.map(function(n){var o,s=h.getKey(n,r),l=i._entities[s],c=t[h.getKey(n,e)];!c&&0!==c&&i.nullValuesCount++;var d=i._getLabelText(i.values,i.labelNames,n),g=i._formatter(c);return l?Object.assign(l,{value:c,label:d,formattedValue:g,changedValue:g!==l.formattedValue,changedWidth:c!==l.value,isNew:!1}):i._entities[s]=(o={entity:n,value:c,label:d,formattedValue:g},a(o,i.KEY,s),a(o,"changedValue",!0),a(o,"changedWidth",!0),a(o,"isNew",!0),o)}).sort(function(t,e){var i=t.value,a=e.value;return(a||(0===a?0:-1/0))-(i||(0===i?0:-1/0))}).map(function(t,e,i){return Object.assign(t,{index:e,rank:e&&i[e-1].formattedValue===t.formattedValue?i[e-1].rank:e+1,changedIndex:e!==t.index})})},_selectBars:function(){var t=this,e=this.KEYS,i=this.model.marker.select;this.barContainer.classed("vzb-dimmed-selected",!1),this.barContainer.selectAll(".vzb-br-bar.vzb-selected").classed("vzb-selected",!1),i.length&&(this.barContainer.classed("vzb-dimmed-selected",!0),i.forEach(function(i){t.barContainer.select("#vzb-br-bar-"+(0,l.default)(h.getKey(i,e))+"-"+t._id).classed("vzb-selected",!0)}))},_updateOpacity:function(){var t=this.model.marker,e=t.highlight,i=t.select,a=t.opacityHighlightDim,r=t.opacitySelectDim,n=t.opacityRegular,o=e.length>0,s=i.length>0;this.barContainer.selectAll(".vzb-br-bar").style("opacity",function(e){return o&&t.isHighlighted(e.entity)?1:s?t.isSelected(e.entity)?n:r:o?a:n})},_updateDoubtOpacity:function(t){this.dataWarningEl.style("opacity",t||(this.model.marker.select.length?1:this.wScale(+this.model.time.value.getUTCFullYear().toString())))}},a(n,"_getLabelText",function(t,e,i){return this.KEYS.map(function(a){return t[e[a]]?t[e[a]][i[a]]:i[a]}).join(", ")}),a(n,"_createTooltipInteract",function(t,e){var i=this;return{mouseOver:function(){var a=d3.event,r=d3.mouse(t.node()),n=e.node().getBBox(),o=d3.mouse(e.node());i.tooltipSvg.classed("vzb-hidden",!1),i._setTooltip(d3.select(a.target).attr("data-text"),r[0]-o[0],r[1]-o[1]+n.y)},mouseOut:function(){i.tooltipSvg.classed("vzb-hidden",!0),i._setTooltip()},tap:function(){}}}),a(n,"_setTooltip",function(t,e,i){if(t){this.tooltip.classed("vzb-hidden",!1).selectAll("text").text(t);var a=this.tooltip.select("text").node().getBBox();e-a.width<0?e=a.width+5:e-=5,i-a.height<0?i+=a.height:i-=11,this.tooltip.attr("transform","translate("+e+","+i+")"),this.tooltip.selectAll("rect").attr("width",a.width+8).attr("height",1.2*a.height).attr("x",-a.width-4).attr("y",.85*-a.height).attr("rx",.2*a.height).attr("ry",.2*a.height)}else this.tooltip.classed("vzb-hidden",!0)}),n));e.default=u},function(t,e,i){(function(e){!function(e,i){t.exports=i(e)}("undefined"!=typeof e?e:this,function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=function(t){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var e,i=String(t),a=i.length,r=-1,n="",o=i.charCodeAt(0);++r<a;)e=i.charCodeAt(r),n+=0!=e?e>=1&&e<=31||127==e||0==r&&e>=48&&e<=57||1==r&&e>=48&&e<=57&&45==o?"\\"+e.toString(16)+" ":(0!=r||1!=a||45!=e)&&(e>=128||45==e||95==e||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)?i.charAt(r):"\\"+i.charAt(r):"�";return n};return t.CSS||(t.CSS={}),t.CSS.escape=e,e})}).call(e,i(5))},function(t,e){},function(t,e){t.exports='\x3c!-- Bar Chart Component --\x3e\n<div class="vzb-barrankchart">\n <svg class="vzb-br-header">\n <g class="vzb-br-title">\n <text></text>\n </g>\n <g class="vzb-br-total">\n <text></text>\n </g>\n <g class="vzb-br-axis-info vzb-noexport"></g>\n </svg>\n\n <div class="vzb-br-barsviewport vzb-dialog-scrollable">\n <svg class="vzb-br-bars-svg vzb-export">\n <g class="vzb-br-bars"></g>\n </svg>\n </div>\n\n <svg class="vzb-data-warning-svg">\n <g class="vzb-data-warning vzb-noexport">\n <svg></svg>\n <text></text>\n </g>\n <g class="vzb-data-warning vzb-data-warning-missed-positions">\n <text></text>\n </g>\n </svg>\n\n <svg class="vzb-br-tooltip-svg vzb-hidden">\n <g class="vzb-br-tooltip vzb-hidden">\n <rect class="vzb-tooltip-border"></rect>\n <text class="vzb-tooltip-text"></text>\n </g>\n </svg>\n</div>\n'},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===typeof window&&(i=window)}t.exports=i},function(t,e,i){t.exports=i(0)}]);
//# sourceMappingURL=barrankchart.min.js.map
{
"name": "vizabi-barrankchart",
"version": "2.2.2",
"version": "2.3.0",
"description": "Bar rank chart tool for Vizabi 📊",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc