|
@@ -1,15 +1,16 @@
|
|
|
import { RcsbFv3DCustomInterface} from "../RcsbFv3D/RcsbFv3DCustom";
|
|
|
import { DebugUtil } from "./tmdet-extension/debug-utils";
|
|
|
-import { createFeatureViewerConfing } from "./FeatureViewConfig";
|
|
|
+import { createFeatureViewerConfing, setRegionColors } from "./FeatureViewConfig";
|
|
|
import { fetchDescriptor, registerRegionDescriptorData } from "./UniTmpHelper";
|
|
|
import { TmFv3DCustom } from "./tmdet-viewer/TmFv3DCustom";
|
|
|
-import { RcsbFv, RcsbFvRowConfigInterface } from "@rcsb/rcsb-saguaro";
|
|
|
-import { getStyleColorString, updateSiteColors } from "./tmdet-extension/tmdet-color-theme";
|
|
|
+import { RcsbFv } from "@rcsb/rcsb-saguaro";
|
|
|
+import { updateSiteColors } from "./tmdet-extension/tmdet-color-theme";
|
|
|
|
|
|
-function createViewer(configParams: any) {
|
|
|
+function createRcsb3DViewer(configParams: any) {
|
|
|
document.addEventListener("DOMContentLoaded", (event) => {
|
|
|
(async function(event) {
|
|
|
|
|
|
+ updateSiteColors(configParams.side1 as any);
|
|
|
DebugUtil.enableLog();
|
|
|
|
|
|
const panel3dConfig = await createConfig(configParams);
|
|
@@ -35,10 +36,11 @@ async function createConfig(configParams: any): Promise<RcsbFv3DCustomInterface>
|
|
|
};
|
|
|
|
|
|
if (pdbEntry) {
|
|
|
- const descriptorUrl = `/${pdbEntry}.json`;
|
|
|
- registerRegionDescriptorData(descriptorUrl, params.side1);
|
|
|
+ console.log('annotation data:', configParams.annotationData);
|
|
|
+ await registerRegionDescriptorData(configParams.annotationData, params.side1);
|
|
|
}
|
|
|
if (configParams.configData) {
|
|
|
+ console.log('config data:', configParams.configData);
|
|
|
params.fvConfigData = await fetchDescriptor(configParams.configData);
|
|
|
}
|
|
|
|
|
@@ -75,20 +77,14 @@ async function createRcsbFeatureViewer(params: {
|
|
|
boardConfig.rowTitleWidth = params.rowTitleWidth ?? 160;
|
|
|
|
|
|
const rowConfig = blockConfig[0].featureViewConfig[0].rowConfig;
|
|
|
- rowConfig.forEach((track: RcsbFvRowConfigInterface) => {
|
|
|
- track.displayConfig?.forEach(region => {
|
|
|
- const css = (region as any).css;
|
|
|
- if (css) {
|
|
|
- region.displayColor = getStyleColorString(css);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
+ setRegionColors(rowConfig);
|
|
|
|
|
|
const pfv = new RcsbFv({
|
|
|
boardConfigData: boardConfig,
|
|
|
rowConfigData: rowConfig,
|
|
|
elementId: params.elementId
|
|
|
});
|
|
|
+ return pfv;
|
|
|
}
|
|
|
|
|
|
-export { DebugUtil, createViewer, createRcsbFeatureViewer };
|
|
|
+export { DebugUtil, createRcsb3DViewer, createRcsbFeatureViewer };
|