js/plugins/trimTimeline.js
function clickHandlerKink() {
    timeline.pluginSetOrGetState("trimClinicalTimeline", false);
    //create a bounding box to ease the clicking of axis
    xAxisBBox = d3.select(timeline.divId()+" > svg > g > g.axis")[0][0].getBBox()
    d3.select(timeline.divId()+"> svg > g")
      .insert("rect")
      .attr("x", xAxisBBox.x)
      .attr("y", 4)
      .attr("width", xAxisBBox.width)
      .attr("height", xAxisBBox.height)
      .attr("fill", "rgba(0,0,0,0)")
      .style("cursor", "pointer")
      .on("click", function () {
        timeline.pluginSetOrGetState("trimClinicalTimeline", true);
      })
      .append("svg:title")
      .text("Click to trim the timeline");
  }
function clickHandlerKink() {
    timeline.pluginSetOrGetState("trimClinicalTimeline", false);
    //create a bounding box to ease the clicking of axis
    xAxisBBox = d3.select(timeline.divId()+" > svg > g > g.axis")[0][0].getBBox()
    d3.select(timeline.divId()+"> svg > g")
      .insert("rect")
      .attr("x", xAxisBBox.x)
      .attr("y", 4)
      .attr("width", xAxisBBox.width)
      .attr("height", xAxisBBox.height)
      .attr("fill", "rgba(0,0,0,0)")
      .style("cursor", "pointer")
      .on("click", function () {
        timeline.pluginSetOrGetState("trimClinicalTimeline", true);
      })
      .append("svg:title")
      .text("Click to trim the timeline");
  }
function clickHandlerKink ( ) { timeline . pluginSetOrGetState ( "trimClinicalTimeline" , false ) ; //create a bounding box to ease the clicking of axis xAxisBBox = d3 . select ( timeline . divId ( ) + " > svg > g > g.axis" ) [ 0 ] [ 0 ] . getBBox ( ) d3 . select ( timeline . divId ( ) + "> svg > g" ) . insert ( "rect" ) . attr ( "x" , xAxisBBox . x ) . attr ( "y" , 4 ) . attr ( "width" , xAxisBBox . width ) . attr ( "height" , xAxisBBox . height ) . attr ( "fill" , "rgba(0,0,0,0)" ) . style ( "cursor" , "pointer" ) . on ( "click" , function ( ) { timeline . pluginSetOrGetState ( "trimClinicalTimeline" , true ) ; } ) . append ( "svg:title" ) . text ( "Click to trim the timeline" ) ; }
Handles double clicking of the kinks in trimmed timeline
by extending back the timeline
and also handles coming back to trimmed timeline
Handles double clicking of the kinks in trimmed timeline by extending back the timeline and also handles coming back to trimmed timeline