简体   繁体   中英

Canvas versus server generated graphics

I am migrating a legacy graphing application from (broken) PHP to... something. I am debating between just a newer PHP library and a JS library for Canvas. The application is NOT interactive, so it doesn't intrinsically need Javascript.

My impression is that it is more "modern" to use JS as a graphing library than to do it server-side. Server-side rendering seems more "enterprisy". But honestly I'm not entirely sure why this is.

To avoid making this seem like a debatable or opinionated question, I really just want to know the advantages to doing this in Canvas vs server-side in terms of maintainability, longevity, etc. I cannot think of obvious benefits one way or the other. I would appreciate some feedback concerning concrete advantages to rendering server-side vs in Canvas (or vice-versa) in my non-interactive application. Thanks!

One benefit is it's easier to make a modular client when javascript renders the graphs. It allows you to make api calls from javascript to get the data. This allows your server side api to be implemented any way you want in any language as long as it returns the correct data format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM