MCPcopy Index your code
hub / github.com/apache/echarts / themeRiverLayout

Function themeRiverLayout

src/chart/themeRiver/themeRiverLayout.ts:36–72  ·  view source on GitHub ↗
(ecModel: GlobalModel, api: ExtensionAPI)

Source from the content-addressed store, hash-verified

34export const themeRiverLayoutStageHandler = createSimpleOverallStageHandler(SERIES_TYPE_THEME_RIVER, themeRiverLayout);
35
36function themeRiverLayout(ecModel: GlobalModel, api: ExtensionAPI) {
37
38 ecModel.eachSeriesByType(SERIES_TYPE_THEME_RIVER, function (seriesModel: ThemeRiverSeriesModel) {
39
40 const data = seriesModel.getData();
41
42 const single = seriesModel.coordinateSystem;
43
44 const layoutInfo = {} as ThemeRiverLayoutInfo;
45
46 // use the axis boundingRect for view
47 const rect = single.getRect();
48
49 layoutInfo.rect = rect;
50
51 const boundaryGap = seriesModel.get('boundaryGap');
52
53 const axis = single.getAxis();
54
55 layoutInfo.boundaryGap = boundaryGap;
56
57 if (axis.orient === 'horizontal') {
58 boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.height);
59 boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.height);
60 const height = rect.height - boundaryGap[0] - boundaryGap[1];
61 doThemeRiverLayout(data, seriesModel, height);
62 }
63 else {
64 boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], rect.width);
65 boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], rect.width);
66 const width = rect.width - boundaryGap[0] - boundaryGap[1];
67 doThemeRiverLayout(data, seriesModel, width);
68 }
69
70 data.setLayout('layoutInfo', layoutInfo);
71 });
72}
73
74/**
75 * The layout information about themeriver

Callers

nothing calls this directly

Calls 7

doThemeRiverLayoutFunction · 0.85
eachSeriesByTypeMethod · 0.80
getDataMethod · 0.65
setLayoutMethod · 0.65
getRectMethod · 0.45
getMethod · 0.45
getAxisMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…