 With a project this size, one thing always leads to another. There are so many rabbit holes to lose oneself in. I started the research for implementing pixel perfect hit detection for the chart, as currently the calculations are prone to rounding errors which add up over many iterations, ultimately creating a sub optimal user experience. The chart already has an extremely flexible multi-layered canvas class. The task is now to work hit detection layers into this. But more on that topic for another post. What this led to, was me finally implementing a chart image snapshot export; something I'd been putting off for a long time. In theory it should be straight forward, because, that chart already has all of the layers for each chart component, all I needed to do was composite them together on a larger canvas, and then pass that to the code that would turn that into a format the browser could work with as a download. In practice it was straight forward! Which left me wondering why I avoided it for so long. So now it is as simple as ``chart.downloadImage()`` to save a ``.png`` image file to your local storage. There is also a related ``toImageURL()`` call that then can be passed to other HTML elements as an image source, or passed on to other API calls. The chart's development progress is accelerating now, because so many of the fundamentals are now in place, which means I'm starting to fill i the gaps, rather than working on the foundations. In the coming posts, I'll fill you in on the big leap forward that is coming. Available on GitHub and NPM GitHub https://github.com/tradex-app/TradeX-chart NPM https://www.npmjs.com/package/tradex-chart Documentation - WIP https://tradex-chart.guildmedia.net/reference/api-examples/#download-image
author | leoplaw | ||||||
---|---|---|---|---|---|---|---|
permlink | programming-my-own-trading-chart-part-29-picture-perfect | ||||||
category | hive-169321 | ||||||
json_metadata | {"app":"peakd/2023.7.1","format":"markdown","tags":["programming","development","javascript","trading","crypto"],"users":[],"image":["https://files.peakd.com/file/peakd-hive/leoplaw/23tGRcb11JruswWWUGAELvfqkRtSrYNfGqnKFvMH5R1DBCYn4WjG1uECanc24dYsMuzkQ.png"]} | ||||||
created | 2023-08-08 20:21:06 | ||||||
last_update | 2023-08-09 08:36:45 | ||||||
depth | 0 | ||||||
children | 1 | ||||||
last_payout | 2023-08-15 20:21:06 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 1.840 HBD | ||||||
curator_payout_value | 1.868 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 1,925 | ||||||
author_reputation | 189,628,210,789,149 | ||||||
root_title | "Programming My Own Trading Chart - Part 29 - Picture Perfect" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 126,067,373 | ||||||
net_rshares | 8,134,554,284,585 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
ausbitbank | 0 | 1,163,421,759,167 | 50% | ||
krystle | 0 | 700,105,195 | 40% | ||
andyjim | 0 | 480,509,214 | 100% | ||
gric | 0 | 383,672,974,988 | 100% | ||
choogirl | 0 | 25,944,819,404 | 30% | ||
worldfinances | 0 | 28,171,047,661 | 100% | ||
gamersclassified | 0 | 93,084,691,102 | 100% | ||
mikepedro | 0 | 3,357,896,138 | 50% | ||
gohba.handcrafts | 0 | 580,753,695 | 7% | ||
scooter77 | 0 | 41,077,786,515 | 20% | ||
drwom | 0 | 17,852,756,292 | 50% | ||
bearone | 0 | 15,191,477,391 | 30% | ||
reddragonfly | 0 | 4,250,000,873 | 80% | ||
tracer-paulo | 0 | 37,309,762,271 | 100% | ||
teamaustralia | 0 | 12,470,526,928 | 45% | ||
centerlink | 0 | 183,971,043,438 | 100% | ||
techken | 0 | 40,644,890,744 | 50% | ||
nuthman | 0 | 4,110,896,343,978 | 100% | ||
chrisdavidphoto | 0 | 18,540,500,970 | 30% | ||
reinhard-schmid | 0 | 299,791,576,584 | 100% | ||
mrsquiggle | 0 | 128,070,008,376 | 50% | ||
deadsparrow | 0 | 1,970,843,688 | 60% | ||
maxruebensal | 0 | 677,264,675 | 50% | ||
masterwu | 0 | 3,213,624,831 | 30% | ||
dougbudlong | 0 | 16,100,611,289 | 100% | ||
cryptwo | 0 | 8,896,272,548 | 90% | ||
sneakyninja | 0 | 624,979,005 | 0.99% | ||
jordan.white306 | 0 | 1,046,556,829 | 50% | ||
fineartnow | 0 | 57,087,275,819 | 40% | ||
bengy | 0 | 3,922,458,801 | 3% | ||
bec-on-the-block | 0 | 2,543,155,220 | 50% | ||
gio6 | 0 | 796,537,547 | 50% | ||
etn0 | 0 | 8,221,956,982 | 40% | ||
positiveninja | 0 | 17,017,770,997 | 50% | ||
evlachsblog | 0 | 13,124,276,034 | 50% | ||
krasnec | 0 | 382,672,034,436 | 100% | ||
vcclothing | 0 | 28,102,569,160 | 40% | ||
sapphic | 0 | 10,973,549,494 | 50% | ||
bobaphet | 0 | 7,662,028,827 | 20% | ||
terrybogan | 0 | 2,498,753,436 | 30% | ||
philippekiene | 0 | 7,859,238,792 | 40% | ||
cryptoslicex | 0 | 1,245,475,454 | 50% | ||
lifeofryan | 0 | 7,570,233,964 | 50% | ||
vincy | 0 | 558,887,825 | 20% | ||
niouton | 0 | 10,910,799,744 | 40% | ||
solarwarrior | 0 | 113,714,494,091 | 100% | ||
longer | 0 | 8,815,651,957 | 25% | ||
sbi6 | 0 | 154,608,493,092 | 26.03% | ||
thedailysneak | 0 | 862,491,773 | 0.99% | ||
jason.che | 0 | 531,562,960 | 50% | ||
deividluchi | 0 | 2,171,072,645 | 50% | ||
jay.ell | 0 | 1,064,316,663 | 100% | ||
positiveninja2 | 0 | 950,839,457 | 25% | ||
wulff-media | 0 | 48,726,123,645 | 50% | ||
sbi-tokens | 0 | 1,732,306,047 | 1.99% | ||
tatiana21 | 0 | 754,988,035 | 100% | ||
apineda | 0 | 482,015,142 | 100% | ||
nazaleo | 0 | 10,010,337,880 | 100% | ||
koyel | 0 | 2,499,625,735 | 50% | ||
pishio | 0 | 560,795,372,591 | 10% | ||
scion02b | 0 | 0 | 100% | ||
strega.azure | 0 | 22,056,206,551 | 50% |
Congratulations @leoplaw! You received a personal badge! <table><tr><td>https://images.hive.blog/70x70/http://hivebuzz.me/badges/birthday-7.png</td><td>Happy Hive Birthday! You are on the Hive blockchain for 7 years!</td></tr></table> <sub>_You can view your badges on [your board](https://hivebuzz.me/@leoplaw) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub> **Check out our last posts:** <table><tr><td><a href="/hive-102201/@hivebuzz/wc2023-recap-day19"><img src="https://images.hive.blog/64x128/https://files.peakd.com/file/peakd-hive/hivebuzz/48kBuTQSRzzteFSojBm1d421vrXMUPHxq7Z9WdpwpNn3E59JAC8rn6ViEafBFPvgkJ.png"></a></td><td><a href="/hive-102201/@hivebuzz/wc2023-recap-day19">Women's World Cup Contest - Round of 16 - Recap of Day 4</a></td></tr><tr><td><a href="/hive-102201/@hivebuzz/wc2023-recap-day18"><img src="https://images.hive.blog/64x128/https://files.peakd.com/file/peakd-hive/hivebuzz/48Un9NAH7ZfZnA9knFJEpZP535q8FcWMEcDkbL9RGeKkRETzuZYYduq2hqyVUwGWfT.png"></a></td><td><a href="/hive-102201/@hivebuzz/wc2023-recap-day18">Women's World Cup Contest - Round of 16 - Recap of Day 3</a></td></tr><tr><td><a href="/hive-102201/@hivebuzz/wc2023-recap-day17"><img src="https://images.hive.blog/64x128/https://files.peakd.com/file/peakd-hive/hivebuzz/48TozstqJfBJAmxL9tcSzUVfRpM7MJ9zhx4efy5S343UMDsA7Sc2oJopDLZ1f7X1LR.png"></a></td><td><a href="/hive-102201/@hivebuzz/wc2023-recap-day17">Women's World Cup Contest - Round of 16 - Recap of Day 2</a></td></tr></table>
author | hivebuzz |
---|---|
permlink | notify-leoplaw-20230810t080522 |
category | hive-169321 |
json_metadata | {"image":["http://hivebuzz.me/notify.t6.png"]} |
created | 2023-08-10 08:05:21 |
last_update | 2023-08-10 08:05:21 |
depth | 1 |
children | 0 |
last_payout | 2023-08-17 08:05:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,519 |
author_reputation | 370,708,462,589,164 |
root_title | "Programming My Own Trading Chart - Part 29 - Picture Perfect" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 126,116,699 |
net_rshares | 0 |