forked from DengYiping/wordpress-to-markdown
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtest-wordpress-dump.xml
1384 lines (1154 loc) · 98.9 KB
/
test-wordpress-dump.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!-- on the site. For each author, you may choose to map to an -->
<!-- existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!-- contained in this file into your site. -->
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.2/"
>
<channel>
<title>A geek with a hat</title>
<link>https://swizec.com/blog</link>
<description>Helping you become a better engineer</description>
<pubDate>Thu, 13 Aug 2020 01:42:08 +0000</pubDate>
<language>en-US</language>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>https://swizec.com/blog</wp:base_site_url>
<wp:base_blog_url>https://swizec.com/blog</wp:base_blog_url>
<wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[admin]]></wp:author_login><wp:author_email><![CDATA[swizec@swizec.com]]></wp:author_email><wp:author_display_name><![CDATA[Swizec]]></wp:author_display_name><wp:author_first_name><![CDATA[Swizec]]></wp:author_first_name><wp:author_last_name><![CDATA[Teller]]></wp:author_last_name></wp:author>
<item>
<title>Adversarial example of bad code</title>
<link>https://swizec.com/blog/ref-callbacks-measure-react-component-size/swizec/8444</link>
<pubDate>Thu, 07 Jun 2018 17:04:31 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">https://swizec.com/blog/?p=8444</guid>
<description></description>
<content:encoded><![CDATA[You can use ref callbacks to measure the rendered size of React components, did you know? It's a neat little trick.
This is a codesandbox iframe embed
<iframe src="https://codesandbox.io/embed/71vx2q5r76" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin" class="hai-there"></iframe>
This is a code block with JSX
<pre lang="javascript">
class ReportSize extends React.Component {
refCallback = element => {
if (element) {
this.props.getSize(element.getBoundingClientRect());
}
};
render() {
return (
<div data-prop="hello" ref={this.refCallback} id="an-id" style={{ border: "1px solid red" }} keepMe={lol} href="a link" objProp={{test:'nospace'}} objProp2={{ test: 'leftspace'}} notObj="{{">
{faker.lorem.paragraphs(Math.random() * 10)}
</div>
);
}
}
</pre>
<pre lang="javascript">
<FadeIn height={400}>
{onLoad =>
<img className={cx('img')} src={subheader2} onLoad={onLoad} />
}
</FadeIn>
</pre>
<pre lang="javascript">
d3.csv("https://raw.githubusercontent.com/Swizec/server-side-d3-poc/master/src/data.csv")
.row(this.rowParse)
.get(data =>
ReactDOM.hydrate(<App data={data} />, document.getElementById('root'))
);
</pre>
This is a MDX style youtube embed
https://www.youtube.com/watch?v=Tzcb9lxBRXc
A full youtube embed
<iframe width="560" height="315" src="https://www.youtube.com/embed/Tzcb9lxBRXc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
A mdx style twitter embed
https://twitter.com/joshmanders/status/1296085276146663427
A full twitter embed
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Can we start a movement where we stop fucking using recaptcha and other shitty services? Holy fuck I'm getting tired of it.<br><br>I'm about to just stop using services that use that garbage.</p>— ≋Josh≋ 𝘧𝘳𝘰𝘮 ☁️ ᴘʀɪᴍᴄʟᴏᴜᴅ.ᴄᴏᴍ (@joshmanders) <a href="https://twitter.com/joshmanders/status/1296085276146663427?ref_src=twsrc%5Etfw">August 19, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
A mdx style instagram embed
https://www.instagram.com/p/CD76HESFLy5/
A full instagram embed
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/CD76HESFLy5/?utm_source=ig_embed&utm_campaign=loading" data-instgrm-version="12" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/p/CD76HESFLy5/?utm_source=ig_embed&utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;"> View this post on Instagram</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div></a> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://www.instagram.com/p/CD76HESFLy5/?utm_source=ig_embed&utm_campaign=loading" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">Playing Gloomhaven with @morganeambre great game, like a user friendly D&D</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">A post shared by <a href="https://www.instagram.com/swizec/?utm_source=ig_embed&utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px;" target="_blank"> Swizec Teller</a> (@swizec) on <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2020-08-16T04:02:37+00:00">Aug 15, 2020 at 9:02pm PDT</time></p></div></blockquote> <script async src="//www.instagram.com/embed.js"></script>
This is a codepen html embed
<p class="codepen" data-height="265" data-theme-id="light" data-default-tab="css,result" data-user="louflan" data-slug-hash="JjGVbjY" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="The Girl With A p̶e̶a̶r̶l̶ CSS Earring">
<span>See the Pen <a href="https://codepen.io/louflan/pen/JjGVbjY">
The Girl With A p̶e̶a̶r̶l̶ CSS Earring</a> by Louise Flanagan (<a href="https://codepen.io/louflan">@louflan</a>)
on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
A MDX style codepen embed:
https://codepen.io/louflan/pen/JjGVbjY
A twitter link with underscores
<a href="https://twitter.com/_developit/status/1297374800105672705">tweet</a>
https://twitter.com/_developit/status/1297374800105672705
Shortcode tweet embed
[tweet https://twitter.com/_developit/status/1297374800105672705]
]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>8444</wp:post_id>
<wp:post_date><![CDATA[2018-06-07 10:04:31]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2018-06-07 17:04:31]]></wp:post_date_gmt>
<wp:comment_status><![CDATA[open]]></wp:comment_status>
<wp:ping_status><![CDATA[open]]></wp:ping_status>
<wp:post_name><![CDATA[ref-callbacks-measure-react-component-size]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[post]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="front-end"><![CDATA[Front End]]></category>
<category domain="category" nicename="technical"><![CDATA[Technical]]></category>
<wp:postmeta>
<wp:meta_key><![CDATA[_wpcom_is_markdown]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
<wp:meta_value><![CDATA[4]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[publish_post_category]]></wp:meta_key>
<wp:meta_value><![CDATA[0]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[publish_to_discourse]]></wp:meta_key>
<wp:meta_value><![CDATA[0]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_yoast_wpseo_content_score]]></wp:meta_key>
<wp:meta_value><![CDATA[90]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_yoast_wpseo_primary_category]]></wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_c68e0a57110ca30bcd4f4c21725b4736]]></wp:meta_key>
<wp:meta_value><![CDATA[<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" width="580" height="870" src="https://codesandbox.io/embed/71vx2q5r76#?secret=SyHKovHY1l" data-secret="SyHKovHY1l"></iframe>]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_time_c68e0a57110ca30bcd4f4c21725b4736]]></wp:meta_key>
<wp:meta_value><![CDATA[1528390929]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_9726891f37745f20911bc33153e6470a]]></wp:meta_key>
<wp:meta_value><![CDATA[<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" width="580" height="870" src="https://codesandbox.io/embed/v6m4o48zl#?secret=D2SlHVG2rm" data-secret="D2SlHVG2rm"></iframe>]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_time_9726891f37745f20911bc33153e6470a]]></wp:meta_key>
<wp:meta_value><![CDATA[1528390930]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_25cf02016b1a8b78b71e7cddbeea8569]]></wp:meta_key>
<wp:meta_value><![CDATA[<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" width="580" height="870" src="https://codesandbox.io/embed/7jqmo1jn8j#?secret=bd42F8jkLJ" data-secret="bd42F8jkLJ"></iframe>]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_time_25cf02016b1a8b78b71e7cddbeea8569]]></wp:meta_key>
<wp:meta_value><![CDATA[1528390930]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_yoast_wpseo_opengraph-image]]></wp:meta_key>
<wp:meta_value><![CDATA[https://swizec.com/blog/wp-content/uploads/2018/06/patricia-serna-415257-unsplash.jpg]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_yoast_wpseo_twitter-image]]></wp:meta_key>
<wp:meta_value><![CDATA[https://swizec.com/blog/wp-content/uploads/2018/06/patricia-serna-415257-unsplash.jpg]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_yoast_wpseo_metadesc]]></wp:meta_key>
<wp:meta_value><![CDATA[You can use ref callbacks to measure the rendered size of React components, did you know? It's a neat little trick.]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_05affd165389cd7fc47879262d9844ca]]></wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_bb2c05c8a39f2af32e13b37155e16b80]]></wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_6efecfe7776bd2ce4f8d2044e82f448c]]></wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_f8c90c0d7ea216a307bf4ea9a245f24d]]></wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_92540f87fc5f70297a5cb52913a1d4e9]]></wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_oembed_bbaf7a1b8e6a90b80b09697cf34bdcd8]]></wp:meta_key>
<wp:meta_value><![CDATA[{{unknown}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[wp-syntax-cache-content]]></wp:meta_key>
<wp:meta_value><![CDATA[a:3:{i:1;s:3357:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #FF0000;">class</span> ReportSize <span style="color: #FF0000;">extends</span> React.<span style="color: #660066;">Component</span> <span style="color: #009900;">{</span>
refCallback <span style="color: #339933;">=</span> element <span style="color: #339933;">=></span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">(</span>element<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">props</span>.<span style="color: #660066;">getSize</span><span style="color: #009900;">(</span>element.<span style="color: #660066;">getBoundingClientRect</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #009900;">}</span><span style="color: #339933;">;</span>
render<span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">(</span>
<span style="color: #339933;"><</span>div ref<span style="color: #339933;">=</span><span style="color: #009900;">{</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">refCallback</span><span style="color: #009900;">}</span> style<span style="color: #339933;">=</span><span style="color: #009900;">{</span><span style="color: #009900;">{</span> border<span style="color: #339933;">:</span> <span style="color: #3366CC;">"1px solid red"</span> <span style="color: #009900;">}</span><span style="color: #009900;">}</span><span style="color: #339933;">></span>
<span style="color: #009900;">{</span>faker.<span style="color: #660066;">lorem</span>.<span style="color: #660066;">paragraphs</span><span style="color: #009900;">(</span><span style="">Math</span>.<span style="color: #660066;">random</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">)</span><span style="color: #009900;">}</span>
<span style="color: #339933;"></</span>div<span style="color: #339933;">></span>
<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #009900;">}</span></pre></td></tr></table><p class="theCode" style="display:none;">class ReportSize extends React.Component {
refCallback = element => {
if (element) {
this.props.getSize(element.getBoundingClientRect());
}
};
render() {
return (
<div ref={this.refCallback} style={{ border: "1px solid red" }}>
{faker.lorem.paragraphs(Math.random() * 10)}
</div>
);
}
}</p></div>
";i:2;s:1865:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">{</span>
<span style="color: #3366CC;">"x"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">8</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"y"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">158.8125</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"width"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">544</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"height"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">340</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"top"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">158.8125</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"right"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">552</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"bottom"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">498.8125</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">"left"</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">8</span>
<span style="color: #009900;">}</span></pre></td></tr></table><p class="theCode" style="display:none;">{
"x": 8,
"y": 158.8125,
"width": 544,
"height": 340,
"top": 158.8125,
"right": 552,
"bottom": 498.8125,
"left": 8
}</p></div>
";i:3;s:4459:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">shuffle <span style="color: #339933;">=</span> <span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #339933;">=></span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">doReportSize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">setState</span><span style="color: #009900;">(</span><span style="color: #009900;">{</span>
text<span style="color: #339933;">:</span> faker.<span style="color: #660066;">lorem</span>.<span style="color: #660066;">paragraphs</span><span style="color: #009900;">(</span><span style="">Math</span>.<span style="color: #660066;">random</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">)</span>
<span style="color: #009900;">}</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span><span style="color: #339933;">;</span>
refCallback <span style="color: #339933;">=</span> element <span style="color: #339933;">=></span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">(</span>element<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">elementRef</span> <span style="color: #339933;">=</span> element<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">props</span>.<span style="color: #660066;">getSize</span><span style="color: #009900;">(</span>element.<span style="color: #660066;">getBoundingClientRect</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #009900;">}</span><span style="color: #339933;">;</span>
componentDidUpdate<span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">(</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">doReportSize</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">props</span>.<span style="color: #660066;">getSize</span><span style="color: #009900;">(</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">elementRef</span>.<span style="color: #660066;">getBoundingClientRect</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">doReportSize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #009900;">}</span></pre></td></tr></table><p class="theCode" style="display:none;">shuffle = () => {
this.doReportSize = true;
this.setState({
text: faker.lorem.paragraphs(Math.random() * 10)
});
};
refCallback = element => {
if (element) {
this.elementRef = element;
this.props.getSize(element.getBoundingClientRect());
}
};
componentDidUpdate() {
if (this.doReportSize) {
this.props.getSize(this.elementRef.getBoundingClientRect());
this.doReportSize = false;
}
}</p></div>
";}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_yoast_wpseo_opengraph-image-id]]></wp:meta_key>
<wp:meta_value><![CDATA[8448]]></wp:meta_value>
</wp:postmeta>
</item>
<item>
<title>Sexy animated spirographs in 35 sloc of d3.js</title>
<link>https://swizec.com/blog/sexy-animated-spirographs-in-35-sloc-of-d3-js/swizec/6052</link>
<pubDate>Thu, 07 Mar 2013 12:13:50 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">http://swizec.com/blog/?p=6052</guid>
<description></description>
<content:encoded><![CDATA[You probably remember spirographs as kid's toys from your youth. I had a simple set that was just a collection of plastic sprockets with holes for pencils.
Endless amounts of fun when I was two or three years old. I think ... I don't really remember much from that time, but I remember having those thingies and loving playing with them. One of my earliest memories even!
[caption id="" align="alignnone" width="560"]<img class=" " title="Spirograph" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/97/Spirograph3.jpg/800px-Spirograph3.jpg" alt="Spirograph" width="560" height="420" /> <a class="zem_slink" title="Spirograph" href="http://en.wikipedia.org/wiki/Spirograph" rel="wikipedia" target="_blank">Spirograph</a>[/caption]
Last night I was making an animation example for the d3.js book I'm writing and ended up with the idea of progressively drawing out cool looking parametric equations. Little did I know, those are actually spirographs! Learned something while I was learning something.
<blockquote class="twitter-tweet">@<a href="https://twitter.com/swizec">swizec</a> <a class="zem_slink" title="Parametric equation" href="http://en.wikipedia.org/wiki/Parametric_equation" rel="wikipedia" target="_blank">Parametric equations</a> are a way to model physical spirographs. <a title="http://en.wikipedia.org/wiki/Spirograph" href="http://t.co/JvFBin6ZGa">en.wikipedia.org/wiki/Spirograph</a>
— Klemen Slavič (@krofdrakula) <a href="https://twitter.com/krofdrakula/status/309348085983756288">March 6, 2013</a></blockquote>
My failure in common knowledge aside, it's possible to animate the drawing of parametric equations with just a few lines of <a href="http://d3js.org" target="_blank">d3.js</a> code. What I'm about to show you has a pretty big problem, but produces cool looking results "in the lab". Try to guess what the problem is.
<h2>Animating spirographs</h2>
[caption id="attachment_6059" align="alignnone" width="486"]<a href="http://swizec.com/blog/wp-content/uploads/2013/03/0007_04_04.png"><img class=" wp-image-6059 " title="After a few steps" src="http://swizec.com/blog/wp-content/uploads/2013/03/0007_04_04.png" alt="After a few steps" width="486" height="354" /></a> After a few steps[/caption]
We'll make an animation timer and for each tick we'll draw a new step of the spirograph. After the spirograph is finished, we'll stop the timer. To make the animation more interesting to watch, we'll also fake a brush flying around (just a black dot).
We start with some basic html:
<pre lang="html">
<!DOCTYPE html>
<title></title>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<div id="graph"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="timers.js"></script>
</pre>
Then we hop into the javascript to flesh out the actual code.
<pre lang="javascript">var width = 600,
height = 600,
svg = d3.select('#graph')
.append('svg')
.attr({width: width,
height: height});</pre>
I found the parametric function in the wikipedia's article on parametric equations. We'll be giving it a simple parameter calculated from the animation timer and it will return a two dimensional position.
<pre lang="javascript">var position = function (t) {
var a = 80, b = 1, c = 1, d = 80;
return {x: Math.cos(a*t) - Math.pow(Math.cos(b*t), 3),
y: Math.sin(c*t) - Math.pow(Math.sin(d*t), 3)};
};</pre>
Tweaking the <em>a</em>, <em>b</em>, c, and <em>d</em> parameters will change the final shape.
Next we're going to define some scales to help us translate between maths space and our drawing space.
<pre lang="javascript">var t_scale = d3.scale.linear().domain([500, 30000]).range([0, 2*Math.PI]),
x = d3.scale.linear().domain([-2, 2]).range([100, width-100]),
y = d3.scale.linear().domain([-2, 2]).range([height-100, 100]);
var brush = svg.append('circle')
.attr({r: 4}),
previous = position(0);</pre>
The <em>t_scale</em> is going to translate time into a parameter, <em>x</em> and <em>y</em> calculate proper positions on the final image using the coordinates returned by the position function.
We also put a simple circle on the image - this will represent the brush - and we need to take note of the previous position so we can draw lines between our current and previous state.
<pre lang="javascript">var step = function (time) {
if (time > t_scale.domain()[1]) {
return true;
}
var t = t_scale(time),
pos = position(t);
brush.attr({cx: x(pos.x),
cy: y(pos.y)});
svg.append('line')
.attr({x1: x(previous.x),
y1: y(previous.y),
x2: x(pos.x),
y2: y(pos.y),
stroke: 'steelblue',
'stroke-width': 1.3});
previous = pos;
};</pre>
This is our <a class="zem_slink" title="Step function" href="http://en.wikipedia.org/wiki/Step_function" rel="wikipedia" target="_blank">step function</a>. It draws every consecutive step of the animation by moving the brush and putting a line between the current and previous position. The animation will stop when this function returns <em>true</em> so we make sure the <em>time</em> parameter doesn't go beyond <em>t_scales</em>'s domain.
Finally, we simply start the timer.
<pre lang="javascript">var timer = d3.timer(step, 500);</pre>
The timer will start running after 500 milliseconds and repeatedly call the <em>step </em>function until it returns <em>true.</em>
You can check the animation out via <a href="http://swizec.github.com/d3.js-book-examples/ch4/timers.html" target="_blank">the magic of github pages</a>. The final spirograph looks like this:
[caption id="attachment_6055" align="alignnone" width="555"]<a href="http://swizec.com/blog/wp-content/uploads/2013/03/0007_04_05.png"><img class="size-full wp-image-6055" title="A parametric equation visualised" src="http://swizec.com/blog/wp-content/uploads/2013/03/0007_04_05.png" alt="A parametric equation visualised" width="555" height="443" /></a> A parametric equation visualised[/caption]
Figured out the problem yet?
The problem with this approach is that I'm using the animation timer itself as a parameter to the function, which means point density depends on how long you're willing to let the animation run. It will always draw the complete function because of how d3 scales work, but it might look <em>very</em> approximate. Think squares for circles approximate.
Another problem is that using a slower computer, or doing anything that lags the CPU even a little bit while the animation is running will ruin the final picture.
For instance, this is what happens when I switch desktops around while the browser is drawing.
[caption id="attachment_6057" align="alignnone" width="546"]<a href="http://swizec.com/blog/wp-content/uploads/2013/03/glitchy-spirograph.png"><img class=" wp-image-6057 " title="Glitchy spirograph" src="http://swizec.com/blog/wp-content/uploads/2013/03/glitchy-spirograph.png" alt="Glitchy spirograph" width="546" height="534" /></a> Glitchy spirograph[/caption]
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul zemanta-article-ul-image" style="margin: 0; padding: 0; overflow: hidden;">
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://www.universetoday.com/100325/the-vela-pulsar-as-a-spirograph/" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/148486923_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://www.universetoday.com/100325/the-vela-pulsar-as-a-spirograph/" target="_blank">The Vela Pulsar as a Spirograph</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://hackaday.com/2013/02/21/laser-spirograph/" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/147121686_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://hackaday.com/2013/02/21/laser-spirograph/" target="_blank">Laser Spirograph</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://www.gizmodo.co.uk/2013/02/watch-the-universe-draw-an-awesome-spirograph-in-the-sky/" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/148806266_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://www.gizmodo.co.uk/2013/02/watch-the-universe-draw-an-awesome-spirograph-in-the-sky/" target="_blank">Watch the Universe Draw an Awesome Spirograph in the Sky</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://phys.org/news/2013-02-fermi-motion-spirograph.html" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/148576796_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://phys.org/news/2013-02-fermi-motion-spirograph.html" target="_blank">Fermi's motion produces a study in spirograph</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/?px"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=fb22a411-7098-4367-b54c-e6363f006ad9" alt="Enhanced by Zemanta" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>6052</wp:post_id>
<wp:post_date><![CDATA[2013-03-07 13:13:50]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2013-03-07 12:13:50]]></wp:post_date_gmt>
<wp:comment_status><![CDATA[open]]></wp:comment_status>
<wp:ping_status><![CDATA[open]]></wp:ping_status>
<wp:post_name><![CDATA[sexy-animated-spirographs-in-35-sloc-of-d3-js]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[post]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="post_tag" nicename="animation"><![CDATA[Animation]]></category>
<category domain="post_tag" nicename="d3-js"><![CDATA[d3.js]]></category>
<category domain="post_tag" nicename="javascript"><![CDATA[JavaScript]]></category>
<category domain="post_tag" nicename="spirograph"><![CDATA[Spirograph]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<wp:postmeta>
<wp:meta_key><![CDATA[dsq_thread_id]]></wp:meta_key>
<wp:meta_value><![CDATA[1122994235]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_jetpack_related_posts_cache]]></wp:meta_key>
<wp:meta_value><![CDATA[a:1:{s:32:"8f6677c9d6b0f903e98ad32ec61f8deb";a:2:{s:7:"expires";i:1474511184;s:7:"payload";a:3:{i:0;a:1:{s:2:"id";i:4558;}i:1;a:1:{s:2:"id";i:6784;}i:2;a:1:{s:2:"id";i:5912;}}}}]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[wp-syntax-cache-content]]></wp:meta_key>
<wp:meta_value><![CDATA[a:6:{i:1;s:866:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="html" style="font-family:monospace;"><!DOCTYPE html>
<title></title>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<div id="graph"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="timers.js"></script></pre></td></tr></table><p class="theCode" style="display:none;"><!DOCTYPE html>
<title></title>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<div id="graph"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="timers.js"></script></p></div>
";i:2;s:1491:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> width <span style="color: #339933;">=</span> <span style="color: #CC0000;">600</span><span style="color: #339933;">,</span>
height <span style="color: #339933;">=</span> <span style="color: #CC0000;">600</span><span style="color: #339933;">,</span>
svg <span style="color: #339933;">=</span> d3.<span style="color: #660066;">select</span><span style="color: #009900;">(</span><span style="color: #3366CC;">'#graph'</span><span style="color: #009900;">)</span>
.<span style="color: #660066;">append</span><span style="color: #009900;">(</span><span style="color: #3366CC;">'svg'</span><span style="color: #009900;">)</span>
.<span style="color: #660066;">attr</span><span style="color: #009900;">(</span><span style="color: #009900;">{</span>width<span style="color: #339933;">:</span> width<span style="color: #339933;">,</span>
height<span style="color: #339933;">:</span> height<span style="color: #009900;">}</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre></td></tr></table><p class="theCode" style="display:none;">var width = 600,
height = 600,
svg = d3.select('#graph')
.append('svg')
.attr({width: width,
height: height});</p></div>
";i:3;s:2957:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> position <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">(</span>t<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> <span style="color: #CC0000;">80</span><span style="color: #339933;">,</span> b <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> c <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> d <span style="color: #339933;">=</span> <span style="color: #CC0000;">80</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">{</span>x<span style="color: #339933;">:</span> <span style="">Math</span>.<span style="color: #660066;">cos</span><span style="color: #009900;">(</span>a<span style="color: #339933;">*</span>t<span style="color: #009900;">)</span> <span style="color: #339933;">-</span> <span style="">Math</span>.<span style="color: #660066;">pow</span><span style="color: #009900;">(</span><span style="">Math</span>.<span style="color: #660066;">cos</span><span style="color: #009900;">(</span>b<span style="color: #339933;">*</span>t<span style="color: #009900;">)</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
y<span style="color: #339933;">:</span> <span style="">Math</span>.<span style="color: #660066;">sin</span><span style="color: #009900;">(</span>c<span style="color: #339933;">*</span>t<span style="color: #009900;">)</span> <span style="color: #339933;">-</span> <span style="">Math</span>.<span style="color: #660066;">pow</span><span style="color: #009900;">(</span><span style="">Math</span>.<span style="color: #660066;">sin</span><span style="color: #009900;">(</span>d<span style="color: #339933;">*</span>t<span style="color: #009900;">)</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">)</span><span style="color: #009900;">}</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span><span style="color: #339933;">;</span></pre></td></tr></table><p class="theCode" style="display:none;">var position = function (t) {
var a = 80, b = 1, c = 1, d = 80;
return {x: Math.cos(a*t) - Math.pow(Math.cos(b*t), 3),
y: Math.sin(c*t) - Math.pow(Math.sin(d*t), 3)};
};</p></div>
";i:4;s:4430:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> t_scale <span style="color: #339933;">=</span> d3.<span style="color: #660066;">scale</span>.<span style="color: #660066;">linear</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span>.<span style="color: #660066;">domain</span><span style="color: #009900;">(</span><span style="color: #009900;">[</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">30000</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>.<span style="color: #660066;">range</span><span style="color: #009900;">(</span><span style="color: #009900;">[</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">*</span><span style="">Math</span>.<span style="color: #660066;">PI</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
x <span style="color: #339933;">=</span> d3.<span style="color: #660066;">scale</span>.<span style="color: #660066;">linear</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span>.<span style="color: #660066;">domain</span><span style="color: #009900;">(</span><span style="color: #009900;">[</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>.<span style="color: #660066;">range</span><span style="color: #009900;">(</span><span style="color: #009900;">[</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> width<span style="color: #339933;">-</span><span style="color: #CC0000;">100</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
y <span style="color: #339933;">=</span> d3.<span style="color: #660066;">scale</span>.<span style="color: #660066;">linear</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span>.<span style="color: #660066;">domain</span><span style="color: #009900;">(</span><span style="color: #009900;">[</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span>.<span style="color: #660066;">range</span><span style="color: #009900;">(</span><span style="color: #009900;">[</span>height<span style="color: #339933;">-</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">var</span> brush <span style="color: #339933;">=</span> svg.<span style="color: #660066;">append</span><span style="color: #009900;">(</span><span style="color: #3366CC;">'circle'</span><span style="color: #009900;">)</span>
.<span style="color: #660066;">attr</span><span style="color: #009900;">(</span><span style="color: #009900;">{</span>r<span style="color: #339933;">:</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">}</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
previous <span style="color: #339933;">=</span> position<span style="color: #009900;">(</span><span style="color: #CC0000;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre></td></tr></table><p class="theCode" style="display:none;">var t_scale = d3.scale.linear().domain([500, 30000]).range([0, 2*Math.PI]),
x = d3.scale.linear().domain([-2, 2]).range([100, width-100]),
y = d3.scale.linear().domain([-2, 2]).range([height-100, 100]);
var brush = svg.append('circle')
.attr({r: 4}),
previous = position(0);</p></div>
";i:5;s:4588:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> step <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span> <span style="color: #009900;">(</span>time<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">(</span>time <span style="color: #339933;">></span> t_scale.<span style="color: #660066;">domain</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #009900;">[</span><span style="color: #CC0000;">1</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #000066; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> t_scale<span style="color: #009900;">(</span>time<span style="color: #009900;">)</span><span style="color: #339933;">,</span>
pos <span style="color: #339933;">=</span> position<span style="color: #009900;">(</span>t<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
brush.<span style="color: #660066;">attr</span><span style="color: #009900;">(</span><span style="color: #009900;">{</span>cx<span style="color: #339933;">:</span> x<span style="color: #009900;">(</span>pos.<span style="color: #660066;">x</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
cy<span style="color: #339933;">:</span> y<span style="color: #009900;">(</span>pos.<span style="color: #660066;">y</span><span style="color: #009900;">)</span><span style="color: #009900;">}</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
svg.<span style="color: #660066;">append</span><span style="color: #009900;">(</span><span style="color: #3366CC;">'line'</span><span style="color: #009900;">)</span>
.<span style="color: #660066;">attr</span><span style="color: #009900;">(</span><span style="color: #009900;">{</span>x1<span style="color: #339933;">:</span> x<span style="color: #009900;">(</span>previous.<span style="color: #660066;">x</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
y1<span style="color: #339933;">:</span> y<span style="color: #009900;">(</span>previous.<span style="color: #660066;">y</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
x2<span style="color: #339933;">:</span> x<span style="color: #009900;">(</span>pos.<span style="color: #660066;">x</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
y2<span style="color: #339933;">:</span> y<span style="color: #009900;">(</span>pos.<span style="color: #660066;">y</span><span style="color: #009900;">)</span><span style="color: #339933;">,</span>
stroke<span style="color: #339933;">:</span> <span style="color: #3366CC;">'steelblue'</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">'stroke-width'</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">1.3</span><span style="color: #009900;">}</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
previous <span style="color: #339933;">=</span> pos<span style="color: #339933;">;</span>
<span style="color: #009900;">}</span><span style="color: #339933;">;</span></pre></td></tr></table><p class="theCode" style="display:none;">var step = function (time) {
if (time > t_scale.domain()[1]) {
return true;
}
var t = t_scale(time),
pos = position(t);
brush.attr({cx: x(pos.x),
cy: y(pos.y)});
svg.append('line')
.attr({x1: x(previous.x),
y1: y(previous.y),
x2: x(pos.x),
y2: y(pos.y),
stroke: 'steelblue',
'stroke-width': 1.3});
previous = pos;
};</p></div>
";i:6;s:597:"
<div class="wp_syntax" style="position:relative;"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> timer <span style="color: #339933;">=</span> d3.<span style="color: #660066;">timer</span><span style="color: #009900;">(</span>step<span style="color: #339933;">,</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre></td></tr></table><p class="theCode" style="display:none;">var timer = d3.timer(step, 500);</p></div>
";}]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>5431</wp:comment_id>
<wp:comment_author><![CDATA[Damir Zekić]]></wp:comment_author>
<wp:comment_author_email><![CDATA[damirz@gmail.com]]></wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP><![CDATA[31.176.243.255]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-03-07 09:08:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-03-07 16:08:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[Interesting! Could you work around the problems by using a simple step counter as the parameter?]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[822031517]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>5432</wp:comment_id>
<wp:comment_author><![CDATA[John Aho]]></wp:comment_author>
<wp:comment_author_email><![CDATA[john.aho@gmail.com]]></wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP><![CDATA[98.190.152.99]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-03-07 10:13:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-03-07 17:13:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[
var divd = document.getElementById('debug');
var width = 600,
height = 600,
svg = d3.select('#graph')
.append('svg')
.attr({width: width,
height: height});
var position = function (t) {
var a = 80, b = 1, c = 1, d = 80;
return {x: Math.cos(a*t) - Math.pow(Math.cos(b*t), 3),
y: Math.sin(c*t) - Math.pow(Math.sin(d*t), 3)};
};
var t_scale = d3.scale.linear().domain([500, 30000]).range([0, 2*Math.PI]),
x = d3.scale.linear().domain([-2, 2]).range([100, width-100]),
y = d3.scale.linear().domain([-2, 2]).range([height-100, 100]);
var brush = svg.append('circle')
.attr({r: 4}),
previous = position(0);
var colordraw = 'red';
var step = function (time) {
if (time > t_scale.domain()[1]) {
return true;
}
var t = t_scale(time),
pos = position(t);
divd.innerHTML = divd.innerHTML + ' '+t;
if(t>1 && t2 && t3 && t4 && t5 ){
colordraw ='violet';
}
divd.innerHTML = divd.innerHTML + ' '+ colordraw;
brush.attr({cx: x(pos.x),
cy: y(pos.y)});
svg.append('line')
.attr({x1: x(previous.x),
y1: y(previous.y),
x2: x(pos.x),
y2: y(pos.y),
stroke: colordraw,
'stroke-width': 1.3});
previous = pos;
};
var timer = d3.timer(step, 500);
]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[822085082]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>5433</wp:comment_id>
<wp:comment_author><![CDATA[John Aho]]></wp:comment_author>
<wp:comment_author_email><![CDATA[john.aho@gmail.com]]></wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP><![CDATA[98.190.152.99]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-03-07 14:38:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-03-07 21:38:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[
var divd = document.getElementById('debug');
var width = 600,
height = 600,
svg = d3.select('#graph')
.append('svg')
.attr({width: width,
height: height});
var position = function (t) {
var a = 80, b = 1, c = 1, d = 80;
return {x: Math.cos(a*t) - Math.pow(Math.cos(b*t), 3),
y: Math.sin(c*t) - Math.pow(Math.sin(d*t), 3)};
};
var plotw = width-100; // set these up to explore changing the scale later.
var plotw2 = 100;
var ploth = height-100;
var ploth2 = 100;
var t_scale = d3.scale.linear().domain([500, 30000]).range([0, 2*Math.PI]),
x = d3.scale.linear().domain([-2, 2]).range([plotw2, plotw]),
y = d3.scale.linear().domain([-2, 2]).range([ploth, ploth2]);
var brush = svg.append('circle')
.attr({r: 4}),
previous = position(0);
var colordraw = 'red'; //initial color of drawing
function change_color(){
if(colordraw == 'red'){
colordraw ='orange';
return;
}
if(colordraw == 'orange'){
colordraw ='yellow';
return;
}
if(colordraw =='yellow'){
colordraw ='green';
return;
}
if(colordraw =='green'){
colordraw ='blue';
return;
}
if(colordraw =='blue'){
colordraw ='violet';
return;
}
if(colordraw =='violet'){
colordraw ='red';
return;
}
return;
}
var step = function (time) {
if (time > t_scale.domain()[1]) {
return true;
}
var t = t_scale(time),
pos = position(t);
divd.innerHTML = divd.innerHTML + ' '+t + ' '+ time;
change_color();
divd.innerHTML = divd.innerHTML + ' '+ colordraw;
brush.attr({cx: x(pos.x),
cy: y(pos.y)});
svg.append('line')
.attr({x1: x(previous.x),
y1: y(previous.y),
x2: x(pos.x),
y2: y(pos.y),
stroke: colordraw,
'stroke-width': 1.3});
previous = pos;
};
var timer = d3.timer(step, 500);
]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[822303410]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>5434</wp:comment_id>
<wp:comment_author><![CDATA[Swizec]]></wp:comment_author>
<wp:comment_author_email><![CDATA[swizec@swizec.com]]></wp:comment_author_email>
<wp:comment_author_url>http://swizec.com</wp:comment_author_url>
<wp:comment_author_IP><![CDATA[193.77.212.100]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-03-07 16:55:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-03-07 23:55:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[Not really because the problem is you're drawing one step per animation tick and those can lag for any random reason.
What you'd have to do is making sure there is an even amount of steps done no matter how much time passed between two ticks of the animation.]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>5431</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[822031517]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[822430931]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>5436</wp:comment_id>
<wp:comment_author><![CDATA[John Aho]]></wp:comment_author>
<wp:comment_author_email><![CDATA[john.aho@gmail.com]]></wp:comment_author_email>
<wp:comment_author_url></wp:comment_author_url>
<wp:comment_author_IP><![CDATA[98.167.231.128]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-03-08 19:22:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-03-09 02:22:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[Here is my expanded version of this spirograph with multicolors and even spacing.
http://johnaho.github.com/d3.js-book-examples/ch4/timers.html]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[823585989]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
</item>
<item>
<title>Vine - the crappiest app I can't help but love</title>
<link>https://swizec.com/blog/vine-the-crappiest-app-i-cant-help-but-love/swizec/5926</link>
<pubDate>Thu, 31 Jan 2013 11:40:04 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">http://swizec.com/blog/?p=5926</guid>
<description></description>
<content:encoded><![CDATA[Earlier this week, or maybe it was late last week, Twitter released a smashing new service called <a href="http://vineapp.com/" target="_blank">Vine</a>. The simplest possible value proposition - <a class="zem_slink" title="Instagram" href="http://instagr.am/" rel="homepage" target="_blank">Instagram</a> for video.
Or possibly "<a class="zem_slink" title="Graphics Interchange Format" href="http://en.wikipedia.org/wiki/Graphics_Interchange_Format" rel="wikipedia" target="_blank">GIFs</a> for the rest of us".
<blockquote class="twitter-tweet">Mmmmmmm <a title="http://vine.co/v/bJV67bFbjia" href="http://t.co/hLr2SdJ6">vine.co/v/bJV67bFbjia</a>
— Swizec (@Swizec) <a href="https://twitter.com/Swizec/status/296719923902828544">January 30, 2013</a></blockquote>
I can't quite decide which it is. All I know is that as soon as I saw Vine I knew, I just <em>knew</em>, there was nothing I have ever wanted to do more in my life than make short 6 second looping videos of the boring crap I do day to day.
Sure, a picture says a thousand words, a picture with a filter might even say 1200 words. But a 6 second video? Wow, that's 144 pictures! 144,000 words! Think of all the things you can say! The tiny stories you can tell! The ...
Reality is far from fantasy, though. At least for me.
<blockquote class="twitter-tweet">I needed 5 attempts to Vine this. <a title="http://vine.co/v/bJji3qtmH93" href="http://t.co/EqLeO9hN">vine.co/v/bJji3qtmH93</a>
— Swizec (@Swizec) <a href="https://twitter.com/Swizec/status/296283862428942336">January 29, 2013</a></blockquote>
Every time I try to make a new Vine I realize that I am a <strong><em>crappy</em></strong><em></em> video creator. While Instagram fills me with love for the beautiful things I can make at the tap of a cold glass screen, Vine fills me with dread. My total failure at even taking a stable shot. At telling anything remotely compelling. It's all right there. Plain for all to see.
Whenever I'm doing something, that means using my <a class="zem_slink" title="Handedness" href="http://en.wikipedia.org/wiki/Handedness" rel="wikipedia" target="_blank">dominant hand</a>. I want to make videos of doing something [interesting]. But that means holding the phone with my left hand. My left hand is crap at everything.
Then we come to conveying a story, keeping the shots interesting, playing with the whole idea of taking bursts of video to create something akin to a <a class="zem_slink" title="Stop motion" href="http://en.wikipedia.org/wiki/Stop_motion" rel="wikipedia" target="_blank">stop-motion animation</a> and ... it's just a little too much. My engineering brain can't handle the boundless possibilities.
Then there's the crashing. Vine ... it just doesn't work very well.
First of all, it will simply crash whenever you aren't connected to the internet. Found something cool in a parking garage? Forget about it. You might be able to make the video, but then the app will crash and lose it.
Even when you are connected to the internet, only one in five videos will actually succeed. Sometimes the app fizzes out during filming. Sometimes you make the whole video and instead of a preview you get a <a class="zem_slink" title="Black Screen of Death" href="http://en.wikipedia.org/wiki/Black_Screen_of_Death" rel="wikipedia" target="_blank">black screen</a>. But Vine doesn't let you lose hope. Oh no, it promises that it's simply the upload failing.
It's not. The video is gone. All those <em>seconds</em> of hard work. Just gone.
Whenever even the tiniest thing goes wrong, your video just *poof* vanishes. Just another bleep on your infinite history of failure.
But my god I am falling in love with this app. Sure it takes at least five attempts to create anything, but that's just part of the charm you know?
Perhaps someday, maybe, Vine will help us all achieve greatness.
<blockquote class="twitter-tweet">it's like Vine in the hands of a magician - <a title="http://buff.ly/11dqSKP" href="http://t.co/idXYbBzS">buff.ly/11dqSKP</a>
— Hrishi Mittal (@hrishio) <a href="https://twitter.com/hrishio/status/296679805368279041">January 30, 2013</a></blockquote>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul zemanta-article-ul-image" style="margin: 0; padding: 0; overflow: hidden;">
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://rjmarmol.com/2013/01/30/vineit-lets-you-easily-share-vine-videos-on-tumblr/" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/141722974_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://rjmarmol.com/2013/01/30/vineit-lets-you-easily-share-vine-videos-on-tumblr/" target="_blank">Vineit Lets You Easily Share Vine Videos on Tumblr</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://www.livescience.com/26745-vine-app-melies-magic.html" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/141910820_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://www.livescience.com/26745-vine-app-melies-magic.html" target="_blank">Twitter's Vine Revives 1890s Magic Movies</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://suburbanmen.com/vine-app-is-crap/18171/" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/141571872_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://suburbanmen.com/vine-app-is-crap/18171/" target="_blank">Vine App is Crap</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="http://www.petapixel.com/2013/01/28/that-explains-it-the-difference-between-instagram-and-vine/" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/141314871_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="http://www.petapixel.com/2013/01/28/that-explains-it-the-difference-between-instagram-and-vine/" target="_blank">That Explains It: The Difference Between Instagram and Vine</a></li>
<li class="zemanta-article-ul-li-image zemanta-article-ul-li" style="padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;"><a style="box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;" href="https://www.blogher.com/second-look-vine-make-scene" target="_blank"><img style="padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;" src="http://i.zemanta.com/141812395_80_80.jpg" alt="" /></a><a style="display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;" href="https://www.blogher.com/second-look-vine-make-scene" target="_blank">A Second Look at Vine - Make a Scene</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/?px"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=97299318-2e70-4d58-a0c3-fe55610de74f" alt="Enhanced by Zemanta" /></a></div>]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>5926</wp:post_id>
<wp:post_date><![CDATA[2013-01-31 12:40:04]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2013-01-31 11:40:04]]></wp:post_date_gmt>
<wp:comment_status><![CDATA[open]]></wp:comment_status>
<wp:ping_status><![CDATA[open]]></wp:ping_status>
<wp:post_name><![CDATA[vine-the-crappiest-app-i-cant-help-but-love]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[post]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="post_tag" nicename="instagram"><![CDATA[Instagram]]></category>
<category domain="post_tag" nicename="stop-motion"><![CDATA[Stop motion]]></category>
<category domain="post_tag" nicename="twitter"><![CDATA[Twitter]]></category>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<category domain="post_tag" nicename="vine"><![CDATA[Vine]]></category>
<wp:postmeta>
<wp:meta_key><![CDATA[dsq_thread_id]]></wp:meta_key>
<wp:meta_value><![CDATA[1056802484]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_edit_last]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_jetpack_related_posts_cache]]></wp:meta_key>
<wp:meta_value><![CDATA[a:1:{s:32:"8f6677c9d6b0f903e98ad32ec61f8deb";a:2:{s:7:"expires";i:1474734632;s:7:"payload";a:3:{i:0;a:1:{s:2:"id";i:3377;}i:1;a:1:{s:2:"id";i:6152;}i:2;a:1:{s:2:"id";i:6982;}}}}]]></wp:meta_value>
</wp:postmeta>
<wp:comment>
<wp:comment_id>5399</wp:comment_id>
<wp:comment_author><![CDATA[Smotko]]></wp:comment_author>
<wp:comment_author_email><![CDATA[smotko@smotko.si]]></wp:comment_author_email>
<wp:comment_author_url>http://smotko.si/</wp:comment_author_url>
<wp:comment_author_IP><![CDATA[212.85.162.22]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-01-31 07:21:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-01-31 14:21:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[If we survived instagram we will survive this.
Signed,
Non hipster type people.]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>0</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[784488840]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>5400</wp:comment_id>
<wp:comment_author><![CDATA[Swizec]]></wp:comment_author>
<wp:comment_author_email><![CDATA[swizec@swizec.com]]></wp:comment_author_email>
<wp:comment_author_url>http://swizec.com</wp:comment_author_url>
<wp:comment_author_IP><![CDATA[193.77.212.100]]></wp:comment_author_IP>
<wp:comment_date><![CDATA[2013-01-31 18:04:00]]></wp:comment_date>
<wp:comment_date_gmt><![CDATA[2013-02-01 01:04:00]]></wp:comment_date_gmt>
<wp:comment_content><![CDATA[Oh I'm sure I can find a way to properly annoy you :P]]></wp:comment_content>
<wp:comment_approved><![CDATA[1]]></wp:comment_approved>
<wp:comment_type><![CDATA[]]></wp:comment_type>
<wp:comment_parent>5399</wp:comment_parent>
<wp:comment_user_id>0</wp:comment_user_id>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_parent_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[784488840]]></wp:meta_value>
</wp:commentmeta>
<wp:commentmeta>
<wp:meta_key><![CDATA[dsq_post_id]]></wp:meta_key>
<wp:meta_value><![CDATA[785198844]]></wp:meta_value>
</wp:commentmeta>
</wp:comment>
<wp:comment>
<wp:comment_id>5401</wp:comment_id>
<wp:comment_author><![CDATA[LasVegasLoopy]]></wp:comment_author>
<wp:comment_author_email><![CDATA[loopynvegas@gmail.com]]></wp:comment_author_email>