DiaColloDB-WWW

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	* fixed "Use of uninitialized value $cwd in chdir" bug in dcdb-www-server.perl
	* added pass-through for 'onepass' option in share/htdocs/dc-common.ttk , diacollo.js

v0.01.006 Wed, 13 Apr 2016 13:46:21 +0200 moocow
	* diacollo.js submit-on-enter for ie 11

v0.01.005 Wed, 13 Apr 2016 13:46:21 +0200 moocow
	* diacollo.js fixes for internet exploder / win7

v0.01.004 Mon, 07 Mar 2016 09:04:48 +0100 moocow
	* diacollo.js: use jquery-ui for hicharts 'details' popup
	  - eliminates need for highslide.js dependency (overly restrictive license)
	  - enables info popups in standalone mode
	* added license files for included third-party libraries (d3.layout.cloud.js, purl.js)
	* added attribution for third-party code to README

v0.01.003 Fri, 04 Mar 2016 14:14:44 +0100 moocow
	* fixed File::MimeInfo -> MIME::Types dependency

v0.01.002 Fri, 04 Mar 2016 09:01:28 +0100 moocow
	* added missing prereq DiaColloDB (oops)

v0.01.001 Thu, 03 Mar 2016 15:09:26 +0100 moocow

share/htdocs/diacollo.css  view on Meta::CPAN

    stroke: #ccc;
}
.content:focus #d3frame {
    stroke: #808080;
}
#d3background {
    fill: #fff;
}

/*--------------------------------------------------------------
 * profile data: d3: common: details popup
 */
#profileDataPopup td.num {
  text-align: right;
}
#profileDataPopup .details { 
  vertical-align: middle;
}
#profileDataPopup .details table { 
  margin-top: 2px;
  border: 1px solid #aaa;

share/htdocs/diacollo.js  view on Meta::CPAN



//----------------------------------------------------------------------
// d3: common variables & utilities

var dforce, dcloud, dcur, dsnapto, dkeys, dlabels, itemid, items;
var dcpScoreRange; //-- [minScore,maxScore]
var dcpValueNull;  //-- null value
var dcpSizeRange;  //-- [minSize,maxSize]
var dcpItemSize;   //-- interpolating accessor for item size (cloud:font-size, bubble:radius)
var d3InfoCur;     //-- currently selected info-popup data

var brushInterp;  //-- function variable for brush interpolation
var brushSnap;    //-- function variable for brush snap

// data = dcpParseFlat(dataStr,opts)
//  + parses profile data into flat d3-friendly format
//  + returns true on success; sets $("#status .msg").text() and returns false on error
//  + sets globals:
//     qinfo   = data.qinfo
//     dkeys   = [$date0,...]  (slice key-strings, raw,     e.g. "1900-1900" or "0-1750")

share/htdocs/diacollo.js  view on Meta::CPAN

    //-- setup scales: size/radius ("sizes" key)
    dcpSizeRange = (isBubble
		    ? [8,56]    //-- bubble: radius range
		    : [12,78]   //-- cloud: font-size range (in pixels)
		   );
    dcpItemSize = (isAbsDiff
		   ? function(item,pos) { return dcpSizeRange[0] + linterp(item.avalue,pos)*(dcpSizeRange[1]-dcpSizeRange[0]); }
		   : function(item,pos) { return dcpSizeRange[0] + linterp(item.value,pos) *(dcpSizeRange[1]-dcpSizeRange[0]); }
		  );

    //-- setup formatters (for details popup)
    var ffmt = d3.format(",r");
    var sfmt = d3.format(user_query.score=="ld" ? ".4r"
			 : (user_query.score=="f" ? ",r"
			    : ".4s"));

    //-- parse data
    var pi, p, pscores, iid, idata, iscore, ivalue, avalue;
    for (pi=0; pi < data.profiles.length; ++pi) {
	p = data.profiles[pi];
	p.label = String(p.label);

share/htdocs/diacollo.js  view on Meta::CPAN


//--------------------------------------------------------------
// d3: common: node titles (bubble,cloud)
function d3NodeTitleText(d) {
    return (d.label + " ~ " + dcpItemScore(d,dcur)
	    + (user_query.debug ? (": " + JSON.stringify({id:d.id, value:dcpItemValue(d,dcur), avalue:dcpItemAbsValue(d,dcur), size:dcpItemSize(d,dcur)})) : '')
	   );
}

//--------------------------------------------------------------
// d3: info popup
function d3InfoPopup(d,opts) {
    var dsnap  = Math.round(dcur);
    var dlabel = dlabels[dsnap];
    

    //-- save current info item
    d3InfoCur = {data:d};

    var dopts = {
	title: d.label,

share/htdocs/diacollo.js  view on Meta::CPAN

    var dlg = $("#profileDataPopup").html(content).dialog(dopts);

    //-- add node-class
    d3.selectAll(".node").classed("selected",false);
    d3.select("#g"+d.id).classed("selected",true);

    return false;
}

//--------------------------------------------------------------
// d3: info popup: update
function d3InfoPopupUpdate(snapto) {
    //-- maybe update info box
    if (d3InfoCur != null && snapto != dsnapto) {
	var dlg   = $("#profileDataPopup");
	var d     = d3InfoCur.data;
	dlg.find(".slice").text(String(dlabels[snapto]));
	dlg.find(".score").text(String(d.score[snapto]));
	if (d3InfoCur.kwic != null)  { d3InfoCur.kwic.tr[0]  = dkeys[snapto]; dlg.find(".kwic").prop('href',kwicurl(d3InfoCur.kwic)); }
	if (d3InfoCur.bkwic != null) { d3InfoCur.bkwic.tr[0] = dkeys[snapto]; dlg.find(".bkwic").prop('href',kwicurl(d3InfoCur.bkwic)); }
	if (isDiff) {

share/htdocs/diacollo.js  view on Meta::CPAN

	.ease(easeby)
	.remove();
    exited
	.attr("opacity",0)
	.selectAll("circle")
	.attr("r",dcpSizeRange[0]);

    //-- (re-)start the force layout
    dforce.start();

    //-- update info popup and current snap-to value
    d3InfoPopupUpdate(snapto);
    dsnapto = snapto;
}


//--------------------------------------------------------------
// d3: bubble: collision detection: text "radius" (really horizontal only)
function itemTextRadius(item) {
    if (Number(item.textRadius) > 0) return item.textRadius;
    return item.textRadius = d3.select("#g"+item.id+" text").node().getBBox().width/2;

share/htdocs/diacollo.js  view on Meta::CPAN

	.transition()
	.duration(dur)
	.ease(easeby)
	.remove();
    exited.selectAll("text")
	.attr("opacity", 0)
	.style("fill", dcpMinColor())
	.tween("font-size", tween_font_size)
    ;

    //-- maybe update info popup
    d3InfoPopupUpdate(snapto);
    dsnapto = snapto;
}

//--------------------------------------------------------------
// d3: cloud: debug (show all at max size)
function dcpCloudDebug(dur,easeby,opacity,doInterp) {
    if (dcloud==null) return; //-- not defined yet
    if (dur==null) { dur = 1000; }
    if (easeby==null) { easeby = "linear"; }

share/htdocs/dstar/dstar.css  view on Meta::CPAN

.ui-autocomplete.ui-menu, .ui-autocomplete.ui-menu .ui-menu-item {
  opacity: 1;
  background-color: #ffffcc;
}
*/
.ui-autocomplete .ui-state-focus {
  /*background: #99ccff;*//*light blue*/
  background: #ffbb75;/*light orange*/
}

/*-- dialog (popup) --*/
.ui-dialog {
/*
  -webkit-box-shadow: 2px 2px 2px #aaa;
  box-shadow: 2px 2px 2px #aaa;
*/
}
.ui-dialog .ui-dialog-title {
  white-space: normal;
  width: auto;
  margin: 0 1em 0 0;

share/htdocs/help.ttk  view on Meta::CPAN

	      If the groupby expression is of the form <span class="math"><i>ATTR</i>=<i>HAVING</i></span>, the <i>HAVING</i>
	      expression (<i>qnc_value</i>) is interpreted as a restriction on the candidate collocates&apos; values for the
	      associated projected attribute <i>ATTR</i> (<i>qnc_attr</i>).
	      For example, <span class="math"><b>groupby:</b> Lemma, Pos=NN</span> will return only those collocates with the
	      PoS-tag "NN" (common noun), and <span class="math"><b>groupby:</b> Lemma, Pos=/^ADJ/</span> will return only
	      collocates whose PoS-tag begins with "ADJ".
	    </p>
	    <p>
	      Note that the <a href="#fmt-bubble">bubble</a> and <a href="#fmt-cloud">cloud</a>
	      formats only display the first projected collocate attribute by default, although the entire
	      projected collocate n-tuple should be available through the "details" popup window
	      display after (double-)clicking on a collocate item in the main display canvas.
	    </p>
	  </div>
	  <!--/div.subsection#qgroupy-->
	  
	  <p/>
	</div>

	<!--=================================================-->
	<div class="section" id="scores">

share/htdocs/help.ttk  view on Meta::CPAN

	   when using this output format.
	   See also <a href="http://members.unine.ch/martin.hilpert/motion.html">Martin Hilpert's motion chart resource page</a>
	   for some examples, use cases, and discussion.
	   </dd>

           <dt><a name="fmt-hichart">hichart</a></dt>
	   <dd>(aliases: hc hi chart hichart highchart highcharts)<br/>
	   Online visualization using the <a href="http://www.highcharts.com">Highcharts</a> JavaScript library.
	   For best results, it is recommended that you set the <a href="#global">global</a> parameter to a true value (e.g. 1 (one))
	   when using this output format.
	   Clicking on any data point causes a popup window to be displayed containing
	   hyperlinks to corpus hits for the corresponding collocation pairs as for the <a href="#fmt-html">HTML format</a>,
	   which see with respect to caveats.
	   </dd>

           <dt><a name="fmt-bubble">bubble</a></dt>
	   <dd>(aliases: b bub bubble bubbles)<br/>
	   Online interactive visualization using the <a href="//d3js.org/">D3.js</a> JavaScript library
	   <a href="https://github.com/mbostock/d3/wiki/Force-Layout">force-layout</a>.
	   Collocates are displayed as labelled circles whose radii and color represent the
	   correspondig <a href="#scores">association score</a>.



( run in 2.764 seconds using v1.01-cache-2.11-cpan-364913b4093 )