function themeRiverLayout(data, seriesModel, height) {
    if (!data.count()) {
        return;
    }
    var coordSys = seriesModel.coordinateSystem;
    // the data in each layer are organized into a series.
    var layerSeries = seriesModel.getLayerSeries();

    // the points in each layer.
    var timeDim = data.mapDimension('single');
    var valueDim = data.mapDimension('value');
    var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {
        return zrUtil.map(singleLayer.indices, function (idx) {
            var pt = coordSys.dataToPoint(data.get(timeDim, idx));
            pt[1] = data.get(valueDim, idx);
            return pt;
        });
    });

    var base = computeBaseline(layerPoints);
    var baseLine = base.y0;
    var ky = height / base.max;

    // set layout information for each item.
    var n = layerSeries.length;
    var m = layerSeries[0].indices.length;
    var baseY0;
    for (var j = 0; j < m; ++j) {
        baseY0 = baseLine[j] * ky;
        data.setItemLayout(layerSeries[0].indices[j], {
            layerIndex: 0,
            x: layerPoints[0][j][0],
            y0: baseY0,
            y: layerPoints[0][j][1] * ky
        });
        for (var i = 1; i < n; ++i) {
            baseY0 += layerPoints[i - 1][j][1] * ky;
            data.setItemLayout(layerSeries[i].indices[j], {
                layerIndex: i,
                x: layerPoints[i][j][0],
                y0: baseY0,
                y: layerPoints[i][j][1] * ky
            });
        }
    }
}
function themeRiverLayout(data, seriesModel, height) {
    if (!data.count()) {
        return;
    }
    var coordSys = seriesModel.coordinateSystem;
    // the data in each layer are organized into a series.
    var layerSeries = seriesModel.getLayerSeries();

    // the points in each layer.
    var timeDim = data.mapDimension('single');
    var valueDim = data.mapDimension('value');
    var layerPoints = zrUtil.map(layerSeries, function (singleLayer) {
        return zrUtil.map(singleLayer.indices, function (idx) {
            var pt = coordSys.dataToPoint(data.get(timeDim, idx));
            pt[1] = data.get(valueDim, idx);
            return pt;
        });
    });

    var base = computeBaseline(layerPoints);
    var baseLine = base.y0;
    var ky = height / base.max;

    // set layout information for each item.
    var n = layerSeries.length;
    var m = layerSeries[0].indices.length;
    var baseY0;
    for (var j = 0; j < m; ++j) {
        baseY0 = baseLine[j] * ky;
        data.setItemLayout(layerSeries[0].indices[j], {
            layerIndex: 0,
            x: layerPoints[0][j][0],
            y0: baseY0,
            y: layerPoints[0][j][1] * ky
        });
        for (var i = 1; i < n; ++i) {
            baseY0 += layerPoints[i - 1][j][1] * ky;
            data.setItemLayout(layerSeries[i].indices[j], {
                layerIndex: i,
                x: layerPoints[i][j][0],
                y0: baseY0,
                y: layerPoints[i][j][1] * ky
            });
        }
    }
}
function themeRiverLayout ( data , seriesModel , height ) { if ( ! data . count ( ) ) { return ; } var coordSys = seriesModel . coordinateSystem ; // the data in each layer are organized into a series. var layerSeries = seriesModel . getLayerSeries ( ) ; // the points in each layer. var timeDim = data . mapDimension ( 'single' ) ; var valueDim = data . mapDimension ( 'value' ) ; var layerPoints = zrUtil . map ( layerSeries , function ( singleLayer ) { return zrUtil . map ( singleLayer . indices , function ( idx ) { var pt = coordSys . dataToPoint ( data . get ( timeDim , idx ) ) ; pt [ 1 ] = data . get ( valueDim , idx ) ; return pt ; } ) ; } ) ; var base = computeBaseline ( layerPoints ) ; var baseLine = base . y0 ; var ky = height / base . max ; // set layout information for each item. var n = layerSeries . length ; var m = layerSeries [ 0 ] . indices . length ; var baseY0 ; for ( var j = 0 ; j < m ; ++ j ) { baseY0 = baseLine [ j ] * ky ; data . setItemLayout ( layerSeries [ 0 ] . indices [ j ] , { layerIndex : 0 , x : layerPoints [ 0 ] [ j ] [ 0 ] , y0 : baseY0 , y : layerPoints [ 0 ] [ j ] [ 1 ] * ky } ) ; for ( var i = 1 ; i < n ; ++ i ) { baseY0 += layerPoints [ i - 1 ] [ j ] [ 1 ] * ky ; data . setItemLayout ( layerSeries [ i ] . indices [ j ] , { layerIndex : i , x : layerPoints [ i ] [ j ] [ 0 ] , y0 : baseY0 , y : layerPoints [ i ] [ j ] [ 1 ] * ky } ) ; } } }
The layout information about themeriver

@param {module:echarts/data/List} data  data in the series
@param {module:echarts/model/Series} seriesModel  the model object of themeRiver series
@param {number} height  value used to compute every series height
The layout information about themeriver
Layouts the data in the seriesModel based on the height of the data.