Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.

Commit 460b1e6

Browse files
author
Justin Palmer
committed
remove erroneous trailing whitespace
1 parent b429723 commit 460b1e6

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

index.js

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424
svg = null,
2525
point = null,
2626
target = null
27-
27+
2828
function tip(vis) {
2929
svg = getSVGNode(vis)
3030
point = svg.createSVGPoint()
3131
document.body.appendChild(node)
3232
}
33-
33+
3434
// Public - show the tooltip on the screen
3535
//
3636
// Returns a tip
3737
tip.show = function() {
3838
var args = Array.prototype.slice.call(arguments)
3939
if(args[args.length - 1] instanceof SVGElement) target = args.pop()
40-
40+
4141
var content = html.apply(this, args),
4242
poffset = offset.apply(this, args),
4343
dir = direction.apply(this, args),
@@ -46,20 +46,20 @@
4646
coords,
4747
scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
4848
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
49-
49+
5050
nodel.html(content)
5151
.style({ opacity: 1, 'pointer-events': 'all' })
52-
52+
5353
while(i--) nodel.classed(directions[i], false)
5454
coords = direction_callbacks.get(dir).apply(this)
5555
nodel.classed(dir, true).style({
5656
top: (coords.top + poffset[0]) + scrollTop + 'px',
5757
left: (coords.left + poffset[1]) + scrollLeft + 'px'
5858
})
59-
59+
6060
return tip
6161
}
62-
62+
6363
// Public - hide the tooltip
6464
//
6565
// Returns a tip
@@ -68,7 +68,7 @@
6868
nodel.style({ opacity: 0, 'pointer-events': 'none' })
6969
return tip
7070
}
71-
71+
7272
// Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.
7373
//
7474
// n - name of the attribute
@@ -82,10 +82,10 @@
8282
var args = Array.prototype.slice.call(arguments)
8383
d3.selection.prototype.attr.apply(d3.select(node), args)
8484
}
85-
85+
8686
return tip
8787
}
88-
88+
8989
// Public: Proxy style calls to the d3 tip container. Sets or gets a style value.
9090
//
9191
// n - name of the property
@@ -99,10 +99,10 @@
9999
var args = Array.prototype.slice.call(arguments)
100100
d3.selection.prototype.style.apply(d3.select(node), args)
101101
}
102-
102+
103103
return tip
104104
}
105-
105+
106106
// Public: Set or get the direction of the tooltip
107107
//
108108
// v - One of n(north), s(south), e(east), or w(west), nw(northwest),
@@ -112,10 +112,10 @@
112112
tip.direction = function(v) {
113113
if (!arguments.length) return direction
114114
direction = v == null ? v : d3.functor(v)
115-
115+
116116
return tip
117117
}
118-
118+
119119
// Public: Sets or gets the offset of the tip
120120
//
121121
// v - Array of [x, y] offset
@@ -124,10 +124,10 @@
124124
tip.offset = function(v) {
125125
if (!arguments.length) return offset
126126
offset = v == null ? v : d3.functor(v)
127-
127+
128128
return tip
129129
}
130-
130+
131131
// Public: sets or gets the html value of the tooltip
132132
//
133133
// v - String value of the tip
@@ -136,14 +136,14 @@
136136
tip.html = function(v) {
137137
if (!arguments.length) return html
138138
html = v == null ? v : d3.functor(v)
139-
139+
140140
return tip
141141
}
142-
142+
143143
function d3_tip_direction() { return 'n' }
144144
function d3_tip_offset() { return [0, 0] }
145145
function d3_tip_html() { return ' ' }
146-
146+
147147
var direction_callbacks = d3.map({
148148
n: direction_n,
149149
s: direction_s,
@@ -154,73 +154,73 @@
154154
sw: direction_sw,
155155
se: direction_se
156156
}),
157-
157+
158158
directions = direction_callbacks.keys()
159-
159+
160160
function direction_n() {
161161
var bbox = getScreenBBox()
162162
return {
163163
top: bbox.n.y - node.offsetHeight,
164164
left: bbox.n.x - node.offsetWidth / 2
165165
}
166166
}
167-
167+
168168
function direction_s() {
169169
var bbox = getScreenBBox()
170170
return {
171171
top: bbox.s.y,
172172
left: bbox.s.x - node.offsetWidth / 2
173173
}
174174
}
175-
175+
176176
function direction_e() {
177177
var bbox = getScreenBBox()
178178
return {
179179
top: bbox.e.y - node.offsetHeight / 2,
180180
left: bbox.e.x
181181
}
182182
}
183-
183+
184184
function direction_w() {
185185
var bbox = getScreenBBox()
186186
return {
187187
top: bbox.w.y - node.offsetHeight / 2,
188188
left: bbox.w.x - node.offsetWidth
189189
}
190190
}
191-
191+
192192
function direction_nw() {
193193
var bbox = getScreenBBox()
194194
return {
195195
top: bbox.nw.y - node.offsetHeight,
196196
left: bbox.nw.x - node.offsetWidth
197197
}
198198
}
199-
199+
200200
function direction_ne() {
201201
var bbox = getScreenBBox()
202202
return {
203203
top: bbox.ne.y - node.offsetHeight,
204204
left: bbox.ne.x
205205
}
206206
}
207-
207+
208208
function direction_sw() {
209209
var bbox = getScreenBBox()
210210
return {
211211
top: bbox.sw.y,
212212
left: bbox.sw.x - node.offsetWidth
213213
}
214214
}
215-
215+
216216
function direction_se() {
217217
var bbox = getScreenBBox()
218218
return {
219219
top: bbox.se.y,
220220
left: bbox.e.x
221221
}
222222
}
223-
223+
224224
function initNode() {
225225
var node = d3.select(document.createElement('div'))
226226
node.style({
@@ -230,18 +230,18 @@
230230
'pointer-events': 'none',
231231
'box-sizing': 'border-box'
232232
})
233-
233+
234234
return node.node()
235235
}
236-
236+
237237
function getSVGNode(el) {
238238
el = el.node()
239239
if(el.tagName.toLowerCase() == 'svg')
240240
return el
241-
241+
242242
return el.ownerSVGElement
243243
}
244-
244+
245245
// Private - gets the screen coordinates of a shape
246246
//
247247
// Given a shape on the screen, will return an SVGPoint for the directions
@@ -264,7 +264,7 @@
264264
height = tbbox.height,
265265
x = tbbox.x,
266266
y = tbbox.y
267-
267+
268268
point.x = x
269269
point.y = y
270270
bbox.nw = point.matrixTransform(matrix)
@@ -283,11 +283,11 @@
283283
bbox.n = point.matrixTransform(matrix)
284284
point.y += height
285285
bbox.s = point.matrixTransform(matrix)
286-
286+
287287
return bbox
288288
}
289-
289+
290290
return tip
291291
};
292292

293-
}));
293+
}));

0 commit comments

Comments
 (0)