jqvmap-rails 0.1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 282886b877dec580d04292645f6b9bb4500b599d
4
+ data.tar.gz: 3614bb802d1ba41b7aec66eb67633b837a2226f6
5
+ SHA512:
6
+ metadata.gz: 56a53c8e8cf48ee5f258956b69225a5cc10a32181d162bc6964caf06f6620460b1d088fc357433f16df7106128f11c8d4fe29d62e1175091025238a3d8a30043
7
+ data.tar.gz: 10185aa9243099be1d49d1f320d724636104404eb7364a60e4a22e3a57d6e843eabbf81e632997fe3a732913aafbd46196d7e9aa2f3a33050f93a43181d3224d
@@ -0,0 +1,7 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .DS_Store
6
+ .bin
7
+ vendor/bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in jquery-datatables-rails.gemspec
4
+ gemspec
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Adrian Rangel
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,739 @@
1
+ ![JQVMap](http://jqvmap.com/img/logo.png "JQVMap")
2
+
3
+ This gem bundles the contents of JQVMap from Manifest Interactive
4
+
5
+ This project is a heavily modified version of [jVectorMap](https://github.com/bjornd/jvectormap). I chose to start fresh rather than fork their project as my intentions were to take it in such a different direction that it would become incompatibale with the original source, rendering it near impossible to merge our projects together without extreme complications.
6
+
7
+ ### Rails Setup
8
+ Load jQuery(1.7+) and include JQVMap plugin files
9
+
10
+ add to your Gemfile
11
+ ```ruby
12
+ gem 'jqvmap-rails'
13
+ ```
14
+
15
+ add to your application.js
16
+ ```ruby
17
+ //= require jquery-jvectormap
18
+ ```
19
+
20
+ add to your application.css
21
+ ```ruby
22
+ *= require owl.jvectormap
23
+ ```
24
+
25
+ jQuery Vector Map
26
+ ======
27
+
28
+ To get started, all you need to do is include the JavaScript and CSS files for the map you want to load. Here is a sample HTML page for loading the World Map with default settings:
29
+
30
+ <?xml version="1.0" encoding="UTF-8"?>
31
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
32
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
33
+ <head>
34
+ <title>JQVMap - World Map</title>
35
+
36
+ <link href="../jqvmap/jqvmap.css" media="screen" rel="stylesheet" type="text/css" />
37
+
38
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
39
+ <script src="../jqvmap/jquery.vmap.js" type="text/javascript"></script>
40
+ <script src="../jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
41
+
42
+ <script type="text/javascript">
43
+ jQuery(document).ready(function() {
44
+ jQuery('#vmap').vectorMap({ map: 'world_en' });
45
+ });
46
+ </script>
47
+ </head>
48
+ <body>
49
+ <div id="vmap" style="width: 600px; height: 400px;"></div>
50
+ </body>
51
+ </html>
52
+
53
+ Making it Pretty
54
+ ======
55
+
56
+ While initializing a map you can provide parameters to change its look and feel.
57
+
58
+ jQuery('#vmap').vectorMap(
59
+ {
60
+ map: 'world_en',
61
+ backgroundColor: '#a5bfdd',
62
+ borderColor: '#818181',
63
+ borderOpacity: 0.25,
64
+ borderWidth: 1,
65
+ color: '#f4f3f0',
66
+ enableZoom: true,
67
+ hoverColor: '#c9dfaf',
68
+ hoverOpacity: null,
69
+ normalizeFunction: 'linear',
70
+ scaleColors: ['#b6d6ff', '#005ace'],
71
+ selectedColor: '#c9dfaf',
72
+ selectedRegion: null,
73
+ showTooltip: true,
74
+ onRegionClick: function(element, code, region)
75
+ {
76
+ var message = 'You clicked "'
77
+ + region
78
+ + '" which has the code: '
79
+ + code.toUpperCase();
80
+
81
+ alert(message);
82
+ }
83
+ });
84
+
85
+ Configuration Settings
86
+ ------
87
+
88
+ **map** *'world_en'*
89
+
90
+ Map you want to load. Must include the javascript file with the name of the map you want. Available maps with this library are world_en, usa_en, europe_en and germany_en
91
+
92
+ **backgroundColor** *'#a5bfdd'*
93
+
94
+ Background color of map container in any CSS compatible format.
95
+
96
+ **borderColor** *'#818181'*
97
+
98
+ Border Color to use to outline map objects
99
+
100
+ **borderOpacity** *0.5*
101
+
102
+ Border Opacity to use to outline map objects ( use anything from 0-1, e.g. 0.5, defaults to 0.25 )
103
+
104
+ **borderWidth** *3*
105
+
106
+ Border Width to use to outline map objects ( defaults to 1 )
107
+
108
+ **color** *'#f4f3f0'*
109
+
110
+ Color of map regions.
111
+
112
+ **colors**
113
+
114
+ Colors of individual map regions. Keys of the colors objects are country codes according to ISO 3166-1 alpha-2 standard. Keys of colors must be in lower case.
115
+
116
+ **enableZoom** *boolean*
117
+
118
+ Whether to Enable Map Zoom ( true or false, defaults to true)
119
+
120
+ **hoverColor** *'#c9dfaf'*
121
+
122
+ Color of the region when mouse pointer is over it.
123
+
124
+ **hoverOpacity** *0.5*
125
+
126
+ Opacity of the region when mouse pointer is over it.
127
+
128
+ **normalizeFunction** *'linear'*
129
+
130
+ This function can be used to improve results of visualizations for data with non-linear nature. Function gets raw value as the first parameter and should return value which will be used in calculations of color, with which particular region will be painted.
131
+
132
+ **scaleColors** *['#b6d6ff', '#005ace']*
133
+
134
+ This option defines colors, with which regions will be painted when you set option values. Array scaleColors can have more then two elements. Elements should be strings representing colors in RGB hex format.
135
+
136
+ **selectedRegion** *'mo'*
137
+
138
+ This is the Region that you are looking to have preselected (two letter ISO code, defaults to null )
139
+
140
+ WORLD
141
+ ------------------------------
142
+ AE = United Arab Emirates
143
+ AF = Afghanistan
144
+ AG = Antigua and Barbuda
145
+ AL = Albania
146
+ AM = Armenia
147
+ AO = Angola
148
+ AR = Argentina
149
+ AT = Austria
150
+ AU = Australia
151
+ AZ = Azerbaijan
152
+ BA = Bosnia and Herzegovina
153
+ BB = Barbados
154
+ BD = Bangladesh
155
+ BE = Belgium
156
+ BF = Burkina Faso
157
+ BG = Bulgaria
158
+ BI = Burundi
159
+ BJ = Benin
160
+ BN = Brunei Darussalam
161
+ BO = Bolivia
162
+ BR = Brazil
163
+ BS = Bahamas
164
+ BT = Bhutan
165
+ BW = Botswana
166
+ BY = Belarus
167
+ BZ = Belize
168
+ CA = Canada
169
+ CD = Congo
170
+ CF = Central African Republic
171
+ CG = Congo
172
+ CH = Switzerland
173
+ CI = Cote d'Ivoire
174
+ CL = Chile
175
+ CM = Cameroon
176
+ CN = China
177
+ CO = Colombia
178
+ CR = Costa Rica
179
+ CU = Cuba
180
+ CV = Cape Verde
181
+ CY = Cyprus
182
+ CZ = Czech Republic
183
+ DE = Germany
184
+ DJ = Djibouti
185
+ DK = Denmark
186
+ DM = Dominica
187
+ DO = Dominican Republic
188
+ DZ = Algeria
189
+ EC = Ecuador
190
+ EE = Estonia
191
+ EG = Egypt
192
+ ER = Eritrea
193
+ ES = Spain
194
+ ET = Ethiopia
195
+ FI = Finland
196
+ FJ = Fiji
197
+ FK = Falkland Islands
198
+ FR = France
199
+ GA = Gabon
200
+ GB = United Kingdom
201
+ GD = Grenada
202
+ GE = Georgia
203
+ GF = French Guiana
204
+ GH = Ghana
205
+ GL = Greenland
206
+ GM = Gambia
207
+ GN = Guinea
208
+ GQ = Equatorial Guinea
209
+ GR = Greece
210
+ GT = Guatemala
211
+ GW = Guinea-Bissau
212
+ GY = Guyana
213
+ HN = Honduras
214
+ HR = Croatia
215
+ HT = Haiti
216
+ HU = Hungary
217
+ ID = Indonesia
218
+ IE = Ireland
219
+ IL = Israel
220
+ IN = India
221
+ IQ = Iraq
222
+ IR = Iran
223
+ IS = Iceland
224
+ IT = Italy
225
+ JM = Jamaica
226
+ JO = Jordan
227
+ JP = Japan
228
+ KE = Kenya
229
+ KG = Kyrgyz Republic
230
+ KH = Cambodia
231
+ KM = Comoros
232
+ KN = Saint Kitts and Nevis
233
+ KP = North Korea
234
+ KR = South Korea
235
+ KW = Kuwait
236
+ KZ = Kazakhstan
237
+ LA = Lao People's Democratic Republic
238
+ LB = Lebanon
239
+ LC = Saint Lucia
240
+ LK = Sri Lanka
241
+ LR = Liberia
242
+ LS = Lesotho
243
+ LT = Lithuania
244
+ LV = Latvia
245
+ LY = Libya
246
+ MA = Morocco
247
+ MD = Moldova
248
+ MG = Madagascar
249
+ MK = Macedonia
250
+ ML = Mali
251
+ MM = Myanmar
252
+ MN = Mongolia
253
+ MR = Mauritania
254
+ MT = Malta
255
+ MU = Mauritius
256
+ MV = Maldives
257
+ MW = Malawi
258
+ MX = Mexico
259
+ MY = Malaysia
260
+ MZ = Mozambique
261
+ NA = Namibia
262
+ NC = New Caledonia
263
+ NE = Niger
264
+ NG = Nigeria
265
+ NI = Nicaragua
266
+ NL = Netherlands
267
+ NO = Norway
268
+ NP = Nepal
269
+ NZ = New Zealand
270
+ OM = Oman
271
+ PA = Panama
272
+ PE = Peru
273
+ PF = French Polynesia
274
+ PG = Papua New Guinea
275
+ PH = Philippines
276
+ PK = Pakistan
277
+ PL = Poland
278
+ PT = Portugal
279
+ PY = Paraguay
280
+ QA = Qatar
281
+ RE = Reunion
282
+ RO = Romania
283
+ RS = Serbia
284
+ RU = Russian Federationß
285
+ RW = Rwanda
286
+ SA = Saudi Arabia
287
+ SB = Solomon Islands
288
+ SC = Seychelles
289
+ SD = Sudan
290
+ SE = Sweden
291
+ SI = Slovenia
292
+ SK = Slovakia
293
+ SL = Sierra Leone
294
+ SN = Senegal
295
+ SO = Somalia
296
+ SR = Suriname
297
+ ST = Sao Tome and Principe
298
+ SV = El Salvador
299
+ SY = Syrian Arab Republic
300
+ SZ = Swaziland
301
+ TD = Chad
302
+ TG = Togo
303
+ TH = Thailand
304
+ TJ = Tajikistan
305
+ TL = Timor-Leste
306
+ TM = Turkmenistan
307
+ TN = Tunisia
308
+ TR = Turkey
309
+ TT = Trinidad and Tobago
310
+ TW = Taiwan
311
+ TZ = Tanzania
312
+ UA = Ukraine
313
+ UG = Uganda
314
+ US = United States of America
315
+ UY = Uruguay
316
+ UZ = Uzbekistan
317
+ VE = Venezuela
318
+ VN = Vietnam
319
+ VU = Vanuatu
320
+ YE = Yemen
321
+ ZA = South Africa
322
+ ZM = Zambia
323
+ ZW = Zimbabwe
324
+
325
+ USA
326
+ ------------------------------
327
+ AK = Alaska
328
+ AL = Alabama
329
+ AR = Arkansas
330
+ AZ = Arizona
331
+ CA = California
332
+ CO = Colorado
333
+ CT = Connecticut
334
+ DC = District of Columbia
335
+ DE = Delaware
336
+ FL = Florida
337
+ GA = Georgia
338
+ HI = Hawaii
339
+ IA = Iowa
340
+ ID = Idaho
341
+ IL = Illinois
342
+ IN = Indiana
343
+ KS = Kansas
344
+ KY = Kentucky
345
+ LA = Louisiana
346
+ MA = Massachusetts
347
+ MD = Maryland
348
+ ME = Maine
349
+ MI = Michigan
350
+ MN = Minnesota
351
+ MO = Missouri
352
+ MS = Mississippi
353
+ MT = Montana
354
+ NC = North Carolina
355
+ ND = North Dakota
356
+ NE = Nebraska
357
+ NH = New Hampshire
358
+ NJ = New Jersey
359
+ NM = New Mexico
360
+ NV = Nevada
361
+ NY = New York
362
+ OH = Ohio
363
+ OK = Oklahoma
364
+ OR = Oregon
365
+ PA = Pennsylvania
366
+ RI = Rhode Island
367
+ SC = South Carolina
368
+ SD = South Dakota
369
+ TN = Tennessee
370
+ TX = Texas
371
+ UT = Utah
372
+ VA = Virginia
373
+ VT = Vermont
374
+ WA = Washington
375
+ WI = Wisconsin
376
+ WV = West Virginia
377
+ WY = Wyoming
378
+
379
+ EUROPE
380
+ ------------------------------
381
+ AD = Andorra
382
+ AL = Albania
383
+ AM = Armenia
384
+ AT = Austria
385
+ AZ = Azerbaijan
386
+ BA = Bosnia and Herzegovina
387
+ BE = Belgium
388
+ BG = Bulgaria
389
+ BY = Belarus
390
+ CH = Switzerland
391
+ CY = Cyprus
392
+ CZ = Czech Republic
393
+ DE = Germany
394
+ DK = Denmark
395
+ DZ = Algeria
396
+ EE = Estonia
397
+ ES = Spain
398
+ FI = Finland
399
+ FR = France
400
+ GB = United Kingdom
401
+ GE = Georgia
402
+ GL = Greenland
403
+ GR = Greece
404
+ HR = Croatia
405
+ HU = Hungary
406
+ IE = Ireland
407
+ IL = Israel
408
+ IQ = Iraq
409
+ IR = Iran
410
+ IS = Iceland
411
+ IT = Italy
412
+ JO = Jordan
413
+ KZ = Kazakhstan
414
+ LB = Lebanon
415
+ LI = Liechtenstein
416
+ LT = Lithuania
417
+ LU = Luxembourg
418
+ LV = Latvia
419
+ MA = Morocco
420
+ MC = Monaco
421
+ MD = Moldova
422
+ ME = Montenegro
423
+ MK = Macedonia
424
+ MT = Malta
425
+ NL = Netherlands
426
+ NO = Norway
427
+ PL = Poland
428
+ PT = Portugal
429
+ RO = Romania
430
+ RU = Russian Federation
431
+ SA = Saudi Arabia
432
+ SE = Sweden
433
+ SI = Slovenia
434
+ SK = Slovakia
435
+ SM = San Marino
436
+ SR = Suriname
437
+ SY = Syrian Arab Republic
438
+ TM = Turkmenistan
439
+ TN = Tunisia
440
+ TR = Turkey
441
+ UA = Ukraine
442
+
443
+ GERMANY
444
+ ------------------------------
445
+ BB = Brandenburg
446
+ BE = Berlin
447
+ BW = Baden-WÃrttemberg
448
+ BY = Bayern
449
+ HB = Bremen
450
+ HE = Hessen
451
+ HH = Hamburg
452
+ MV = Mecklenburg-Vorpommern
453
+ NI = Niedersachsen
454
+ NW = Nordrhein-Westfalen
455
+ RP = Rheinland-Pfalz
456
+ SH = Schleswig-Holstein
457
+ SL = Saarland
458
+ SN = Sachsen
459
+ ST = Sachsen-Anhalt
460
+ TH = ThÃri
461
+
462
+ RUSSIA
463
+ ------------------------------
464
+ CH = Chukotka Autonomous Okrug
465
+ KA = Kamchatka Krai
466
+ MA = Magadan Oblast
467
+ SA = Sakha Republic
468
+ AM = Amur Oblast
469
+ PR = Primorsky Krai
470
+ EU = Jewish Autonomous Oblast
471
+ HA = Khabarovsk Krai
472
+ SH = Sakhalin Oblast
473
+ OM = Omsk Oblast
474
+ NV = Novosibirsk Oblast
475
+ AL = Altai Krai
476
+ LT = Altai Republic
477
+ TV = Tuva Republic
478
+ HK = Republic of Khakassia
479
+ KM = Kemerovo Oblast
480
+ TM = Tomsk Oblast
481
+ ZB = Zabaykalsky Krai
482
+ BR = Buryat Republic
483
+ IR = Irkutsk Oblast
484
+ KR = Krasnoyarsk Krai
485
+ YA = Yamalo-Nenets Autonomous Okrug
486
+ HT = Khanty–Mansi Autonomous Okrug
487
+ TU = Tyumen Oblast
488
+ KU = Kurgan Oblast
489
+ CL = Chelyabinsk Oblast
490
+ SV = Sverdlovsk Oblast
491
+ AR = Arkhangelsk Oblast
492
+ NE = Nenets Autonomous Okrug
493
+ KO = Komi Republic
494
+ MU = Murmansk Oblast
495
+ VO = Vologda Oblast
496
+ NO = Novgorod Oblast
497
+ PS = Pskov Oblast
498
+ LE = Leningrad Oblast
499
+ KL = Republic of Karelia
500
+ KN = Kaliningrad Oblast
501
+ DA = Republic of Dagestan
502
+ ST = Stavropol Krai
503
+ SO = Republic of North Ossetia–Alania
504
+ KB = Kabardino-Balkar Republic
505
+ KH = Karachay–Cherkess Republic
506
+ CC = Chechen Republic
507
+ IN = Republic of Ingushetia
508
+ AD = Republic of Adygea
509
+ KS = Krasnodar Krai
510
+ RO = Rostov Oblast
511
+ KK = Republic of Kalmykia
512
+ AS = Astrakhan Oblast
513
+ VL = Volgograd Oblast
514
+ TR = Tver Oblast
515
+ SM = Smolensk Oblast
516
+ BN = Bryansk Oblast
517
+ KY = Kursk Oblast
518
+ BL = Belgorod Oblast
519
+ OR = Oryol Oblast
520
+ KJ = Kaluga Oblast
521
+ TL = Tula Oblast
522
+ LP = Lipetsk Oblast
523
+ MC = Moscow Oblast
524
+ RZ = Ryazan Oblast
525
+ TB = Tambov Oblast
526
+ VM = Vladimir Oblast
527
+ IV = Ivanovo Oblast
528
+ YR = Yaroslavl Oblast
529
+ KT = Kostroma Oblast
530
+ NN = Nizhny Novgorod Oblast
531
+ MR = Republic of Mordovia
532
+ PZ = Penza Oblast
533
+ SR = Saratov Oblast
534
+ SS = Samara Oblast
535
+ OB = Orenburg Oblast
536
+ BS = Republic of Bashkortostan
537
+ UL = Ulyanovsk Oblast
538
+ CU = Chuvash Republic
539
+ TA = Republic of Tatarstan
540
+ ML = Mari El Republic
541
+ UD = Udmurt Republic
542
+ KI = Kirov Oblast
543
+ PE = Perm Krai
544
+ VN = Voronezh Oblast
545
+
546
+ **showTooltip** *boolean*
547
+
548
+ Whether to show Tooltips on Mouseover ( true or false, defaults to true)
549
+
550
+ **onLabelShow** *function(event, label, code)*
551
+
552
+ Callback function which will be called before label is shown. Label DOM object and country code will be passed to the callback as arguments.
553
+
554
+ **onRegionOver** *function(event, code, region)*
555
+
556
+ Callback function which will be called when the mouse cursor enters the region path. Country code will be passed to the callback as argument.
557
+
558
+ **onRegionOut** *function(event, code, region)*
559
+
560
+ Callback function which will be called when the mouse cursor leaves the region path. Country code will be passed to the callback as argument.
561
+
562
+ **onRegionClick** *function(event, code, region)*
563
+
564
+ Callback function which will be called when the user clicks the region path. Country code will be passed to the callback as argument. This callback may be called while the user is moving the map. If you need to distinguish between a "real" click and a click resulting from moving the map, you can inspect **$(event.currentTarget).data('mapObject').isMoving**.
565
+
566
+ Dynamic Updating
567
+ ======
568
+
569
+ Most of the options can be changed after initialization using the following code:
570
+
571
+ jQuery('#vmap').vectorMap('set', 'colors', {us: '#0000ff'});
572
+
573
+ Instead of colors can be used any parameter except callbacks. Callbacks can be added and deleted using standard jQuery patterns of working with events.
574
+ You can define callback function when you initialize JQVMap:
575
+
576
+ jQuery('#vmap').vectorMap(
577
+ {
578
+ onLabelShow: function(event, label, code)
579
+ {
580
+
581
+ },
582
+ onRegionOver: function(event, code, region)
583
+ {
584
+
585
+ },
586
+ onRegionOut: function(event, code, region)
587
+ {
588
+
589
+ },
590
+ onRegionClick: function(event, code, region)
591
+ {
592
+
593
+ }
594
+ });
595
+
596
+ Or later using standard jQuery mechanism:
597
+
598
+ jQuery('#vmap').bind('labelShow.jqvmap',
599
+ function(event, label, code)
600
+ {
601
+
602
+ }
603
+ );
604
+ jQuery('#vmap').bind('regionMouseOver.jqvmap',
605
+ function(event, code, region)
606
+ {
607
+
608
+ }
609
+ );
610
+ jQuery('#vmap').bind('regionMouseOut.jqvmap',
611
+ function(event, code, region)
612
+ {
613
+
614
+ }
615
+ );
616
+ jQuery('#vmap').bind('regionClick.jqvmap',
617
+ function(event, code, region)
618
+ {
619
+
620
+ }
621
+ );
622
+
623
+ Consider that fact that you can use standard features of jQuery events like event.preventDefault() or returning false from the callback to prevent default behavior of JQVMap (showing label or changing country color on hover). In the following example, when user moves mouse cursor over Canada label won't be shown and color of country won't be changed. At the same label for Russia will have custom text.
624
+
625
+ jQuery('#vmap').vectorMap(
626
+ {
627
+ onLabelShow: function(event, label, code)
628
+ {
629
+ if (code == 'ca')
630
+ {
631
+ event.preventDefault();
632
+ }
633
+ else if (code == 'ru')
634
+ {
635
+ label.text('Bears, vodka, balalaika');
636
+ }
637
+ },
638
+ onRegionOver: function(event, code)
639
+ {
640
+ if (code == 'ca')
641
+ {
642
+ event.preventDefault();
643
+ }
644
+ },
645
+ });
646
+
647
+ Data Visualization
648
+ ======
649
+
650
+ Here I want to demonstrate how visualization of some geographical-related data can be done using JQVMap. Let's visualize information about GDP in 2010 for every country. At first we need some data. Let it be site of International Monetary Fond. There we can get information in xsl format, which can be converted first to csv and then to json with any scripting language. Now we have file gdp-data.js with such content (globals are evil, I know, but just for the sake of simplification):
651
+
652
+ var sample_data = {"af":16.63,"al":11.58,"dz":158.97,...};
653
+
654
+ Then connect it to the page and add some code to make visualization:
655
+
656
+ var max = 0,
657
+ min = Number.MAX_VALUE,
658
+ cc,
659
+ startColor = [200, 238, 255],
660
+ endColor = [0, 100, 145],
661
+ colors = {},
662
+ hex;
663
+
664
+ //find maximum and minimum values
665
+ for (cc in gdpData)
666
+ {
667
+ if (parseFloat(gdpData[cc]) > max)
668
+ {
669
+ max = parseFloat(gdpData[cc]);
670
+ }
671
+ if (parseFloat(gdpData[cc]) < min)
672
+ {
673
+ min = parseFloat(gdpData[cc]);
674
+ }
675
+ }
676
+
677
+ //set colors according to values of GDP
678
+ for (cc in gdpData)
679
+ {
680
+ if (gdpData[cc] > 0)
681
+ {
682
+ colors[cc] = '#';
683
+ for (var i = 0; i<3; i++)
684
+ {
685
+ hex = Math.round(startColor[i]
686
+ + (endColor[i]
687
+ - startColor[i])
688
+ * (gdpData[cc] / (max - min))).toString(16);
689
+
690
+ if (hex.length == 1)
691
+ {
692
+ hex = '0'+hex;
693
+ }
694
+
695
+ colors[cc] += (hex.length == 1 ? '0' : '') + hex;
696
+ }
697
+ }
698
+ }
699
+
700
+ //initialize JQVMap
701
+ jQuery('#vmap').vectorMap(
702
+ {
703
+ colors: colors,
704
+ hoverOpacity: 0.7,
705
+ hoverColor: false
706
+ });
707
+
708
+ Custom Maps
709
+ ======
710
+
711
+ The following is the converter instructions directly from [jVectorMap](https://github.com/bjornd/jvectormap) that could be used to create your own maps for JQVMap from the data in various GIS formats like Shapefile. The following command could be used to convert USA map from the data available at [www.naturalearthdata.com](www.naturalearthdata.com):
712
+
713
+ python \
714
+ path/to/converter.py \
715
+ path/to/geo-data.shp \
716
+ path/to/resulting-map.js \
717
+ --width 900 \
718
+ --country_name_index 4 \
719
+ --where "ISO = 'USA'" \
720
+ --codes_file path/to/codes-en.tsv \
721
+ --insets '[{"codes": ["US-AK"], "width": 200, "left": 10, "top": 370}, {"codes": ["US-HI"], "width": 100, "left": 220, "top": 400}]' \
722
+ --minimal_area 4000000 \
723
+ --buffer_distance -3000 \
724
+ --simplify_tolerance 1000 \
725
+ --longtitude0 10w \
726
+ --name us
727
+ Contributing
728
+ ------------
729
+
730
+ 1. Fork it.
731
+ 2. Create a branch (`git checkout -b my_markup`)
732
+ 3. Commit your changes (`git commit -am "Cool new feature"`)
733
+ 4. Push to the branch (`git push origin my_markup`)
734
+ 5. Open a [Pull Request][1]
735
+ 6. Enjoy a refreshing 'Insert Favorite Beverage' and wait
736
+
737
+ License
738
+ ------------
739
+ The MIT License (MIT)
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/jqvmap-rails/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.name = "jqvmap-rails"
6
+ gem.version = Jqvmap::Rails::VERSION
7
+ gem.authors = ["Manifest Interactive", "Adrian Rangel"]
8
+ gem.email = ["adrian.rangel@gmail.com"]
9
+ gem.homepage = "http://jqvmap.com/"
10
+ gem.summary = %q{JQVMap is a jQuery plugin that renders Vector Maps. It uses resizable Scalable Vector Graphics (SVG) for modern browsers like Firefox, Safari, Chrome, Opera and Internet Explorer 9. Legacy support for older versions of Internet Explorer 6-8 is provided via VML}
11
+ gem.description = %q{JQVMap is a jQuery plugin that renders Vector Maps. It uses resizable Scalable Vector Graphics (SVG) for modern browsers like Firefox, Safari, Chrome, Opera and Internet Explorer 9. Legacy support for older versions of Internet Explorer 6-8 is provided via VML}
12
+ gem.license = "MIT"
13
+
14
+ gem.rubyforge_project = "jqvmap-rails"
15
+
16
+ gem.files = `git ls-files`.split("\n")
17
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_dependency "jquery-rails"
22
+ gem.add_development_dependency "rake"
23
+
24
+ end
@@ -0,0 +1,8 @@
1
+ require "owlcarousel-rails/version"
2
+
3
+ module Jqvmap
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Jqvmap
2
+ module Rails
3
+ VERSION = "0.1.2.2"
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ /**
2
+ * jVectorMap version 1.2.2
3
+ *
4
+ * Copyright 2011-2013, Kirill Lebedev
5
+ * Licensed under the MIT license.
6
+ *
7
+ */(function(e){var t={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};e.fn.vectorMap=function(e){var n,r,i,n=this.children(".jvectormap-container").data("mapObject");if(e==="addMap")jvm.WorldMap.maps[arguments[1]]=arguments[2];else{if(!(e!=="set"&&e!=="get"||!t[e][arguments[1]]))return r=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1),n[e+r].apply(n,Array.prototype.slice.call(arguments,2));e=e||{},e.container=this,n=new jvm.WorldMap(e)}return this}})(jQuery),function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=t.length;n;)e.event.fixHooks[t[--n]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],r,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);var jvm={inherits:function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.parentClass=t},mixin:function(e,t){var n;for(n in t.prototype)t.prototype.hasOwnProperty(n)&&(e.prototype[n]=t.prototype[n])},min:function(e){var t=Number.MAX_VALUE,n;if(e instanceof Array)for(n=0;n<e.length;n++)e[n]<t&&(t=e[n]);else for(n in e)e[n]<t&&(t=e[n]);return t},max:function(e){var t=Number.MIN_VALUE,n;if(e instanceof Array)for(n=0;n<e.length;n++)e[n]>t&&(t=e[n]);else for(n in e)e[n]>t&&(t=e[n]);return t},keys:function(e){var t=[],n;for(n in e)t.push(n);return t},values:function(e){var t=[],n,r;for(r=0;r<arguments.length;r++){e=arguments[r];for(n in e)t.push(e[n])}return t}};jvm.$=jQuery,jvm.AbstractElement=function(e,t){this.node=this.createElement(e),this.name=e,this.properties={},t&&this.set(t)},jvm.AbstractElement.prototype.set=function(e,t){var n;if(typeof e=="object")for(n in e)this.properties[n]=e[n],this.applyAttr(n,e[n]);else this.properties[e]=t,this.applyAttr(e,t)},jvm.AbstractElement.prototype.get=function(e){return this.properties[e]},jvm.AbstractElement.prototype.applyAttr=function(e,t){this.node.setAttribute(e,t)},jvm.AbstractElement.prototype.remove=function(){jvm.$(this.node).remove()},jvm.AbstractCanvasElement=function(e,t,n){this.container=e,this.setSize(t,n),this.rootElement=new jvm[this.classPrefix+"GroupElement"],this.node.appendChild(this.rootElement.node),this.container.appendChild(this.node)},jvm.AbstractCanvasElement.prototype.add=function(e,t){t=t||this.rootElement,t.add(e),e.canvas=this},jvm.AbstractCanvasElement.prototype.addPath=function(e,t,n){var r=new jvm[this.classPrefix+"PathElement"](e,t);return this.add(r,n),r},jvm.AbstractCanvasElement.prototype.addCircle=function(e,t,n){var r=new jvm[this.classPrefix+"CircleElement"](e,t);return this.add(r,n),r},jvm.AbstractCanvasElement.prototype.addGroup=function(e){var t=new jvm[this.classPrefix+"GroupElement"];return e?e.node.appendChild(t.node):this.node.appendChild(t.node),t.canvas=this,t},jvm.AbstractShapeElement=function(e,t,n){this.style=n||{},this.style.current={},this.isHovered=!1,this.isSelected=!1,this.updateStyle()},jvm.AbstractShapeElement.prototype.setHovered=function(e){this.isHovered!==e&&(this.isHovered=e,this.updateStyle())},jvm.AbstractShapeElement.prototype.setSelected=function(e){this.isSelected!==e&&(this.isSelected=e,this.updateStyle(),jvm.$(this.node).trigger("selected",[e]))},jvm.AbstractShapeElement.prototype.setStyle=function(e,t){var n={};typeof e=="object"?n=e:n[e]=t,jvm.$.extend(this.style.current,n),this.updateStyle()},jvm.AbstractShapeElement.prototype.updateStyle=function(){var e={};jvm.AbstractShapeElement.mergeStyles(e,this.style.initial),jvm.AbstractShapeElement.mergeStyles(e,this.style.current),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(e,this.style.hover),this.isSelected&&(jvm.AbstractShapeElement.mergeStyles(e,this.style.selected),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(e,this.style.selectedHover)),this.set(e)},jvm.AbstractShapeElement.mergeStyles=function(e,t){var n;t=t||{};for(n in t)t[n]===null?delete e[n]:e[n]=t[n]},jvm.SVGElement=function(e,t){jvm.SVGElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.SVGElement,jvm.AbstractElement),jvm.SVGElement.svgns="http://www.w3.org/2000/svg",jvm.SVGElement.prototype.createElement=function(e){return document.createElementNS(jvm.SVGElement.svgns,e)},jvm.SVGElement.prototype.addClass=function(e){this.node.setAttribute("class",e)},jvm.SVGElement.prototype.getElementCtr=function(e){return jvm["SVG"+e]},jvm.SVGElement.prototype.getBBox=function(){return this.node.getBBox()},jvm.SVGGroupElement=function(){jvm.SVGGroupElement.parentClass.call(this,"g")},jvm.inherits(jvm.SVGGroupElement,jvm.SVGElement),jvm.SVGGroupElement.prototype.add=function(e){this.node.appendChild(e.node)},jvm.SVGCanvasElement=function(e,t,n){this.classPrefix="SVG",jvm.SVGCanvasElement.parentClass.call(this,"svg"),jvm.AbstractCanvasElement.apply(this,arguments)},jvm.inherits(jvm.SVGCanvasElement,jvm.SVGElement),jvm.mixin(jvm.SVGCanvasElement,jvm.AbstractCanvasElement),jvm.SVGCanvasElement.prototype.setSize=function(e,t){this.width=e,this.height=t,this.node.setAttribute("width",e),this.node.setAttribute("height",t)},jvm.SVGCanvasElement.prototype.applyTransformParams=function(e,t,n){this.scale=e,this.transX=t,this.transY=n,this.rootElement.node.setAttribute("transform","scale("+e+") translate("+t+", "+n+")")},jvm.SVGShapeElement=function(e,t,n){jvm.SVGShapeElement.parentClass.call(this,e,t),jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.SVGShapeElement,jvm.SVGElement),jvm.mixin(jvm.SVGShapeElement,jvm.AbstractShapeElement),jvm.SVGPathElement=function(e,t){jvm.SVGPathElement.parentClass.call(this,"path",e,t),this.node.setAttribute("fill-rule","evenodd")},jvm.inherits(jvm.SVGPathElement,jvm.SVGShapeElement),jvm.SVGCircleElement=function(e,t){jvm.SVGCircleElement.parentClass.call(this,"circle",e,t)},jvm.inherits(jvm.SVGCircleElement,jvm.SVGShapeElement),jvm.VMLElement=function(e,t){jvm.VMLElement.VMLInitialized||jvm.VMLElement.initializeVML(),jvm.VMLElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.VMLElement,jvm.AbstractElement),jvm.VMLElement.VMLInitialized=!1,jvm.VMLElement.initializeVML=function(){try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),jvm.VMLElement.prototype.createElement=function(e){return document.createElement("<rvml:"+e+' class="rvml">')}}catch(e){jvm.VMLElement.prototype.createElement=function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"),jvm.VMLElement.VMLInitialized=!0},jvm.VMLElement.prototype.getElementCtr=function(e){return jvm["VML"+e]},jvm.VMLElement.prototype.addClass=function(e){jvm.$(this.node).addClass(e)},jvm.VMLElement.prototype.applyAttr=function(e,t){this.node[e]=t},jvm.VMLElement.prototype.getBBox=function(){var e=jvm.$(this.node);return{x:e.position().left/this.canvas.scale,y:e.position().top/this.canvas.scale,width:e.width()/this.canvas.scale,height:e.height()/this.canvas.scale}},jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,"group"),this.node.style.left="0px",this.node.style.top="0px",this.node.coordorigin="0 0"},jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement),jvm.VMLGroupElement.prototype.add=function(e){this.node.appendChild(e.node)},jvm.VMLCanvasElement=function(e,t,n){this.classPrefix="VML",jvm.VMLCanvasElement.parentClass.call(this,"group"),jvm.AbstractCanvasElement.apply(this,arguments),this.node.style.position="absolute"},jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement),jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement),jvm.VMLCanvasElement.prototype.setSize=function(e,t){var n,r,i,s;this.width=e,this.height=t,this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.coordsize=e+" "+t,this.node.coordorigin="0 0";if(this.rootElement){n=this.rootElement.node.getElementsByTagName("shape");for(i=0,s=n.length;i<s;i++)n[i].coordsize=e+" "+t,n[i].style.width=e+"px",n[i].style.height=t+"px";r=this.node.getElementsByTagName("group");for(i=0,s=r.length;i<s;i++)r[i].coordsize=e+" "+t,r[i].style.width=e+"px",r[i].style.height=t+"px"}},jvm.VMLCanvasElement.prototype.applyTransformParams=function(e,t,n){this.scale=e,this.transX=t,this.transY=n,this.rootElement.node.coordorigin=this.width-t-this.width/100+","+(this.height-n-this.height/100),this.rootElement.node.coordsize=this.width/e+","+this.height/e},jvm.VMLShapeElement=function(e,t){jvm.VMLShapeElement.parentClass.call(this,e,t),this.fillElement=new jvm.VMLElement("fill"),this.strokeElement=new jvm.VMLElement("stroke"),this.node.appendChild(this.fillElement.node),this.node.appendChild(this.strokeElement.node),this.node.stroked=!1,jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.VMLShapeElement,jvm.VMLElement),jvm.mixin(jvm.VMLShapeElement,jvm.AbstractShapeElement),jvm.VMLShapeElement.prototype.applyAttr=function(e,t){switch(e){case"fill":this.node.fillcolor=t;break;case"fill-opacity":this.fillElement.node.opacity=Math.round(t*100)+"%";break;case"stroke":t==="none"?this.node.stroked=!1:this.node.stroked=!0,this.node.strokecolor=t;break;case"stroke-opacity":this.strokeElement.node.opacity=Math.round(t*100)+"%";break;case"stroke-width":parseInt(t,10)===0?this.node.stroked=!1:this.node.stroked=!0,this.node.strokeweight=t;break;case"d":this.node.path=jvm.VMLPathElement.pathSvgToVml(t);break;default:jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}},jvm.VMLPathElement=function(e,t){var n=new jvm.VMLElement("skew");jvm.VMLPathElement.parentClass.call(this,"shape",e,t),this.node.coordorigin="0 0",n.node.on=!0,n.node.matrix="0.01,0,0,0.01,0,0",n.node.offset="0,0",this.node.appendChild(n.node)},jvm.inherits(jvm.VMLPathElement,jvm.VMLShapeElement),jvm.VMLPathElement.prototype.applyAttr=function(e,t){e==="d"?this.node.path=jvm.VMLPathElement.pathSvgToVml(t):jvm.VMLShapeElement.prototype.applyAttr.call(this,e,t)},jvm.VMLPathElement.pathSvgToVml=function(e){var t="",n=0,r=0,i,s;return e=e.replace(/(-?\d+)e(-?\d+)/g,"0"),e.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g,function(e,t,o,u){o=o.replace(/(\d)-/g,"$1,-").replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/g,",").split(","),o[0]||o.shift();for(var a=0,f=o.length;a<f;a++)o[a]=Math.round(100*o[a]);switch(t){case"m":return n+=o[0],r+=o[1],"t"+o.join(",");case"M":return n=o[0],r=o[1],"m"+o.join(",");case"l":return n+=o[0],r+=o[1],"r"+o.join(",");case"L":return n=o[0],r=o[1],"l"+o.join(",");case"h":return n+=o[0],"r"+o[0]+",0";case"H":return n=o[0],"l"+n+","+r;case"v":return r+=o[0],"r0,"+o[0];case"V":return r=o[0],"l"+n+","+r;case"c":return i=n+o[o.length-4],s=r+o[o.length-3],n+=o[o.length-2],r+=o[o.length-1],"v"+o.join(",");case"C":return i=o[o.length-4],s=o[o.length-3],n=o[o.length-2],r=o[o.length-1],"c"+o.join(",");case"s":return o.unshift(r-s),o.unshift(n-i),i=n+o[o.length-4],s=r+o[o.length-3],n+=o[o.length-2],r+=o[o.length-1],"v"+o.join(",");case"S":return o.unshift(r+r-s),o.unshift(n+n-i),i=o[o.length-4],s=o[o.length-3],n=o[o.length-2],r=o[o.length-1],"c"+o.join(",")}return""}).replace(/z/g,"e")},jvm.VMLCircleElement=function(e,t){jvm.VMLCircleElement.parentClass.call(this,"oval",e,t)},jvm.inherits(jvm.VMLCircleElement,jvm.VMLShapeElement),jvm.VMLCircleElement.prototype.applyAttr=function(e,t){switch(e){case"r":this.node.style.width=t*2+"px",this.node.style.height=t*2+"px",this.applyAttr("cx",this.get("cx")||0),this.applyAttr("cy",this.get("cy")||0);break;case"cx":if(!t)return;this.node.style.left=t-(this.get("r")||0)+"px";break;case"cy":if(!t)return;this.node.style.top=t-(this.get("r")||0)+"px";break;default:jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this,e,t)}},jvm.VectorCanvas=function(e,t,n){return this.mode=window.SVGAngle?"svg":"vml",this.mode=="svg"?this.impl=new jvm.SVGCanvasElement(e,t,n):this.impl=new jvm.VMLCanvasElement(e,t,n),this.impl},jvm.SimpleScale=function(e){this.scale=e},jvm.SimpleScale.prototype.getValue=function(e){return e},jvm.OrdinalScale=function(e){this.scale=e},jvm.OrdinalScale.prototype.getValue=function(e){return this.scale[e]},jvm.NumericScale=function(e,t,n,r){this.scale=[],t=t||"linear",e&&this.setScale(e),t&&this.setNormalizeFunction(t),n&&this.setMin(n),r&&this.setMax(r)},jvm.NumericScale.prototype={setMin:function(e){this.clearMinValue=e,typeof this.normalize=="function"?this.minValue=this.normalize(e):this.minValue=e},setMax:function(e){this.clearMaxValue=e,typeof this.normalize=="function"?this.maxValue=this.normalize(e):this.maxValue=e},setScale:function(e){var t;for(t=0;t<e.length;t++)this.scale[t]=[e[t]]},setNormalizeFunction:function(e){e==="polynomial"?this.normalize=function(e){return Math.pow(e,.2)}:e==="linear"?delete this.normalize:this.normalize=e,this.setMin(this.clearMinValue),this.setMax(this.clearMaxValue)},getValue:function(e){var t=[],n=0,r,i=0,s;typeof this.normalize=="function"&&(e=this.normalize(e));for(i=0;i<this.scale.length-1;i++)r=this.vectorLength(this.vectorSubtract(this.scale[i+1],this.scale[i])),t.push(r),n+=r;s=(this.maxValue-this.minValue)/n;for(i=0;i<t.length;i++)t[i]*=s;i=0,e-=this.minValue;while(e-t[i]>=0)e-=t[i],i++;return i==this.scale.length-1?e=this.vectorToNum(this.scale[i]):e=this.vectorToNum(this.vectorAdd(this.scale[i],this.vectorMult(this.vectorSubtract(this.scale[i+1],this.scale[i]),e/t[i]))),e},vectorToNum:function(e){var t=0,n;for(n=0;n<e.length;n++)t+=Math.round(e[n])*Math.pow(256,e.length-n-1);return t},vectorSubtract:function(e,t){var n=[],r;for(r=0;r<e.length;r++)n[r]=e[r]-t[r];return n},vectorAdd:function(e,t){var n=[],r;for(r=0;r<e.length;r++)n[r]=e[r]+t[r];return n},vectorMult:function(e,t){var n=[],r;for(r=0;r<e.length;r++)n[r]=e[r]*t;return n},vectorLength:function(e){var t=0,n;for(n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}},jvm.ColorScale=function(e,t,n,r){jvm.ColorScale.parentClass.apply(this,arguments)},jvm.inherits(jvm.ColorScale,jvm.NumericScale),jvm.ColorScale.prototype.setScale=function(e){var t;for(t=0;t<e.length;t++)this.scale[t]=jvm.ColorScale.rgbToArray(e[t])},jvm.ColorScale.prototype.getValue=function(e){return jvm.ColorScale.numToRgb(jvm.ColorScale.parentClass.prototype.getValue.call(this,e))},jvm.ColorScale.arrayToRgb=function(e){var t="#",n,r;for(r=0;r<e.length;r++)n=e[r].toString(16),t+=n.length==1?"0"+n:n;return t},jvm.ColorScale.numToRgb=function(e){e=e.toString(16);while(e.length<6)e="0"+e;return"#"+e},jvm.ColorScale.rgbToArray=function(e){return e=e.substr(1),[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16)]},jvm.DataSeries=function(e,t){var n;e=e||{},e.attribute=e.attribute||"fill",this.elements=t,this.params=e,e.attributes&&this.setAttributes(e.attributes),jvm.$.isArray(e.scale)?(n=e.attribute==="fill"||e.attribute==="stroke"?jvm.ColorScale:jvm.NumericScale,this.scale=new n(e.scale,e.normalizeFunction,e.min,e.max)):e.scale?this.scale=new jvm.OrdinalScale(e.scale):this.scale=new jvm.SimpleScale(e.scale),this.values=e.values||{},this.setValues(this.values)},jvm.DataSeries.prototype={setAttributes:function(e,t){var n=e,r;if(typeof e=="string")this.elements[e]&&this.elements[e].setStyle(this.params.attribute,t);else for(r in n)this.elements[r]&&this.elements[r].element.setStyle(this.params.attribute,n[r])},setValues:function(e){var t=Number.MIN_VALUE,n=Number.MAX_VALUE,r,i,s={};if(this.scale instanceof jvm.OrdinalScale||this.scale instanceof jvm.SimpleScale)for(i in e)e[i]?s[i]=this.scale.getValue(e[i]):s[i]=this.elements[i].element.style.initial[this.params.attribute];else{if(!this.params.min||!this.params.max){for(i in e)r=parseFloat(e[i]),r>t&&(t=e[i]),r<n&&(n=r);this.params.min||this.scale.setMin(n),this.params.max||this.scale.setMax(t),this.params.min=n,this.params.max=t}for(i in e)r=parseFloat(e[i]),isNaN(r)?s[i]=this.elements[i].element.style.initial[this.params.attribute]:s[i]=this.scale.getValue(r)}this.setAttributes(s),jvm.$.extend(this.values,e)},clear:function(){var e,t={};for(e in this.values)this.elements[e]&&(t[e]=this.elements[e].element.style.initial[this.params.attribute]);this.setAttributes(t),this.values={}},setScale:function(e){this.scale.setScale(e),this.values&&this.setValues(this.values)},setNormalizeFunction:function(e){this.scale.setNormalizeFunction(e),this.values&&this.setValues(this.values)}},jvm.Proj={degRad:180/Math.PI,radDeg:Math.PI/180,radius:6381372,sgn:function(e){return e>0?1:e<0?-1:e},mill:function(e,t,n){return{x:this.radius*(t-n)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*e)*this.radDeg))/.8}},mill_inv:function(e,t,n){return{lat:(2.5*Math.atan(Math.exp(.8*t/this.radius))-5*Math.PI/8)*this.degRad,lng:(n*this.radDeg+e/this.radius)*this.degRad}},merc:function(e,t,n){return{x:this.radius*(t-n)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}},merc_inv:function(e,t,n){return{lat:(2*Math.atan(Math.exp(t/this.radius))-Math.PI/2)*this.degRad,lng:(n*this.radDeg+e/this.radius)*this.degRad}},aea:function(e,t,n){var r=0,i=n*this.radDeg,s=29.5*this.radDeg,o=45.5*this.radDeg,u=e*this.radDeg,a=t*this.radDeg,f=(Math.sin(s)+Math.sin(o))/2,l=Math.cos(s)*Math.cos(s)+2*f*Math.sin(s),c=f*(a-i),h=Math.sqrt(l-2*f*Math.sin(u))/f,p=Math.sqrt(l-2*f*Math.sin(r))/f;return{x:h*Math.sin(c)*this.radius,y:-(p-h*Math.cos(c))*this.radius}},aea_inv:function(e,t,n){var r=e/this.radius,i=t/this.radius,s=0,o=n*this.radDeg,u=29.5*this.radDeg,a=45.5*this.radDeg,f=(Math.sin(u)+Math.sin(a))/2,l=Math.cos(u)*Math.cos(u)+2*f*Math.sin(u),c=Math.sqrt(l-2*f*Math.sin(s))/f,h=Math.sqrt(r*r+(c-i)*(c-i)),p=Math.atan(r/(c-i));return{lat:Math.asin((l-h*h*f*f)/(2*f))*this.degRad,lng:(o+p/f)*this.degRad}},lcc:function(e,t,n){var r=0,i=n*this.radDeg,s=t*this.radDeg,o=33*this.radDeg,u=45*this.radDeg,a=e*this.radDeg,f=Math.log(Math.cos(o)*(1/Math.cos(u)))/Math.log(Math.tan(Math.PI/4+u/2)*(1/Math.tan(Math.PI/4+o/2))),l=Math.cos(o)*Math.pow(Math.tan(Math.PI/4+o/2),f)/f,c=l*Math.pow(1/Math.tan(Math.PI/4+a/2),f),h=l*Math.pow(1/Math.tan(Math.PI/4+r/2),f);return{x:c*Math.sin(f*(s-i))*this.radius,y:-(h-c*Math.cos(f*(s-i)))*this.radius}},lcc_inv:function(e,t,n){var r=e/this.radius,i=t/this.radius,s=0,o=n*this.radDeg,u=33*this.radDeg,a=45*this.radDeg,f=Math.log(Math.cos(u)*(1/Math.cos(a)))/Math.log(Math.tan(Math.PI/4+a/2)*(1/Math.tan(Math.PI/4+u/2))),l=Math.cos(u)*Math.pow(Math.tan(Math.PI/4+u/2),f)/f,c=l*Math.pow(1/Math.tan(Math.PI/4+s/2),f),h=this.sgn(f)*Math.sqrt(r*r+(c-i)*(c-i)),p=Math.atan(r/(c-i));return{lat:(2*Math.atan(Math.pow(l/h,1/f))-Math.PI/2)*this.degRad,lng:(o+p/f)*this.degRad}}},jvm.WorldMap=function(e){var t=this,n;this.params=jvm.$.extend(!0,{},jvm.WorldMap.defaultParams,e);if(!jvm.WorldMap.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+this.params.map);this.mapData=jvm.WorldMap.maps[this.params.map],this.markers={},this.regions={},this.regionsColors={},this.regionsData={},this.container=jvm.$("<div>").css({width:"100%",height:"100%"}).addClass("jvectormap-container"),this.params.container.append(this.container),this.container.data("mapObject",this),this.container.css({position:"relative",overflow:"hidden"}),this.defaultWidth=this.mapData.width,this.defaultHeight=this.mapData.height,this.setBackgroundColor(this.params.backgroundColor),this.onResize=function(){t.setSize()},jvm.$(window).resize(this.onResize);for(n in jvm.WorldMap.apiEvents)this.params[n]&&this.container.bind(jvm.WorldMap.apiEvents[n]+".jvectormap",this.params[n]);this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?this.params.bindTouchEvents&&this.bindContainerTouchEvents():this.bindContainerEvents(),this.bindElementEvents(),this.createLabel(),this.params.zoomButtons&&this.bindZoomButtons(),this.createRegions(),this.createMarkers(this.params.markers||{}),this.setSize(),this.params.focusOn&&(typeof this.params.focusOn=="object"?this.setFocus.call(this,this.params.focusOn.scale,this.params.focusOn.x,this.params.focusOn.y):this.setFocus.call(this,this.params.focusOn)),this.params.selectedRegions&&this.setSelectedRegions(this.params.selectedRegions),this.params.selectedMarkers&&this.setSelectedMarkers(this.params.selectedMarkers),this.params.series&&this.createSeries()},jvm.WorldMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(e){this.container.css("background-color",e)},resize:function(){var e=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/e,this.transX*=this.baseScale/e,this.transY*=this.baseScale/e},setSize:function(){this.width=this.container.width(),this.height=this.container.height(),this.resize(),this.canvas.setSize(this.width,this.height),this.applyTransform()},reset:function(){var e,t;for(e in this.series)for(t=0;t<this.series[e].length;t++)this.series[e][t].clear();this.scale=this.baseScale,this.transX=this.baseTransX,this.transY=this.baseTransY,this.applyTransform()},applyTransform:function(){var e,t,n,r;this.defaultWidth*this.scale<=this.width?(e=(this.width-this.defaultWidth*this.scale)/(2*this.scale),n=(this.width-this.defaultWidth*this.scale)/(2*this.scale)):(e=0,n=(this.width-this.defaultWidth*this.scale)/this.scale),this.defaultHeight*this.scale<=this.height?(t=(this.height-this.defaultHeight*this.scale)/(2*this.scale),r=(this.height-this.defaultHeight*this.scale)/(2*this.scale)):(t=0,r=(this.height-this.defaultHeight*this.scale)/this.scale),this.transY>t?this.transY=t:this.transY<r&&(this.transY=r),this.transX>e?this.transX=e:this.transX<n&&(this.transX=n),this.canvas.applyTransformParams(this.scale,this.transX,this.transY),this.markers&&this.repositionMarkers(),this.container.trigger("viewportChange",[this.scale/this.baseScale,this.transX,this.transY])},bindContainerEvents:function(){var e=!1,t,n,r=this;this.container.mousemove(function(i){return e&&(r.transX-=(t-i.pageX)/r.scale,r.transY-=(n-i.pageY)/r.scale,r.applyTransform(),t=i.pageX,n=i.pageY),!1}).mousedown(function(r){return e=!0,t=r.pageX,n=r.pageY,!1}),jvm.$("body").mouseup(function(){e=!1}),this.params.zoomOnScroll&&this.container.mousewheel(function(e,t,n,i){var s=jvm.$(r.container).offset(),o=e.pageX-s.left,u=e.pageY-s.top,a=Math.pow(1.3,i);r.label.hide(),r.setScale(r.scale*a,o,u),e.preventDefault()})},bindContainerTouchEvents:function(){var e,t,n=this,r,i,s,o,u,a=function(a){var f=a.originalEvent.touches,l,c,h,p;a.type=="touchstart"&&(u=0),f.length==1?(u==1&&(h=n.transX,p=n.transY,n.transX-=(r-f[0].pageX)/n.scale,n.transY-=(i-f[0].pageY)/n.scale,n.applyTransform(),n.label.hide(),(h!=n.transX||p!=n.transY)&&a.preventDefault()),r=f[0].pageX,i=f[0].pageY):f.length==2&&(u==2?(c=Math.sqrt(Math.pow(f[0].pageX-f[1].pageX,2)+Math.pow(f[0].pageY-f[1].pageY,2))/t,n.setScale(e*c,s,o),n.label.hide(),a.preventDefault()):(l=jvm.$(n.container).offset(),f[0].pageX>f[1].pageX?s=f[1].pageX+(f[0].pageX-f[1].pageX)/2:s=f[0].pageX+(f[1].pageX-f[0].pageX)/2,f[0].pageY>f[1].pageY?o=f[1].pageY+(f[0].pageY-f[1].pageY)/2:o=f[0].pageY+(f[1].pageY-f[0].pageY)/2,s-=l.left,o-=l.top,e=n.scale,t=Math.sqrt(Math.pow(f[0].pageX-f[1].pageX,2)+Math.pow(f[0].pageY-f[1].pageY,2)))),u=f.length};jvm.$(this.container).bind("touchstart",a),jvm.$(this.container).bind("touchmove",a)},bindElementEvents:function(){var e=this,t;this.container.mousemove(function(){t=!0}),this.container.delegate("[class~='jvectormap-element']","mouseover mouseout",function(t){var n=this,r=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),i=r.indexOf("jvectormap-region")===-1?"marker":"region",s=i=="region"?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),o=i=="region"?e.regions[s].element:e.markers[s].element,u=i=="region"?e.mapData.paths[s].name:e.markers[s].config.name||"",a=jvm.$.Event(i+"LabelShow.jvectormap"),f=jvm.$.Event(i+"Over.jvectormap");t.type=="mouseover"?(e.container.trigger(f,[s]),f.isDefaultPrevented()||o.setHovered(!0),e.label.text(u),e.container.trigger(a,[e.label,s]),a.isDefaultPrevented()||(e.label.show(),e.labelWidth=e.label.width(),e.labelHeight=e.label.height())):(o.setHovered(!1),e.label.hide(),e.container.trigger(i+"Out.jvectormap",[s]))}),this.container.delegate("[class~='jvectormap-element']","mousedown",function(e){t=!1}),this.container.delegate("[class~='jvectormap-element']","mouseup",function(n){var r=this,i=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),s=i.indexOf("jvectormap-region")===-1?"marker":"region",o=s=="region"?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),u=jvm.$.Event(s+"Click.jvectormap"),a=s=="region"?e.regions[o].element:e.markers[o].element;if(!t){e.container.trigger(u,[o]);if(s==="region"&&e.params.regionsSelectable||s==="marker"&&e.params.markersSelectable)u.isDefaultPrevented()||(e.params[s+"sSelectableOne"]&&e.clearSelected(s+"s"),a.setSelected(!a.isSelected))}})},bindZoomButtons:function(){var e=this;jvm.$("<div/>").addClass("jvectormap-zoomin").text("+").appendTo(this.container),jvm.$("<div/>").addClass("jvectormap-zoomout").html("&#x2212;").appendTo(this.container),this.container.find(".jvectormap-zoomin").click(function(){e.setScale(e.scale*e.params.zoomStep,e.width/2,e.height/2)}),this.container.find(".jvectormap-zoomout").click(function(){e.setScale(e.scale/e.params.zoomStep,e.width/2,e.height/2)})},createLabel:function(){var e=this;this.label=jvm.$("<div/>").addClass("jvectormap-label").appendTo(jvm.$("body")),this.container.mousemove(function(t){var n=t.pageX-15-e.labelWidth,r=t.pageY-15-e.labelHeight;n<5&&(n=t.pageX+15),r<5&&(r=t.pageY+15),e.label.is(":visible")&&e.label.css({left:n,top:r})})},setScale:function(e,t,n,r){var i,s=jvm.$.Event("zoom.jvectormap");e>this.params.zoomMax*this.baseScale?e=this.params.zoomMax*this.baseScale:e<this.params.zoomMin*this.baseScale&&(e=this.params.zoomMin*this.baseScale),typeof t!="undefined"&&typeof n!="undefined"&&(i=e/this.scale,r?(this.transX=t+this.defaultWidth*(this.width/(this.defaultWidth*e))/2,this.transY=n+this.defaultHeight*(this.height/(this.defaultHeight*e))/2):(this.transX-=(i-1)/e*t,this.transY-=(i-1)/e*n)),this.scale=e,this.applyTransform(),this.container.trigger(s,[e/this.baseScale])},setFocus:function(e,t,n){var r,i,s,o,u;if(jvm.$.isArray(e)||this.regions[e]){jvm.$.isArray(e)?o=e:o=[e];for(u=0;u<o.length;u++)this.regions[o[u]]&&(i=this.regions[o[u]].element.getBBox(),i&&(typeof r=="undefined"?r=i:(s={x:Math.min(r.x,i.x),y:Math.min(r.y,i.y),width:Math.max(r.x+r.width,i.x+i.width)-Math.min(r.x,i.x),height:Math.max(r.y+r.height,i.y+i.height)-Math.min(r.y,i.y)},r=s)));this.setScale(Math.min(this.width/r.width,this.height/r.height),-(r.x+r.width/2),-(r.y+r.height/2),!0)}else e*=this.baseScale,this.setScale(e,-t*this.defaultWidth,-n*this.defaultHeight,!0)},getSelected:function(e){var t,n=[];for(t in this[e])this[e][t].element.isSelected&&n.push(t);return n},getSelectedRegions:function(){return this.getSelected("regions")},getSelectedMarkers:function(){return this.getSelected("markers")},setSelected:function(e,t){var n;typeof t!="object"&&(t=[t]);if(jvm.$.isArray(t))for(n=0;n<t.length;n++)this[e][t[n]].element.setSelected(!0);else for(n in t)this[e][n].element.setSelected(!!t[n])},setSelectedRegions:function(e){this.setSelected("regions",e)},setSelectedMarkers:function(e){this.setSelected("markers",e)},clearSelected:function(e){var t={},n=this.getSelected(e),r;for(r=0;r<n.length;r++)t[n[r]]=!1;this.setSelected(e,t)},clearSelectedRegions:function(){this.clearSelected("regions")},clearSelectedMarkers:function(){this.clearSelected("markers")},getMapObject:function(){return this},getRegionName:function(e){return this.mapData.paths[e].name},createRegions:function(){var e,t,n=this;for(e in this.mapData.paths)t=this.canvas.addPath({d:this.mapData.paths[e].path,"data-code":e},jvm.$.extend(!0,{},this.params.regionStyle)),jvm.$(t.node).bind("selected",function(e,t){n.container.trigger("regionSelected.jvectormap",[jvm.$(this).attr("data-code"),t,n.getSelectedRegions()])}),t.addClass("jvectormap-region jvectormap-element"),this.regions[e]={element:t,config:this.mapData.paths[e]}},createMarkers:function(e){var t,n,r,i,s,o=this;this.markersGroup=this.markersGroup||this.canvas.addGroup();if(jvm.$.isArray(e)){s=e.slice(),e={};for(t=0;t<s.length;t++)e[t]=s[t]}for(t in e)i=e[t]instanceof Array?{latLng:e[t]}:e[t],r=this.getMarkerPosition(i),r!==!1&&(n=this.canvas.addCircle({"data-index":t,cx:r.x,cy:r.y},jvm.$.extend(!0,{},this.params.markerStyle,{initial:i.style||{}}),this.markersGroup),n.addClass("jvectormap-marker jvectormap-element"),jvm.$(n.node).bind("selected",function(e,t){o.container.trigger("markerSelected.jvectormap",[jvm.$(this).attr("data-index"),t,o.getSelectedMarkers()])}),this.markers[t]&&this.removeMarkers([t]),this.markers[t]={element:n,config:i})},repositionMarkers:function(){var e,t;for(e in this.markers)t=this.getMarkerPosition(this.markers[e].config),t!==!1&&this.markers[e].element.setStyle({cx:t.x,cy:t.y})},getMarkerPosition:function(e){return jvm.WorldMap.maps[this.params.map].projection?this.latLngToPoint.apply(this,e.latLng||[0,0]):{x:e.coords[0]*this.scale+this.transX*this.scale,y:e.coords[1]*this.scale+this.transY*this.scale}},addMarker:function(e,t,n){var r={},i=[],s,o,n=n||[];r[e]=t;for(o=0;o<n.length;o++)s={},s[e]=n[o],i.push(s);this.addMarkers(r,i)},addMarkers:function(e,t){var n;t=t||[],this.createMarkers(e);for(n=0;n<t.length;n++)this.series.markers[n].setValues(t[n]||{})},removeMarkers:function(e){var t;for(t=0;t<e.length;t++)this.markers[e[t]].element.remove(),delete this.markers[e[t]]},removeAllMarkers:function(){var e,t=[];for(e in this.markers)t.push(e);this.removeMarkers(t)},latLngToPoint:function(e,t){var n,r=jvm.WorldMap.maps[this.params.map].projection,i=r.centralMeridian,s=this.width-this.baseTransX*2*this.baseScale,o=this.height-this.baseTransY*2*this.baseScale,u,a,f=this.scale/this.baseScale;return t<-180+i&&(t+=360),n=jvm.Proj[r.type](e,t,i),u=this.getInsetForPoint(n.x,n.y),u?(a=u.bbox,n.x=(n.x-a[0].x)/(a[1].x-a[0].x)*u.width*this.scale,n.y=(n.y-a[0].y)/(a[1].y-a[0].y)*u.height*this.scale,{x:n.x+this.transX*this.scale+u.left*this.scale,y:n.y+this.transY*this.scale+u.top*this.scale}):!1},pointToLatLng:function(e,t){var n=jvm.WorldMap.maps[this.params.map].projection,r=n.centralMeridian,i=jvm.WorldMap.maps[this.params.map].insets,s,o,u,a,f;for(s=0;s<i.length;s++){o=i[s],u=o.bbox,a=e-(this.transX*this.scale+o.left*this.scale),f=t-(this.transY*this.scale+o.top*this.scale),a=a/(o.width*this.scale)*(u[1].x-u[0].x)+u[0].x,f=f/(o.height*this.scale)*(u[1].y-u[0].y)+u[0].y;if(a>u[0].x&&a<u[1].x&&f>u[0].y&&f<u[1].y)return jvm.Proj[n.type+"_inv"](a,-f,r)}return!1},getInsetForPoint:function(e,t){var n=jvm.WorldMap.maps[this.params.map].insets,r,i;for(r=0;r<n.length;r++){i=n[r].bbox;if(e>i[0].x&&e<i[1].x&&t>i[0].y&&t<i[1].y)return n[r]}},createSeries:function(){var e,t;this.series={markers:[],regions:[]};for(t in this.params.series)for(e=0;e<this.params.series[t].length;e++)this.series[t][e]=new jvm.DataSeries(this.params.series[t][e],this[t])},remove:function(){this.label.remove(),this.container.remove(),jvm.$(window).unbind("resize",this.onResize)}},jvm.WorldMap.maps={},jvm.WorldMap.defaultParams={map:"world_mill_en",backgroundColor:"#505050",zoomButtons:!0,zoomOnScroll:!0,zoomMax:8,zoomMin:1,zoomStep:1.6,regionsSelectable:!1,markersSelectable:!1,bindTouchEvents:!0,regionStyle:{initial:{fill:"white","fill-opacity":1,stroke:"none","stroke-width":0,"stroke-opacity":1},hover:{"fill-opacity":.8},selected:{fill:"yellow"},selectedHover
8
+ :{}},markerStyle:{initial:{fill:"grey",stroke:"#505050","fill-opacity":1,"stroke-width":1,"stroke-opacity":1,r:5},hover:{stroke:"black","stroke-width":2},selected:{fill:"blue"},selectedHover:{}}},jvm.WorldMap.apiEvents={onRegionLabelShow:"regionLabelShow",onRegionOver:"regionOver",onRegionOut:"regionOut",onRegionClick:"regionClick",onRegionSelected:"regionSelected",onMarkerLabelShow:"markerLabelShow",onMarkerOver:"markerOver",onMarkerOut:"markerOut",onMarkerClick:"markerClick",onMarkerSelected:"markerSelected",onViewportChange:"viewportChange"};
@@ -0,0 +1,37 @@
1
+ .jvectormap-label {
2
+ position: absolute;
3
+ display: none;
4
+ border: solid 1px #CDCDCD;
5
+ -webkit-border-radius: 3px;
6
+ -moz-border-radius: 3px;
7
+ border-radius: 3px;
8
+ background: #292929;
9
+ color: white;
10
+ font-family: sans-serif, Verdana;
11
+ font-size: smaller;
12
+ padding: 3px;
13
+ }
14
+
15
+ .jvectormap-zoomin, .jvectormap-zoomout {
16
+ position: absolute;
17
+ left: 10px;
18
+ -webkit-border-radius: 3px;
19
+ -moz-border-radius: 3px;
20
+ border-radius: 3px;
21
+ background: #292929;
22
+ padding: 3px;
23
+ color: white;
24
+ width: 10px;
25
+ height: 10px;
26
+ cursor: pointer;
27
+ line-height: 10px;
28
+ text-align: center;
29
+ }
30
+
31
+ .jvectormap-zoomin {
32
+ top: 10px;
33
+ }
34
+
35
+ .jvectormap-zoomout {
36
+ top: 30px;
37
+ }
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jqvmap-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2.2
5
+ platform: ruby
6
+ authors:
7
+ - Manifest Interactive
8
+ - Adrian Rangel
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-02-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: jquery-rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ description: JQVMap is a jQuery plugin that renders Vector Maps. It uses resizable
43
+ Scalable Vector Graphics (SVG) for modern browsers like Firefox, Safari, Chrome,
44
+ Opera and Internet Explorer 9. Legacy support for older versions of Internet Explorer
45
+ 6-8 is provided via VML
46
+ email:
47
+ - adrian.rangel@gmail.com
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - ".gitignore"
53
+ - Gemfile
54
+ - MIT-LICENSE
55
+ - README.md
56
+ - Rakefile
57
+ - jqvmap-rails.gemspec
58
+ - lib/jqvmap-rails.rb
59
+ - lib/jqvmap-rails/version.rb
60
+ - vendor/assets/javascripts/jquery-jvectormap.js
61
+ - vendor/assets/stylesheets/jquery-jvectormap.css
62
+ homepage: http://jqvmap.com/
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project: jqvmap-rails
82
+ rubygems_version: 2.2.1
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: JQVMap is a jQuery plugin that renders Vector Maps. It uses resizable Scalable
86
+ Vector Graphics (SVG) for modern browsers like Firefox, Safari, Chrome, Opera and
87
+ Internet Explorer 9. Legacy support for older versions of Internet Explorer 6-8
88
+ is provided via VML
89
+ test_files: []