From 047dfb6e4a330a655ef3cd04a34b52c557b18b6d Mon Sep 17 00:00:00 2001 From: Martin Heinzerling Date: Fri, 5 Dec 2014 13:55:45 +0100 Subject: [PATCH] JENKINS-16580: crop plots to fit screen with extra margin --- resources/test/crop100.png | Bin 0 -> 6367 bytes resources/test/crop5.png | Bin 0 -> 7466 bytes .../jacoco/model/CoverageGraphLayout.java | 23 +++++++++++++++ .../plugins/jacoco/model/CoverageObject.java | 27 ++++++++++++++++++ .../jacoco/model/CoverageObjectGraphTest.java | 24 ++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 resources/test/crop100.png create mode 100644 resources/test/crop5.png diff --git a/resources/test/crop100.png b/resources/test/crop100.png new file mode 100644 index 0000000000000000000000000000000000000000..fbe29071148a9a926668016fb310e28c6958269a GIT binary patch literal 6367 zcmcIpcT`i^z79>Al#!wmX@Vdipu-3#LJ$<`NEbp!M5F|yNkT$V!BHt9WdLc?dy_;; zD58WS5Rpz2q)9?oLnr}xCpd52J8#{8-dpRPwRTp>-e;eEe)ao4{=8{=gNI9m3j_l3 z80cTK0D+jO!1r#BBfzKFNdYnlbfU=M+EuFuldD8NxEPj>*d5Doe|N z2KN--k8u}bgcJm7PoGAiwh-AQM8_r{bv>|;o^oa865m$p{kL1FflGs70|HVY5dWqd zEx4wl!nmQK!LO~V%2dI&$|^XxfwnR+7r#lPHQl$iPMMsXEV&K>?Fo{JL}G7u_e~w0 z=#bUPg?PsYGmpzEDy%|6&tK#Js)DVR4UR%-G4{=2#0wcO%9u4IKk zAhy5#`RAW&SLm|)+c-!F)X6E^(8y?He4HFVW!sx9XIW&tj;8vbJz6=7X^J-F~qoZAMI*UV!Z!*o|FH4&p^hKR@xAj&cv>RFzOWoQ^AhYuW?%kHg^RY+qf1FwJEFX#)fFZ!2W+Odtth9Nr)GYXu{0w$I}GdV8&)P_Pngy4CUe_3OPo zJpt1ySS+@zs>vR_V}aQSUiuy6^2>?&ju32;>Bw z6wXiXiWyYILrMz^ulJ=Xhtl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!HF-CQ0S9xnLrNCX&v{?n&ie=pKEGJ2M(?7T*+ud929V?T1lA$M_caUH<*eSLkF zUS6dlU@$R&ZpfhX$#UX;C-aX|2L?C+=SKt;FNeacq z#VUQk77+F(6BHB+Z^#_+>s-xLgNf1hfByXW+df0;ikv$^zQOhXppjj(%l(JOA_WLU zPte-`(Yld$xu^_tqJAk_hi#Pw#BUOnosuF%5fKr0b6 zZ%YLMh|%i(*-HBc`4*VKGv7ynAD#+XeRLfy?Vsr#7%2KZ-X<4%V&YlwyGNW1w>TFY zr_WYFaorzZUHZ)SDOC~r=E1kwZgGWM)vsnxH1@odZ65oQbjHYm2>7ybOjhrp!>hW- z>vK_~@6vFo2n5wqZb=%Gaxa$Cl`+Yf7hb3v{E(#)YH=xlV|Tf_xf)F~C^5e+FeiNO zmi7Yqtl~cW)Ai$x=^KDrtQ5JDu+c-3p$%3^bBv^o%up$xi9g>4%&CuD;1brNbzx%6 z?d>x(R72Ms#`@lO+ht9VZvsJ#fW*QxkAf2jD--p^*A97O3-~S#y`th`S%*;C&Ru~z zU7)I#N{D`FAT0K0F8&0azyfj1fNl=xat@!rKF6e~r(C$dMGSR*Ak>)$LqUoBQnpa& zGW_MJRGnU77VkT<&*YmPlhbI+q=khAhJuO%8bxmKm5nx@{KQ9(9&MmXKI`U+yXO5^ zM8jWMw{D)l01q+9^_5iZbrmlGh-dD7J;|V~C4f(K7ApuV+P{DDNwP-lQoe8OT2=Gf zkTU8U_twNMOG^PQCp){a_J#TjuQt1UO`l)~=~Il>YNya2L#3VM+r>zqg6^+9M@9Rk@d*}2B$@tOPdE!b zQxl;KORiHch>$}#JMhP=kPUH97a0@Ee@{&6s;OS_ksMgjCG8En2j#yo75$zqHW$SU z{5kjMW4+74-G~frb{J~uH_*BlqmKNNJb#I8Al&-{7TkG!R#8RdJ literal 0 HcmV?d00001 diff --git a/resources/test/crop5.png b/resources/test/crop5.png new file mode 100644 index 0000000000000000000000000000000000000000..529d4d7f1ea733656d0149b01362d73068b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`XoJ-X4Yo;JjKSvng zNZa@K+Sr)AaB}0M3GN&mP!cm+(GVaWw7d1B?8d7jGe98Eqx6hXma0M5uXBn-ELUrH zW3h!)5`g3wCzi6=d~7U+_~_fVybcpVT1Nv@xaqL%E$4-;nXt56WND9K!Fix=LT~Ib z981h05Hgctk{fOeECNW!QC9^)GIPhst`3ME5K7GO#EF5z)E!5*gA)+LPb~dTWw)u~ zTCOTQgA^LgI=)EYV5xtxv46#%Qqqs)0^4|cmWB}PWLXCyKlr(jw}F^trQJNx9unVP z;~jyp{t-80O}p8+E9T1Pi*mSe1JKMs{8a}{)1gqHj~$|UczDQeHtz!>hV7vNGA&81H`LNf=`zK%xe*U@Nt2Nb`Lj&OhM z@0euMxGrq8jeC~K%AGrRd^||Q6?XPpxBJTyl`XXF#7ke{ zqtEQgRO^dB3qSin>P?^tcQw{puTHna$J{JU{z^L<9MngOLBcZ;5Qk!ix91#;;9k92-jlCqg;nd*Xe}yl@=H%WV@DFiO>Ta1$ z3nec1e>}+6T$?ic0K=W*NS3o<42d1jP=nSU(KZ_{kzA#o70DB6RQ8tW_12rB6BQL6 zelQaa_LcI$L;^> createDataSetB for (Axis axis : layout.getAxes()) { builders.put(axis, new DataSetBuilder()); + if (axis.isCrop()) bounds.put(axis, new Bounds()); } Map last = new HashMap(); @@ -406,6 +408,7 @@ protected Map> createDataSetB if (axis.isSkipZero() && (value == null || value.floatValue() == 0f)) value = null; if (value != null) { + if (axis.isCrop()) bounds.get(axis).update(value); last.put(plot, value); } else @@ -428,6 +431,20 @@ abstract class GraphImpl extends Graph { private CoverageObject obj; private CoverageGraphLayout layout; + protected Map bounds=new HashMap(); + + protected class Bounds + { + float min=Float.MAX_VALUE; + float max=Float.MIN_VALUE; + + public void update(Number value) + { + float v=value.floatValue(); + if (min>v) min=v; + if (max obj, Calendar timestamp, int defaultW, int defaultH, CoverageGraphLayout layout) { super(timestamp, defaultW, defaultH); @@ -481,12 +498,22 @@ protected JFreeChart createGraph() { NumberAxis numberAxis = new NumberAxis(axis.getLabel()); plot.setRangeAxis(axisId, numberAxis); numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); //TODO + setBounds(axis, numberAxis); axisId++; } layout.apply(chart); return chart; } + + private void setBounds(Axis a, ValueAxis axis) + { + if (!a.isCrop()) return; + Bounds bounds = this.bounds.get(a); + float border = (bounds.max - bounds.min) / 100 * a.getCrop(); + axis.setUpperBound(bounds.max + border); + axis.setLowerBound(Math.max(0, bounds.min - border)); + } } @Override diff --git a/src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java b/src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java index d587f50c..3a822d43 100644 --- a/src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java +++ b/src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java @@ -103,6 +103,30 @@ public void multipleAccessAndDifferentCoverageType() throws IOException assertGraph(chart, "multiple.png"); } + @Test + public void crop5() throws IOException + { + CoverageGraphLayout layout = new CoverageGraphLayout() + .baseStroke(2f) + .axis().crop(5).skipZero() + .plot().type(CoverageType.BRANCH).value(CoverageValue.PERCENTAGE).color(Color.RED); + + JFreeChart chart = createTestCoverage().createGraph(new GregorianCalendar(), WIDTH, HEIGHT, layout).getGraph(); + assertGraph(chart, "crop5.png"); + } + + @Test + public void crop100() throws IOException + { + CoverageGraphLayout layout = new CoverageGraphLayout() + .baseStroke(2f) + .axis().crop(100).skipZero() + .plot().type(CoverageType.BRANCH).value(CoverageValue.PERCENTAGE).color(Color.RED); + + JFreeChart chart = createTestCoverage().createGraph(new GregorianCalendar(), WIDTH, HEIGHT, layout).getGraph(); + assertGraph(chart, "crop100.png"); + } + @Test public void skipZero() throws IOException {