in src/visualComponent/table/body/bodyRowComponent.ts [384:474]
private renderContainer(
options: IBodyRowRenderOptions,
cellConstructors: any[],
isContainerShown: boolean,
rowState: IRowState,
collapserIndex: number,
collapserOrder: number,
): void {
const {
hyperlinkAdapter,
series,
settings,
originRowStateSet,
seriesDeep,
viewport,
} = options;
const cellsLength: number = cellConstructors.length;
const expectedAmountOfComponents: number = this.amountOfSubRows + cellsLength + options.series.children.length;
if (this.components.length !== expectedAmountOfComponents || !this.components.length) {
this.destroyComponents();
this.initCells(
cellConstructors,
this.bodyOptions,
this.cellOptions,
);
this.initSubRows(
cellsLength,
CollapsedBodyRowComponent,
this.amountOfSubRows,
);
this.initSubRows(
this.amountOfSubRows + cellsLength,
BodyRowComponent,
options.series.children.length,
);
}
const category: IGeneratedCategory = SettingsBase.getCategoryByIndex(series.level);
const fontSettings: CategorySettings = settings[category.name] || settings.metricName;
this.components[collapserIndex].render({
fontSettings,
hyperlink: series.hyperlink,
hyperlinkAdapter,
image: series.image,
isExpandCollapseShown: fontSettings.isExpandCollapseShown,
isShown: isContainerShown,
order: collapserOrder,
value: series.name,
} as ICollapserCellRenderOptions);
this.components[collapserIndex + this.amountOfSubRows].render(options);
this.applyContainerClassName();
if ((this.viewMode === BodyRowComponentViewMode.tabular || this.viewMode === BodyRowComponentViewMode.common)
&& fontSettings
) {
this.updateAlignment(this.containerElement, fontSettings.alignment, fontSettings.verticalAlignment);
} else {
this.updateAlignment(this.containerElement, undefined, undefined);
}
options.series.children.forEach((childSeries: IDataRepresentationSeries, childSeriesIndex: number) => {
const component: BodyRowComponent
= this.components[childSeriesIndex + cellConstructors.length + this.amountOfSubRows] as BodyRowComponent;
if (component) {
component.render({
hyperlinkAdapter: options.hyperlinkAdapter,
metadata: options.metadata,
originRowStateSet,
rowStateSet: rowState && rowState.rowSet,
series: childSeries,
seriesDeep,
seriesSettings: options.seriesSettings,
settings: options.settings,
type: options.type,
viewport,
y: options.y,
});
}
});
}