diff --git a/R/inst/java/brunel-core-2.0.jar b/R/inst/java/brunel-core-2.0.jar index fb1eeed8..ec9eaa1d 100644 Binary files a/R/inst/java/brunel-core-2.0.jar and b/R/inst/java/brunel-core-2.0.jar differ diff --git a/R/inst/java/brunel-data-2.0.jar b/R/inst/java/brunel-data-2.0.jar index 458e8232..a9b7b6f6 100644 Binary files a/R/inst/java/brunel-data-2.0.jar and b/R/inst/java/brunel-data-2.0.jar differ diff --git a/python/brunel/brunel_ext/brunel.2.0.css b/python/brunel/brunel_ext/brunel.2.0.css index 07ed2f08..0a4909a6 100644 --- a/python/brunel/brunel_ext/brunel.2.0.css +++ b/python/brunel/brunel_ext/brunel.2.0.css @@ -25,7 +25,7 @@ } .brunel .brunel .axis * { - shape-rendering:crispEdges + shape-rendering: crispEdges } .brunel .grid { @@ -132,13 +132,13 @@ } .brunel .overlap { - visibility:hidden; + visibility: hidden; } .brunel .header { fill: #0b9bdb; font-size: 18px; - font-weight:bold; + font-weight: bold; stroke: none; pointer-events: none; } @@ -146,13 +146,12 @@ .brunel .footer { fill: #888888; font-size: 12px; - font-weight:normal; - label-location:right; + font-weight: normal; + label-location: right; stroke: none; pointer-events: none; } - .brunel .labels text { text-shadow: 1px 1px 5px white, -1px -1px 5px white, -1px 1px 5px white, 1px -1px 5px white } @@ -171,7 +170,7 @@ .brunel path.element.guide { stroke-width: 1px; stroke: lightGray; - stroke-dasharray:10 5 + stroke-dasharray: 10 5 } .brunel .element.bar, .brunel .element.polygon, .brunel .element.area, .brunel .element.line.filled, .brunel .element.path.filled { @@ -238,7 +237,7 @@ .brunel .mark.L4 { stroke: #a0a0a0; - fill:white; + fill: white; } .brunel .label.L1 { @@ -355,6 +354,24 @@ div.brunel.tooltip.below:after { pointer-events: all; } +.brunel .crosshairs * { + pointer-events: none; +} + +.brunel .crosshairs line { + stroke: red; + stroke-dasharray: 8 4; +} + +.brunel .crosshairs circle { + stroke: red; + fill: none; +} + +.brunel .crosshairs text { + fill: red; +} + .ui-slider { width: 200px; } diff --git a/python/brunel/brunel_ext/brunel.2.0.min.js b/python/brunel/brunel_ext/brunel.2.0.min.js index 086683b6..5fcf80e8 100644 --- a/python/brunel/brunel_ext/brunel.2.0.min.js +++ b/python/brunel/brunel_ext/brunel.2.0.min.js @@ -33,15 +33,14 @@ a.k*b.x}).attr("cy",function(b){return a.y+a.k*b.y}).each(function(b){var c=this b,c){b.selection().each(function(e){null!=e.row&&(e=b.data().field("#row").value(e.row),a(this,(e.items?e.items:[e]).map(function(a){return a-1})).build(c))})},time:function(a){if(console){var b=(new Date).getTime();l&&console.log("[Time] "+m+" -> "+a+":\t"+(b-l));l=b;m=a}},interpolate:function(a,b,c){return(a+b)/2+c*(b-a)},animateBuild:function(a,b,c){function e(a){var c,f,g,j={},k=[];h.elements.forEach(function(e){if(f=e.fields[a])for(c=0;cb?f=g:e=g;return b-a(c[e])g;g++)l(k.append("line").attr("class","dim"+Math.floor(g/2)+" part"+g),"stroke","8 4");l(k.append("circle").style("fill","none"),"stroke");l(k.append("text").attr("class","dim0").attr("dy","-0.3em"),"fill");l(k.append("text").attr("class","dim1").attr("dy","-0.3em"),"fill")}if(a){a.points?(b=d3.mouse(b),p=j(a.points,b[0],b[1],e),a=p.x,e=p.y):(e=b.getBBox(),a=e.x+e.width/2,e=e.y+e.height/ -2);h.x.invert||f(h.x);h.y.invert||f(h.y);var m=h.x.invert(a),r=h.y.invert(e);b=h.x.range()[0];g=h.x.range()[1];l=h.y.range()[0];h=h.y.range()[1];m=c.data().field(c.fields.x[0]).format(m);c=c.data().field(c.fields.y[0]).format(r);k.selectAll("line.dim0").attr("x1",a).attr("x2",a);k.selectAll("line.dim1").attr("y1",e).attr("y2",e);k.select("line.part0").attr("y1",l).attr("y2",e+10);k.select("line.part1").attr("y1",e-10).attr("y2",h);k.select("line.part2").attr("x1",b).attr("x2",a-10);k.select("line.part3").attr("x1", -a+10).attr("x2",g);k.select("circle").attr("cx",a).attr("cy",e).attr("r",10);k.select("text.dim0").attr("x",a).attr("y",l).text(" "+m);k.select("text.dim1").attr("y",e).attr("x",b).text(" "+c);k.style("visibility","visible")}else k.style("visibility","hidden")}},filterTicks:function(a){var b=a.domain();if(3>b.length)return b;a=a.range();a=Math.abs(a[1]-a[0]);var c=Math.ceil(16*b.length/a);return 2>c?b:b.filter(function(a,b){return!(b%c)})},closestOnPath:j,closest:function(a,b,c){var e,f,g,j,h,k,l= -{distance:9E99};a.each(function(a){k=this;e=e||d3.mouse(this);a.points?a.points.forEach(function(c){f=0;"y"!=b&&(f+=(c.x-e[0])*(c.x-e[0]));"x"!=b&&(f+=(c.y-e[1])*(c.y-e[1]));fc&&(l.item=null);return l},panzoom:function(a, -b){var c=b.translate()[0],e=b.translate()[1],f=b.scale();a&&(c=a.dx||c,e=a.dy||e,f=a.s||f,b.translate([c,e]).scale(f));return{dx:c,dy:e,s:f}},restrictZoom:function(a,b,c){var e=a.x,f=a.y;a=a.k;var g=b.inner_width;b=b.inner_height;var j=0.5*g,h=0.5*b;e+a*gg-j&&(e=g-j);f+a*bb-h&&(f=b-h);e=d3.zoomIdentity.translate(e,f).scale(a);return c.__zoom=e},geoStream:function(a){var b,c,e;return d3.geoTransform({lineStart:function(){c=e=null;this.stream.lineStart()},lineEnd:function(){c= -e=null;this.stream.lineEnd()},point:function(f,g){-85f&&(f=Math.min(180,f+360)),-150>c&&150(e[0]-b[0])*(e[0]-b[0])+(e[1]-b[1])*(e[1]-b[1])))e=b,this.stream.point(b)}})},winkel3:function(){return d3.geoProjection(function(a,b){var c=Math.acos(Math.cos(b)*Math.cos(a/2)),c=1E-6>Math.abs(c)?1:Math.sin(c)/c;return[Math.cos(b)*Math.sin(a/2)/c+a/Math.PI,(Math.sin(b)*c+b)/2]})},setAspect:function(a,b,c){if(a.domain()&&!(2!=a.domain().length|| -!b.domain()||2!=b.domain().length)){var e=0!=a.range()[1]?a.range()[1]:a.range()[0],f=0!=b.range()[0]?b.range()[0]:b.range()[1],g=a.domain()[0].getTime,j=b.domain()[0].getTime,h=BrunelData.Data.asNumeric(a.domain()[1]),k=BrunelData.Data.asNumeric(a.domain()[0]),l=BrunelData.Data.asNumeric(b.domain()[1]),m=BrunelData.Data.asNumeric(b.domain()[0]),s=k>h?-1:1,t=m>l?-1:1,h=Math.abs(h-k),l=Math.abs(l-m),l=Math.max(h/e,l/f);c=k+c*l*e*s;f=m+l*f*t;g&&(k=BrunelData.Data.asDate(k),c=BrunelData.Data.asDate(c)); -j&&(m=BrunelData.Data.asDate(m),f=BrunelData.Data.asDate(f));a.domain([k,c]);b.domain([m,f])}}}}();var BrunelData=function(){var h={extend:function(a,b){var c,e=b.prototype;a.prototype=new function(){};a.prototype.constructor=a;a.$superConstructor=b;a.$super=e;for(c in e)e.hasOwnProperty(c)&&(a.prototype[c]=e[c])},superconstruct:function(a){a.constructor.$superConstructor.apply(a,Array.prototype.slice.call(arguments,1))},extendEnum:function(a){var b=[],c=0,e;for(e in a)if(a.hasOwnProperty(e)){var f=a[e];f.constructor==a&&"prototype"!=e&&(f._ordinal=c++,f._name=e,f.toString=function(){return this._name}, +"grid "+(e?"x":"y")).merge(a);e?g.attr("y1",0).attr("y2",c).attr("x1",f).attr("x2",f):g.attr("x1",0).attr("x2",c).attr("y1",f).attr("y2",f);a.exit().remove()},crosshairs:function(a,b,c,e){function f(a){a.invert=function(b){for(var c=a.domain(),e=0,f=c.length-1,g;1b?f=g:e=g;return b-a(c[e])g;g++)k.append("line").attr("class","dim"+Math.floor(g/2)+" part"+g);k.append("circle").style("fill","none");k.append("text").attr("class","dim0").attr("dy","-0.3em");k.append("text").attr("class","dim1").attr("dy","-0.3em")}if(a){a.points?(b=d3.mouse(b),p=j(a.points,b[0],b[1],e),a=p.x,e=p.y):(e=b.getBBox(),a=e.x+e.width/2,e=e.y+e.height/2);h.x.invert||f(h.x);h.y.invert||f(h.y);var l=h.x.invert(a),m=h.y.invert(e);b=h.x.range()[0];g=h.x.range()[1];var r=h.y.range()[0],h=h.y.range()[1],l=c.data().field(c.fields.x[0]).format(l); +c=c.data().field(c.fields.y[0]).format(m);k.selectAll("line.dim0").attr("x1",a).attr("x2",a);k.selectAll("line.dim1").attr("y1",e).attr("y2",e);k.select("line.part0").attr("y1",r).attr("y2",e+10);k.select("line.part1").attr("y1",e-10).attr("y2",h);k.select("line.part2").attr("x1",b).attr("x2",a-10);k.select("line.part3").attr("x1",a+10).attr("x2",g);k.select("circle").attr("cx",a).attr("cy",e).attr("r",10);k.select("text.dim0").attr("x",a).attr("y",r).text(" "+l);k.select("text.dim1").attr("y",e).attr("x", +b).text(" "+c);k.style("visibility","visible")}else k.style("visibility","hidden")}},filterTicks:function(a){var b=a.domain();if(3>b.length)return b;a=a.range();a=Math.abs(a[1]-a[0]);var c=Math.ceil(16*b.length/a);return 2>c?b:b.filter(function(a,b){return!(b%c)})},closestOnPath:j,closest:function(a,b,c){var e,f,g,j,h,k,l={distance:9E99};a.each(function(a){k=this;e=e||d3.mouse(this);a.points?a.points.forEach(function(c){f=0;"y"!=b&&(f+=(c.x-e[0])*(c.x-e[0]));"x"!=b&&(f+=(c.y-e[1])*(c.y-e[1]));fc&&(l.item=null);return l},panzoom:function(a,b){var c=b.translate()[0],e=b.translate()[1],f=b.scale();a&&(c=a.dx||c,e=a.dy||e,f=a.s||f,b.translate([c,e]).scale(f));return{dx:c,dy:e,s:f}},restrictZoom:function(a,b,c){var e= +a.x,f=a.y;a=a.k;var g=b.inner_width;b=b.inner_height;var j=0.5*g,h=0.5*b;e+a*gg-j&&(e=g-j);f+a*bb-h&&(f=b-h);e=d3.zoomIdentity.translate(e,f).scale(a);return c.__zoom=e},geoStream:function(a){var b,c,e;return d3.geoTransform({lineStart:function(){c=e=null;this.stream.lineStart()},lineEnd:function(){c=e=null;this.stream.lineEnd()},point:function(f,g){-85f&&(f=Math.min(180,f+360)),-150>c&&150 +(e[0]-b[0])*(e[0]-b[0])+(e[1]-b[1])*(e[1]-b[1])))e=b,this.stream.point(b)}})},winkel3:function(){return d3.geoProjection(function(a,b){var c=Math.acos(Math.cos(b)*Math.cos(a/2)),c=1E-6>Math.abs(c)?1:Math.sin(c)/c;return[Math.cos(b)*Math.sin(a/2)/c+a/Math.PI,(Math.sin(b)*c+b)/2]})},setAspect:function(a,b,c){if(a.domain()&&!(2!=a.domain().length||!b.domain()||2!=b.domain().length)){var e=0!=a.range()[1]?a.range()[1]:a.range()[0],f=0!=b.range()[0]?b.range()[0]:b.range()[1],g=a.domain()[0].getTime,j= +b.domain()[0].getTime,h=BrunelData.Data.asNumeric(a.domain()[1]),k=BrunelData.Data.asNumeric(a.domain()[0]),l=BrunelData.Data.asNumeric(b.domain()[1]),m=BrunelData.Data.asNumeric(b.domain()[0]),s=k>h?-1:1,t=m>l?-1:1,h=Math.abs(h-k),l=Math.abs(l-m),l=Math.max(h/e,l/f);c=k+c*l*e*s;f=m+l*f*t;g&&(k=BrunelData.Data.asDate(k),c=BrunelData.Data.asDate(c));j&&(m=BrunelData.Data.asDate(m),f=BrunelData.Data.asDate(f));a.domain([k,c]);b.domain([m,f])}}}}();var BrunelData=function(){var h={extend:function(a,b){var c,e=b.prototype;a.prototype=new function(){};a.prototype.constructor=a;a.$superConstructor=b;a.$super=e;for(c in e)e.hasOwnProperty(c)&&(a.prototype[c]=e[c])},superconstruct:function(a){a.constructor.$superConstructor.apply(a,Array.prototype.slice.call(arguments,1))},extendEnum:function(a){var b=[],c=0,e;for(e in a)if(a.hasOwnProperty(e)){var f=a[e];f.constructor==a&&"prototype"!=e&&(f._ordinal=c++,f._name=e,f.toString=function(){return this._name}, f.ordinal=function(){return this._ordinal},b.push(f))}a.values=function(){return b}},copy:function(a,b){for(var c in b)a[c]=b[c]},iter:function(a){return new h.Iterator(a)},equals:function(a,b){return a===b?!0:null===a||null===b||typeof a!=typeof b?!1:"function"==typeof b.equals?a.equals(b):"function"==typeof a.getTime?a.getTime()==b.getTime():a==b},hash:function(a){return!a?"#":"function"==typeof a.hashCode?a.hashCode():"#"+String(a)},toArray:function(a){return a.constructor===Array?a:"function"== typeof a.toArray?a.toArray():[a]},Array:function(a,b){var c=Array(a),e=a;if(2e)return 1;if("function"==typeof a.compareTo)return a.compareTo(b);"function"==typeof a.getTime&&(a=a.getTime(),b=b.getTime());return ab?1:0},addAll:function(a, b){for(var c=0;c