Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Nyaplotの紹介@U-22プロコン
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
domitry
October 06, 2014
Technology
200
1
Share
Nyaplotの紹介@U-22プロコン
domitry
October 06, 2014
More Decks by domitry
See All by domitry
Topics about SciRuby @dcmodel/davis tutorial, Kobe
domitry
0
240
The Elements of Statistical Learning 読書会 3.4章
domitry
0
330
PCで絵をかこう!
domitry
0
590
JavaScript&可視化講習会#1
domitry
1
700
精神は物理的に記述できるか
domitry
0
180
RubyとFortranの話
domitry
0
390
Nyaplot - a data visualization tool for Ruby
domitry
3
750
D3.js入門
domitry
0
4.3k
3Dプリンタの使用感に関する考察
domitry
1
330
Other Decks in Technology
See All in Technology
さきさん文庫の書籍ができるまで
sakiengineer
0
320
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
280
探して_入れて_作って_使う_Agent_Skills___LT.pdf
peintangos
2
130
『家族アルバム みてね』における インシデント対応との向き合い方 / Approach incident response in Family Album
kohbis
2
280
Claude Codeですべての日常業務を爆速化しよう!
minorun365
PRO
17
16k
AIガバナンス実践 - 生成AIコネクタのデータ漏洩リスクと実務対策
knishioka
0
150
電子辞書Brainをネットに繋げてみた(自力編)
raspython3
0
390
個人の発見を、組織の知恵に 〜生成AI活用を"探索"から"組織の仕組み"へ〜
kintotechdev
2
370
形式手法特論:公平性制約の位相的特徴づけ #kernelvm / Kernel VM Study Kansai 12th
ytaka23
1
650
ルールやカスタム機能、どう使う?理想の出力を引き出すために今知りたいIBM Bob 5つの機能
muehara
0
160
脅威をエンジニアリングの糧にして:恐怖を乗り越えた先にあったもの / Turn threats into fuel for engineering: what lay beyond overcoming fear
nrslib
1
360
APIテストとは?
nagix
0
160
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
600
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
350
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
520
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
830
Transcript
Nyaplot v0.1.1 ⼤阪⼤学 基礎⼯学部 2年 ⻄⽥ 直樹 (※このページの画像は以下の通りライセンスされています)
Nyaplot Ruby向けのインタラクティブなプロット⽤ライブラリ データの解析・加⼯と可視化、プロットのWebへの出⼒を Rubyで⼀貫して⾏う プログラミング初⼼者の学⽣・研究者でも数⾏でプロット
インタラクティブ性 (1/2) Prototyping (試⾏錯誤しながらプロットを作る) 対話的に⾊決め、データ解析
インタラクティブ性 (2/2) Viewing (閲覧者がデータに触れることができる) PC・タブレット・スマホのブラウザで表⽰
Case 1: 物理系の研究室 教授「Strange Attractorの初期値鋭敏性を体感してもらう Webサイトを作りたい!」 Excelで試してから同じものをJavaScriptで実装する…?
None
None
Erbテンプレートへ notebookで書いたコードに数⾏の追加で実現 <title>Nyaplot</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script> <script> </script> <form method="post" action="/">
<input type="submit" value="submit"> </form> <%= Nyaplot.generate_init_code %> <%= @frame.generate_body %> <%= str=""; @p.each{|k, v| str += "#{k}: <input type="\"text\"" name="\"#{k}\"" value="\"#{v}\""><br>"
Case2: 統計学のレポート 「⾵速・海⽔温・地震のデータをそれぞれ可視化し、考察 を含めてレポートにせよ」 matplotlibのプロットをpngで出⼒しepsに変換、TeXに張 り付け…?
None
レポート提出 ⾃動⽣成されたNotebookをDropboxへアップロード
Nyaplotの夢 「科学分野でRubyを使ってもらいたい!」 現在使われている⾔語はバラバラ (例えば解析:R, 可視化:matplotlib, 出⼒: Rails) 利⽤者(学⽣・研究者)にはフラストレーションの溜まる状 況
Nyaplotは最先端 JavaScriptの台頭で情勢が変わりつつある 各⾔語のライブラリがこぞってJavaScriptと連携 PythonのBokeh, matplotlib, Plotlyなど Nyaplotはその中でも最先端 WebGLでの3Dプロットのサポート IRuby notebookとの密な連携
まとめ Ruby向けプロットライブラリNyaplot ⾼い⽣産性(数⾏で複雑なプロットができる) インタラクティブ性 Prototyping (対話的なプロットの作成) Viewing (ブラウザでプロットに触る) Nyaplotの未来 Rubyの科学分野での普及
Nyaplotは最先端(JavaScript, WebGL)
補⾜
拡張機能 RubyとJavaScriptで⾮常に短く実装 地図を実装するのにRuby約100⾏+JavaScript約200⾏ これだけで国別に塗り分けしたり気候情報を地図上にプロ ットできる
拡張機能 Plot, Diagram, Scale等にモジュール分け 両者は同じDiagram(Nyaplot::Diagrams::Scatter) 座標系のみを新しく定義し同じDiagramを⼆度実装しない
⼆種類のAPI 簡単なプロットと複雑なプロットの両⽅を簡潔に作りたい 統⼀された2つのAPI 簡単なプロット: Arrayベース 複雑なプロット: DataFrameベース
DataFrameベース R⾵, データを解析・加⼯する際に向いている DataFrameを作った後、⾏(column)の名前を指定 df = DataFrame.from_csv("path_to_csv_file") sc = plot.add_with_df(df,
:scatter, :x, :y) sc.fill_by(:home) sc.shape_by(:home) sc.tooltip_contents([:name, :home])
Arrayベース matplotlib⾵, データがRubyのオブジェクトとしてすでにあ る場合に有⽤(Strange Attractorの例など) 配列(Array)をそのまま代⼊してプロット plot.add(:bar, [:hoge, :hunya, :nyaa],
[0.3, 1.0, 2.0])
その他のプロット :2D View notebook
その他のプロット :3D View notebook
その他のプロット :Mapnya View notebook
その他のプロット :Bionya View notebook