stripchart 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +21 -0
- data/exe/stripchart +5 -0
- data/lib/stripchart/app.rb +71 -0
- data/lib/stripchart/public/app.css +37 -0
- data/lib/stripchart/public/app.js +167 -0
- data/lib/stripchart/public/components/d3/LICENSE +26 -0
- data/lib/stripchart/public/components/d3/Makefile +45 -0
- data/lib/stripchart/public/components/d3/README.md +7 -0
- data/lib/stripchart/public/components/d3/bower.json +25 -0
- data/lib/stripchart/public/components/d3/component.json +30 -0
- data/lib/stripchart/public/components/d3/d3.js +8798 -0
- data/lib/stripchart/public/components/d3/d3.min.js +5 -0
- data/lib/stripchart/public/components/d3/index-browserify.js +3 -0
- data/lib/stripchart/public/components/d3/index.js +15 -0
- data/lib/stripchart/public/components/d3/lib/colorbrewer/LICENSE +38 -0
- data/lib/stripchart/public/components/d3/lib/colorbrewer/colorbrewer.css +1690 -0
- data/lib/stripchart/public/components/d3/lib/colorbrewer/colorbrewer.js +302 -0
- data/lib/stripchart/public/components/d3/lib/geographiclib/LICENSE +23 -0
- data/lib/stripchart/public/components/d3/lib/jit/LICENSE +27 -0
- data/lib/stripchart/public/components/d3/lib/penner/LICENSE +31 -0
- data/lib/stripchart/public/components/d3/lib/polymaps/LICENSE +28 -0
- data/lib/stripchart/public/components/d3/lib/protovis/LICENSE +27 -0
- data/lib/stripchart/public/components/d3/lib/science/LICENSE +26 -0
- data/lib/stripchart/public/components/d3/lib/science/science.js +225 -0
- data/lib/stripchart/public/components/d3/lib/science/science.lin.js +27 -0
- data/lib/stripchart/public/components/d3/lib/science/science.lin.min.js +1 -0
- data/lib/stripchart/public/components/d3/lib/science/science.min.js +1 -0
- data/lib/stripchart/public/components/d3/lib/science/science.stats.js +720 -0
- data/lib/stripchart/public/components/d3/lib/science/science.stats.min.js +1 -0
- data/lib/stripchart/public/components/d3/package.json +53 -0
- data/lib/stripchart/public/components/d3/src/arrays/ascending.js +3 -0
- data/lib/stripchart/public/components/d3/src/arrays/bisect.js +28 -0
- data/lib/stripchart/public/components/d3/src/arrays/descending.js +3 -0
- data/lib/stripchart/public/components/d3/src/arrays/entries.js +5 -0
- data/lib/stripchart/public/components/d3/src/arrays/extent.js +21 -0
- data/lib/stripchart/public/components/d3/src/arrays/index.js +22 -0
- data/lib/stripchart/public/components/d3/src/arrays/keys.js +5 -0
- data/lib/stripchart/public/components/d3/src/arrays/map.js +50 -0
- data/lib/stripchart/public/components/d3/src/arrays/max.js +14 -0
- data/lib/stripchart/public/components/d3/src/arrays/mean.js +15 -0
- data/lib/stripchart/public/components/d3/src/arrays/median.js +9 -0
- data/lib/stripchart/public/components/d3/src/arrays/merge.js +3 -0
- data/lib/stripchart/public/components/d3/src/arrays/min.js +14 -0
- data/lib/stripchart/public/components/d3/src/arrays/nest.js +97 -0
- data/lib/stripchart/public/components/d3/src/arrays/permute.js +7 -0
- data/lib/stripchart/public/components/d3/src/arrays/quantile.js +8 -0
- data/lib/stripchart/public/components/d3/src/arrays/range.js +24 -0
- data/lib/stripchart/public/components/d3/src/arrays/set.js +38 -0
- data/lib/stripchart/public/components/d3/src/arrays/shuffle.js +8 -0
- data/lib/stripchart/public/components/d3/src/arrays/sum.js +14 -0
- data/lib/stripchart/public/components/d3/src/arrays/transpose.js +5 -0
- data/lib/stripchart/public/components/d3/src/arrays/values.js +5 -0
- data/lib/stripchart/public/components/d3/src/arrays/zip.js +15 -0
- data/lib/stripchart/public/components/d3/src/behavior/behavior.js +1 -0
- data/lib/stripchart/public/components/d3/src/behavior/drag.js +79 -0
- data/lib/stripchart/public/components/d3/src/behavior/index.js +3 -0
- data/lib/stripchart/public/components/d3/src/behavior/zoom.js +209 -0
- data/lib/stripchart/public/components/d3/src/color/color.js +5 -0
- data/lib/stripchart/public/components/d3/src/color/hcl.js +42 -0
- data/lib/stripchart/public/components/d3/src/color/hsl.js +64 -0
- data/lib/stripchart/public/components/d3/src/color/index.js +6 -0
- data/lib/stripchart/public/components/d3/src/color/lab.js +68 -0
- data/lib/stripchart/public/components/d3/src/color/rgb.js +307 -0
- data/lib/stripchart/public/components/d3/src/color/xyz.js +7 -0
- data/lib/stripchart/public/components/d3/src/compat/date.js +3 -0
- data/lib/stripchart/public/components/d3/src/compat/index.js +2 -0
- data/lib/stripchart/public/components/d3/src/compat/style.js +20 -0
- data/lib/stripchart/public/components/d3/src/core/array.js +19 -0
- data/lib/stripchart/public/components/d3/src/core/class.js +12 -0
- data/lib/stripchart/public/components/d3/src/core/document.js +3 -0
- data/lib/stripchart/public/components/d3/src/core/functor.js +5 -0
- data/lib/stripchart/public/components/d3/src/core/identity.js +3 -0
- data/lib/stripchart/public/components/d3/src/core/index.js +3 -0
- data/lib/stripchart/public/components/d3/src/core/noop.js +1 -0
- data/lib/stripchart/public/components/d3/src/core/ns.js +22 -0
- data/lib/stripchart/public/components/d3/src/core/rebind.js +16 -0
- data/lib/stripchart/public/components/d3/src/core/source.js +3 -0
- data/lib/stripchart/public/components/d3/src/core/subclass.js +11 -0
- data/lib/stripchart/public/components/d3/src/core/target.js +3 -0
- data/lib/stripchart/public/components/d3/src/core/true.js +3 -0
- data/lib/stripchart/public/components/d3/src/core/vendor.js +12 -0
- data/lib/stripchart/public/components/d3/src/d3.js +23 -0
- data/lib/stripchart/public/components/d3/src/dsv/csv.js +3 -0
- data/lib/stripchart/public/components/d3/src/dsv/dsv.js +136 -0
- data/lib/stripchart/public/components/d3/src/dsv/index.js +3 -0
- data/lib/stripchart/public/components/d3/src/dsv/tsv.js +3 -0
- data/lib/stripchart/public/components/d3/src/end.js +2 -0
- data/lib/stripchart/public/components/d3/src/event/dispatch.js +69 -0
- data/lib/stripchart/public/components/d3/src/event/drag.js +27 -0
- data/lib/stripchart/public/components/d3/src/event/event.js +50 -0
- data/lib/stripchart/public/components/d3/src/event/index.js +5 -0
- data/lib/stripchart/public/components/d3/src/event/mouse.js +39 -0
- data/lib/stripchart/public/components/d3/src/event/timer.js +82 -0
- data/lib/stripchart/public/components/d3/src/event/touches.js +12 -0
- data/lib/stripchart/public/components/d3/src/format/collapse.js +3 -0
- data/lib/stripchart/public/components/d3/src/format/format-locale.js +4 -0
- data/lib/stripchart/public/components/d3/src/format/format-localized.js +5 -0
- data/lib/stripchart/public/components/d3/src/format/format.js +144 -0
- data/lib/stripchart/public/components/d3/src/format/formatPrefix.js +22 -0
- data/lib/stripchart/public/components/d3/src/format/index.js +4 -0
- data/lib/stripchart/public/components/d3/src/format/requote.js +5 -0
- data/lib/stripchart/public/components/d3/src/format/round.js +5 -0
- data/lib/stripchart/public/components/d3/src/geo/albers-usa.js +129 -0
- data/lib/stripchart/public/components/d3/src/geo/albers.js +11 -0
- data/lib/stripchart/public/components/d3/src/geo/area.js +67 -0
- data/lib/stripchart/public/components/d3/src/geo/azimuthal-equal-area.js +12 -0
- data/lib/stripchart/public/components/d3/src/geo/azimuthal-equidistant.js +13 -0
- data/lib/stripchart/public/components/d3/src/geo/azimuthal.js +25 -0
- data/lib/stripchart/public/components/d3/src/geo/bounds.js +169 -0
- data/lib/stripchart/public/components/d3/src/geo/cartesian.js +47 -0
- data/lib/stripchart/public/components/d3/src/geo/centroid.js +149 -0
- data/lib/stripchart/public/components/d3/src/geo/circle.js +81 -0
- data/lib/stripchart/public/components/d3/src/geo/clip-antimeridian.js +101 -0
- data/lib/stripchart/public/components/d3/src/geo/clip-circle.js +182 -0
- data/lib/stripchart/public/components/d3/src/geo/clip-polygon.js +94 -0
- data/lib/stripchart/public/components/d3/src/geo/clip-view.js +212 -0
- data/lib/stripchart/public/components/d3/src/geo/clip.js +135 -0
- data/lib/stripchart/public/components/d3/src/geo/compose.js +12 -0
- data/lib/stripchart/public/components/d3/src/geo/conic-conformal.js +36 -0
- data/lib/stripchart/public/components/d3/src/geo/conic-equal-area.js +33 -0
- data/lib/stripchart/public/components/d3/src/geo/conic-equidistant.js +35 -0
- data/lib/stripchart/public/components/d3/src/geo/conic.js +16 -0
- data/lib/stripchart/public/components/d3/src/geo/distance.js +13 -0
- data/lib/stripchart/public/components/d3/src/geo/equirectangular.js +10 -0
- data/lib/stripchart/public/components/d3/src/geo/geo.js +1 -0
- data/lib/stripchart/public/components/d3/src/geo/gnomonic.js +12 -0
- data/lib/stripchart/public/components/d3/src/geo/graticule.js +102 -0
- data/lib/stripchart/public/components/d3/src/geo/greatArc.js +42 -0
- data/lib/stripchart/public/components/d3/src/geo/index.js +32 -0
- data/lib/stripchart/public/components/d3/src/geo/interpolate.js +38 -0
- data/lib/stripchart/public/components/d3/src/geo/length.js +43 -0
- data/lib/stripchart/public/components/d3/src/geo/mercator.js +48 -0
- data/lib/stripchart/public/components/d3/src/geo/orthographic.js +12 -0
- data/lib/stripchart/public/components/d3/src/geo/path-area.js +40 -0
- data/lib/stripchart/public/components/d3/src/geo/path-bounds.js +21 -0
- data/lib/stripchart/public/components/d3/src/geo/path-buffer.js +59 -0
- data/lib/stripchart/public/components/d3/src/geo/path-centroid.js +78 -0
- data/lib/stripchart/public/components/d3/src/geo/path-context.js +49 -0
- data/lib/stripchart/public/components/d3/src/geo/path.js +97 -0
- data/lib/stripchart/public/components/d3/src/geo/point-in-polygon.js +71 -0
- data/lib/stripchart/public/components/d3/src/geo/projection.js +132 -0
- data/lib/stripchart/public/components/d3/src/geo/resample.js +98 -0
- data/lib/stripchart/public/components/d3/src/geo/rotation.js +72 -0
- data/lib/stripchart/public/components/d3/src/geo/spherical.js +12 -0
- data/lib/stripchart/public/components/d3/src/geo/stereographic.js +12 -0
- data/lib/stripchart/public/components/d3/src/geo/stream.js +71 -0
- data/lib/stripchart/public/components/d3/src/geo/transverse-mercator.js +23 -0
- data/lib/stripchart/public/components/d3/src/geom/delaunay.js +31 -0
- data/lib/stripchart/public/components/d3/src/geom/geom.js +1 -0
- data/lib/stripchart/public/components/d3/src/geom/hull.js +120 -0
- data/lib/stripchart/public/components/d3/src/geom/index.js +6 -0
- data/lib/stripchart/public/components/d3/src/geom/polygon.js +105 -0
- data/lib/stripchart/public/components/d3/src/geom/quadtree.js +190 -0
- data/lib/stripchart/public/components/d3/src/geom/voronoi.js +545 -0
- data/lib/stripchart/public/components/d3/src/interpolate/array.js +19 -0
- data/lib/stripchart/public/components/d3/src/interpolate/ease.js +110 -0
- data/lib/stripchart/public/components/d3/src/interpolate/hcl.js +23 -0
- data/lib/stripchart/public/components/d3/src/interpolate/hsl.js +23 -0
- data/lib/stripchart/public/components/d3/src/interpolate/index.js +13 -0
- data/lib/stripchart/public/components/d3/src/interpolate/interpolate.js +25 -0
- data/lib/stripchart/public/components/d3/src/interpolate/lab.js +20 -0
- data/lib/stripchart/public/components/d3/src/interpolate/number.js +6 -0
- data/lib/stripchart/public/components/d3/src/interpolate/object.js +25 -0
- data/lib/stripchart/public/components/d3/src/interpolate/rgb.js +20 -0
- data/lib/stripchart/public/components/d3/src/interpolate/round.js +6 -0
- data/lib/stripchart/public/components/d3/src/interpolate/string.js +88 -0
- data/lib/stripchart/public/components/d3/src/interpolate/transform.js +56 -0
- data/lib/stripchart/public/components/d3/src/interpolate/uninterpolate.js +9 -0
- data/lib/stripchart/public/components/d3/src/layout/bundle.js +59 -0
- data/lib/stripchart/public/components/d3/src/layout/chord.js +157 -0
- data/lib/stripchart/public/components/d3/src/layout/cluster.js +92 -0
- data/lib/stripchart/public/components/d3/src/layout/force.js +359 -0
- data/lib/stripchart/public/components/d3/src/layout/hierarchy.js +116 -0
- data/lib/stripchart/public/components/d3/src/layout/histogram.js +110 -0
- data/lib/stripchart/public/components/d3/src/layout/index.js +13 -0
- data/lib/stripchart/public/components/d3/src/layout/layout.js +1 -0
- data/lib/stripchart/public/components/d3/src/layout/pack.js +212 -0
- data/lib/stripchart/public/components/d3/src/layout/partition.js +51 -0
- data/lib/stripchart/public/components/d3/src/layout/pie.js +99 -0
- data/lib/stripchart/public/components/d3/src/layout/stack.js +245 -0
- data/lib/stripchart/public/components/d3/src/layout/tree.js +251 -0
- data/lib/stripchart/public/components/d3/src/layout/treemap.js +230 -0
- data/lib/stripchart/public/components/d3/src/math/adder.js +34 -0
- data/lib/stripchart/public/components/d3/src/math/index.js +2 -0
- data/lib/stripchart/public/components/d3/src/math/number.js +3 -0
- data/lib/stripchart/public/components/d3/src/math/random.js +28 -0
- data/lib/stripchart/public/components/d3/src/math/transform.js +64 -0
- data/lib/stripchart/public/components/d3/src/math/trigonometry.js +29 -0
- data/lib/stripchart/public/components/d3/src/scale/bilinear.js +7 -0
- data/lib/stripchart/public/components/d3/src/scale/category.js +57 -0
- data/lib/stripchart/public/components/d3/src/scale/identity.js +33 -0
- data/lib/stripchart/public/components/d3/src/scale/index.js +11 -0
- data/lib/stripchart/public/components/d3/src/scale/linear.js +128 -0
- data/lib/stripchart/public/components/d3/src/scale/log.js +92 -0
- data/lib/stripchart/public/components/d3/src/scale/nice.js +28 -0
- data/lib/stripchart/public/components/d3/src/scale/ordinal.js +92 -0
- data/lib/stripchart/public/components/d3/src/scale/polylinear.js +24 -0
- data/lib/stripchart/public/components/d3/src/scale/pow.js +58 -0
- data/lib/stripchart/public/components/d3/src/scale/quantile.js +54 -0
- data/lib/stripchart/public/components/d3/src/scale/quantize.js +44 -0
- data/lib/stripchart/public/components/d3/src/scale/scale.js +10 -0
- data/lib/stripchart/public/components/d3/src/scale/sqrt.js +6 -0
- data/lib/stripchart/public/components/d3/src/scale/threshold.js +36 -0
- data/lib/stripchart/public/components/d3/src/selection/append.js +16 -0
- data/lib/stripchart/public/components/d3/src/selection/attr.js +62 -0
- data/lib/stripchart/public/components/d3/src/selection/call.js +8 -0
- data/lib/stripchart/public/components/d3/src/selection/classed.js +72 -0
- data/lib/stripchart/public/components/d3/src/selection/data.js +118 -0
- data/lib/stripchart/public/components/d3/src/selection/datum.js +7 -0
- data/lib/stripchart/public/components/d3/src/selection/each.js +16 -0
- data/lib/stripchart/public/components/d3/src/selection/empty.js +5 -0
- data/lib/stripchart/public/components/d3/src/selection/enter-insert.js +20 -0
- data/lib/stripchart/public/components/d3/src/selection/enter-select.js +27 -0
- data/lib/stripchart/public/components/d3/src/selection/enter.js +21 -0
- data/lib/stripchart/public/components/d3/src/selection/filter.js +28 -0
- data/lib/stripchart/public/components/d3/src/selection/html.js +10 -0
- data/lib/stripchart/public/components/d3/src/selection/index.js +1 -0
- data/lib/stripchart/public/components/d3/src/selection/insert.js +9 -0
- data/lib/stripchart/public/components/d3/src/selection/node.js +11 -0
- data/lib/stripchart/public/components/d3/src/selection/on.js +104 -0
- data/lib/stripchart/public/components/d3/src/selection/order.js +13 -0
- data/lib/stripchart/public/components/d3/src/selection/property.js +43 -0
- data/lib/stripchart/public/components/d3/src/selection/remove.js +11 -0
- data/lib/stripchart/public/components/d3/src/selection/select.js +32 -0
- data/lib/stripchart/public/components/d3/src/selection/selectAll.js +27 -0
- data/lib/stripchart/public/components/d3/src/selection/selection.js +67 -0
- data/lib/stripchart/public/components/d3/src/selection/size.js +7 -0
- data/lib/stripchart/public/components/d3/src/selection/sort.js +15 -0
- data/lib/stripchart/public/components/d3/src/selection/style.js +56 -0
- data/lib/stripchart/public/components/d3/src/selection/text.js +10 -0
- data/lib/stripchart/public/components/d3/src/selection/transition.js +19 -0
- data/lib/stripchart/public/components/d3/src/start.js +2 -0
- data/lib/stripchart/public/components/d3/src/svg/arc.js +99 -0
- data/lib/stripchart/public/components/d3/src/svg/area-radial.js +14 -0
- data/lib/stripchart/public/components/d3/src/svg/area.js +120 -0
- data/lib/stripchart/public/components/d3/src/svg/axis.js +222 -0
- data/lib/stripchart/public/components/d3/src/svg/brush.js +379 -0
- data/lib/stripchart/public/components/d3/src/svg/chord.js +90 -0
- data/lib/stripchart/public/components/d3/src/svg/diagonal-radial.js +26 -0
- data/lib/stripchart/public/components/d3/src/svg/diagonal.js +43 -0
- data/lib/stripchart/public/components/d3/src/svg/index.js +12 -0
- data/lib/stripchart/public/components/d3/src/svg/line-radial.js +26 -0
- data/lib/stripchart/public/components/d3/src/svg/line.js +439 -0
- data/lib/stripchart/public/components/d3/src/svg/svg.js +1 -0
- data/lib/stripchart/public/components/d3/src/svg/symbol.js +105 -0
- data/lib/stripchart/public/components/d3/src/time/day.js +21 -0
- data/lib/stripchart/public/components/d3/src/time/format-iso.js +20 -0
- data/lib/stripchart/public/components/d3/src/time/format-locale.js +10 -0
- data/lib/stripchart/public/components/d3/src/time/format-localized.js +11 -0
- data/lib/stripchart/public/components/d3/src/time/format-utc.js +31 -0
- data/lib/stripchart/public/components/d3/src/time/format.js +303 -0
- data/lib/stripchart/public/components/d3/src/time/hour.js +14 -0
- data/lib/stripchart/public/components/d3/src/time/index.js +15 -0
- data/lib/stripchart/public/components/d3/src/time/interval.js +71 -0
- data/lib/stripchart/public/components/d3/src/time/minute.js +13 -0
- data/lib/stripchart/public/components/d3/src/time/month.js +16 -0
- data/lib/stripchart/public/components/d3/src/time/scale-utc.js +43 -0
- data/lib/stripchart/public/components/d3/src/time/scale.js +150 -0
- data/lib/stripchart/public/components/d3/src/time/second.js +13 -0
- data/lib/stripchart/public/components/d3/src/time/time.js +35 -0
- data/lib/stripchart/public/components/d3/src/time/week.js +32 -0
- data/lib/stripchart/public/components/d3/src/time/year.js +16 -0
- data/lib/stripchart/public/components/d3/src/transition/attr.js +58 -0
- data/lib/stripchart/public/components/d3/src/transition/delay.js +9 -0
- data/lib/stripchart/public/components/d3/src/transition/duration.js +9 -0
- data/lib/stripchart/public/components/d3/src/transition/each.js +23 -0
- data/lib/stripchart/public/components/d3/src/transition/ease.js +10 -0
- data/lib/stripchart/public/components/d3/src/transition/filter.js +22 -0
- data/lib/stripchart/public/components/d3/src/transition/index.js +1 -0
- data/lib/stripchart/public/components/d3/src/transition/remove.js +8 -0
- data/lib/stripchart/public/components/d3/src/transition/select.js +27 -0
- data/lib/stripchart/public/components/d3/src/transition/selectAll.js +30 -0
- data/lib/stripchart/public/components/d3/src/transition/style.js +53 -0
- data/lib/stripchart/public/components/d3/src/transition/subtransition.js +25 -0
- data/lib/stripchart/public/components/d3/src/transition/text.js +11 -0
- data/lib/stripchart/public/components/d3/src/transition/transition.js +118 -0
- data/lib/stripchart/public/components/d3/src/transition/tween.js +17 -0
- data/lib/stripchart/public/components/d3/src/xhr/html.js +12 -0
- data/lib/stripchart/public/components/d3/src/xhr/index.js +5 -0
- data/lib/stripchart/public/components/d3/src/xhr/json.js +9 -0
- data/lib/stripchart/public/components/d3/src/xhr/text.js +5 -0
- data/lib/stripchart/public/components/d3/src/xhr/xhr.js +118 -0
- data/lib/stripchart/public/components/d3/src/xhr/xml.js +5 -0
- data/lib/stripchart/public/components/d3/test/XMLHttpRequest.js +55 -0
- data/lib/stripchart/public/components/d3/test/arrays/ascending-test.js +45 -0
- data/lib/stripchart/public/components/d3/test/arrays/bisect-test.js +257 -0
- data/lib/stripchart/public/components/d3/test/arrays/descending-test.js +45 -0
- data/lib/stripchart/public/components/d3/test/arrays/entries-test.js +39 -0
- data/lib/stripchart/public/components/d3/test/arrays/extent-test.js +50 -0
- data/lib/stripchart/public/components/d3/test/arrays/keys-test.js +27 -0
- data/lib/stripchart/public/components/d3/test/arrays/map-test.js +214 -0
- data/lib/stripchart/public/components/d3/test/arrays/max-test.js +51 -0
- data/lib/stripchart/public/components/d3/test/arrays/mean-test.js +39 -0
- data/lib/stripchart/public/components/d3/test/arrays/median-test.js +39 -0
- data/lib/stripchart/public/components/d3/test/arrays/merge-test.js +26 -0
- data/lib/stripchart/public/components/d3/test/arrays/min-test.js +51 -0
- data/lib/stripchart/public/components/d3/test/arrays/nest-test.js +256 -0
- data/lib/stripchart/public/components/d3/test/arrays/permute-test.js +49 -0
- data/lib/stripchart/public/components/d3/test/arrays/quantile-test.js +56 -0
- data/lib/stripchart/public/components/d3/test/arrays/range-test.js +99 -0
- data/lib/stripchart/public/components/d3/test/arrays/set-test.js +136 -0
- data/lib/stripchart/public/components/d3/test/arrays/sum-test.js +43 -0
- data/lib/stripchart/public/components/d3/test/arrays/transpose-test.js +28 -0
- data/lib/stripchart/public/components/d3/test/arrays/values-test.js +31 -0
- data/lib/stripchart/public/components/d3/test/arrays/zip-test.js +28 -0
- data/lib/stripchart/public/components/d3/test/assert.js +153 -0
- data/lib/stripchart/public/components/d3/test/color/hcl-test.js +112 -0
- data/lib/stripchart/public/components/d3/test/color/hsl-test.js +118 -0
- data/lib/stripchart/public/components/d3/test/color/lab-test.js +81 -0
- data/lib/stripchart/public/components/d3/test/color/rgb-test.js +91 -0
- data/lib/stripchart/public/components/d3/test/core/functor-test.js +25 -0
- data/lib/stripchart/public/components/d3/test/core/ns-test.js +57 -0
- data/lib/stripchart/public/components/d3/test/core/rebind-test.js +50 -0
- data/lib/stripchart/public/components/d3/test/core/version-test.js +16 -0
- data/lib/stripchart/public/components/d3/test/data/sample.csv +2 -0
- data/lib/stripchart/public/components/d3/test/data/sample.html +5 -0
- data/lib/stripchart/public/components/d3/test/data/sample.json +1 -0
- data/lib/stripchart/public/components/d3/test/data/sample.tsv +2 -0
- data/lib/stripchart/public/components/d3/test/data/sample.txt +1 -0
- data/lib/stripchart/public/components/d3/test/data/sample.xml +4 -0
- data/lib/stripchart/public/components/d3/test/data/us-counties.json +3186 -0
- data/lib/stripchart/public/components/d3/test/dsv/csv-test.js +214 -0
- data/lib/stripchart/public/components/d3/test/dsv/tsv-test.js +185 -0
- data/lib/stripchart/public/components/d3/test/event/dispatch-test.js +163 -0
- data/lib/stripchart/public/components/d3/test/event/mouse-test.html +22 -0
- data/lib/stripchart/public/components/d3/test/event/timer-test.js +74 -0
- data/lib/stripchart/public/components/d3/test/event/touch-test.html +61 -0
- data/lib/stripchart/public/components/d3/test/format/format-test.js +360 -0
- data/lib/stripchart/public/components/d3/test/format/formatPrefix-test.js +112 -0
- data/lib/stripchart/public/components/d3/test/format/requote-test.js +49 -0
- data/lib/stripchart/public/components/d3/test/format/round-test.js +66 -0
- data/lib/stripchart/public/components/d3/test/geo/albers-test.js +40 -0
- data/lib/stripchart/public/components/d3/test/geo/albers-usa-test.js +33 -0
- data/lib/stripchart/public/components/d3/test/geo/area-benchmark.js +12 -0
- data/lib/stripchart/public/components/d3/test/geo/area-test.js +185 -0
- data/lib/stripchart/public/components/d3/test/geo/azimuthal-equal-area-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/azimuthal-equidistant-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/benchmark.js +83 -0
- data/lib/stripchart/public/components/d3/test/geo/bounds-test.js +265 -0
- data/lib/stripchart/public/components/d3/test/geo/centroid-test.js +187 -0
- data/lib/stripchart/public/components/d3/test/geo/circle-test.js +29 -0
- data/lib/stripchart/public/components/d3/test/geo/clip-view-mock.js +4 -0
- data/lib/stripchart/public/components/d3/test/geo/clip-view-test.js +44 -0
- data/lib/stripchart/public/components/d3/test/geo/conic-conformal-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/conic-equal-area-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/conic-equidistant-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/distance-test.js +20 -0
- data/lib/stripchart/public/components/d3/test/geo/equirectangular-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/gnomonic-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/graticule-test.js +188 -0
- data/lib/stripchart/public/components/d3/test/geo/greatArc-test.js +35 -0
- data/lib/stripchart/public/components/d3/test/geo/interpolate-test.js +22 -0
- data/lib/stripchart/public/components/d3/test/geo/length-test.js +44 -0
- data/lib/stripchart/public/components/d3/test/geo/mercator-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/orthographic-test.js +34 -0
- data/lib/stripchart/public/components/d3/test/geo/path-test.js +832 -0
- data/lib/stripchart/public/components/d3/test/geo/point-in-polygon-mock.js +18 -0
- data/lib/stripchart/public/components/d3/test/geo/point-in-polygon-test.js +352 -0
- data/lib/stripchart/public/components/d3/test/geo/projection-test-suite.js +29 -0
- data/lib/stripchart/public/components/d3/test/geo/projection-test.js +58 -0
- data/lib/stripchart/public/components/d3/test/geo/rotation-test.js +35 -0
- data/lib/stripchart/public/components/d3/test/geo/stereographic-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geo/stream-test.js +264 -0
- data/lib/stripchart/public/components/d3/test/geo/transverse-mercator-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/geom/hull-test.js +68 -0
- data/lib/stripchart/public/components/d3/test/geom/polygon-test.js +151 -0
- data/lib/stripchart/public/components/d3/test/geom/quadtree-test.js +139 -0
- data/lib/stripchart/public/components/d3/test/geom/voronoi-test.js +230 -0
- data/lib/stripchart/public/components/d3/test/interpolate/array-test.js +24 -0
- data/lib/stripchart/public/components/d3/test/interpolate/ease-test.js +135 -0
- data/lib/stripchart/public/components/d3/test/interpolate/hcl-test.js +47 -0
- data/lib/stripchart/public/components/d3/test/interpolate/hsl-test.js +47 -0
- data/lib/stripchart/public/components/d3/test/interpolate/interpolate-test.js +157 -0
- data/lib/stripchart/public/components/d3/test/interpolate/interpolate-transform-test.js +60 -0
- data/lib/stripchart/public/components/d3/test/interpolate/lab-test.js +31 -0
- data/lib/stripchart/public/components/d3/test/interpolate/number-test.js +20 -0
- data/lib/stripchart/public/components/d3/test/interpolate/object-test.js +35 -0
- data/lib/stripchart/public/components/d3/test/interpolate/rgb-test.js +31 -0
- data/lib/stripchart/public/components/d3/test/interpolate/round-test.js +17 -0
- data/lib/stripchart/public/components/d3/test/interpolate/string-test.js +43 -0
- data/lib/stripchart/public/components/d3/test/layout/chord-test.js +164 -0
- data/lib/stripchart/public/components/d3/test/layout/cluster-test.js +44 -0
- data/lib/stripchart/public/components/d3/test/layout/force-test.js +119 -0
- data/lib/stripchart/public/components/d3/test/layout/hierarchy-test.js +27 -0
- data/lib/stripchart/public/components/d3/test/layout/histogram-test.js +92 -0
- data/lib/stripchart/public/components/d3/test/layout/pack-test.js +129 -0
- data/lib/stripchart/public/components/d3/test/layout/partition-test.js +45 -0
- data/lib/stripchart/public/components/d3/test/layout/pie-test.js +24 -0
- data/lib/stripchart/public/components/d3/test/layout/tree-test.js +45 -0
- data/lib/stripchart/public/components/d3/test/layout/treemap-test.js +181 -0
- data/lib/stripchart/public/components/d3/test/load.js +58 -0
- data/lib/stripchart/public/components/d3/test/math/random-test.js +37 -0
- data/lib/stripchart/public/components/d3/test/math/transform-null-matrix-test.html +26 -0
- data/lib/stripchart/public/components/d3/test/math/transform-null-test.html +26 -0
- data/lib/stripchart/public/components/d3/test/math/transform-rotate-origin-test.html +40 -0
- data/lib/stripchart/public/components/d3/test/math/transform-rotate-test.html +138 -0
- data/lib/stripchart/public/components/d3/test/math/transform-test.html +88 -0
- data/lib/stripchart/public/components/d3/test/scale/category-test.js +76 -0
- data/lib/stripchart/public/components/d3/test/scale/identity-test.js +163 -0
- data/lib/stripchart/public/components/d3/test/scale/linear-test.js +281 -0
- data/lib/stripchart/public/components/d3/test/scale/log-test.js +378 -0
- data/lib/stripchart/public/components/d3/test/scale/ordinal-test.js +272 -0
- data/lib/stripchart/public/components/d3/test/scale/pow-test.js +267 -0
- data/lib/stripchart/public/components/d3/test/scale/quantile-test.js +91 -0
- data/lib/stripchart/public/components/d3/test/scale/quantize-test.js +92 -0
- data/lib/stripchart/public/components/d3/test/scale/sqrt-test.js +260 -0
- data/lib/stripchart/public/components/d3/test/scale/threshold-test.js +64 -0
- data/lib/stripchart/public/components/d3/test/selection/append-test.js +153 -0
- data/lib/stripchart/public/components/d3/test/selection/attr-test.js +182 -0
- data/lib/stripchart/public/components/d3/test/selection/call-test.js +75 -0
- data/lib/stripchart/public/components/d3/test/selection/classed-test.js +269 -0
- data/lib/stripchart/public/components/d3/test/selection/data-test.js +270 -0
- data/lib/stripchart/public/components/d3/test/selection/datum-test.js +87 -0
- data/lib/stripchart/public/components/d3/test/selection/each-test.js +87 -0
- data/lib/stripchart/public/components/d3/test/selection/empty-test.js +53 -0
- data/lib/stripchart/public/components/d3/test/selection/enter-test.js +24 -0
- data/lib/stripchart/public/components/d3/test/selection/filter-test.js +72 -0
- data/lib/stripchart/public/components/d3/test/selection/html-test.js +134 -0
- data/lib/stripchart/public/components/d3/test/selection/insert-test.js +169 -0
- data/lib/stripchart/public/components/d3/test/selection/node-test.js +55 -0
- data/lib/stripchart/public/components/d3/test/selection/on-test.js +135 -0
- data/lib/stripchart/public/components/d3/test/selection/order-test.js +32 -0
- data/lib/stripchart/public/components/d3/test/selection/property-test.js +118 -0
- data/lib/stripchart/public/components/d3/test/selection/remove-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/selection/select-test.js +69 -0
- data/lib/stripchart/public/components/d3/test/selection/selectAll-test.js +52 -0
- data/lib/stripchart/public/components/d3/test/selection/selection-select-test.js +128 -0
- data/lib/stripchart/public/components/d3/test/selection/selection-selectAll-test.js +131 -0
- data/lib/stripchart/public/components/d3/test/selection/selection-test.js +38 -0
- data/lib/stripchart/public/components/d3/test/selection/size-test.js +52 -0
- data/lib/stripchart/public/components/d3/test/selection/sort-test.js +81 -0
- data/lib/stripchart/public/components/d3/test/selection/style-test.js +129 -0
- data/lib/stripchart/public/components/d3/test/selection/text-test.js +115 -0
- data/lib/stripchart/public/components/d3/test/svg/arc-test.js +143 -0
- data/lib/stripchart/public/components/d3/test/svg/area-radial-test.js +199 -0
- data/lib/stripchart/public/components/d3/test/svg/area-test.js +192 -0
- data/lib/stripchart/public/components/d3/test/svg/axis-test.js +447 -0
- data/lib/stripchart/public/components/d3/test/svg/brush-test.js +96 -0
- data/lib/stripchart/public/components/d3/test/svg/diagonal-test.js +62 -0
- data/lib/stripchart/public/components/d3/test/svg/line-radial-test.js +120 -0
- data/lib/stripchart/public/components/d3/test/svg/line-test.js +207 -0
- data/lib/stripchart/public/components/d3/test/svg/symbol-test.js +91 -0
- data/lib/stripchart/public/components/d3/test/time/day-test.js +178 -0
- data/lib/stripchart/public/components/d3/test/time/dayOfYear-test.js +16 -0
- data/lib/stripchart/public/components/d3/test/time/days-test.js +95 -0
- data/lib/stripchart/public/components/d3/test/time/format-iso-test.js +33 -0
- data/lib/stripchart/public/components/d3/test/time/format-test.js +300 -0
- data/lib/stripchart/public/components/d3/test/time/format-utc-test.js +219 -0
- data/lib/stripchart/public/components/d3/test/time/hour-test.js +215 -0
- data/lib/stripchart/public/components/d3/test/time/hours-test.js +109 -0
- data/lib/stripchart/public/components/d3/test/time/minute-test.js +127 -0
- data/lib/stripchart/public/components/d3/test/time/minutes-test.js +91 -0
- data/lib/stripchart/public/components/d3/test/time/month-test.js +150 -0
- data/lib/stripchart/public/components/d3/test/time/months-test.js +95 -0
- data/lib/stripchart/public/components/d3/test/time/scale-test.js +585 -0
- data/lib/stripchart/public/components/d3/test/time/second-test.js +143 -0
- data/lib/stripchart/public/components/d3/test/time/seconds-test.js +91 -0
- data/lib/stripchart/public/components/d3/test/time/time.js +30 -0
- data/lib/stripchart/public/components/d3/test/time/week-test.js +162 -0
- data/lib/stripchart/public/components/d3/test/time/weeks-test.js +95 -0
- data/lib/stripchart/public/components/d3/test/time/year-test.js +137 -0
- data/lib/stripchart/public/components/d3/test/time/years-test.js +74 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-attr.js +56 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-attrTween.js +59 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-call.js +30 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-delay.js +56 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-duration.js +60 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-each.js +163 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-filter.js +84 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-id.js +22 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-node.js +39 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-remove.js +45 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-select.js +60 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-selectAll.js +56 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-size.js +37 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-style.js +51 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-styleTween.js +65 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-text.js +27 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-time.js +38 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-transition.js +59 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test-tween.js +62 -0
- data/lib/stripchart/public/components/d3/test/transition/transition-test.js +89 -0
- data/lib/stripchart/public/components/d3/test/xhr/html-test.js +37 -0
- data/lib/stripchart/public/components/d3/test/xhr/json-test.js +51 -0
- data/lib/stripchart/public/components/d3/test/xhr/text-test.js +46 -0
- data/lib/stripchart/public/components/d3/test/xhr/xhr-test.js +54 -0
- data/lib/stripchart/public/components/d3/test/xhr/xml-test.js +46 -0
- data/lib/stripchart/public/components/jquery/README.md +11 -0
- data/lib/stripchart/public/components/jquery/bower.json +11 -0
- data/lib/stripchart/public/components/jquery/component.json +23 -0
- data/lib/stripchart/public/components/jquery/composer.json +35 -0
- data/lib/stripchart/public/components/jquery/jquery-migrate.js +511 -0
- data/lib/stripchart/public/components/jquery/jquery-migrate.min.js +3 -0
- data/lib/stripchart/public/components/jquery/jquery.js +8829 -0
- data/lib/stripchart/public/components/jquery/jquery.min.js +6 -0
- data/lib/stripchart/public/components/jquery/jquery.min.map +1 -0
- data/lib/stripchart/public/components/jquery/package.json +7 -0
- data/lib/stripchart/version.rb +3 -0
- data/lib/stripchart/views/index.erb +19 -0
- data/lib/stripchart/web.rb +22 -0
- data/lib/stripchart/websocket.rb +22 -0
- metadata +602 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
var vows = require("vows"),
|
2
|
+
load = require("../load"),
|
3
|
+
assert = require("../assert");
|
4
|
+
|
5
|
+
var suite = vows.describe("d3.random");
|
6
|
+
|
7
|
+
suite.addBatch({
|
8
|
+
"random": {
|
9
|
+
topic: load("math/random").expression("d3.random"),
|
10
|
+
"normal": {
|
11
|
+
"topic": function(random) {
|
12
|
+
return random.normal();
|
13
|
+
},
|
14
|
+
"returns a number": function(r) {
|
15
|
+
assert.typeOf(r(), "number");
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"logNormal": {
|
19
|
+
"topic": function(random) {
|
20
|
+
return random.logNormal();
|
21
|
+
},
|
22
|
+
"returns a number": function(r) {
|
23
|
+
assert.typeOf(r(), "number");
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"irwinHall": {
|
27
|
+
"topic": function(random) {
|
28
|
+
return random.irwinHall(10);
|
29
|
+
},
|
30
|
+
"returns a number": function(r) {
|
31
|
+
assert.typeOf(r(), "number");
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
});
|
36
|
+
|
37
|
+
suite.export(module);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<meta charset="utf-8">
|
3
|
+
<body>
|
4
|
+
<script src="../../d3.js"></script>
|
5
|
+
<script>
|
6
|
+
|
7
|
+
var svg = d3.select("body").append("svg")
|
8
|
+
.attr("width", 960)
|
9
|
+
.attr("height", 500);
|
10
|
+
|
11
|
+
var g = svg.append("g")
|
12
|
+
.attr("transform", "translate(100,100)")
|
13
|
+
.append("g")
|
14
|
+
.attr("transform", "matrix(1 0 0 1 0 0)rotate(0)");
|
15
|
+
|
16
|
+
var rect = g.append("rect")
|
17
|
+
.attr("x", -25)
|
18
|
+
.attr("y", -50)
|
19
|
+
.attr("width", 50)
|
20
|
+
.attr("height", 100);
|
21
|
+
|
22
|
+
g.transition()
|
23
|
+
.duration(3000)
|
24
|
+
.attrTween("transform", d3.tween("matrix(1 0 0 1 100 100)rotate(360)", d3.interpolateString));
|
25
|
+
|
26
|
+
</script>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<meta charset="utf-8">
|
3
|
+
<body>
|
4
|
+
<script src="../../d3.js"></script>
|
5
|
+
<script>
|
6
|
+
|
7
|
+
var svg = d3.select("body").append("svg")
|
8
|
+
.attr("width", 960)
|
9
|
+
.attr("height", 500);
|
10
|
+
|
11
|
+
var g = svg.append("g")
|
12
|
+
.attr("transform", "translate(100,100)")
|
13
|
+
.append("g")
|
14
|
+
.attr("transform", "translate(0,0)rotate(0)");
|
15
|
+
|
16
|
+
var rect = g.append("rect")
|
17
|
+
.attr("x", -25)
|
18
|
+
.attr("y", -50)
|
19
|
+
.attr("width", 50)
|
20
|
+
.attr("height", 100);
|
21
|
+
|
22
|
+
g.transition()
|
23
|
+
.duration(3000)
|
24
|
+
.attrTween("transform", d3.tween("translate(100,100)rotate(360)", d3.interpolateString));
|
25
|
+
|
26
|
+
</script>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<meta charset="utf-8">
|
3
|
+
<body>
|
4
|
+
<script src="../../d3.js"></script>
|
5
|
+
<script>
|
6
|
+
|
7
|
+
var width = 960,
|
8
|
+
height = 500;
|
9
|
+
|
10
|
+
var cross = d3.svg.symbol()
|
11
|
+
.type("cross")
|
12
|
+
.size(10000);
|
13
|
+
|
14
|
+
var svg = d3.select("body").append("svg")
|
15
|
+
.attr("width", width)
|
16
|
+
.attr("height", height)
|
17
|
+
.append("g")
|
18
|
+
.attr("transform", "translate(" + (width / 2) + "," + (height / 2) + ")");
|
19
|
+
|
20
|
+
svg.append("path")
|
21
|
+
.style("fill", "steelblue")
|
22
|
+
.attr("d", cross);
|
23
|
+
|
24
|
+
svg.append("path")
|
25
|
+
.style("fill", "darkgreen")
|
26
|
+
.attr("d", cross)
|
27
|
+
.attr("transform", "rotate(45 200,200)");
|
28
|
+
|
29
|
+
svg.append("path")
|
30
|
+
.style("fill", "white")
|
31
|
+
.style("fill-opacity", .2)
|
32
|
+
.style("stroke", "steelblue")
|
33
|
+
.style("stroke-width", "4px")
|
34
|
+
.attr("d", cross)
|
35
|
+
.transition()
|
36
|
+
.duration(1000)
|
37
|
+
.style("stroke", "darkgreen")
|
38
|
+
.attr("transform", "rotate(45 200,200)");
|
39
|
+
|
40
|
+
</script>
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<meta charset="utf-8">
|
3
|
+
<style>
|
4
|
+
|
5
|
+
table {
|
6
|
+
width: 960px;
|
7
|
+
border-spacing: 0;
|
8
|
+
border-collapse: collapse;
|
9
|
+
}
|
10
|
+
|
11
|
+
th, td {
|
12
|
+
padding: 4px;
|
13
|
+
}
|
14
|
+
|
15
|
+
th {
|
16
|
+
text-align: left;
|
17
|
+
}
|
18
|
+
|
19
|
+
td {
|
20
|
+
border: solid 1px #ccc;
|
21
|
+
text-align: right;
|
22
|
+
}
|
23
|
+
|
24
|
+
td.fail {
|
25
|
+
background: lightcoral;
|
26
|
+
}
|
27
|
+
|
28
|
+
td.success {
|
29
|
+
background: lightgreen;
|
30
|
+
}
|
31
|
+
|
32
|
+
</style>
|
33
|
+
<table>
|
34
|
+
<thead>
|
35
|
+
<th>start</th>
|
36
|
+
<th>end</th>
|
37
|
+
<th colspan=5>actual intermediate values</th>
|
38
|
+
<th>exp.</th>
|
39
|
+
<th>act.</th>
|
40
|
+
</thead>
|
41
|
+
<tbody>
|
42
|
+
</tbody>
|
43
|
+
</table>
|
44
|
+
<script src="../../d3.js"></script>
|
45
|
+
<script>
|
46
|
+
|
47
|
+
var format = d3.format(",.2f");
|
48
|
+
|
49
|
+
var tests = [
|
50
|
+
{start: 170, end: 225, expected: [ 170.00, -176.25, -162.50, -148.75, -135.00]},
|
51
|
+
{start: 225, end: 170, expected: [-135.00, -148.75, -162.50, -176.25, 170.00]},
|
52
|
+
{start: -170, end: -225, expected: [-170.00, 176.25, 162.50, 148.75, 135.00]},
|
53
|
+
{start: -225, end: -170, expected: [ 135.00, 148.75, 162.50, 176.25, -170.00]},
|
54
|
+
{start: -170, end: 170, expected: [-170.00, -175.00, 180.00, 175.00, 170.00]},
|
55
|
+
{start: -170, end: 0, expected: [-170.00, -127.50, -85.00, -42.50, 0.00]},
|
56
|
+
{start: 170, end: 0, expected: [ 170.00, 127.50, 85.00, 42.50, 0.00]},
|
57
|
+
{start: -180, end: 90, expected: [ 180.00, 157.50, 135.00, 112.50, 90.00]},
|
58
|
+
{start: 180, end: 90, expected: [ 180.00, 157.50, 135.00, 112.50, 90.00]},
|
59
|
+
{start: -180, end: -90, expected: [-180.00, -157.50, -135.00, -112.50, -90.00]},
|
60
|
+
{start: 180, end: -90, expected: [ 180.00, -157.50, -135.00, -112.50, -90.00]},
|
61
|
+
{start: 780, end: -90, expected: [ 60.00, 22.50, -15.00, -52.50, -90.00]}
|
62
|
+
];
|
63
|
+
|
64
|
+
var tr = d3.select("tbody").selectAll("tr")
|
65
|
+
.data(tests)
|
66
|
+
.enter().append("tr");
|
67
|
+
|
68
|
+
tr.append("td")
|
69
|
+
.text(function(d) { return format(d.start); });
|
70
|
+
|
71
|
+
tr.append("td")
|
72
|
+
.text(function(d) { return format(d.end); });
|
73
|
+
|
74
|
+
tr.selectAll(".actual")
|
75
|
+
.data(function(d) {
|
76
|
+
var interpolate = d3.interpolateTransform("rotate(" + d.start + ")", "rotate(" + d.end + ")");
|
77
|
+
return d.expected.map(function(expected, i) {
|
78
|
+
return {
|
79
|
+
expected: expected,
|
80
|
+
actual: d3.transform(interpolate(i / 4)).rotate
|
81
|
+
};
|
82
|
+
});
|
83
|
+
})
|
84
|
+
.enter().append("td")
|
85
|
+
.text(function(d, i) { return format(d.actual); })
|
86
|
+
.attr("class", function(d) { return Math.abs(d.actual - d.expected) < .01 ? "success" : "fail"; });
|
87
|
+
|
88
|
+
var ga = tr.append("td").attr("width", 40).append("svg")
|
89
|
+
.attr("width", 40)
|
90
|
+
.attr("height", 20)
|
91
|
+
.append("g")
|
92
|
+
.attr("transform", "translate(20,10)")
|
93
|
+
.append("g")
|
94
|
+
.each(animateExpected);
|
95
|
+
|
96
|
+
ga.append("path")
|
97
|
+
.attr("d", d3.svg.symbol().type("cross").size(120));
|
98
|
+
|
99
|
+
ga.append("circle")
|
100
|
+
.attr("cx", 8)
|
101
|
+
.attr("r", 4);
|
102
|
+
|
103
|
+
var gb = tr.append("td").attr("width", 40).append("svg")
|
104
|
+
.attr("width", 40)
|
105
|
+
.attr("height", 20)
|
106
|
+
.append("g")
|
107
|
+
.attr("transform", "translate(20,10)")
|
108
|
+
.append("g")
|
109
|
+
.each(animateActual);
|
110
|
+
|
111
|
+
gb.append("path")
|
112
|
+
.attr("d", d3.svg.symbol().type("cross").size(120));
|
113
|
+
|
114
|
+
gb.append("circle")
|
115
|
+
.attr("cx", 8)
|
116
|
+
.attr("r", 4);
|
117
|
+
|
118
|
+
function animateExpected(d) {
|
119
|
+
d3.select(this).transition()
|
120
|
+
.duration(2500)
|
121
|
+
.attrTween("transform", function(d) {
|
122
|
+
var a = d.start % 360, b = d.end % 360;
|
123
|
+
if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
|
124
|
+
return d3.interpolateString("rotate(" + a + ")", "rotate(" + b + ")");
|
125
|
+
})
|
126
|
+
.each("end", animateExpected);
|
127
|
+
}
|
128
|
+
|
129
|
+
function animateActual(d) {
|
130
|
+
d3.select(this)
|
131
|
+
.attr("transform", "rotate(" + d.start + ")")
|
132
|
+
.transition()
|
133
|
+
.duration(2500)
|
134
|
+
.attr("transform", "rotate(" + d.end + ")")
|
135
|
+
.each("end", animateActual);
|
136
|
+
}
|
137
|
+
|
138
|
+
</script>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<meta charset="utf-8">
|
3
|
+
<title>Transform Test</title>
|
4
|
+
<style>
|
5
|
+
|
6
|
+
th,
|
7
|
+
td {
|
8
|
+
border: solid #ccc 1px;
|
9
|
+
}
|
10
|
+
|
11
|
+
</style>
|
12
|
+
<body>
|
13
|
+
<script src="../../d3.js"></script>
|
14
|
+
<script>
|
15
|
+
|
16
|
+
var outcome = d3.select("body").append("p");
|
17
|
+
|
18
|
+
var g = d3.select("body").append("svg")
|
19
|
+
.attr("width", 10)
|
20
|
+
.attr("height", 10)
|
21
|
+
.append("g");
|
22
|
+
|
23
|
+
var results = d3.select("body").append("table")
|
24
|
+
.style("display", "none");
|
25
|
+
|
26
|
+
results.append("tr").selectAll("th")
|
27
|
+
.data(["Expected", "Actual", "Expected matrix", "Actual matrix"])
|
28
|
+
.enter().append("th")
|
29
|
+
.text(function(d) { return d; });
|
30
|
+
|
31
|
+
var el = g[0][0],
|
32
|
+
v,
|
33
|
+
m,
|
34
|
+
a,
|
35
|
+
b,
|
36
|
+
failures = 0;
|
37
|
+
|
38
|
+
for (var tx = -10; tx <= 10; tx += 5) {
|
39
|
+
for (var ty = -10; ty <= 10; ty += 5) {
|
40
|
+
for (var r = -180; r <= 180; r += 15) {
|
41
|
+
for (var skx = -45; skx <= 45; skx += 45) {
|
42
|
+
for (var sx = -2; sx <= 2; sx++) {
|
43
|
+
for (var sy = -2; sy <= 2; sy++) {
|
44
|
+
v = "translate(" + tx + "," + ty + ")rotate(" + r + ")skewX(" + skx + ")scale(" + sx + "," + sy + ")";
|
45
|
+
g.attr("transform", v);
|
46
|
+
a = matrix(el);
|
47
|
+
g.attr("transform", d3.transform(v));
|
48
|
+
b = matrix(el);
|
49
|
+
if (!deepEqual(a, b, 1e-6)) {
|
50
|
+
failures++;
|
51
|
+
results
|
52
|
+
.style("display", null)
|
53
|
+
.append("tr").selectAll("td")
|
54
|
+
.data([v, d3.transform(v), a, b])
|
55
|
+
.enter().append("td")
|
56
|
+
.text(function(d) { return d; });
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
outcome.text(failures ? failures + " failures" : "Success!");
|
66
|
+
|
67
|
+
function matrix(el) {
|
68
|
+
var t = el.transform.baseVal.consolidate();
|
69
|
+
if (t) {
|
70
|
+
var m = t.matrix;
|
71
|
+
return [m.a, m.b, m.c, m.d, m.e, m.f];
|
72
|
+
}
|
73
|
+
return null;
|
74
|
+
}
|
75
|
+
|
76
|
+
function deepEqual(actual, expected, epsilon) {
|
77
|
+
epsilon = epsilon || 0;
|
78
|
+
if (actual === expected) return true;
|
79
|
+
if (actual == null || expected == null) return false;
|
80
|
+
if (actual.length !== expected.length) return false;
|
81
|
+
|
82
|
+
for (var i = 0; i < actual.length; i++) {
|
83
|
+
if (Math.abs(actual[i] - expected[i]) > epsilon) return false;
|
84
|
+
}
|
85
|
+
return true;
|
86
|
+
}
|
87
|
+
|
88
|
+
</script>
|
@@ -0,0 +1,76 @@
|
|
1
|
+
var vows = require("vows"),
|
2
|
+
_ = require("../../"),
|
3
|
+
load = require("../load"),
|
4
|
+
assert = require("../assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.scale.category");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"category": {
|
10
|
+
topic: load("scale/category").expression("d3.scale"),
|
11
|
+
"category10": category("category10", 10),
|
12
|
+
"category20": category("category20", 20),
|
13
|
+
"category20b": category("category20b", 20),
|
14
|
+
"category20c": category("category20c", 20)
|
15
|
+
}
|
16
|
+
});
|
17
|
+
|
18
|
+
function category(category, n) {
|
19
|
+
return {
|
20
|
+
"is an ordinal scale": function(scale) {
|
21
|
+
var x = scale[category](), colors = x.range();
|
22
|
+
assert.lengthOf(x.domain(), 0);
|
23
|
+
assert.lengthOf(x.range(), n);
|
24
|
+
assert.equal(x(1), colors[0]);
|
25
|
+
assert.equal(x(2), colors[1]);
|
26
|
+
assert.equal(x(1), colors[0]);
|
27
|
+
var y = x.copy();
|
28
|
+
assert.deepEqual(y.domain(), x.domain());
|
29
|
+
assert.deepEqual(y.range(), x.range());
|
30
|
+
x.domain(_.range(n));
|
31
|
+
for (var i = 0; i < n; ++i) assert.equal(x(i + n), x(i));
|
32
|
+
assert.equal(y(1), colors[0]);
|
33
|
+
assert.equal(y(2), colors[1]);
|
34
|
+
},
|
35
|
+
"each instance is isolated": function(scale) {
|
36
|
+
var a = scale[category](), b = scale[category](), colors = a.range();
|
37
|
+
assert.equal(a(1), colors[0]);
|
38
|
+
assert.equal(b(2), colors[0]);
|
39
|
+
assert.equal(b(1), colors[1]);
|
40
|
+
assert.equal(a(1), colors[0]);
|
41
|
+
},
|
42
|
+
"contains the expected number of values in the range": function(scale) {
|
43
|
+
var x = scale[category]();
|
44
|
+
assert.lengthOf(x.range(), n);
|
45
|
+
},
|
46
|
+
"each range value is distinct": function(scale) {
|
47
|
+
var map = {}, count = 0, x = scale[category]();
|
48
|
+
x.range().forEach(function(v) {
|
49
|
+
if (!(v in map)) {
|
50
|
+
map[v] = ++count;
|
51
|
+
}
|
52
|
+
});
|
53
|
+
assert.equal(count, x.range().length);
|
54
|
+
},
|
55
|
+
"each range value is a hexadecimal color": function(scale) {
|
56
|
+
var x = scale[category]();
|
57
|
+
x.range().forEach(function(v) {
|
58
|
+
assert.match(v, /#[0-9a-f]{6}/);
|
59
|
+
v = _.rgb(v);
|
60
|
+
assert.isFalse(isNaN(v.r));
|
61
|
+
assert.isFalse(isNaN(v.g));
|
62
|
+
assert.isFalse(isNaN(v.b));
|
63
|
+
});
|
64
|
+
},
|
65
|
+
"no range values are very dark or very light": function(scale) {
|
66
|
+
var x = scale[category]();
|
67
|
+
x.range().forEach(function(v) {
|
68
|
+
var c = _.hsl(v);
|
69
|
+
assert.isTrue(c.l >= .34, "expected " + v + " to be lighter (l = " + c.l + ")");
|
70
|
+
assert.isTrue(c.l <= .89, "expected " + v + " to be darker (l = " + c.l + ")");
|
71
|
+
});
|
72
|
+
}
|
73
|
+
};
|
74
|
+
}
|
75
|
+
|
76
|
+
suite.export(module);
|
@@ -0,0 +1,163 @@
|
|
1
|
+
var vows = require("vows"),
|
2
|
+
load = require("../load"),
|
3
|
+
assert = require("../assert");
|
4
|
+
|
5
|
+
var suite = vows.describe("d3.scale.identity");
|
6
|
+
|
7
|
+
suite.addBatch({
|
8
|
+
"identity": {
|
9
|
+
topic: load("scale/identity").expression("d3.scale.identity"),
|
10
|
+
|
11
|
+
"domain and range": {
|
12
|
+
"are identical": function(identity) {
|
13
|
+
var x = identity();
|
14
|
+
assert.strictEqual(x.domain, x.range);
|
15
|
+
assert.strictEqual(x.domain(), x.range());
|
16
|
+
var x = identity().domain([-10, 0, 100]);
|
17
|
+
assert.deepEqual(x.range(), [-10, 0, 100]);
|
18
|
+
var x = identity().range([-10, 0, 100]);
|
19
|
+
assert.deepEqual(x.domain(), [-10, 0, 100]);
|
20
|
+
},
|
21
|
+
"default to [0, 1]": function(identity) {
|
22
|
+
var x = identity();
|
23
|
+
assert.deepEqual(x.domain(), [0, 1]);
|
24
|
+
assert.deepEqual(x.range(), [0, 1]);
|
25
|
+
assert.strictEqual(x(.5), .5);
|
26
|
+
},
|
27
|
+
"coerce values to numbers": function(identity) {
|
28
|
+
var x = identity().domain([new Date(1990, 0, 1), new Date(1991, 0, 1)]);
|
29
|
+
assert.typeOf(x.domain()[0], "number");
|
30
|
+
assert.typeOf(x.domain()[1], "number");
|
31
|
+
assert.strictEqual(x.domain()[0], +new Date(1990, 0, 1));
|
32
|
+
assert.strictEqual(x.domain()[1], +new Date(1991, 0, 1));
|
33
|
+
assert.typeOf(x(new Date(1989, 09, 20)), "number");
|
34
|
+
assert.strictEqual(x(new Date(1989, 09, 20)), +new Date(1989, 09, 20));
|
35
|
+
var x = identity().domain(["0", "1"]);
|
36
|
+
assert.typeOf(x.domain()[0], "number");
|
37
|
+
assert.typeOf(x.domain()[1], "number");
|
38
|
+
assert.strictEqual(x(.5), .5);
|
39
|
+
var x = identity().domain([new Number(0), new Number(1)]);
|
40
|
+
assert.typeOf(x.domain()[0], "number");
|
41
|
+
assert.typeOf(x.domain()[1], "number");
|
42
|
+
assert.strictEqual(x(.5), .5);
|
43
|
+
|
44
|
+
var x = identity().range([new Date(1990, 0, 1), new Date(1991, 0, 1)]);
|
45
|
+
assert.typeOf(x.range()[0], "number");
|
46
|
+
assert.typeOf(x.range()[1], "number");
|
47
|
+
assert.strictEqual(x.range()[0], +new Date(1990, 0, 1));
|
48
|
+
assert.strictEqual(x.range()[1], +new Date(1991, 0, 1));
|
49
|
+
assert.typeOf(x(new Date(1989, 09, 20)), "number");
|
50
|
+
assert.strictEqual(x(new Date(1989, 09, 20)), +new Date(1989, 09, 20));
|
51
|
+
var x = identity().range(["0", "1"]);
|
52
|
+
assert.typeOf(x.range()[0], "number");
|
53
|
+
assert.typeOf(x.range()[1], "number");
|
54
|
+
assert.strictEqual(x(.5), .5);
|
55
|
+
var x = identity().range([new Number(0), new Number(1)]);
|
56
|
+
assert.typeOf(x.range()[0], "number");
|
57
|
+
assert.typeOf(x.range()[1], "number");
|
58
|
+
assert.strictEqual(x(.5), .5);
|
59
|
+
},
|
60
|
+
"can specify a polyidentity domain and range": function(identity) {
|
61
|
+
var x = identity().domain([-10, 0, 100]);
|
62
|
+
assert.deepEqual(x.domain(), [-10, 0, 100]);
|
63
|
+
assert.strictEqual(x(-5), -5);
|
64
|
+
assert.strictEqual(x(50), 50);
|
65
|
+
assert.strictEqual(x(75), 75);
|
66
|
+
|
67
|
+
var x = identity().range([-10, 0, 100]);
|
68
|
+
assert.deepEqual(x.range(), [-10, 0, 100]);
|
69
|
+
assert.strictEqual(x(-5), -5);
|
70
|
+
assert.strictEqual(x(50), 50);
|
71
|
+
assert.strictEqual(x(75), 75);
|
72
|
+
},
|
73
|
+
"do not affect the identity function": function(identity) {
|
74
|
+
var x = identity().domain([Infinity, NaN]);
|
75
|
+
assert.strictEqual(x(42), 42);
|
76
|
+
assert.strictEqual(x.invert(-42), -42);
|
77
|
+
}
|
78
|
+
},
|
79
|
+
|
80
|
+
"is the identity function": function(identity) {
|
81
|
+
var x = identity().domain([1, 2]);
|
82
|
+
assert.strictEqual(x(.5), .5);
|
83
|
+
assert.strictEqual(x(1), 1);
|
84
|
+
assert.strictEqual(x(1.5), 1.5);
|
85
|
+
assert.strictEqual(x(2), 2);
|
86
|
+
assert.strictEqual(x(2.5), 2.5);
|
87
|
+
},
|
88
|
+
"coerces input to a number": function(identity) {
|
89
|
+
var x = identity().domain([1, 2]);
|
90
|
+
assert.strictEqual(x("2"), 2);
|
91
|
+
},
|
92
|
+
|
93
|
+
"invert": {
|
94
|
+
"is the identity function": function(identity) {
|
95
|
+
var x = identity().domain([1, 2]);
|
96
|
+
assert.strictEqual(x.invert(.5), .5);
|
97
|
+
assert.strictEqual(x.invert(1), 1);
|
98
|
+
assert.strictEqual(x.invert(1.5), 1.5);
|
99
|
+
assert.strictEqual(x.invert(2), 2);
|
100
|
+
assert.strictEqual(x.invert(2.5), 2.5);
|
101
|
+
},
|
102
|
+
"coerces range value to numbers": function(identity) {
|
103
|
+
var x = identity().range(["0", "2"]);
|
104
|
+
assert.strictEqual(x.invert("1"), 1);
|
105
|
+
var x = identity().range([new Date(1990, 0, 1), new Date(1991, 0, 1)]);
|
106
|
+
assert.strictEqual(x.invert(new Date(1990, 6, 2, 13)), +new Date(1990, 6, 2, 13));
|
107
|
+
var x = identity().range(["#000", "#fff"]);
|
108
|
+
assert.isNaN(x.invert("#999"));
|
109
|
+
},
|
110
|
+
"coerces input to a number": function(identity) {
|
111
|
+
var x = identity().domain([1, 2]);
|
112
|
+
assert.strictEqual(x.invert("2"), 2);
|
113
|
+
}
|
114
|
+
},
|
115
|
+
|
116
|
+
"ticks": {
|
117
|
+
"generates ticks of varying degree": function(identity) {
|
118
|
+
var x = identity();
|
119
|
+
assert.deepEqual(x.ticks(1).map(x.tickFormat(1)), [0, 1]);
|
120
|
+
assert.deepEqual(x.ticks(2).map(x.tickFormat(2)), [0, .5, 1]);
|
121
|
+
assert.deepEqual(x.ticks(5).map(x.tickFormat(5)), [0, .2, .4, .6, .8, 1]);
|
122
|
+
assert.deepEqual(x.ticks(10).map(x.tickFormat(10)), [0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1]);
|
123
|
+
var x = identity().domain([1, 0]);
|
124
|
+
assert.deepEqual(x.ticks(1).map(x.tickFormat(1)), [0, 1]);
|
125
|
+
assert.deepEqual(x.ticks(2).map(x.tickFormat(2)), [0, .5, 1]);
|
126
|
+
assert.deepEqual(x.ticks(5).map(x.tickFormat(5)), [0, .2, .4, .6, .8, 1]);
|
127
|
+
assert.deepEqual(x.ticks(10).map(x.tickFormat(10)), [0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1]);
|
128
|
+
},
|
129
|
+
"formats ticks with the appropriate precision": function(identity) {
|
130
|
+
var x = identity().domain([.123456789, 1.23456789]);
|
131
|
+
assert.strictEqual(x.tickFormat(1)(x.ticks(1)[0]), "1");
|
132
|
+
assert.strictEqual(x.tickFormat(2)(x.ticks(2)[0]), "0.5");
|
133
|
+
assert.strictEqual(x.tickFormat(4)(x.ticks(4)[0]), "0.2");
|
134
|
+
assert.strictEqual(x.tickFormat(8)(x.ticks(8)[0]), "0.2");
|
135
|
+
assert.strictEqual(x.tickFormat(16)(x.ticks(16)[0]), "0.2");
|
136
|
+
assert.strictEqual(x.tickFormat(32)(x.ticks(32)[0]), "0.15");
|
137
|
+
assert.strictEqual(x.tickFormat(64)(x.ticks(64)[0]), "0.14");
|
138
|
+
assert.strictEqual(x.tickFormat(128)(x.ticks(128)[0]), "0.13");
|
139
|
+
assert.strictEqual(x.tickFormat(256)(x.ticks(256)[0]), "0.125");
|
140
|
+
}
|
141
|
+
},
|
142
|
+
|
143
|
+
"copy": {
|
144
|
+
"changes to the domain or range are isolated": function(identity) {
|
145
|
+
var x = identity(), y = x.copy();
|
146
|
+
x.domain([1, 2]);
|
147
|
+
assert.deepEqual(y.domain(), [0, 1]);
|
148
|
+
y.domain([2, 3]);
|
149
|
+
assert.deepEqual(x.domain(), [1, 2]);
|
150
|
+
assert.deepEqual(y.domain(), [2, 3]);
|
151
|
+
|
152
|
+
var x = identity(), y = x.copy();
|
153
|
+
x.range([1, 2]);
|
154
|
+
assert.deepEqual(y.range(), [0, 1]);
|
155
|
+
y.range([2, 3]);
|
156
|
+
assert.deepEqual(x.range(), [1, 2]);
|
157
|
+
assert.deepEqual(y.range(), [2, 3]);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
});
|
162
|
+
|
163
|
+
suite.export(module);
|