mushon / IWBA

The International Water Bank Association's Water Deposit exhibit - a water ATM for depositing your first drops
0 stars 1 forks source link

Maps images and graphs for email #22

Open mushon opened 8 years ago

mushon commented 8 years ago

Ideally it would be great to have the email come with small maps and graphs projecting the revenue. Something like this: iwba_email

With the limits of the email system we're using and the limits of the technology, would that be feasible? And if not, what would?

wonyoungso commented 8 years ago

Graph and map cannot be dynamically generated--you know, since it's email. To make this feasible, we need to manually add images of a map of spots and projection graphs and so on. Embedding webfonts can be possible in some mail clients;

https://litmus.com/blog/typography-tips-for-email-designers

wonyoungso commented 8 years ago

And projection data also should be added in spots table in administration page.

wonyoungso commented 8 years ago

mail template can be modified in /app/views/deposit_mailer/deposit_mail.html.erb

mushon commented 8 years ago

Yes, I know the maps and graphs should be rendered on the server and served in the email. Mapbox has an API for rendering static image maps from GL. Either way, we can always prepare the hotspots in advance (basically create screenshots manually). My main question is whether you think this is something we should do, or is it too much work at this point. Otherwise I'm open to other solutions.

Mushon Zer-Aviv Mushon.com | Shual.com | @Mushon

On Oct 29, 2016, at 05:10, Wonyoung So notifications@github.com wrote:

mail template can be modified in /app/views/deposit_mailer/deposit_mail.html.erb

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

wonyoungso commented 8 years ago

I think showing water projection data of invested spots will strengthen our works little bit because through pouring experience we can know what's happening around the world about the water. But I don't know..crafting email is basically annoying task so..

mushon commented 8 years ago

We can pretender the hotspots and basically also pretender the percentile projections, then just link to pre-rendered images, no?

wonyoungso commented 8 years ago

Yes, if you make some of the graphs and maps of hotspots and send them to me, then I can upload them to somewhere in cloud and point them.

mushon commented 8 years ago

Ok. The hotspots will be easier than the graphs, but maybe I can think of something. Maybe we can use bars instead and render them in simple HTML.

Mushon Zer-Aviv Mushon.com | Shual.com | @mushon

On Oct 29, 2016, at 23:57, Wonyoung So notifications@github.com wrote:

Yes, if you make some of the graphs and maps of hotspots and send them to me, then I can upload them to somewhere in cloud and point them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

wonyoungso commented 8 years ago

Rendering graph in email natively may be challenging although it's simple, because in some email clients they misinterpret <div> tag and all of css should be inline. We need to take simple approach..

mushon commented 8 years ago

@wonyoungso can we simply pre-render all of the maps and graphs (in percentage) as PNGs on the server and then include them in the email?

mushon commented 8 years ago

Image URL structure: https://api.mapbox.com/styles/v1/mushon/cittuq85x000s2irqfdmd1kdr/static/127.523067,36.346416,5.46,0.00,0.00/600x400?access_token=pk.eyJ1IjoibXVzaG9uIiwiYSI6IjY1bHhhTkEifQ.DhW2zcurHHBtmnc2FsMBqg

mushon commented 8 years ago

Pointers for server-side rendering of d3 code: https://gist.github.com/vicapow/758fce6aa4c5195d24be http://stackoverflow.com/questions/11632748/svg-to-png-server-side-using-node-js?answertab=votes#tab-top https://gist.github.com/mattbaker/1509145

wonyoungso commented 8 years ago

images are done, but I seriously think it is feasible in serverside rendering in graph..

mushon commented 8 years ago

Not sure I understood your previous response. So you think it IS feasible? Or not?

Mushon Zer-Aviv Mushon.com | Shual.com | @Mushon

On Nov 3, 2016, at 05:59, Wonyoung So notifications@github.com wrote:

images are done, but I seriously think it is feasible in serverside rendering in graph..

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

wonyoungso commented 8 years ago

not feasible. (oh I wrote in completely opposite way..) it's heavy since it should be done in serverside and I need to install nodejs thing in heroku server and it's gonna be messed up. maybe we'll do it in just simple

bar graph..

wonyoungso commented 8 years ago

except that, almost done.

mushon commented 8 years ago

Fair enough. How about this bar graph:

image

mushon commented 8 years ago

after @wonyoungso implements #33 @mushon will generate static images for graphs, push them to assets/images and reference them into the admin

wonyoungso commented 8 years ago