グラフ作成CGIの作成を始める
グラフをプロットするCGIの作成を思い立ち、以下のページで改良しつつ運用しています。
http://www.crystal.rm.st/pacgi/graphedit.cgi
要件
・perlのみで動く
かならずしもサーバーにimage magickだの、GDだの、なんとかSQLだのPHPだのrubyだのがインストールされている保証がないので、少なくともperlで動くように作る。
・目盛りとか、余白とか勝手に計算する
データに応じて余白のサイズとか、グリッドの間隔とかを良きにはからってくれるようにする。
・使いやすくする
ブログなどの記事とグラフを絡めたコンテンツをつくりやすいように、グラフ作成が簡単に出来るようにする。
・javascriptとか使わない
興味はあるのですが、クライアント側と、サーバー側の両方で処理が入ると難しくなるので、ひとまずクライアントは何も行わない方向で。
いろんなブラウザで表示できたほうがいいし。
といったところでしょうか。変わるかもしれませんが。
プロットした図を表示させる方法は、gif2htmlを参考にさせてもらいました。
ソースコードは参照していませんが、出力データ形式はそのまま利用させてもらっています。
ゆくゆくはPNGあたりのグラフィック形式にでも対応させられればいいのですが、ひとまずこのまますすめます。
エンコーダが作れればかっこいいのですが、それはまた別プロジェクトで。
ブラウザによってはベクタデータを扱うことが出来るみたいですが、将来的にはグラフ以外のラスタデータを扱うかもしれないので、しばらくはベクタデータは保留で。
以下、今後の予定
・テキストモードがあるとおもしろいかも
テキストブラウザでも見られるモードがあるといいなぁ。
・Datalistのソート
編集機能が貧弱なので、データのリストをソートさせたり、少しはインターフェースを考えようかと。
・データ圧縮
やたらとメモリを食う可能性があります。多次元配列で1ピクセルごとメモリを使っているのですが、グラフのサイズを大きくするとサーバーに怒られることがあるみたいです。perlのメモリ管理を良く理解していないので、どうしたら小さく収まるかは調べつつ行いましょう。
・はてなグラフにある機能のまね
グラフの合成
関数グラフ evalは危険だな、と
y軸を逆に(x軸、y軸の方向が固定なのがいまいち)
積分グラフ
・グラフ設定ファイルにコメント欄を設ける
なにか備考が書けるとなにかと便利かと。
・グラフのキャッシュ
毎回計算してプロットデータを出すよりは、グラフデータをキャッシュしておいた方が当然よいですね。グラフの参照もしやすくなるし。
ただ、グラフの作成のオーバーヘッドよりも、グラフ自体の転送に時間がかかると思われるので、あんまり早くはならないかも。
・ソースの公開
そろそろソースを公開しようかと。それなりに動いているし。
そのまえにライセンスを決めなければ。というか免責の文章を作らねば。
・回帰直線の計算
今日思いついたネタ。1次の回帰直線ぐらいならすぐできるかもね。
R値とか表示するとうれしい?個人的にはいらないが。

9 Comments:
TODO 追加
グラフデータの見出しにスペースが含まれていると、+に置き換わってしまうことが判明。直すか、スペース禁止にするか。
spanked sex Thank you very much! I took a too-handy. п»їVery interesting! Not very often can not understand how to update your blog? STUDY theme! super original All zdryam! Today marked the second anniversary maintaining your blog. Congratulations on not imposing ourselves, we would like to know the author and perhaps a comment: and what time you run your resource? Frankly, had difficult moments, when visited by the thought to throw this case. First, because of the departure of the index of PS Yandex, later - due to lack of time. But after a while you begin to understand that it is sometimes useful to lay out on the list (in this case on the web page your thoughts, share something interesting with our readers. The author of this resource would like to wish the inspiration for the new positions will never leave! Good luck ... Yes, but it's not all ... I hope it will still Blog just super, I will recommend to friends! fabulous idea ... we would learn ... great.
house adults in youth correctional facilities Really? amazing. Very good site, but not bad-would make a version for smartphones. I read a similar article on this subject, but you have quite a different opinion, thanks, it was interesting to compare You know now who rarely writes on the subject, very pleasant to read, I would advise to add more pictures! Thank you great! Yes, but it's not all ... I hope it will still And you know what a holiday today? Just do not believe
adult fun biz I like your posts You can still search in Google .. read with pleasure In my opinion you stole this article and placed on another site. I had already seen. Yes, the news went on inetu and distributed by starshnoy force Thanks for the post, and this issue Interestingly, and cognitive, and will have something on this subject? Thank you! In quotations!
blowjob young You know now who rarely writes on the subject, very pleasant to read, I would advise to add more pictures! Thank you! Article interesting. fabulous idea ... we would learn ... great. Cool Cool Indeed ... super creative! Really? amazing. super original
dick the bruiser So engrossed that I missed a football blog in my favorites Actions do not always bring happiness, but there is no happiness without action. - B. Disraeli Super! Everything is very clear and competently, and at the same time without philosophising and narcissism, and in accessible language. Rare case when a person is divided into topical and interesting infoy. Thanks to author! read with pleasure Thank you, useful thing. All read satisfy my interest but "No matter how cursed himself, others certainly will do it better.") cool .. took almost all))
gay contacts in cornwall Wine and women bring to us Well without untoward happens - even a schoolboy on holiday give job. - Charles Lamb On your blog, familiar in the ICQ link tossed. It turned out that nothing I liked. Tepr always read will I do not know how the rest, but I liked it. Greatest number of people can join only the lowest common denominator. - FA Hayek Classroom paper, by the way the author would like to offer yandeks.deneg chip set from the site, "Give the ruble." I would give, so to speak on the maintenance. Excellent post, after reading several articles on the subject realized that everything did not look on the other hand, a post once very interested. I do not know about you, but I like it! There is.
lionsden adult The site just super, I will recommend to friends! They like. Must be waiting to continue. This topic is certainly of interest to all. Thank you very much! I took a too-handy. Super! Everything is very clear and competently, and at the same time without philosophising and narcissism, and in accessible language. Rare case when a person is divided into topical and interesting infoy. Thanks to author! All zdryam! Today marked the second anniversary maintaining your blog. Congratulations on not imposing ourselves, we would like to know the author and perhaps a comment: and what time you run your resource? Frankly, had difficult moments, when visited by the thought to throw this case. First, because of the departure of the index of PS Yandex, later - due to lack of time. But after a while you begin to understand that it is sometimes useful to lay out on the list (in this case on the web page your thoughts, share something interesting with our readers. The author of this resource would like to wish the inspiration for the new positions will never leave! Good luck ... Yes, the news went on inetu and distributed by starshnoy force cool .. took almost all)) Most people are happy as much as they have decided to be happy. - A. Lincoln
kent meridian the cat who smelled smoke smoke shop aka women smoking glamour eva mendes vogue lincoln welding smoke eater smoking ruins clothes dishwasher job kent wa winston salem murder news
Post a Comment
<< Home