[Pkg-javascript-commits] [d3-tip.js] 60/277: kill some examples we no longer need

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

bhuvan-guest pushed a commit to branch master
in repository d3-tip.js.

commit 6433d62e04b3ae4b463256e0ab4086bbaba37075
Author: Justin Palmer <justin at github.com>
Date:   Fri Apr 5 12:43:44 2013 -0700

    kill some examples we no longer need
---
 examples/line.html          | 130 -----------------------
 examples/nested-groups.html | 244 --------------------------------------------
 2 files changed, 374 deletions(-)

diff --git a/examples/line.html b/examples/line.html
deleted file mode 100644
index dd239c7..0000000
--- a/examples/line.html
+++ /dev/null
@@ -1,130 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Lines</title>
-    <script type="text/javascript" src="../components/d3/d3.js"></script>
-    <script type="text/javascript" src="../src/d3.tip.js"></script>
-    <style type="text/css">
-      .d3-tip path, .d3-tip rect {
-        fill: #005dae;
-        font-weight: bold;
-      }
-
-      .d3-tip text {
-        fill: #fff;
-        font-size: 12px;
-        stroke: none;
-        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-      }
-
-      .rule {
-        stroke-width: 1px;
-        stroke: #c00;
-        shape-rendering: crispedges;
-      }
-
-      g.line path {
-        fill: none;
-        stroke-width: 2px;
-      }
-
-      circle {
-        fill: #fff;
-        stroke: #c00;
-        stroke-width: 2px;
-      }
-    </style>
-  </head>
-  <body>
-  <script type="text/javascript">
-  var data  = [[300,700,900,100,400,400,800,200,500], [500,200,300,400,900,600,400,600,800]],
-      pl = 20, pt = 20, pr = 20, pb = 20,
-      w     = 800 - pl - pr,
-      h     = 300 - pt - pb,
-      max   = d3.max(data, function(d) { return d3.max(d) }),
-      linex, liney,
-      tip = d3.svg.tip()
-        .orient('top')
-        .padding(4)
-        .offset([20, 20])
-        .text(function(d) { return d; })
-        .attr('class', 'd3-tip');
-
-  // Scales
-  var x  = d3.scale.linear().domain([0, data[0].length - 1]).range([0, w])
-      y  = d3.scale.linear().domain([0, max]).range([h, 0]);
-
-  // Base vis layer
-  var vis = d3.select(document.body)
-    .append('svg')
-      .attr('width', w + (pl + pr))
-      .attr('height', h + pt + pb)
-      .attr('class', 'viz')
-    .append('g')
-      .attr('transform', "translate(" + pl + "," + pt + ")")
-
-  // add path layers to their repesctive group
-  var paths = vis.selectAll('g.line')
-    .data(data)
-  .enter().append("g")
-    .attr('class', 'line')
-
-  paths.append('path')
-    .attr("d", d3.svg.line().x(function(d,i) { return x(i) }).y(y).interpolate('cardinal'))
-    .style('stroke', function(d, i) { return ['#2fa5c7', '#d95ba6'][i] })
-
-  //Add point circles
-  paths.selectAll('.point')
-    .data(function(d) { return d })
-  .enter().append("circle")
-    .attr("class", 'point')
-    .attr("r", 4)
-    .attr("cx", function(d, i) { return x(i) })
-    .attr("cy", function(d) { return y(d) })
-    .on('click', function() {
-      var rect = this.getBoundingClientRect(),
-          bbox = this.getBBox(),
-          x = bbox.x + (bbox.width / 2),
-          y = bbox.y;
-
-      linex.transition()
-        .attr('x1', x)
-        .attr('x2', x)
-
-      liney.transition()
-        .attr('y1', y)
-        .attr('y2',y)
-    })
-    .on('mouseover', function() {
-      var rect = this.getBoundingClientRect(),
-          bbox = this.getBBox(),
-          x = bbox.x + (bbox.width / 2),
-          y = bbox.y + bbox.height;
-
-      linex.transition()
-        .attr('x1', x)
-        .attr('x2', x)
-
-      liney.transition()
-        .attr('y1', y)
-        .attr('y2',y)
-
-      tip.apply(this, arguments)
-    })
-
-  linex = vis.append('line')
-    .attr("x1", 0)
-    .attr("y1", 0)
-    .attr("x2", 0)
-    .attr("y2", h)
-    .attr('class', 'rule')
-
-  liney = vis.append('line')
-    .attr("x1", 0)
-    .attr("y1", 0)
-    .attr("x2", w)
-    .attr("y2", 0)
-      .attr('class', 'rule')
-  </script>
-  </body>
-</html>
diff --git a/examples/nested-groups.html b/examples/nested-groups.html
deleted file mode 100644
index c3d56e9..0000000
--- a/examples/nested-groups.html
+++ /dev/null
@@ -1,244 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Lines</title>
-    <script type="text/javascript" src="../components/d3/d3.js"></script>
-    <script type="text/javascript" src="../src/d3.tip.js"></script>
-    <style type="text/css">
-      body {
-        padding: 100px;
-      }
-
-      path.domain {
-        display: none;
-      }
-
-      .d3-tip path, .d3-tip rect {
-        fill: #005dae;
-        font-weight: bold;
-      }
-
-      .d3-tip text {
-        fill: #fff;
-        font-size: 12px;
-        stroke: none;
-        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-      }
-
-      .rule {
-        stroke-width: 1px;
-        stroke: #c00;
-        shape-rendering: crispedges;
-      }
-
-      g.line path {
-        fill: none;
-        stroke-width: 2px;
-      }
-
-      circle {
-        fill: #fff;
-        stroke: #c00;
-        stroke-width: 2px;
-      }
-
-      text {
-        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-        font-size: 10px;
-        fill: #777;
-      }
-
-      rect {
-        fill: #2892eb;
-      }
-
-      line.tick {
-        stroke-width: 1px;
-        stroke: #ddd;
-        shape-rendering: crispedges;
-      }
-
-      path.path {
-        fill: none;
-        stroke-width: 3px;
-        stroke: red;
-      }
-    </style>
-  </head>
-  <body>
-  <div id="bars"></div>
-  <div id="circles"></div>
-
-  <script type="text/javascript">
-  var pl = 20, pt = 20, pr = 20, pb = 20,
-      w     = 800 - pl - pr,
-      h     = 300 - pt - pb,
-      linex, liney,
-      tip = d3.svg.tip()
-        .orient('top')
-        .padding(4)
-        .text(function(d) { return d; })
-        .attr('class', 'd3-tip');
-      tip2 = d3.svg.tip()
-        .orient('top')
-        .offset([-11, -32])
-        .padding(4)
-        .text(function(d) { return d; })
-        .attr('class', 'd3-tip');
-
-  // CIRCLES HERE
-  (function() {
-    // Base vis layer
-    var vis = d3.select('#circles')
-      .append('svg')
-        .attr('width', w + (pl + pr))
-        .attr('height', h + pt + pb)
-        .attr('class', 'viz')
-      .append('g')
-        .attr('transform', "translate(" + pl + "," + pt + ")")
-
-    d3.json('data.json', function(data) {
-      var days = data[0].days,
-          max  = d3.max(data, function(d) { return d3.max(d.days) }),
-          h = 260,
-          x = d3.scale.linear().domain([0, days.length - 1]).range([0, w - pl -  pr]),
-          y = d3.scale.linear().domain([0, max]).range([h, 0]),
-          yAxis = d3.svg.axis().scale(y).orient("left").ticks(5).tickSize(-w + pr + pl);
-
-      vis.data([days])
-      vis.append("g")
-        .attr("class", "y axis")
-        .call(yAxis)
-
-      var path = d3.svg.line()
-        .interpolate('cardinal')
-        .x(function(d,i) { return x(i) })
-        .y(y)
-
-      vis.append("path")
-        .attr('class', 'path')
-        .attr('d', path)
-
-      var dots = vis.selectAll('g.dot')
-        .data(days)
-      .enter().append('g')
-        .attr('class', 'dot')
-        .attr('transform', function(d, i) { return "translate(" + x(i) + "," + y(d) + ")" })
-
-      dots.append('circle')
-        .attr('r', 4)
-        .on('mouseover', function(d, i) {
-          tip2.apply(this, arguments)
-          var rect = this.getBoundingClientRect(),
-              bbox = this.getBBox(),
-              // trans = this.getTransformToElement(),
-              scree = this.getScreenCTM(),
-              ctm   = this.getCTM(),
-              x = ctm.e,
-              y = ctm.f;
-
-          linex.transition()
-            .attr('x1', x)
-            .attr('x2', x)
-
-          liney.transition()
-            .attr('y1', y)
-            .attr('y2',y)
-        })
-
-          // debugging stuff
-      var linex = vis.append('line')
-        .attr("x1", 0)
-        .attr("y1", 0)
-        .attr("x2", 0)
-        .attr("y2", h)
-        .attr('class', 'rule')
-
-      var liney = vis.append('line')
-        .attr("x1", 0)
-        .attr("y1", 0)
-        .attr("x2", w)
-        .attr("y2", 0)
-        .attr('class', 'rule')
-    })
-  })();
-
-  // BARS HERE
-  (function() {
-    // Base vis layer
-    var vis = d3.select('#bars')
-      .append('svg')
-        .attr('width', w + (pl + pr))
-        .attr('height', h + pt + pb)
-        .attr('class', 'viz')
-      .append('g')
-        .attr('transform', "translate(" + pl + "," + pt + ")")
-
-    d3.json('data.json', function(data) {
-      var totals  = data.map(function(d) { return d.total }),
-          max     = d3.max(totals),
-          // Scales
-          x       = d3.scale.ordinal().domain(d3.range(totals.length)).rangeRoundBands([0, w - pl - pr], 0.1)
-          y       = d3.scale.linear().domain([0, max]).range([h, 0]),
-          yAxis   = d3.svg.axis().scale(y).orient("left").ticks(3).tickSize(-w + pl + pr),
-          xAxis   = d3.svg.axis().scale(x).tickSize(8);
-
-      vis.append("g")
-        .attr("class", "y axis")
-        .call(yAxis)
-
-      var bgroups = vis.selectAll('g.bar')
-          .data(totals)
-        .enter().append('g')
-          .attr('transform', function(d, i) { return "translate(" + x(i) + ",0)" })
-
-      bgroups.append('rect')
-        .attr('width', x.rangeBand())
-        .attr('height', function(d) { return h - y(d) })
-        .attr('y', function(d) { return y(d) })
-        .on('mouseover', function(d) {
-          tip.apply(this, arguments)
-          var rect = this.getBoundingClientRect(),
-              bbox = this.getBBox(),
-              trans = this.getTransformToElement(this.ownerSVGElement),
-              scree = this.getScreenCTM(),
-              ctm   = this.getCTM(),
-              x = ctm.e - ctm.f + (bbox.width / 2),
-              y = bbox.y;
-
-          linex.transition()
-            .attr('x1', x)
-            .attr('x2', x)
-
-          liney.transition()
-            .attr('y1', y)
-            .attr('y2',y)
-        })
-
-      vis.append('g')
-        .attr('class', 'x axis')
-        .attr("transform", "translate(0," + h + ")")
-        .call(xAxis)
-      .selectAll('.x.axis g')
-        .style('display', function(d, i) { return i % 3 != 0 ? 'none' : 'block' })
-
-
-      // debugging stuff
-      var linex = vis.append('line')
-        .attr("x1", 0)
-        .attr("y1", 0)
-        .attr("x2", 0)
-        .attr("y2", h)
-        .attr('class', 'rule')
-
-      var liney = vis.append('line')
-        .attr("x1", 0)
-        .attr("y1", 0)
-        .attr("x2", w)
-        .attr("y2", 0)
-        .attr('class', 'rule')
-    })
-  })()
-  </script>
-  </body>
-</html>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/d3-tip.js.git



More information about the Pkg-javascript-commits mailing list