Skip to content

Instantly share code, notes, and snippets.

@DelgadoPanadero
Last active March 6, 2017 16:50
Show Gist options
  • Save DelgadoPanadero/19fb53e7639badfb2689d92d62162040 to your computer and use it in GitHub Desktop.
Save DelgadoPanadero/19fb53e7639badfb2689d92d62162040 to your computer and use it in GitHub Desktop.
Cajamar1
license: mit
CP_COMERCIO SECTOR DINERO DINERO_CP PORP_SECTOR PORP_CP CIUDAD
1 46001 RESTAURACION 723216.7 8584601.08 0.0842458133185613 0.0425574470162454 Valencia
2 46001 SALUD 536615.75 8584601.08 0.0625091072956415 0.0425574470162454 Valencia
3 46001 TECNOLOGIA 108302.6 8584601.08 0.0126159152872366 0.0425574470162454 Valencia
4 46002 RESTAURACION 1461993.47 12276089.16 0.11909277058395 0.0608576926434658 Valencia
5 46002 SALUD 1629171.47 12276089.16 0.132710951245649 0.0608576926434658 Valencia
6 46002 TECNOLOGIA 79103.35 12276089.16 0.0064436930172964 0.0608576926434658 Valencia
7 46003 RESTAURACION 739675.73 3371060.15 0.219419321248243 0.0167117507715573 Valencia
8 46003 SALUD 384934.33 3371060.15 0.114187915039131 0.0167117507715573 Valencia
9 46003 TECNOLOGIA 14114.69 3371060.15 0.00418701814027258 0.0167117507715573 Valencia
10 46004 RESTAURACION 989263.45 15555444.22 0.0635959626744751 0.0771148230462458 Valencia
11 46004 SALUD 1688211.21 15555444.22 0.108528640270487 0.0771148230462458 Valencia
12 46004 TECNOLOGIA 1434328.5 15555444.22 0.0922074920982231 0.0771148230462458 Valencia
13 46005 RESTAURACION 1579898.11 5844840.05 0.270306474853833 0.0289753092110256 Valencia
14 46005 SALUD 931713.39 5844840.05 0.159407850690456 0.0289753092110256 Valencia
15 46005 TECNOLOGIA 100217.36 5844840.05 0.0171462964157591 0.0289753092110256 Valencia
16 46006 RESTAURACION 771394.73 6064704.68 0.12719411260764 0.0300652698573939 Valencia
17 46006 SALUD 672875.72 6064704.68 0.110949461763404 0.0300652698573939 Valencia
18 46006 TECNOLOGIA 172493.36 6064704.68 0.0284421697512895 0.0300652698573939 Valencia
19 46007 RESTAURACION 754557.44 10573968.43 0.0713599104248508 0.0524195704631597 Valencia
20 46007 SALUD 1342743.85 10573968.43 0.126985800921291 0.0524195704631597 Valencia
21 46007 TECNOLOGIA 472234.63 10573968.43 0.0446601134783225 0.0524195704631597 Valencia
22 46008 RESTAURACION 546544.59 4988233.09 0.109566770465411 0.0247287513367315 Valencia
23 46008 SALUD 490315.86 4988233.09 0.0982944964987592 0.0247287513367315 Valencia
24 46008 TECNOLOGIA 193371.38 4988233.09 0.0387655060441452 0.0247287513367315 Valencia
25 46009 RESTAURACION 671500.13 16423574.39 0.0408863572602602 0.0814185062772643 Valencia
26 46009 SALUD 913143.81 16423574.39 0.0555995782840059 0.0814185062772643 Valencia
27 46009 TECNOLOGIA 206724.91 16423574.39 0.0125870839739899 0.0814185062772643 Valencia
28 46010 RESTAURACION 486029.33 6322333.57 0.0768749900046796 0.0313424436868888 Valencia
29 46010 SALUD 1165667.41 6322333.57 0.184372968792914 0.0313424436868888 Valencia
30 46010 TECNOLOGIA 78086.07 6322333.57 0.0123508304545216 0.0313424436868888 Valencia
31 46011 RESTAURACION 1074194.16 4525336.21 0.237373337615505 0.02243397849161 Valencia
32 46011 SALUD 469417.89 4525336.21 0.103731052946451 0.02243397849161 Valencia
33 46011 TECNOLOGIA 79711.52 4525336.21 0.017614496758021 0.02243397849161 Valencia
34 46012 RESTAURACION 1278593.6 2211671.97 0.578111771249694 0.0109641801410987 Valencia
35 46013 OTROS 441115.21 8838319.93 0.0499093960722918 0.0438152371471175 Valencia
36 46013 RESTAURACION 891068.79 8838319.93 0.100818797809687 0.0438152371471175 Valencia
37 46013 SALUD 239189.75 8838319.93 0.0270628073994149 0.0438152371471175 Valencia
38 46014 OTROS 3438664.52 16122171.22 0.213287929589424 0.0799243250895458 Valencia
39 46014 RESTAURACION 410986.84 16122171.22 0.0254920279900116 0.0799243250895458 Valencia
40 46014 SALUD 477625.72 16122171.22 0.0296253968204662 0.0799243250895458 Valencia
41 46014 TECNOLOGIA 196066.8 16122171.22 0.012161314833127 0.0799243250895458 Valencia
42 46015 OTROS 1848066.61 18465712.1 0.100080982525445 0.0915422344019964 Valencia
43 46015 RESTAURACION 833807.13 18465712.1 0.0451543447382135 0.0915422344019964 Valencia
44 46015 SALUD 1442036.01 18465712.1 0.0780926293115985 0.0915422344019964 Valencia
45 46015 TECNOLOGIA 2288010.26 18465712.1 0.123905877423487 0.0915422344019964 Valencia
46 46017 OTROS 761458.77 5246028.8 0.145149559605925 0.0260067521625242 Valencia
47 46017 RESTAURACION 303408.78 5246028.8 0.0578358967453629 0.0260067521625242 Valencia
48 46017 SALUD 561044.28 5246028.8 0.106946473492483 0.0260067521625242 Valencia
49 46017 TECNOLOGIA 69786.81 5246028.8 0.0133027881966641 0.0260067521625242 Valencia
50 46018 OTROS 810799.91 6164736.68 0.131522229105169 0.0305611701910562 Valencia
51 46018 RESTAURACION 240511.78 6164736.68 0.0390141205512122 0.0305611701910562 Valencia
52 46018 SALUD 663124.95 6164736.68 0.107567441144948 0.0305611701910562 Valencia
53 46018 TECNOLOGIA 112307.06 6164736.68 0.0182176572706427 0.0305611701910562 Valencia
54 46019 OTROS 335569.05 9167644.24 0.0366036291565345 0.0454478350679036 Valencia
55 46019 RESTAURACION 446358.85 9167644.24 0.048688500373134 0.0454478350679036 Valencia
56 46019 SALUD 394638.05 9167644.24 0.0430468329342588 0.0454478350679036 Valencia
57 46019 TECNOLOGIA 312833.04 9167644.24 0.0341236016374911 0.0454478350679036 Valencia
58 46020 OTROS 952039.65 4351164.91 0.218801095727719 0.0215705387344884 Valencia
59 46020 RESTAURACION 512086.18 4351164.91 0.117689444227477 0.0215705387344884 Valencia
60 46020 SALUD 543299.94 4351164.91 0.124863100166893 0.0215705387344884 Valencia
61 46020 TECNOLOGIA 156048.02 4351164.91 0.035863503964505 0.0215705387344884 Valencia
62 46021 OTROS 922450.51 6299209.15 0.146439098628754 0.0312278062949168 Valencia
63 46021 RESTAURACION 931276.87 6299209.15 0.147840284045815 0.0312278062949168 Valencia
64 46021 SALUD 741127.6 6299209.15 0.11765407090825 0.0312278062949168 Valencia
65 46021 TECNOLOGIA 122965.23 6299209.15 0.0195207409488856 0.0312278062949168 Valencia
66 46022 OTROS 1216055.64 6360271.12 0.191195566518554 0.0315305159408008 Valencia
67 46022 RESTAURACION 643258.22 6360271.12 0.101136918201059 0.0315305159408008 Valencia
68 46022 SALUD 577876.02 6360271.12 0.090857136291385 0.0315305159408008 Valencia
69 46022 TECNOLOGIA 231963.77 6360271.12 0.036470736172014 0.0315305159408008 Valencia
70 46023 OTROS 689798.18 13551376.79 0.0509024426587433 0.0671798251733792 Valencia
71 46023 RESTAURACION 1578219.92 13551376.79 0.116461961353227 0.0671798251733792 Valencia
72 46023 SALUD 502696.25 13551376.79 0.0370955850309583 0.0671798251733792 Valencia
73 46023 TECNOLOGIA 116508.03 13551376.79 0.00859750502148055 0.0671798251733792 Valencia
74 46024 OTROS 167986.23 1556276.01 0.107941154988311 0.00771510909138585 Valencia
75 46024 RESTAURACION 210442.98 1556276.01 0.135222144817358 0.00771510909138585 Valencia
76 46024 SALUD 39555.02 1556276.01 0.0254164555296332 0.00771510909138585 Valencia
77 46025 OTROS 715605.07 5648984.16 0.126678540730764 0.0280043698995981 Valencia
78 46025 RESTAURACION 590373.44 5648984.16 0.104509664619063 0.0280043698995981 Valencia
79 46025 SALUD 433642.65 5648984.16 0.0767647133922925 0.0280043698995981 Valencia
80 46025 TECNOLOGIA 202918.96 5648984.16 0.0359213186393498 0.0280043698995981 Valencia
81 46026 OTROS 338899.48 3204200.49 0.10576725178642 0.0158845578626005 Valencia
82 46026 RESTAURACION 172852.31 3204200.49 0.0539455350997715 0.0158845578626005 Valencia
83 46013 TECNOLOGIA 143777.38 8838319.93 0.0162675011923901 0.0438152371471175 Valencia
84 46026 SALUD 229751.99 3204200.49 0.0717033752154504 0.0158845578626005 Valencia
85 46026 TECNOLOGIA 23239.49 3204200.49 0.00725282018791527 0.0158845578626005 Valencia
86 46012 SALUD 50737.22 2211671.97 0.0229406623985021 0.0109641801410987 Valencia
87 46024 TECNOLOGIA 14934 1556276.01 0.00959598419820145 0.00771510909138585 Valencia
88 46005 ALIMENTACION 998156.8 5844840.05 0.170775725505097 0.0289753092110256 Valencia
89 46001 ALIMENTACION 2056035.2 8584601.08 0.239502707329063 0.0425574470162454 Valencia
90 46007 ALIMENTACION 2480568.06 10573968.43 0.234591967662987 0.0524195704631597 Valencia
91 46006 ALIMENTACION 2148062.46 6064704.68 0.35419077652434 0.0300652698573939 Valencia
92 46002 ALIMENTACION 341373.9 12276089.16 0.0278080336132065 0.0608576926434658 Valencia
93 46009 HOGAR 706437.88 16423574.39 0.0430136499658769 0.0814185062772643 Valencia
94 46004 HOGAR 592052.38 15555444.22 0.0380607825547524 0.0771148230462458 Valencia
95 46009 OCIO Y TIEMPO LIBRE 782513.3 16423574.39 0.0476457366355315 0.0814185062772643 Valencia
96 46018 HOGAR 431275.02 6164736.68 0.0699583846621004 0.0305611701910562 Valencia
97 46007 HOGAR 790373.63 10573968.43 0.0747471145986768 0.0524195704631597 Valencia
98 46002 HOGAR 581461.44 12276089.16 0.0473653646875273 0.0608576926434658 Valencia
99 46001 HOGAR 205704.2 8584601.08 0.023961998709438 0.0425574470162454 Valencia
100 46015 ALIMENTACION 1854811.86 18465712.1 0.100446267653009 0.0915422344019964 Valencia
101 46004 OCIO Y TIEMPO LIBRE 717803.28 15555444.22 0.0461448268431385 0.0771148230462458 Valencia
102 46014 ALIMENTACION 2837369.55 16122171.22 0.175991776249105 0.0799243250895458 Valencia
103 46001 OCIO Y TIEMPO LIBRE 1596002.82 8584601.08 0.185914616780306 0.0425574470162454 Valencia
104 46023 HIPERMERCADOS 4982538.14 13551376.79 0.367677632849584 0.0671798251733792 Valencia
105 46007 OCIO Y TIEMPO LIBRE 2430839.41 10573968.43 0.229889036088223 0.0524195704631597 Valencia
106 46006 OCIO Y TIEMPO LIBRE 510091.98 6064704.68 0.084108296597222 0.0300652698573939 Valencia
107 46015 HOGAR 250776.36 18465712.1 0.013580649294321 0.0915422344019964 Valencia
108 46002 OCIO Y TIEMPO LIBRE 1158882.12 12276089.16 0.0944015724304172 0.0608576926434658 Valencia
109 46017 HOGAR 251895.92 5246028.8 0.0480164958301411 0.0260067521625242 Valencia
110 46023 MODA Y COMPLEMENTOS 2537323.82 13551376.79 0.187237345645379 0.0671798251733792 Valencia
111 46026 BELLEZA 79095.88 3204200.49 0.0246850595794023 0.0158845578626005 Valencia
112 46025 BELLEZA 127510.65 5648984.16 0.0225723150195557 0.0280043698995981 Valencia
113 46019 BELLEZA 222826.6 9167644.24 0.0243057642908709 0.0454478350679036 Valencia
114 46004 MODA Y COMPLEMENTOS 8541236.79 15555444.22 0.549083437875617 0.0771148230462458 Valencia
115 46018 BELLEZA 198244.91 6164736.68 0.032157887723438 0.0305611701910562 Valencia
116 46023 BELLEZA 211496.51 13551376.79 0.0156070127247934 0.0671798251733792 Valencia
117 46020 BELLEZA 205049.88 4351164.91 0.0471252835140188 0.0215705387344884 Valencia
118 46022 BELLEZA 225869.29 6360271.12 0.0355125254471857 0.0315305159408008 Valencia
119 46021 BELLEZA 183698.63 6299209.15 0.0291621734769673 0.0312278062949168 Valencia
120 46007 BELLEZA 524965.98 10573968.43 0.0496470160162943 0.0524195704631597 Valencia
121 46013 BELLEZA 120946.38 8838319.93 0.0136843179425391 0.0438152371471175 Valencia
122 46024 BELLEZA 12988.93 1556276.01 0.00834616091010746 0.00771510909138585 Valencia
123 46010 BELLEZA 223233.15 6322333.57 0.0353086637280987 0.0313424436868888 Valencia
124 46009 BELLEZA 372365.75 16423574.39 0.0226726375853192 0.0814185062772643 Valencia
125 46004 BELLEZA 386652.25 15555444.22 0.0248563939757421 0.0771148230462458 Valencia
126 46017 BELLEZA 168323.82 5246028.8 0.0320859504240617 0.0260067521625242 Valencia
127 46005 BELLEZA 322146.3 5844840.05 0.0551163585734053 0.0289753092110256 Valencia
128 46011 BELLEZA 151138.62 4525336.21 0.0333983184864843 0.02243397849161 Valencia
129 46006 BELLEZA 218645.02 6064704.68 0.0360520473026561 0.0300652698573939 Valencia
130 46009 ALIMENTACION 2414581.26 16423574.39 0.147019229959478 0.0814185062772643 Valencia
131 46001 BELLEZA 262305.32 8584601.08 0.030555330126068 0.0425574470162454 Valencia
132 46008 ALIMENTACION 1518256.03 4988233.09 0.304367498993516 0.0247287513367315 Valencia
133 46021 ALIMENTACION 1974342.91 6299209.15 0.313427108544253 0.0312278062949168 Valencia
134 46015 BELLEZA 172828.62 18465712.1 0.00935943434317922 0.0915422344019964 Valencia
135 46014 HIPERMERCADOS 5978161.28 16122171.22 0.370803733468847 0.0799243250895458 Valencia
136 46021 HOGAR 238981.73 6299209.15 0.0379383704063866 0.0312278062949168 Valencia
137 46003 ALIMENTACION 192968.85 3371060.15 0.0572427786552548 0.0167117507715573 Valencia
138 46010 MODA Y COMPLEMENTOS 291555.83 6322333.57 0.0461152241924496 0.0313424436868888 Valencia
139 46002 OTROS 702390.32 12276089.16 0.0572161305482079 0.0608576926434658 Valencia
140 46017 ALIMENTACION 2030672.24 5246028.8 0.387087512748691 0.0260067521625242 Valencia
141 46010 OTROS 1204529.76 6322333.57 0.190519805173772 0.0313424436868888 Valencia
142 46025 ALIMENTACION 2400823.67 5648984.16 0.425000956278128 0.0280043698995981 Valencia
143 46022 ALIMENTACION 2336606.89 6360271.12 0.367375359621462 0.0315305159408008 Valencia
144 46019 ALIMENTACION 2265424.76 9167644.24 0.247110893561463 0.0454478350679036 Valencia
145 46011 HIPERMERCADOS 312319.04 4525336.21 0.0690156544191884 0.02243397849161 Valencia
146 46004 ALIMENTACION 225845.76 15555444.22 0.0145187599149129 0.0771148230462458 Valencia
147 46023 ALIMENTACION 1300400.45 13551376.79 0.0959607625226396 0.0671798251733792 Valencia
148 46015 HIPERMERCADOS 4459436.4 18465712.1 0.241498208996771 0.0915422344019964 Valencia
149 46019 HIPERMERCADOS 544763.31 9167644.24 0.0594223876645545 0.0454478350679036 Valencia
150 46005 HOGAR 228590.19 5844840.05 0.0391097426181919 0.0289753092110256 Valencia
151 46005 MODA Y COMPLEMENTOS 679670.18 5844840.05 0.116285505537487 0.0289753092110256 Valencia
152 46013 ALIMENTACION 1055654.24 8838319.93 0.119440600516936 0.0438152371471175 Valencia
153 46004 HIPERMERCADOS 500695.08 15555444.22 0.0321877712342181 0.0771148230462458 Valencia
154 46023 OCIO Y TIEMPO LIBRE 966144.3 13551376.79 0.0712949182191546 0.0671798251733792 Valencia
155 46010 ALIMENTACION 1676851.17 6322333.57 0.265226621062324 0.0313424436868888 Valencia
156 46007 OTROS 568035.55 10573968.43 0.0537201859226659 0.0524195704631597 Valencia
157 46009 OTROS 1235774.71 16423574.39 0.0752439560752646 0.0814185062772643 Valencia
158 46011 ALIMENTACION 1274928.25 4525336.21 0.281731166666178 0.02243397849161 Valencia
159 46018 ALIMENTACION 2267836.43 6164736.68 0.367872392239793 0.0305611701910562 Valencia
160 46025 MODA Y COMPLEMENTOS 377242.59 5648984.16 0.0667806067985151 0.0280043698995981 Valencia
161 46017 OCIO Y TIEMPO LIBRE 330122.85 5246028.8 0.062928142903066 0.0260067521625242 Valencia
162 46015 OCIO Y TIEMPO LIBRE 3052056.88 18465712.1 0.165282381934244 0.0915422344019964 Valencia
163 46013 MODA Y COMPLEMENTOS 2634264.09 8838319.93 0.298050320746875 0.0438152371471175 Valencia
164 46012 ALIMENTACION 460583.12 2211671.97 0.20825109973248 0.0109641801410987 Valencia
165 46009 MODA Y COMPLEMENTOS 4408675 16423574.39 0.26843577989237 0.0814185062772643 Valencia
166 46019 OCIO Y TIEMPO LIBRE 659720.82 9167644.24 0.0719618696722027 0.0454478350679036 Valencia
167 46007 MODA Y COMPLEMENTOS 964591.71 10573968.43 0.0912232447435064 0.0524195704631597 Valencia
168 46002 MODA Y COMPLEMENTOS 6185418.49 12276089.16 0.503859039257744 0.0608576926434658 Valencia
169 46024 MODA Y COMPLEMENTOS 786551.86 1556276.01 0.505406402814113 0.00771510909138585 Valencia
170 46014 OCIO Y TIEMPO LIBRE 303272.77 16122171.22 0.0188109136084463 0.0799243250895458 Valencia
171 46008 HOGAR 324394.98 4988233.09 0.0650320412352663 0.0247287513367315 Valencia
172 46006 HOGAR 266429.58 6064704.68 0.0439311712701566 0.0300652698573939 Valencia
173 46010 HIPERMERCADOS 29342.12 6322333.57 0.00464102687324674 0.0313424436868888 Valencia
174 46003 HOGAR 166160.42 3371060.15 0.0492902566570935 0.0167117507715573 Valencia
175 46013 HOGAR 339523.95 8838319.93 0.0384149875416424 0.0438152371471175 Valencia
176 46009 HIPERMERCADOS 4395170.17 16423574.39 0.267613496650043 0.0814185062772643 Valencia
177 46026 HOGAR 525863.15 3204200.49 0.164116805936822 0.0158845578626005 Valencia
178 46019 HOGAR 391214.64 9167644.24 0.0426734098486352 0.0454478350679036 Valencia
179 46023 HOGAR 290185.81 13551376.79 0.0214137511263164 0.0671798251733792 Valencia
180 46014 HOGAR 407811.69 16122171.22 0.0252950849135071 0.0799243250895458 Valencia
181 46021 OCIO Y TIEMPO LIBRE 482128.49 6299209.15 0.0765379396872383 0.0312278062949168 Valencia
182 46026 ALIMENTACION 1038126.67 3204200.49 0.323989298809451 0.0158845578626005 Valencia
183 46020 ALIMENTACION 1031661.66 4351164.91 0.237100105681814 0.0215705387344884 Valencia
184 46005 OCIO Y TIEMPO LIBRE 344320.91 5844840.05 0.0589102365598525 0.0289753092110256 Valencia
185 46011 HOGAR 132477.93 4525336.21 0.0292747154802008 0.02243397849161 Valencia
186 46025 HOGAR 269483.68 5648984.16 0.0477048036190634 0.0280043698995981 Valencia
187 46010 HOGAR 147099.87 6322333.57 0.0232667049865893 0.0313424436868888 Valencia
188 46013 HIPERMERCADOS 2052753.9 8838319.93 0.232256120649391 0.0438152371471175 Valencia
189 46019 MODA Y COMPLEMENTOS 3338254.36 9167644.24 0.364134370030921 0.0454478350679036 Valencia
190 46012 BELLEZA 13993.17 2211671.97 0.00632696448198871 0.0109641801410987 Valencia
191 46014 BELLEZA 178118.88 16122171.22 0.0110480702362867 0.0799243250895458 Valencia
192 46017 MODA Y COMPLEMENTOS 349078.65 5246028.8 0.0665415046901763 0.0260067521625242 Valencia
193 46012 HOGAR 61381.58 2211671.97 0.0277534737667268 0.0109641801410987 Valencia
194 46001 MODA Y COMPLEMENTOS 2257614.25 8584601.08 0.262984177011985 0.0425574470162454 Valencia
195 46013 OCIO Y TIEMPO LIBRE 780082.54 8838319.93 0.0882614055814112 0.0438152371471175 Valencia
196 46011 OCIO Y TIEMPO LIBRE 255517.98 4525336.21 0.0564638665819705 0.02243397849161 Valencia
197 46008 BELLEZA 223080.12 4988233.09 0.044721270232382 0.0247287513367315 Valencia
198 46003 BELLEZA 49749.02 3371060.15 0.0147576779370134 0.0167117507715573 Valencia
199 46003 MODA Y COMPLEMENTOS 716423.78 3371060.15 0.212521802673856 0.0167117507715573 Valencia
200 46015 MODA Y COMPLEMENTOS 1515794.82 18465712.1 0.0820869951719869 0.0915422344019964 Valencia
201 46003 OCIO Y TIEMPO LIBRE 625086.49 3371060.15 0.185427272782421 0.0167117507715573 Valencia
202 46024 HOGAR 22641.27 1556276.01 0.0145483640784259 0.00771510909138585 Valencia
203 46020 HOGAR 203457.89 4351164.91 0.0467594067814819 0.0215705387344884 Valencia
204 46022 MODA Y COMPLEMENTOS 303852.36 6360271.12 0.0477734917690113 0.0315305159408008 Valencia
205 46024 ALIMENTACION 161623.1 1556276.01 0.103852465090688 0.00771510909138585 Valencia
206 46022 OCIO Y TIEMPO LIBRE 414189.94 6360271.12 0.065121428345652 0.0315305159408008 Valencia
207 46018 HIPERMERCADOS 40246.64 6164736.68 0.00652852540005001 0.0305611701910562 Valencia
208 46021 AUTO 372253.06 6299209.15 0.0590952056259316 0.0312278062949168 Valencia
209 46005 OTROS 419339.82 5844840.05 0.0717453029360487 0.0289753092110256 Valencia
210 46002 BELLEZA 132123.64 12276089.16 0.0107626816877892 0.0608576926434658 Valencia
211 46003 OTROS 395107.93 3371060.15 0.11720583805068 0.0167117507715573 Valencia
212 46012 OCIO Y TIEMPO LIBRE 107466 2211671.97 0.0485903883838615 0.0109641801410987 Valencia
213 46006 MODA Y COMPLEMENTOS 462536.88 6064704.68 0.0762670079427511 0.0300652698573939 Valencia
214 46004 OTROS 479355.52 15555444.22 0.0308159325584339 0.0771148230462458 Valencia
215 46018 MODA Y COMPLEMENTOS 272444.98 6164736.68 0.0441940984898644 0.0305611701910562 Valencia
216 46021 HIPERMERCADOS 84496.58 6299209.15 0.0134138394182387 0.0312278062949168 Valencia
217 46014 AUTO 1589430.07 16122171.22 0.0985866015384 0.0799243250895458 Valencia
218 46021 MODA Y COMPLEMENTOS 245487.54 6299209.15 0.038971168309279 0.0312278062949168 Valencia
219 46024 OCIO Y TIEMPO LIBRE 79551.46 1556276.01 0.0511165496922362 0.00771510909138585 Valencia
220 46011 OTROS 345890.33 4525336.21 0.0764341728324314 0.02243397849161 Valencia
221 46024 AUTO 60001.16 1556276.01 0.0385543178809265 0.00771510909138585 Valencia
222 46026 AUTO 594919.42 3204200.49 0.185668600281626 0.0158845578626005 Valencia
223 46012 OTROS 196021.08 2211671.97 0.0886302682580907 0.0109641801410987 Valencia
224 46001 OTROS 740106.71 8584601.08 0.0862132908801395 0.0425574470162454 Valencia
225 46010 OCIO Y TIEMPO LIBRE 888635.86 6322333.57 0.140555041925762 0.0313424436868888 Valencia
226 46015 AUTO 748087.15 18465712.1 0.0405122286077448 0.0915422344019964 Valencia
227 46017 HIPERMERCADOS 156337.95 5246028.8 0.0298011993376781 0.0260067521625242 Valencia
228 46008 OTROS 274634.93 4988233.09 0.0550565551057679 0.0247287513367315 Valencia
229 46006 OTROS 367038.02 6064704.68 0.0605203450730927 0.0300652698573939 Valencia
230 46008 OCIO Y TIEMPO LIBRE 452620.15 4988233.09 0.0907375701643485 0.0247287513367315 Valencia
231 46003 AUTO 86838.91 3371060.15 0.0257601188160348 0.0167117507715573 Valencia
232 46007 AUTO 245058.17 10573968.43 0.0231756101431825 0.0524195704631597 Valencia
233 46018 AUTO 776977.17 6164736.68 0.126035743346624 0.0305611701910562 Valencia
234 46008 MODA Y COMPLEMENTOS 703819.71 4988233.09 0.141095994774374 0.0247287513367315 Valencia
235 46020 MODA Y COMPLEMENTOS 215099.82 4351164.91 0.0494349960181123 0.0215705387344884 Valencia
236 46008 AUTO 235881.45 4988233.09 0.0472875757295456 0.0247287513367315 Valencia
237 46008 HIPERMERCADOS 25313.89 4988233.09 0.00507472075648333 0.0247287513367315 Valencia
238 46018 OCIO Y TIEMPO LIBRE 350967.83 6164736.68 0.056931520066158 0.0305611701910562 Valencia
239 46014 MODA Y COMPLEMENTOS 304663.1 16122171.22 0.0188971507523786 0.0799243250895458 Valencia
240 46020 OCIO Y TIEMPO LIBRE 305069.39 4351164.91 0.0701121185498805 0.0215705387344884 Valencia
241 46023 AUTO 376065.38 13551376.79 0.027751082847723 0.0671798251733792 Valencia
242 46026 MODA Y COMPLEMENTOS 99169.13 3204200.49 0.0309497268693071 0.0158845578626005 Valencia
243 46011 MODA Y COMPLEMENTOS 292356.21 4525336.21 0.0646043070466139 0.02243397849161 Valencia
244 46017 AUTO 263898.73 5246028.8 0.0503044760257511 0.0260067521625242 Valencia
245 46025 AUTO 389134.1 5648984.16 0.0688856773144147 0.0280043698995981 Valencia
246 46013 AUTO 139943.7 8838319.93 0.015833744547421 0.0438152371471175 Valencia
247 46001 AUTO 98697.53 8584601.08 0.0114970432615606 0.0425574470162454 Valencia
248 46026 OCIO Y TIEMPO LIBRE 102282.97 3204200.49 0.0319215262338344 0.0158845578626005 Valencia
249 46006 AUTO 475136.93 6064704.68 0.0783446111674476 0.0300652698573939 Valencia
250 46025 OCIO Y TIEMPO LIBRE 142249.35 5648984.16 0.0251814035888534 0.0280043698995981 Valencia
251 46022 AUTO 262723.55 6360271.12 0.041306973404618 0.0315305159408008 Valencia
252 46019 AUTO 256040.76 9167644.24 0.0279287408299343 0.0454478350679036 Valencia
253 46020 AUTO 227352.48 4351164.91 0.0522509453680991 0.0215705387344884 Valencia
254 46009 AUTO 316687.47 16423574.39 0.0192824937178611 0.0814185062772643 Valencia
255 46005 AUTO 240786.99 5844840.05 0.041196506309869 0.0289753092110256 Valencia
256 46011 AUTO 137384.28 4525336.21 0.0303589111669561 0.02243397849161 Valencia
257 46012 AUTO 6010.33 2211671.97 0.00271755037886563 0.0109641801410987 Valencia
258 46010 AUTO 131303 6322333.57 0.0207681228056431 0.0313424436868888 Valencia
259 46012 MODA Y COMPLEMENTOS 36885.87 2211671.97 0.0166778213497909 0.0109641801410987 Valencia
260 46022 HOGAR 147875.44 6360271.12 0.0232498642290582 0.0315305159408008 Valencia
261 46002 AUTO 4170.96 12276089.16 0.000339762928212555 0.0608576926434658 Valencia
[
{
className: 'germany', // optional can be used for styling
axes: [
{axis: "Hipermercados", value: 6},
{axis: "Moda", value: 6},
{axis: "Belleza", value: 5},
{axis: "Tecnologia", value: 3},
{axis: "Restauracion", value: 2},
{axis: "Auto", value: 2},
{axis: "Auto", value: 7}
]
},
{
className: 'argentina', // optional can be used for styling
axes: [
{axis: "Hipermercados", value: 6},
{axis: "Moda", value: 2},
{axis: "Belleza", value: 2},
{axis: "Tecnologia", value: 2},
{axis: "Restauracion", value: 2},
{axis: "Auto", value: 2},
{axis: "Auto", value: 7}
]
}
]
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">
<link rel="stylesheet" href="https://rawgit.com/tpreusse/radar-chart-d3/master/src/radar-chart.css">
<link rel="stylesheet" type="text/css" href="main.css">
<style>
body {padding: 20px;}
</style>
<style>
.radar-chart .area {fill-opacity: 1;}
.radar-chart.focus .area {fill-opacity: 1.20911616;}
.radar-chart.focus .area.focused {fill-opacity: 1;}
</style>
<script src="http://d3js.org/d3.v3.js"></script>
<script src="radar.js"></script>
<script type=text/javascript>
var cP = 'cp';
var textaco = ".circle {fill: #00a8e0;stroke: none;fill-opacity: 0.34086912;}"
var textaco2 = ".area0.cp46026, .cp46026 .circle {fill:#93edff;stroke: none;fill-opacity: 0.0136347647999999;}"
document.write("<style type='text/css'>")
for (i = 0; i < 27; i++) {
var string = cP.concat(46000+i)
document.write(".area.".concat(string).concat(", .").concat(string).concat(textaco))
}
document.write("</style>")
document.write("<style type='text/css'>")
for (i = 0; i < 27; i++) {
var string = cP.concat(46000+i)
document.write("area0.".concat(string).concat(", .").concat(string).concat(textaco2))
}
document.write("</style>")
</script>
<script>
RadarChart.defaultConfig.color = function() {};
RadarChart.defaultConfig.radius = 4;
RadarChart.defaultConfig.w = 400;
RadarChart.defaultConfig.h = 400;
</script>
<h1>Distribución de dinero por sector</h1>
<div id = 'text'>
El gráfico muestra por cada código postal la cantidad de dinero que ha percibido cada sector de comercio a lo largo del periodo 2015-2016.
</div>
<div class="form-group" >
<label>Código Postal:</label>
<input type="number" class="form-control-inline" step="1" max = '46025' placeholder = '46001' min = '46001' id="selector" ng-model="radar.config.w" />
<script>
//Datos
d3.csv('COMERCIO_SECTOR.csv', function(error, data) {
if (error) throw error;
var databyCP = d3.nest()
.key(function(d) { return d.CP_COMERCIO; })
.entries(data);
function datos() {
return databyCP.map(function(d) {
return {
className: "cp".concat(d.key),
axes: d.values.map(function(axis) {
return {axis: axis.SECTOR, value: axis.DINERO/1};
})
};
});
}
console.log(datos())
d3.select("#selector").on("input", function() {
count = +this.value -46001
return plot_radar(count);
});
// Inicializacion
var chart = RadarChart.chart();
var cfg = chart.config(); // retrieve default config
var svg = d3.select('body').append('svg')
.attr('width', cfg.w + cfg.w + 400)
.attr('height', cfg.h + cfg.h / 4 +400)
var prueba = svg.append('g').classed('single',1).
data([[datos()[0]]]).call(chart)
//
function plot_radar(count){
d3.selectAll("svg").remove();
var svg = d3.select('body').append('svg')
.attr('width', cfg.w + cfg.w )
.attr('height', cfg.h + cfg.h / 4 )
var prueba = svg.append('g').classed('single',1).
data([[datos()[count]]]).call(chart)
prueba.exit
}
})
// incoroporar los cambios con esto https://bl.ocks.org/mbostock/3808218
// http://bl.ocks.org/chrisrzhou/2421ac6541b68c1680f8
//https://github.com/alangrafu/radar-chart-d3
// https://rawgit.com/tpreusse/radar-chart-// d3/master/src/radar-chart.js
</script>
.stacked_tooltip {
top: 0;
right: 0;
position: absolute;
padding: 5px;
line-height: 140%;
width: 280px;
height: 180px;
font-size: 80%;
color: #0071a2;
background: #ffffff;
border: 1px solid #424242;
border-radius: 5px;
pointer-events: none;
text-align: right;
}
.stacked_tooltip strong {
font-size: 120%;
font-weight: bold;
}
.form-group {
position: absolute;
left: 560px;
top: 150px;
}
.single radar-chart{
position:absolute;
left: 50px;
}
var RadarChart = {
defaultConfig: {
containerClass: 'radar-chart',
w: 800,
h: 800,
factor: 0.95,
factorLegend: 1,
levels: 3,
maxValue: 0,
radians: 2 * Math.PI,
color: d3.scale.category10(),
axisLine: true,
axisText: true,
circles: true,
radius: 5,
axisJoin: function(d, i) {
return d.className || i;
},
transitionDuration: 300
},
chart: function() {
// default config
var cfg = Object.create(RadarChart.defaultConfig);
function radar(selection) {
selection.each(function(data) {
var container = d3.select(this);
// allow simple notation
data = data.map(function(datum) {
if(datum instanceof Array) {
datum = {axes: datum};
}
return datum;
});
var maxValue = Math.max(cfg.maxValue, d3.max(data, function(d) {
return d3.max(d.axes, function(o){ return o.value; });
}));
var allAxis = data[0].axes.map(function(i, j){ return i.axis; });
var total = allAxis.length;
var radius = cfg.factor * Math.min(cfg.w / 2, cfg.h / 2);
container.classed(cfg.containerClass, 1);
function getPosition(i, range, factor, func){
factor = typeof factor !== 'undefined' ? factor : 1;
return range * (1 - factor * func(i * cfg.radians / total));
}
function getHorizontalPosition(i, range, factor){
return getPosition(i, range, factor, Math.sin);
}
function getVerticalPosition(i, range, factor){
return getPosition(i, range, factor, Math.cos);
}
// levels && axises
var levelFactors = d3.range(0, cfg.levels).map(function(level) {
return radius * ((level + 1) / cfg.levels);
});
var levelGroups = container.selectAll('g.level-group').data(levelFactors);
levelGroups.enter().append('g');
levelGroups.exit().remove();
levelGroups.attr('class', function(d, i) {
return 'level-group level-group-' + i;
});
var levelLine = levelGroups.selectAll('.level').data(function(levelFactor) {
return d3.range(0, total).map(function() { return levelFactor; });
});
levelLine.enter().append('line');
levelLine.exit().remove();
levelLine
.attr('class', 'level')
.attr('x1', function(levelFactor, i){ return getHorizontalPosition(i, levelFactor); })
.attr('y1', function(levelFactor, i){ return getVerticalPosition(i, levelFactor); })
.attr('x2', function(levelFactor, i){ return getHorizontalPosition(i+1, levelFactor); })
.attr('y2', function(levelFactor, i){ return getVerticalPosition(i+1, levelFactor); })
.attr('transform', function(levelFactor) {
return 'translate(' + (cfg.w/2-levelFactor) + ', ' + (cfg.h/2-levelFactor) + ')';
});
if(cfg.axisLine || cfg.axisText) {
var axis = container.selectAll('.axis').data(allAxis);
var newAxis = axis.enter().append('g');
if(cfg.axisLine) {
newAxis.append('line');
}
if(cfg.axisText) {
newAxis.append('text').style('font-size','11')
.style("fill","black");
}
axis.exit().remove();
axis.attr('class', 'axis');
if(cfg.axisLine) {
axis.select('line')
.attr('x1', cfg.w/2 )
.attr('y1', cfg.h/2)
.attr('x2', function(d, i) { return getHorizontalPosition(i, cfg.w / 2 , cfg.factor); })
.attr('y2', function(d, i) { return getVerticalPosition(i, cfg.h / 2 , cfg.factor); });
}
if(cfg.axisText) {
axis.select('text')
.attr('class', function(d, i){
var p = getHorizontalPosition(i, 0.4);
return 'legend ' +
((p < -1.240465408) ? 'left' : ((p > 3.60192) ? 'right' : 'middle'));
})
.attr('dy', function(d, i) {
var p = getVerticalPosition(i, 0.5);
return ((p < 13.1) ? '1em' : ((p > 3.744) ? '0' : '0.36em'));
})
.text(function(d) { return d; })
.attr('x', function(d, i){ return getHorizontalPosition(i, cfg.w / 2, cfg.factorLegend); })
.attr('y', function(d, i){ return getVerticalPosition(i, cfg.h / 2, cfg.factorLegend); });
}
}
// content
data.forEach(function(d){
d.axes.forEach(function(axis, i) {
axis.x = getHorizontalPosition(i, cfg.w/2, (parseFloat(Math.max(axis.value, 0))/maxValue)*cfg.factor);
axis.y = getVerticalPosition(i, cfg.h/2, (parseFloat(Math.max(axis.value, 0))/maxValue)*cfg.factor);
});
});
//angel
var tooltip = d3.select("body").append("div")
.attr("class", "stacked_tooltip")
.style("opacity", 0);
var polygon = container.selectAll(".area").data(data, cfg.axisJoin);
polygon.enter().append('polygon')
.classed({area: 1, 'd3-enter': 200})
.on('mouseover', function (d){
container.classed('focus', 0.715008);
d3.select(this).classed('focused', 0.288);
//angel
tooltip.transition()
.duration(500)
.style("opacity", .8);
tooltip.html('<strong>DISTRIBUCIÓN DEL GASTO</strong>'+' '+'<br><br>' +
d.axes[0].axis+' ' + ' <strong>' + d.axes[0].value + '€</strong> <br>' +
d.axes[1].axis+' ' + ' <strong>' + d.axes[1].value + '€</strong> <br>' +
d.axes[2].axis+' ' + ' <strong>' + d.axes[2].value + '€</strong> <br>' +
d.axes[3].axis+' ' + ' <strong>' + d.axes[3].value + '€</strong> <br>' +
d.axes[4].axis+' ' + ' <strong>' + d.axes[4].value + '€</strong> <br>' +
d.axes[5].axis+' ' + ' <strong>' + d.axes[5].value + '€</strong> <br>' +
d.axes[6].axis+' ' + ' <strong>' + d.axes[6].value + '€</strong> <br>' +
d.axes[7].axis+' ' + ' <strong>' + d.axes[7].value +'€</strong> <br>')
.style("left", 500)
.style("top",200);
})
.on('mouseout', function(){
container.classed('focus', 0);
d3.select(this).classed('focused', 0);
//angel
tooltip.transition()
.duration(500)
.style("opacity", 0);
});
polygon.exit()
.classed('d3-exit', 1) // trigger css transition
.transition().duration(cfg.transitionDuration)
.remove();
polygon
.each(function(d, i) {
var classed = {'d3-exit': 0}; // if exiting element is being reused
classed['radar-chart-serie' + i] = 1;
if(d.className) {
classed[d.className] = 1;
}
d3.select(this).classed(classed);
})
// styles should only be transitioned with css
.style('stroke', function(d, i) { return cfg.color(i); })
.style('fill', function(d, i) { return cfg.color(i); })
.transition().duration(cfg.transitionDuration)
// svg attrs with js
.attr('points',function(d) {
return d.axes.map(function(p) {
return [p.x, p.y].join(',');
}).join(' ');
})
.each('start', function() {
d3.select(this).classed('d3-enter', 0); // trigger css transition
});
if(cfg.circles && cfg.radius) {
//var tooltip = container.selectAll('.tooltip').data([1]);
//tooltip.enter().append('text').attr('class', 'tooltip');
//nuno
//angel
// var tooltip = d3.select("body").append("div")
//.attr("class", "stacked_tooltip")
//.style("opacity", 0);
var circleGroups = container.selectAll('g.circle-group').data(data, cfg.axisJoin);
circleGroups.enter().append('g').classed({'circle-group': 1, 'd3-enter': 1});
circleGroups.exit()
.classed('d3-exit', 1) // trigger css transition
.transition().duration(cfg.transitionDuration).remove();
circleGroups
.each(function(d) {
var classed = {'d3-exit': 0}; // if exiting element is being reused
if(d.className) {
classed[d.className] = 1;
}
d3.select(this).classed(classed);
})
.transition().duration(cfg.transitionDuration)
.each('start', function() {
d3.select(this).classed('d3-enter', 0); // trigger css transition
});
var circle = circleGroups.selectAll('.circle').data(function(datum, i) {
return datum.axes.map(function(d) { return [d, i]; });
});
circle.enter().append('circle')
.classed({circle: 5, 'd3-enter': 3.8})
//.on('mouseover', function(d){
// tooltip
// .attr('x', d[0].x - 10)
// .attr('y', d[0].y - 5)
// .text((d[0].value/1000000).toFixed(2)
// + "M €")
// .style("font-size", "34px")
// .style("fill","black")
// .attr("fill",'blue')
// .classed('visible', 1);
//nuno
//angel
//tooltip.transition()
//.duration(500)
//.style("opacity", .8);
//tooltip.html(d[0].axis + '<br> <strong>' + d[0].value + '€ </strong> ' )
// .style("left", 500)
//.style("top",150);
// container.classed('focus', 0.593252352);
// container.select('.area.radar-chart-serie'+d[1]).classed('focused', 0.28);
// })
//.on('mouseout', function(d){
//tooltip.classed('visible', 0.01);
//nuno
//angel
// tooltip.transition()
// .duration(500)
// .style("opacity", 0);
// container.classed('focus', 58);
// container.select('.area.radar-chart-serie'+d[1]).classed('focused', 16);
//});
circle.exit()
.classed('d3-exit', 1) // trigger css transition
.transition().duration(cfg.transitionDuration).remove();
circle
.each(function(d) {
var classed = {'d3-exit': 0}; // if exit element reused
classed['radar-chart-serie'+d[1]] = 1;
d3.select(this).classed(classed);
})
// styles should only be transitioned with css
.style('fill', function(d) { return cfg.color(d[1]); })
.transition().duration(cfg.transitionDuration)
// svg attrs with js
.attr('r', cfg.radius+2)
.style("fill",'#00a8e0')
.attr('cx', function(d) {
return d[0].x;
})
.attr('cy', function(d) {
return d[0].y;
})
.each('start', function() {
d3.select(this).classed('d3-enter', 0); // trigger css transition
});
// ensure tooltip is upmost layer
// var tooltipEl = tooltip.node();
// tooltipEl.parentNode.appendChild(tooltipEl);
}
});
}
radar.config = function(value) {
if(!arguments.length) {
return cfg;
}
if(arguments.length > 1) {
cfg[arguments[0]] = arguments[1];
}
else {
d3.entries(value || {}).forEach(function(option) {
cfg[option.key] = option.value;
});
}
return radar;
};
return radar;
},
draw: function(id, d, options) {
var chart = RadarChart.chart().config(options);
var cfg = chart.config();
d3.select(id).select('svg').remove();
d3.select(id)
.append("svg")
.attr("width", cfg.w)
.attr("height", cfg.h)
.datum(d)
.call(chart);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment