LoginSignup
0
0

More than 1 year has passed since last update.

【Harmoware-VIS】移動体アイコンの詳細な表示コントロール

Posted at

Harmoware-VIS とは

移動体アイコンの詳細な表示コントロール

Harmoware-VIS は移動体アイコンの「表示位置」は移動データに定義した2点の位置と時間から計算しますが、その他の項目は移動データへの定義そのままなので、例えば2点間を移動中にサイズや色や方向、グラフの値などは変化しません。

また、既定ではアーチ(MovesLayeroptionArcVisible)や直線(MovesLayeroptionLineVisible)の表示は直近の2点間のみとなります。

この部分をカスタマイズしたい場合、Harmoware-VIS に登録した移動データ( movesbase )から、表示用の移動体のデータ( movedData )を生成する処理をカスタマイズするオーバーライド関数を使用することで実現できます。

オーバーライド関数を登録する書式

this.props.actions.setMovesOptionFunc(getMovesOptionFunc);

引数となる getMovesOptionFunc の関数書式

const getMovesOptionFunc(props,index1,index2) => object

オーバーライド関数は1移動体(index1)毎にコールします。

引数 説明
props アプリのルートのプロパティ
index1 移動データmovesbase内の処理中の移動体の index
index2 移動データmovesbase内の operation 配列の該当時刻(settime)データの index

リターン値は既定の移動体のデータ( movedData )に上書きされますので注意してください。
既定では settime 、 position 、 sourcePosition 、 targetPosition 、 color 、 direction 、 sourceColor 、 targetColor 、 movesbaseidx 及び、その他の movesbase に含まれる要素がmovedDataにコピーされます。

オーバーライド関数のコード例
getGraphValue(n) はグラフのデータを取得する関数を想定)

const getMovesOptionFunc(props,index1,index2) => {
    const {settime, movesbase} = props;
    const {operation} = movesbase[index1];
    const currentData = operation[index2];
    const optElevation = [];
    optElevation[0] = getGraphValue0(settime,currentData);
    optElevation[1] = getGraphValue1(settime,currentData);
    optElevation[2] = getGraphValue2(settime,currentData);
    optElevation[3] = getGraphValue3(settime,currentData);
    const optColor = [[255,0,0],[0,255,0],[0,0,255],[255,255,255]];
    return {optElevation,optColor};
}

※注意※
オーバーライド関数の引数の Harmoware-VIS の プロパティの movedData は、前回の表示済データですのでご注意ください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0