たれぱんのびぼーろく

わたしの備忘録、生物学とプログラミングが多いかも

d3js

d3.jsとデータの書き換え

入力値やインタラクションの結果をデータとグラフに反映する仕組みはd3.jsに備わっているのか否か 結論 d3.jsには双方向バインディングに該当する仕組みがない. dataの取得・更新とrebinding、rebinding後の更新が必要. うーむ There's no data-binding magi…

SVGのtextをその場で書き換える

下のtext要素をクリックしてごらん、なんと編集できるよ!! 私はtext要素。でも編集できるよ! (クリックしてみ) わかる人向け: 仕組みを一言でいうと contentEditableなHTML要素の下にtext要素を配置し、このセットをforeignObjectへ入れてSVG要素下に吊るす…

d3.js version 4

モジュール Arrays (Statistics, Search, Transformations, Histograms) Axes Brushes Chords Collections (Objects, Maps, Sets, Nests) Colors Dispatches Dragging Delimiter-Separated Values Easings Forces Number Formats Geographies (Paths, Projec…

データの更新・遷移・引き出し/D3.js

データの更新 Data(data, key)のkey指定を利用 nebuta.hatenablog.com データの遷移 transition treeの遷移 Interactive d3.js tree diagram - bl.ocks.org データの引き出し data() 引数無しでselectionの第1groupからjoinされたdatum配列を返してくれる. h…

有向非循環グラフの可視化

概要 有向非循環グラフの可視化(visualization)について手法と記事のまとめ。 有向非循環グラフ Directed Acyclic Graph architecture topolodical sort layer assignment vertex ordering within layers median vertex positioning within layers Sugiyama …

transitions/d3js

selection.transition() あるselectionに対してtransitionsを適用可能にするmethods. 返り値はselectionの特別なタイプ. Starts a transition for the current selection. Transitions behave much like selections, except operators animate smoothly over…

d3js/覚えておきたいmethods

覚えておきたいmethods scale 数値のスケール変換関数. 変換のタイプ(linearとか)に合わせたコンストラクタっぽいので関数を作り、入力domainと出力rangeを関数のsetterでセットして完成。 var xScale = d3.scale.linear(); xScale.domain([0,100]) .range([…