@uibcdf/molsysviewer 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/viewer.js CHANGED
@@ -140086,7 +140086,7 @@ async function loadStructureFromString(plugin, data, format = "pdb", label2, opt
140086
140086
  const raw = await plugin.builders.data.rawData({
140087
140087
  data,
140088
140088
  label: label2 ?? "Structure from string",
140089
- // extension opcional; ayuda a algunos parsers
140089
+ // Optional extension; helps some parsers.
140090
140090
  ext: format
140091
140091
  });
140092
140092
  const trajectory = await plugin.builders.structure.parseTrajectory(raw, format);
@@ -140708,7 +140708,7 @@ var PocketBlob3D = MSVTransform({
140708
140708
  function preparePocketBlobData(options) {
140709
140709
  const field = buildPocketBlobField(options);
140710
140710
  if (!field) {
140711
- console.warn("[MolSysViewer] add_pocket_blob sin datos v\xE1lidos");
140711
+ console.warn("[MolSysViewer] add_pocket_blob: no valid data");
140712
140712
  return void 0;
140713
140713
  }
140714
140714
  const levels = options.iso_levels && options.iso_levels.length > 0 ? options.iso_levels : [options.iso_level ?? 0.1];
@@ -140951,7 +140951,7 @@ function prepareChannelTubeData(options) {
140951
140951
  const built = buildChannelSegments(options);
140952
140952
  const segments2 = built.segments;
140953
140953
  if (!segments2 || segments2.length === 0) {
140954
- console.warn("[MolSysViewer] add_channel_tube sin segmentos v\xE1lidos");
140954
+ console.warn("[MolSysViewer] add_channel_tube: no valid segments");
140955
140955
  return { radialSegments: built.radialSegments };
140956
140956
  }
140957
140957
  const alpha = options.alpha ?? 1;
@@ -141173,7 +141173,7 @@ var AnisotropyEllipsoids3D = MSVTransform({
141173
141173
  function prepareAnisotropyEllipsoidData(plugin, options) {
141174
141174
  const ellipsoids = buildEllipsoidSpecs(plugin, options);
141175
141175
  if (ellipsoids.length === 0) {
141176
- console.warn("[MolSysViewer] add_anisotropy_ellipsoids sin datos v\xE1lidos");
141176
+ console.warn("[MolSysViewer] add_anisotropy_ellipsoids: no valid data");
141177
141177
  return void 0;
141178
141178
  }
141179
141179
  const alpha = options.alpha ?? 0.6;
@@ -141303,7 +141303,7 @@ function preparePharmacophoreData(options) {
141303
141303
  const centers = options.centers ?? [];
141304
141304
  const kinds = options.kinds ?? [];
141305
141305
  if (centers.length === 0 || centers.length !== kinds.length) {
141306
- console.warn("[MolSysViewer] add_pharmacophore_features requiere centers y kinds del mismo tama\xF1o");
141306
+ console.warn("[MolSysViewer] add_pharmacophore_features requires centers and kinds of the same length");
141307
141307
  return void 0;
141308
141308
  }
141309
141309
  const radii = options.radii && options.radii.length === centers.length ? options.radii : new Array(centers.length).fill(0.6);
@@ -141455,7 +141455,7 @@ function normalizeCoordinatePair(entry) {
141455
141455
  function expandToList(value, count3, cast, fallback) {
141456
141456
  if (Array.isArray(value)) {
141457
141457
  if (value.length === count3) return value.map(cast);
141458
- console.warn(`[MolSysViewer] Esperaba ${count3} valores pero recib\xED ${value.length}. Se reutilizar\xE1 el primero.`);
141458
+ console.warn(`[MolSysViewer] Expected ${count3} values but got ${value.length}. The first value will be reused.`);
141459
141459
  return Array(count3).fill(cast(value[0]));
141460
141460
  }
141461
141461
  return Array(count3).fill(cast(value ?? fallback));
@@ -141528,7 +141528,7 @@ function buildLinksFromAtoms(structure, options) {
141528
141528
  const locA = lookup.get(a8);
141529
141529
  const locB = lookup.get(b8);
141530
141530
  if (!locA || !locB) {
141531
- console.warn(`[MolSysViewer] atom_pairs[${i}] no coincide con \xE1tomos de la estructura`);
141531
+ console.warn(`[MolSysViewer] atom_pairs[${i}] does not match atoms in the structure`);
141532
141532
  continue;
141533
141533
  }
141534
141534
  locA.unit.conformation.position(locA.elementIndex, positionsStart);
@@ -141568,7 +141568,7 @@ async function addNetworkLinksFromPython(plugin, options) {
141568
141568
  const structureRef = plugin.managers.structure.hierarchy.current.structures.slice(-1)[0];
141569
141569
  const structure = structureRef?.cell.obj?.data;
141570
141570
  if (!structure) {
141571
- console.warn("[MolSysViewer] add_network_links sin estructura cargada");
141571
+ console.warn("[MolSysViewer] add_network_links: no structure loaded");
141572
141572
  return void 0;
141573
141573
  }
141574
141574
  links = buildLinksFromAtoms(structure, options);
@@ -141578,7 +141578,7 @@ async function addNetworkLinksFromPython(plugin, options) {
141578
141578
  name = getNetworkLinksName(links.length);
141579
141579
  }
141580
141580
  if (links.length === 0) {
141581
- console.warn("[MolSysViewer] add_network_links sin datos v\xE1lidos");
141581
+ console.warn("[MolSysViewer] add_network_links: no valid data");
141582
141582
  return void 0;
141583
141583
  }
141584
141584
  const data = {
@@ -141784,7 +141784,7 @@ function expandOptionalToList(value, count3, cast) {
141784
141784
  if (value === void 0) return Array(count3).fill(void 0);
141785
141785
  if (Array.isArray(value)) {
141786
141786
  if (value.length === count3) return value.map(cast);
141787
- console.warn(`[MolSysViewer] Esperaba ${count3} valores pero recib\xED ${value.length}. Se reutilizar\xE1 el primero.`);
141787
+ console.warn(`[MolSysViewer] Expected ${count3} values but got ${value.length}. The first value will be reused.`);
141788
141788
  return Array(count3).fill(cast(value[0]));
141789
141789
  }
141790
141790
  return Array(count3).fill(cast(value));
@@ -141815,14 +141815,14 @@ function buildTrianglesFromAtoms(structure, options) {
141815
141815
  for (let i = 0; i < triplets.length; i++) {
141816
141816
  const triplet = triplets[i];
141817
141817
  if (!Array.isArray(triplet) || triplet.length !== 3) {
141818
- console.warn(`[MolSysViewer] atom_triplets[${i}] no es un triplete v\xE1lido`);
141818
+ console.warn(`[MolSysViewer] atom_triplets[${i}] is not a valid triplet`);
141819
141819
  continue;
141820
141820
  }
141821
141821
  const locA = lookup.get(triplet[0]);
141822
141822
  const locB = lookup.get(triplet[1]);
141823
141823
  const locC = lookup.get(triplet[2]);
141824
141824
  if (!locA || !locB || !locC) {
141825
- console.warn(`[MolSysViewer] atom_triplets[${i}] no coincide con \xE1tomos de la estructura`);
141825
+ console.warn(`[MolSysViewer] atom_triplets[${i}] does not match atoms in the structure`);
141826
141826
  continue;
141827
141827
  }
141828
141828
  locA.unit.conformation.position(locA.elementIndex, a8);
@@ -141848,7 +141848,7 @@ function prepareTriangleFacesData(plugin, options) {
141848
141848
  const structureRef = plugin.managers.structure.hierarchy.current.structures.slice(-1)[0];
141849
141849
  const structure = structureRef?.cell.obj?.data;
141850
141850
  if (!structure) {
141851
- console.warn("[MolSysViewer] add_triangle_faces con atom_triplets pero sin estructura cargada");
141851
+ console.warn("[MolSysViewer] add_triangle_faces: atom_triplets provided but no structure loaded");
141852
141852
  return void 0;
141853
141853
  }
141854
141854
  triangles = buildTrianglesFromAtoms(structure, options);
@@ -141856,7 +141856,7 @@ function prepareTriangleFacesData(plugin, options) {
141856
141856
  triangles = buildTrianglesFromVertices(options);
141857
141857
  }
141858
141858
  if (triangles.length === 0) {
141859
- console.warn("[MolSysViewer] add_triangle_faces sin tri\xE1ngulos v\xE1lidos");
141859
+ console.warn("[MolSysViewer] add_triangle_faces: no valid triangles");
141860
141860
  return void 0;
141861
141861
  }
141862
141862
  const name = triangles.length === 1 ? "Triangle Face" : `${triangles.length} Triangle Faces`;
@@ -142166,7 +142166,7 @@ function buildTetrahedraFromAtoms(structure, options) {
142166
142166
  const locC = lookup.get(quad[2]);
142167
142167
  const locD = lookup.get(quad[3]);
142168
142168
  if (!locA || !locB || !locC || !locD) {
142169
- console.warn(`[MolSysViewer] atom_quads[${i}] no coincide con \xE1tomos de la estructura`);
142169
+ console.warn(`[MolSysViewer] atom_quads[${i}] does not match atoms in the structure`);
142170
142170
  continue;
142171
142171
  }
142172
142172
  locA.unit.conformation.position(locA.elementIndex, a8);
@@ -142195,7 +142195,7 @@ function prepareTetrahedraData(plugin, options) {
142195
142195
  const structureRef = plugin.managers.structure.hierarchy.current.structures.slice(-1)[0];
142196
142196
  const structure = structureRef?.cell.obj?.data;
142197
142197
  if (!structure) {
142198
- console.warn("[MolSysViewer] add_tetrahedra con atom_quads pero sin estructura cargada");
142198
+ console.warn("[MolSysViewer] add_tetrahedra: atom_quads provided but no structure loaded");
142199
142199
  return void 0;
142200
142200
  }
142201
142201
  tetrahedra = buildTetrahedraFromAtoms(structure, options);
@@ -142203,7 +142203,7 @@ function prepareTetrahedraData(plugin, options) {
142203
142203
  tetrahedra = buildTetrahedraFromCoords(options);
142204
142204
  }
142205
142205
  if (tetrahedra.length === 0) {
142206
- console.warn("[MolSysViewer] add_tetrahedra sin tetraedros v\xE1lidos");
142206
+ console.warn("[MolSysViewer] add_tetrahedra: no valid tetrahedra");
142207
142207
  return void 0;
142208
142208
  }
142209
142209
  const name = options.name ?? (tetrahedra.length === 1 ? "Tetrahedron" : `${tetrahedra.length} Tetrahedra`);
@@ -142344,7 +142344,7 @@ function resolveOriginsFromAtoms(plugin, atomIndices) {
142344
142344
  const structureRef = plugin.managers.structure.hierarchy.current.structures.slice(-1)[0];
142345
142345
  const structure = structureRef?.cell.obj?.data;
142346
142346
  if (!structure) {
142347
- console.warn("[MolSysViewer] add_displacement_vectors sin estructura cargada");
142347
+ console.warn("[MolSysViewer] add_displacement_vectors: no structure loaded");
142348
142348
  return [];
142349
142349
  }
142350
142350
  const lookup = buildUnitLookup(structure);
@@ -142353,7 +142353,7 @@ function resolveOriginsFromAtoms(plugin, atomIndices) {
142353
142353
  atomIndices.forEach((idx, pos) => {
142354
142354
  const loc = lookup.get(idx);
142355
142355
  if (!loc) {
142356
- console.warn(`[MolSysViewer] atom_indices[${pos}] no coincide con \xE1tomos de la estructura`);
142356
+ console.warn(`[MolSysViewer] atom_indices[${pos}] does not match atoms in the structure`);
142357
142357
  origins.push(void 0);
142358
142358
  return;
142359
142359
  }
@@ -142365,12 +142365,12 @@ function resolveOriginsFromAtoms(plugin, atomIndices) {
142365
142365
  function prepareDisplacementVectorData(plugin, options) {
142366
142366
  const vectors = options.vectors ?? [];
142367
142367
  if (!vectors || vectors.length === 0) {
142368
- console.warn("[MolSysViewer] add_displacement_vectors sin vectores");
142368
+ console.warn("[MolSysViewer] add_displacement_vectors: missing vectors");
142369
142369
  return void 0;
142370
142370
  }
142371
142371
  const origins = options.atom_indices && options.atom_indices.length > 0 ? resolveOriginsFromAtoms(plugin, options.atom_indices) : options.origins ?? [];
142372
142372
  if (!origins || origins.length === 0) {
142373
- console.warn("[MolSysViewer] add_displacement_vectors sin or\xEDgenes v\xE1lidos");
142373
+ console.warn("[MolSysViewer] add_displacement_vectors: no valid origins");
142374
142374
  return void 0;
142375
142375
  }
142376
142376
  const count3 = Math.min(origins.length, vectors.length);
@@ -142400,7 +142400,7 @@ function prepareDisplacementVectorData(plugin, options) {
142400
142400
  });
142401
142401
  }
142402
142402
  if (processed.length === 0) {
142403
- console.warn("[MolSysViewer] add_displacement_vectors sin entradas utilizables");
142403
+ console.warn("[MolSysViewer] add_displacement_vectors: no usable inputs");
142404
142404
  return void 0;
142405
142405
  }
142406
142406
  const scaledMax = Math.max(...processed.map((p6) => p6.magnitude * lengthScale));
@@ -142425,7 +142425,7 @@ function prepareDisplacementVectorData(plugin, options) {
142425
142425
  colorValues.push(value);
142426
142426
  }
142427
142427
  if (arrows.length === 0) {
142428
- console.warn("[MolSysViewer] add_displacement_vectors sin flechas tras filtrado");
142428
+ console.warn("[MolSysViewer] add_displacement_vectors: no arrows after filtering");
142429
142429
  return void 0;
142430
142430
  }
142431
142431
  const minValue = Math.min(...colorValues);
@@ -142634,12 +142634,12 @@ async function addPocketSurfaceFromPython(plugin, options) {
142634
142634
  const structureRef = plugin.managers.structure.hierarchy.current.structures.slice(-1)[0];
142635
142635
  const structure = structureRef?.cell.obj?.data;
142636
142636
  if (!structure) {
142637
- console.warn("[MolSysViewer] add_pocket_surface sin estructura cargada");
142637
+ console.warn("[MolSysViewer] add_pocket_surface: no structure loaded");
142638
142638
  return void 0;
142639
142639
  }
142640
142640
  const subset = createSubsetFromAtomIndices(structure, options.atom_indices);
142641
142641
  if (!subset || subset.elementCount === 0) {
142642
- console.warn("[MolSysViewer] add_pocket_surface sin \xE1tomos seleccionados");
142642
+ console.warn("[MolSysViewer] add_pocket_surface: no selected atoms");
142643
142643
  return void 0;
142644
142644
  }
142645
142645
  const gaussianProps = getDefaultGaussianProps(options);