Skip to content

wind chime tableยค

an html transform to look like a wind chime in my yard. each row is a bar that rotates around the z axis so it spins with the slightest wind.

    df = pipe(numpy.linspace(0, 360, 101), pandas.Index).rename("index").to_series().mul(numpy.pi/180).apply(lambda x: pandas.Series(dict(x=numpy.cos(x), y=numpy.sin(x))))
    style_attributes = compose_left(operator.methodcaller("items"), map("--%s: %s".__mod__), ";".join, "{};".format)
%%
<style>
.dataframe {
    --height: 600px;
    display: block;
    position: relative;
    width: 100%;
    border: 5px red solid;
    transform: scaleY(1);
    transform-style: preserve-3d;
    tbody {
        tr {
            display: block;
            border: 4px white solid;
            transform: translateX(300px) perspective(300px) rotateY(calc(1deg * var(--index)));
            th, td {
            }
        }
    }
}

</style>
{% set df = df.reset_index() %}
{% set groups = [df] %}
<table class="dataframe">
<thead>
<tr><th>index</th>
         {%- for k in df.columns -%}
             <th>{{k}}</th>
         {%- endfor -%}
        </tr>
</thead>
     {%- for g in groups -%}
     <tbody>
         {%- for i, row in g.iterrows() -%}
            <tr style="{{style_attributes(row)}}">
<th>{{loop.index}}</th>
             {%- for k in df.columns -%}
                 <td>{{row.loc[k]}}</td>
             {%- endfor -%}
            </tr>
         {%- endfor -%}
     </tbody>
     {%- endfor -%}
</table>
indexindexxy
10.01.00.0
23.60.99802672842827160.06279051952931337
37.20.99211470131447790.12533323356430426
410.80.98228725072868870.18738131458572463
514.40.96858316112863110.2486898871648548
618.00.95105651629515350.3090169943749474
721.60.92977648588825130.368124552684678
825.20.90482705246601960.42577929156507266
928.80.87630668004386360.4817536741017153
1032.40.84432792550201510.5358267949789967
1136.00.80901699437494750.5877852522924731
1239.60.77051324277578910.6374239897486897
1343.20.72896862742141160.6845471059286887
1446.8000000000000040.68454710592868860.7289686274214116
1550.40.63742398974868970.7705132427757893
1654.00.58778525229247310.8090169943749475
1757.60.53582679497899650.8443279255020151
1861.20.481753674101715160.8763066800438637
1964.80.425779291565072660.9048270524660196
2068.40.368124552684677860.9297764858882515
2172.00.309016994374947450.9510565162951535
2275.600000000000010.248689887164854740.9685831611286311
2379.20.187381314585724520.9822872507286887
2482.80.125333233564304260.9921147013144779
2586.40.06279051952931330.9980267284282716
2690.06.123233995736766e-171.0
2793.60000000000001-0.06279051952931340.9980267284282716
2897.2-0.125333233564304370.9921147013144778
29100.8-0.18738131458572460.9822872507286887
30104.4-0.248689887164854850.9685831611286311
31108.0-0.309016994374947340.9510565162951536
32111.60000000000001-0.3681245526846780.9297764858882513
33115.2-0.42577929156507270.9048270524660195
34118.8-0.481753674101715050.8763066800438637
35122.4-0.53582679497899690.844327925502015
36126.0-0.5877852522924730.8090169943749475
37129.6-0.63742398974868970.7705132427757893
38133.20000000000002-0.68454710592868870.7289686274214114
39136.8-0.72896862742141170.6845471059286885
40140.4-0.77051324277578940.6374239897486895
41144.0-0.80901699437494730.5877852522924732
42147.6-0.84432792550201510.5358267949789967
43151.20000000000002-0.87630668004386360.4817536741017152
44154.8-0.90482705246601960.4257792915650725
45158.4-0.92977648588825150.36812455268467775
46162.0-0.95105651629515350.3090169943749475
47165.6-0.96858316112863110.24868988716485482
48169.20000000000002-0.98228725072868870.18738131458572457
49172.8-0.99211470131447790.1253332335643041
50176.4-0.99802672842827160.06279051952931314
51180.0-1.01.2246467991473532e-16
52183.6-0.9980267284282716-0.06279051952931335
53187.20000000000002-0.9921147013144779-0.12533323356430429
54190.8-0.9822872507286886-0.18738131458572477
55194.4-0.9685831611286311-0.24868988716485502
56198.0-0.9510565162951536-0.3090169943749473
57201.6-0.9297764858882515-0.3681245526846779
58205.20000000000002-0.9048270524660195-0.42577929156507266
59208.8-0.8763066800438635-0.4817536741017154
60212.4-0.844327925502015-0.5358267949789968
61216.0-0.8090169943749476-0.587785252292473
62219.6-0.7705132427757893-0.6374239897486896
63223.20000000000002-0.7289686274214116-0.6845471059286887
64226.8-0.6845471059286886-0.7289686274214116
65230.4-0.6374239897486895-0.7705132427757894
66234.0-0.5877852522924732-0.8090169943749473
67237.6-0.5358267949789971-0.8443279255020149
68241.20000000000002-0.48175367410171527-0.8763066800438636
69244.8-0.42577929156507216-0.9048270524660198
70248.4-0.3681245526846778-0.9297764858882515
71252.0-0.30901699437494756-0.9510565162951535
72255.6-0.2486898871648553-0.968583161128631
73259.2-0.18738131458572463-0.9822872507286887
74262.8-0.12533323356430373-0.9921147013144779
75266.40000000000003-0.06279051952931321-0.9980267284282716
76270.0-1.8369701987210297e-16-1.0
77273.60.06279051952931372-0.9980267284282716
78277.20.12533323356430423-0.9921147013144779
79280.80.18738131458572513-0.9822872507286886
80284.400000000000030.24868988716485493-0.9685831611286311
81288.00.30901699437494723-0.9510565162951536
82291.60.36812455268467825-0.9297764858882512
83295.20.4257792915650726-0.9048270524660196
84298.80.4817536741017157-0.8763066800438634
85302.400000000000030.5358267949789968-0.844327925502015
86306.00.5877852522924729-0.8090169943749476
87309.60.63742398974869-0.770513242775789
88313.20.6845471059286886-0.7289686274214116
89316.80.7289686274214119-0.6845471059286883
90320.400000000000030.7705132427757894-0.6374239897486896
91324.00.8090169943749473-0.5877852522924734
92327.60.8443279255020153-0.5358267949789963
93331.20.8763066800438636-0.4817536741017153
94334.80.9048270524660197-0.4257792915650722
95338.400000000000030.9297764858882515-0.36812455268467786
96342.00.9510565162951535-0.3090169943749476
97345.60.9685831611286312-0.2486898871648545
98349.20.9822872507286887-0.18738131458572468
99352.80.9921147013144779-0.1253332335643038
100356.400000000000030.9980267284282716-0.06279051952931326
101360.01.0-2.4492935982947064e-16