%% %% This is file `dynam-js.def', %% generated with the docstrip utility. %% %% The original source files were: %% %% bargraph-js.dtx (with options: `copyright,dynam') %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% bargraph-js.sty package, %% %% Copyright (C) 2019 %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% %% the terms of the LaTeX Project Public License %% %% Distributed from CTAN archives in directory %% %% macros/latex/base/lppl.txt; either version 1.2 of the %% %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{insDLJS}{dynam}{Display dynamic bar graphs} function displayDyBargraph(env,aPr,bPmf,bOptimize) { if (typeof aPr[0]=="undefined") return; var aBars=dataForEnv[env].bgs; var bar=env+"@"+dataForEnv[env].bgs[0]; var n=aPr.length; var index=(bPmf)?1:2; var bc=color.red; var fc=color.blue; var lbl=_labelDyBars; if (arguments.length>4) { var o=arguments[4]; bc=(o.bc==undefined)?bc:o.bc; fc=(o.fc==undefined)?fc:o.fc; var lbl=(o.lbl==undefined)?_labelDyBars:o.lbl; } else { var f=this.getField(bar+".bar0"); if ( f !=null ) { bc=f.strokeColor; fc=f.fillColor; } } var hbar=bar.replace(/@/,"@x"); // dps07 this.removeField(bar); var pos=hbar.indexOf("@"); var env=hbar.substring(0,pos); // get aux info, begin with var hb=this.getField(hbar); var f=hb.getArray()[0]; var pg=f.page; var wd=dataForEnv[env].width; var ht=dataForEnv[env].height; var isHoriz=dataForEnv[env].horiz; var frameH=ht; // frameH is one unit high if (bPmf&&bOptimize) { var maxValue=0; for (var i=0; imaxValue) maxValue=aPr[i][index]; } var w=wd/(n+1); var r=f.rect; var defwidth=r[2]-r[0]; if (defwidth*(n+1)>=wd) r[2]=r[0]+w; else w=defwidth; var gap=-1; // contiguous boundaries overlap var sf=(bPmf&&bOptimize)?frameH/maxValue:frameH; for (var i=0; i