データを視覚的プロパティにバインドする

Bind Data to Visual Property

デフォルトでは、オブジェクト(つまり、図形やコレクション)は、一般的なベクターエディタで見られるものとまったく同じように動作します。移動させたり、サイズや色を変更したり、「削除」ボタンを押して削除したりできます。データビジュアライゼーションを作成するために、オブジェクトの視覚的プロパティを手動で変更することもできます。しかし、このプロセスは手間がかかり、エラーが発生しやすいものです。Data Illustrator は、図形、頂点、セグメント、およびコレクションの視覚的プロパティにデータをバインドするための自動サポートを提供します。

データバインディングを実行するには、まず繰り返し (repeat)分割 (divide)、または高密度化 (densify)操作を通じて、データをオブジェクトにアタッチする必要があります。図形またはコレクションが選択されている状態で、プロパティインスペクタにその視覚的プロパティが表示されます。プロパティをデータにバインドできる場合は、プロパティコントロールの横にバインディングボタン が表示されます。バインディングボタンをクリックすると、そのプロパティにバインドできるすべての適用可能な変数(列名)のドロップダウンメニューが表示されます。

divide by data

以下の例では、長方形のコレクションを作成し、変数「count」を長方形の幅にバインドします。バインディングは、そのプロパティに対する制約と考えることができます。バインディングが作成されると、そのプロパティを操作したり変更したりすることはできなくなります。

バインディング後、「幅」のプロパティコントロールは、バインドされた変数を表示するように更新され、バインディングボタンは「バインディングの解除」ボタン に置き換わります。このボタンをクリックするとバインディングが解除され、長方形の幅に対する制約が取り除かれます。これで、長方形の幅を自由に変更できるようになります。

By default, objects (i.e. shapes and collections) behave exactly like those found in a typical vector editor. You can move them around, change their size and color, or delete them by pressing the “delete” button. To create data visualizations, we can manually alter the visual properties of objects. But this process is laborious and error-prone. Data Illustrateur provides automated support for binding data to visual properties of shapes, vertices, segments and collections.

To perform data binding, you need to first attach data to an object through the repeat, divide, or densify operations. With a shape or a collection selected, the Property Inspector will display its visual properties. If a property can be bound to data, a binding button will appear next to the property control. Clicking on the binding button shows a drop-down menu of all the applicable variables (column names) that can be bound to the property.

divide by data

In the example below, we create a collection of rectangles, and then bind the variable “count” to the width of the rectangles. You can consider binding as a constraint on that property. Once the binding is created, you can no longer manipulate or change that property.

After binding, the property control for “width” updates to show the binding variable, and the binding button is replaced by a “remove binding” button . Clicking on this button will remove the binding, and the constraint on rectangle width will be removed. Now you can freely change the width of the recangles.