Published unlisted
Edited
Nov 16, 2019
Fork of A4 Avant
Insert cell
Insert cell
vl.markPoint()
.data(a4)
.encode(
vl.x().fieldT('date'),
vl.y().fieldQ('odometer'),
vl.color().fieldQ('price')
)
.render()
Insert cell
Changed in fork
-
a4 = d3.tsvParse(`date odometer type price amount 2015-10-31 30187 Kauf 60 2015-11-12 30187 Kauf 14.9 2015-11-12 30187 Kauf 47.4 2015-11-13 30187 Kauf 17.5 2015-11-14 30187 fuel 45.41 34.69 2015-11-14 30187 Kauf 19 2015-11-15 30187 Kauf 4.5 2015-11-17 30476 Versicherung 109.49 2015-11-18 30476 Steuern 94 2015-11-20 30765 fuel 58.75 47.42 2015-11-27 31443 fuel 69.93 54.25 2015-12-02 31911 fuel 58.07 44.70 2015-12-07 32459 fuel 50.61 41.52 2015-12-09 33919 Reifen 631.96 2015-12-26 33070 fuel 52.60 42.80 2016-01-04 33554 Versicherung 804.37 2016-01-05 33554 fuel 48.48 40.77 2016-01-09 33554 Wäsche 7 2016-01-20 34284 fuel 63.54 53.44 2016-01-28 34851 fuel 51.90 44.02 2016-02-09 35571 fuel 59.90 50.81 2016-02-22 36137 fuel 49.50 43.08 2016-02-23 36155 Wäsche 7 2016-04-01 36734 fuel 56.71 47.30 2016-04-11 37000 Werkstatt 300 2016-04-20 37459 fuel 64.69 51.79 2016-05-08 38280 fuel 69.23 55.43 2016-05-20 39167 fuel 72.54 55.84 2016-05-21 39247 Wäsche 7 2016-05-23 39306 Reifen 76.56 2016-05-29 39772 fuel 61.52 46.64 2016-06-08 40470 fuel 2016-06-12 41271 fuel 54.65 37.98 2016-06-16 41850 fuel 66.70 52.98 2016-06-29 42557 fuel 64.32 50.29 2016-07-13 43320 fuel 64.72 52.66 2016-07-28 44021 fuel 46.68 57.84 2016-08-06 44544 fuel 26.39 20.01 2016-08-08 45066 fuel 91.99 75.18 2016-08-11 45412 Wäsche 10 2016-08-19 45775 fuel 50.00 2016-08-30 46549 fuel 63.48 53.39 2016-09-01 47054 fuel 53.31 41.68 2016-09-04 47322 fuel 31.72 24.61 2016-09-04 47828 fuel 63.49 48.85 2016-09-07 48074 Wäsche 6 2016-09-15 48477 fuel 69.82 56.35 2016-10-03 49261 fuel 69.94 56.00 2016-10-05 49922 fuel 75.13 56.11 2016-10-11 50532 fuel 66.31 50.66 2016-10-24 51329 fuel 73.18 54.65 2016-11-02 51951 Reifen 57.96 2016-11-05 52037 fuel 73.22 53.42 2016-11-05 52037 Sonstiges 4.9 2016-11-21 52837 fuel 66.93 53.16 2016-11-27 53430 fuel 51.57 40.78 2016-12-04 54156 fuel 66.92 52.32 2016-12-13 54806 fuel 58.33 46.33 2016-12-27 55457 fuel 67.61 49.39 2017-01-02 55895 Versicherung 817.9 2017-01-05 55892 Wäsche 7.5 2017-01-05 55895 fuel 44.74 34.98 2017-01-16 56679 fuel 69.90 54.23 2017-01-27 57405 fuel 75.02 54.47 2017-02-02 57775 fuel 35.59 26.58 2017-02-02 57775 Sonstiges 25.5 2017-02-07 58225 Werkstatt 814.78 2017-02-13 58549 fuel 74.66 54.94 2017-02-26 59319 fuel 73.26 55.97 2017-03-19 59990 fuel 58.10 46.12 2017-03-22 60299 Reifen 70.96 2017-03-31 60607 fuel 64.67 50.17 2017-04-02 60996 Wäsche 15.9 2017-04-18 61385 fuel 68.74 52.92 2017-04-26 62473 fuel 66.53 52.43 2017-05-11 63175 fuel 68.58 53.62 2017-05-21 63807 fuel 56.56 43.54 2017-05-28 64419 fuel 40.00 28.59 2017-06-01 64782 fuel 53.13 41.54 2017-06-04 65339 fuel 54.11 41.98 2017-06-05 65808 fuel 48.55 37.09 2017-06-08 66472 fuel 70.18 53.21 2017-06-19 67229 fuel 66.77 54.33 2017-06-27 67753 fuel 43.30 34.95 2017-06-28 68300 fuel 43.49 33.00 2017-07-08 68738 fuel 53.78 40.11 2017-07-08 69299 fuel 54.94 43.99 2017-07-17 70001 fuel 70.83 53.70 2017-07-25 70677 fuel 59.36 47.15 2017-07-30 71337 fuel 71.90 56.66 2017-08-11 72142 fuel 73.52 55.74 2017-08-22 72892 fuel 70.39 55.91 2017-09-14 73565 fuel 66.04 47.89 2017-09-16 73880 fuel 30.64 22.88 2017-09-18 74392 fuel 51.20 38.82 2017-09-22 74472 fuel 10.00 8.20 2017-09-23 75079 Wäsche 7.9 2017-09-25 75149 fuel 68.06 53.63 2017-10-06 75895 fuel 64.14 51.77 2017-10-19 76672 fuel 72.07 56.79 2017-10-25 77230 Reifen 71.56 2017-10-30 77429 fuel 78.90 55.60 2017-11-13 77800 Steuern 94 2017-11-16 78171 fuel 65.88 49.57 2017-11-27 78917 fuel 72.48 56.23 2017-12-01 79132 Wäsche 270 2017-12-02 79346 fuel 42.24 30.41 2017-12-04 79866 fuel 59.03 45.44 2017-12-08 80468 fuel 69.94 53.43 2017-12-22 81335 fuel 22.72 17.36 2018-01-02 Kauf 918.81 2018-01-08 82041 fuel 27.38 20.00 2018-01-09 82224 fuel 63.00 48.13 2018-01-13 82855 fuel 59.22 44.23 2018-01-15 83221 Sonstiges 74.95 2018-01-17 83586 fuel 70.73 53.22 2018-01-28 84274 fuel 66.96 50.01 2018-01-28 84600 fuel 37.11 25.63 2018-02-03 84977 Wäsche 9.95 2018-02-06 85354 fuel 68.25 51.74 2018-02-16 85879 fuel 51.56 40.31 2018-02-16 85879 Sonstiges 6.99 2018-03-01 86793 Wäsche 12.95 2018-03-15 87362 fuel 68.36 55.62 2018-04-02 87900 fuel 52.65 39.62 2018-04-08 88678 fuel 16.99 10.00 2018-04-08 88807 fuel 30.01 21.92 2018-04-11 89226 fuel 70.96 54.63 2018-04-12 89270 Sonstiges 15.99 2018-04-25 90038 fuel 72.58 54.61 2018-04-26 90135 Werkstatt 821.22 2018-05-02 90618 Reifen 76.96 2018-05-04 90733 fuel 73.95 54.02 2018-05-23 91405 fuel 14.19 10.00 2018-05-23 91422 Wäsche 10 2018-05-30 91547 fuel 10.00 6.76 2018-06-01 91573 fuel 28.38 20.00 2018-06-12 91862 fuel 31.00 22.16 2018-06-21 92084 fuel 23.01 16.33 2018-07-02 92282 fuel 10.01 6.86 2018-07-06 92358 fuel 19.90 14.33 2018-07-11 92527 fuel 50.02 35.25 2018-07-20 92798 Wäsche 10 2018-07-23 92795 Werkstatt 26 2018-08-03 93000 fuel 39.69 27.97 2018-08-10 93361 fuel 80.56 55.98 2018-08-20 94046 fuel 79.23 55.06 2018-09-04 94552 Wäsche 12.95 2018-09-07 94697 fuel 79.12 54.60 2018-12-21 95293 fuel 43.54 30.47 2019-01-02 Versicherung 1139.96 2019-01-31 95694 fuel 39.96 31.00 2019-03-09 96123 fuel 31.25 23.69 2019-03-27 96317 Wäsche 15 2019-04-10 96376 fuel 15.13 10.37 2019-04-14 96462 fuel 58.10 42.13 2019-05-02 Reifen 79.2 2019-05-16 97086 Werkstatt 1187.59 2019-05-16 97092 fuel 88.35 57.41 2019-06-12 97816 fuel 23.60 16.15 2019-07-01 98478 fuel 71.63 51.94 2019-07-08 98710 Wäsche 15 2019-08-20 99649 fuel 73.28 56.41 2019-09-26 100363 fuel 73.79 55.10 2019-10-09 100459 Wäsche 12.95 2019-10-09 100461 Reifen 76 2019-10-23 101162 fuel 70.07 53.94 2020-01-01 Versicherung 818.04`)
+
a4 = d3.tsvParse(await FileAttachment("data.tsv").text(), d3.autoType)
Insert cell
Removed in parent
d3.pairs(
a4.filter(d => d.type === "fuel")
.sort((a, b) => d3.ascending(a.date, b.date)),
(a, b) => ({
...b,
odometer_delta: b.odometer - a.odometer
})
)
Insert cell
import {vl} from '@vega/vega-lite-api'
Insert cell
Changed in fork
-
d3 = require("d3@5")
+
d3 = require("d3@^5.13")
Insert cell