@teselagen/ove 0.8.5 → 0.8.7

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.
@@ -1,16 +1,9 @@
1
- /**
2
- * Minimal SVG BarPlot component
3
- * @param {Object} props
4
- * @param {number[]} props.data - Array of numbers to plot
5
- * @param {number} [props.width=300]
6
- * @param {number} [props.height=150]
7
- * @param {string[]} [props.barColors]
8
- */
9
1
  export function BarPlot({ data, width, height, barColors, className }: {
10
- data: number[];
2
+ data: any;
11
3
  width?: number | undefined;
12
4
  height?: number | undefined;
13
- barColors?: string[] | undefined;
5
+ barColors: any;
6
+ className: any;
14
7
  }): import("react/jsx-runtime").JSX.Element | null;
15
8
  export function AminoAcidCirclePlot({ data, width, className }: {
16
9
  data: any;
@@ -1,5 +1,3 @@
1
1
  export function PropertiesDialog(props: any): import("react/jsx-runtime").JSX.Element;
2
- declare const _default: import('../../../../../node_modules/react-redux').ConnectedComponent<(props: any) => import("react/jsx-runtime").JSX.Element, {
3
- [x: string]: any;
4
- }>;
2
+ declare const _default: any;
5
3
  export default _default;
package/index.cjs.js CHANGED
@@ -109747,14 +109747,21 @@ function getAnnotationNameAndStartStopString({
109747
109747
  end2 = start2 - 1;
109748
109748
  start2 = oldEnd + 1;
109749
109749
  }
109750
- return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${name2 ? name2 : ""} - Start: ${isProtein2 ? (start2 + 3) / 3 : start2 + 1} End: ${isProtein2 ? (end2 + 1) / 3 : end2 + 1} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""} ${readOnly2 ? "" : annotationTypePlural === "cutsites" ? `
109750
+ const interactionInstructions = readOnly2 ? "" : annotationTypePlural === "cutsites" ? `
109751
109751
 
109752
- click --> top cut position
109753
- alt/option+click --> bottom cut position
109754
- cmd/ctrl+click --> recognition range` : `
109752
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109753
+ INTERACTIONS:
109754
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109755
+ click → top cut position
109756
+ alt/option+click → bottom cut position
109757
+ cmd/ctrl+click → recognition range` : `
109755
109758
 
109756
- alt/option+click --> jump row view to start/end
109757
- double click --> edit`}`;
109759
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109760
+ INTERACTIONS:
109761
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109762
+ alt/option+click → jump row view to start/end
109763
+ double click → edit`;
109764
+ return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${name2 ? name2 : ""} - Start: ${isProtein2 ? (start2 + 3) / 3 : start2 + 1} End: ${isProtein2 ? (end2 + 1) / 3 : end2 + 1} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""}${interactionInstructions}`;
109758
109765
  }
109759
109766
  __name(getAnnotationNameAndStartStopString, "getAnnotationNameAndStartStopString");
109760
109767
  const orfFrameToColorMap = {
@@ -116604,7 +116611,7 @@ function showFileDialog({ multiple = false, onSelect }) {
116604
116611
  input.click();
116605
116612
  }
116606
116613
  __name(showFileDialog, "showFileDialog");
116607
- const version = "0.8.4";
116614
+ const version = "0.8.6";
116608
116615
  const packageJson = {
116609
116616
  version
116610
116617
  };
@@ -123906,9 +123913,9 @@ function BarPlot({
123906
123913
  if (!data || data.length === 0) return null;
123907
123914
  const maxVal = Math.max(...data);
123908
123915
  const barWidth = width / data.length;
123909
- return /* @__PURE__ */ React.createElement("svg", { width, height, className }, data.map((val2, i) => {
123916
+ return /* @__PURE__ */ React$1.createElement("svg", { width, height, className }, data.map((val2, i) => {
123910
123917
  const barHeight = val2 / maxVal * (height - 2);
123911
- return /* @__PURE__ */ React.createElement(
123918
+ return /* @__PURE__ */ React$1.createElement(
123912
123919
  "rect",
123913
123920
  {
123914
123921
  "data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
@@ -123921,7 +123928,7 @@ function BarPlot({
123921
123928
  rx: 2
123922
123929
  }
123923
123930
  );
123924
- }), /* @__PURE__ */ React.createElement(
123931
+ }), /* @__PURE__ */ React$1.createElement(
123925
123932
  "line",
123926
123933
  {
123927
123934
  x1: 1,
@@ -123932,7 +123939,7 @@ function BarPlot({
123932
123939
  strokeDasharray: "4,2",
123933
123940
  strokeWidth: 1
123934
123941
  }
123935
- ), /* @__PURE__ */ React.createElement(
123942
+ ), /* @__PURE__ */ React$1.createElement(
123936
123943
  "line",
123937
123944
  {
123938
123945
  x1: 0,
@@ -123954,7 +123961,7 @@ function AminoAcidCirclePlot({ data, width, className }) {
123954
123961
  const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
123955
123962
  const radius = Math.max(8, Math.min(maxRadius, 20));
123956
123963
  const svgHeight = radius * 2 + 10;
123957
- return /* @__PURE__ */ React.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React.createElement("g", { key: idx }, /* @__PURE__ */ React.createElement(
123964
+ return /* @__PURE__ */ React$1.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React$1.createElement("g", { key: idx }, /* @__PURE__ */ React$1.createElement(
123958
123965
  "circle",
123959
123966
  {
123960
123967
  "data-tip": d2.group,
@@ -143562,7 +143569,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143562
143569
  this.commands = getCommands(this);
143563
143570
  }
143564
143571
  render() {
143565
- var _a2;
143572
+ var _a2, _b2;
143566
143573
  const {
143567
143574
  readOnly: readOnly2,
143568
143575
  annotations = {},
@@ -143573,7 +143580,8 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143573
143580
  isProtein: isProtein2,
143574
143581
  allPartTags,
143575
143582
  annotationPropertiesSelectedEntities: _annotationPropertiesSelectedEntities,
143576
- selectedAnnotationId
143583
+ selectedAnnotationId,
143584
+ PropertiesProps
143577
143585
  } = this.props;
143578
143586
  const annotationPropertiesSelectedEntities = _annotationPropertiesSelectedEntities.filter((a2) => annotations[a2.id]);
143579
143587
  const deleteAnnotation = this.props[`delete${annotationTypeUpper}`];
@@ -143585,6 +143593,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143585
143593
  });
143586
143594
  });
143587
143595
  const keyedPartTags = (_a2 = getKeyedTagsAndTagOptions(allPartTags)) != null ? _a2 : {};
143596
+ const additionalColumns = ((_b2 = PropertiesProps == null ? void 0 : PropertiesProps[annotationType]) == null ? void 0 : _b2.additionalColumns) || [];
143588
143597
  this.schema = {
143589
143598
  fields: [
143590
143599
  {
@@ -143670,7 +143679,8 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143670
143679
  }, "render")
143671
143680
  }
143672
143681
  ] : [],
143673
- { path: "strand", type: "number" }
143682
+ { path: "strand", type: "number" },
143683
+ ...additionalColumns
143674
143684
  ]
143675
143685
  };
143676
143686
  return /* @__PURE__ */ React$1.createElement(
@@ -143812,8 +143822,9 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143812
143822
  selectionLayer: selectionLayer2,
143813
143823
  featureLengthsToHide: featureLengthsToHide2,
143814
143824
  primerLengthsToHide: primerLengthsToHide2,
143815
- partLengthsToHide: partLengthsToHide2
143816
- }) => {
143825
+ partLengthsToHide: partLengthsToHide2,
143826
+ PropertiesProps
143827
+ }, ownProps) => {
143817
143828
  return {
143818
143829
  annotationVisibility: annotationVisibility2,
143819
143830
  selectionLayer: selectionLayer2,
@@ -143825,7 +143836,8 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143825
143836
  sequence: sequenceData2.sequence,
143826
143837
  annotations: sequenceData2[annotationType + "s"],
143827
143838
  [annotationType + "s"]: sequenceData2[annotationType + "s"],
143828
- sequenceLength: sequenceData2.sequence.length
143839
+ sequenceLength: sequenceData2.sequence.length,
143840
+ PropertiesProps: ownProps.PropertiesProps || PropertiesProps
143829
143841
  };
143830
143842
  }
143831
143843
  ),
@@ -144415,6 +144427,19 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144415
144427
  if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
144416
144428
  tabId = propertiesList[0].name || propertiesList[0];
144417
144429
  }
144430
+ const getAnnotationCount = /* @__PURE__ */ __name((name2) => {
144431
+ const annotations = props[name2] || props.sequenceData[name2];
144432
+ let count2;
144433
+ if (Array.isArray(annotations)) {
144434
+ count2 = annotations.length;
144435
+ } else if (annotations && typeof annotations === "object") {
144436
+ count2 = Object.keys(annotations).length;
144437
+ }
144438
+ if (isNumber$2(count2)) {
144439
+ return /* @__PURE__ */ React$1.createElement(core.Tag, { className: "tg-smallTag", round: true, style: { marginLeft: 1 } }, count2);
144440
+ }
144441
+ return null;
144442
+ }, "getAnnotationCount");
144418
144443
  const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
144419
144444
  if (annotationsToSupport2[nameOrOverride] === false) {
144420
144445
  return [];
@@ -144426,12 +144451,16 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144426
144451
  return null;
144427
144452
  }
144428
144453
  }
144429
- const title = (() => {
144454
+ const count2 = getAnnotationCount(name2);
144455
+ let title = (() => {
144430
144456
  if (nameOrOverride.Comp) return name2;
144431
144457
  if (name2 === "orfs") return "ORFs";
144432
144458
  if (name2 === "cutsites") return "Cut Sites";
144433
144459
  return startCase(name2);
144434
144460
  })();
144461
+ if (count2) {
144462
+ title = /* @__PURE__ */ React$1.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
144463
+ }
144435
144464
  return /* @__PURE__ */ React$1.createElement(
144436
144465
  core.Tab,
144437
144466
  {
@@ -144447,7 +144476,8 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144447
144476
  showReadOnly,
144448
144477
  showAvailability,
144449
144478
  disableSetReadOnly,
144450
- selectedAnnotationId
144479
+ selectedAnnotationId,
144480
+ PropertiesProps: props.PropertiesProps
144451
144481
  }), nameOrOverride.name && nameOrOverride))
144452
144482
  )
144453
144483
  }
@@ -144490,11 +144520,7 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144490
144520
  )
144491
144521
  );
144492
144522
  }, "PropertiesDialog");
144493
- const Properties = redux.compose(
144494
- connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
144495
- return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
144496
- })
144497
- )(PropertiesDialog);
144523
+ const Properties = withEditorProps(PropertiesDialog);
144498
144524
  const useLadders = /* @__PURE__ */ __name(() => {
144499
144525
  return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
144500
144526
  }, "useLadders");
@@ -145397,7 +145423,7 @@ const _panelMap = {
145397
145423
  pcrTool: PCRTool$1,
145398
145424
  properties: {
145399
145425
  comp: Properties,
145400
- panelSpecificPropsToSpread: ["PropertiesProps"]
145426
+ panelSpecificProps: ["PropertiesProps"]
145401
145427
  },
145402
145428
  mismatches: Mismatches$1
145403
145429
  };
package/index.es.js CHANGED
@@ -109729,14 +109729,21 @@ function getAnnotationNameAndStartStopString({
109729
109729
  end2 = start2 - 1;
109730
109730
  start2 = oldEnd + 1;
109731
109731
  }
109732
- return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${name2 ? name2 : ""} - Start: ${isProtein2 ? (start2 + 3) / 3 : start2 + 1} End: ${isProtein2 ? (end2 + 1) / 3 : end2 + 1} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""} ${readOnly2 ? "" : annotationTypePlural === "cutsites" ? `
109732
+ const interactionInstructions = readOnly2 ? "" : annotationTypePlural === "cutsites" ? `
109733
109733
 
109734
- click --> top cut position
109735
- alt/option+click --> bottom cut position
109736
- cmd/ctrl+click --> recognition range` : `
109734
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109735
+ INTERACTIONS:
109736
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109737
+ click → top cut position
109738
+ alt/option+click → bottom cut position
109739
+ cmd/ctrl+click → recognition range` : `
109737
109740
 
109738
- alt/option+click --> jump row view to start/end
109739
- double click --> edit`}`;
109741
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109742
+ INTERACTIONS:
109743
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
109744
+ alt/option+click → jump row view to start/end
109745
+ double click → edit`;
109746
+ return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${name2 ? name2 : ""} - Start: ${isProtein2 ? (start2 + 3) / 3 : start2 + 1} End: ${isProtein2 ? (end2 + 1) / 3 : end2 + 1} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""}${interactionInstructions}`;
109740
109747
  }
109741
109748
  __name(getAnnotationNameAndStartStopString, "getAnnotationNameAndStartStopString");
109742
109749
  const orfFrameToColorMap = {
@@ -116586,7 +116593,7 @@ function showFileDialog({ multiple = false, onSelect }) {
116586
116593
  input.click();
116587
116594
  }
116588
116595
  __name(showFileDialog, "showFileDialog");
116589
- const version = "0.8.4";
116596
+ const version = "0.8.6";
116590
116597
  const packageJson = {
116591
116598
  version
116592
116599
  };
@@ -123888,9 +123895,9 @@ function BarPlot({
123888
123895
  if (!data || data.length === 0) return null;
123889
123896
  const maxVal = Math.max(...data);
123890
123897
  const barWidth = width / data.length;
123891
- return /* @__PURE__ */ React.createElement("svg", { width, height, className }, data.map((val2, i) => {
123898
+ return /* @__PURE__ */ React__default.createElement("svg", { width, height, className }, data.map((val2, i) => {
123892
123899
  const barHeight = val2 / maxVal * (height - 2);
123893
- return /* @__PURE__ */ React.createElement(
123900
+ return /* @__PURE__ */ React__default.createElement(
123894
123901
  "rect",
123895
123902
  {
123896
123903
  "data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
@@ -123903,7 +123910,7 @@ function BarPlot({
123903
123910
  rx: 2
123904
123911
  }
123905
123912
  );
123906
- }), /* @__PURE__ */ React.createElement(
123913
+ }), /* @__PURE__ */ React__default.createElement(
123907
123914
  "line",
123908
123915
  {
123909
123916
  x1: 1,
@@ -123914,7 +123921,7 @@ function BarPlot({
123914
123921
  strokeDasharray: "4,2",
123915
123922
  strokeWidth: 1
123916
123923
  }
123917
- ), /* @__PURE__ */ React.createElement(
123924
+ ), /* @__PURE__ */ React__default.createElement(
123918
123925
  "line",
123919
123926
  {
123920
123927
  x1: 0,
@@ -123936,7 +123943,7 @@ function AminoAcidCirclePlot({ data, width, className }) {
123936
123943
  const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
123937
123944
  const radius = Math.max(8, Math.min(maxRadius, 20));
123938
123945
  const svgHeight = radius * 2 + 10;
123939
- return /* @__PURE__ */ React.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React.createElement("g", { key: idx }, /* @__PURE__ */ React.createElement(
123946
+ return /* @__PURE__ */ React__default.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React__default.createElement("g", { key: idx }, /* @__PURE__ */ React__default.createElement(
123940
123947
  "circle",
123941
123948
  {
123942
123949
  "data-tip": d2.group,
@@ -143544,7 +143551,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143544
143551
  this.commands = getCommands(this);
143545
143552
  }
143546
143553
  render() {
143547
- var _a2;
143554
+ var _a2, _b2;
143548
143555
  const {
143549
143556
  readOnly: readOnly2,
143550
143557
  annotations = {},
@@ -143555,7 +143562,8 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143555
143562
  isProtein: isProtein2,
143556
143563
  allPartTags,
143557
143564
  annotationPropertiesSelectedEntities: _annotationPropertiesSelectedEntities,
143558
- selectedAnnotationId
143565
+ selectedAnnotationId,
143566
+ PropertiesProps
143559
143567
  } = this.props;
143560
143568
  const annotationPropertiesSelectedEntities = _annotationPropertiesSelectedEntities.filter((a2) => annotations[a2.id]);
143561
143569
  const deleteAnnotation = this.props[`delete${annotationTypeUpper}`];
@@ -143567,6 +143575,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143567
143575
  });
143568
143576
  });
143569
143577
  const keyedPartTags = (_a2 = getKeyedTagsAndTagOptions(allPartTags)) != null ? _a2 : {};
143578
+ const additionalColumns = ((_b2 = PropertiesProps == null ? void 0 : PropertiesProps[annotationType]) == null ? void 0 : _b2.additionalColumns) || [];
143570
143579
  this.schema = {
143571
143580
  fields: [
143572
143581
  {
@@ -143652,7 +143661,8 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143652
143661
  }, "render")
143653
143662
  }
143654
143663
  ] : [],
143655
- { path: "strand", type: "number" }
143664
+ { path: "strand", type: "number" },
143665
+ ...additionalColumns
143656
143666
  ]
143657
143667
  };
143658
143668
  return /* @__PURE__ */ React__default.createElement(
@@ -143794,8 +143804,9 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143794
143804
  selectionLayer: selectionLayer2,
143795
143805
  featureLengthsToHide: featureLengthsToHide2,
143796
143806
  primerLengthsToHide: primerLengthsToHide2,
143797
- partLengthsToHide: partLengthsToHide2
143798
- }) => {
143807
+ partLengthsToHide: partLengthsToHide2,
143808
+ PropertiesProps
143809
+ }, ownProps) => {
143799
143810
  return {
143800
143811
  annotationVisibility: annotationVisibility2,
143801
143812
  selectionLayer: selectionLayer2,
@@ -143807,7 +143818,8 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
143807
143818
  sequence: sequenceData2.sequence,
143808
143819
  annotations: sequenceData2[annotationType + "s"],
143809
143820
  [annotationType + "s"]: sequenceData2[annotationType + "s"],
143810
- sequenceLength: sequenceData2.sequence.length
143821
+ sequenceLength: sequenceData2.sequence.length,
143822
+ PropertiesProps: ownProps.PropertiesProps || PropertiesProps
143811
143823
  };
143812
143824
  }
143813
143825
  ),
@@ -144397,6 +144409,19 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144397
144409
  if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
144398
144410
  tabId = propertiesList[0].name || propertiesList[0];
144399
144411
  }
144412
+ const getAnnotationCount = /* @__PURE__ */ __name((name2) => {
144413
+ const annotations = props[name2] || props.sequenceData[name2];
144414
+ let count2;
144415
+ if (Array.isArray(annotations)) {
144416
+ count2 = annotations.length;
144417
+ } else if (annotations && typeof annotations === "object") {
144418
+ count2 = Object.keys(annotations).length;
144419
+ }
144420
+ if (isNumber$2(count2)) {
144421
+ return /* @__PURE__ */ React__default.createElement(Tag, { className: "tg-smallTag", round: true, style: { marginLeft: 1 } }, count2);
144422
+ }
144423
+ return null;
144424
+ }, "getAnnotationCount");
144400
144425
  const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
144401
144426
  if (annotationsToSupport2[nameOrOverride] === false) {
144402
144427
  return [];
@@ -144408,12 +144433,16 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144408
144433
  return null;
144409
144434
  }
144410
144435
  }
144411
- const title = (() => {
144436
+ const count2 = getAnnotationCount(name2);
144437
+ let title = (() => {
144412
144438
  if (nameOrOverride.Comp) return name2;
144413
144439
  if (name2 === "orfs") return "ORFs";
144414
144440
  if (name2 === "cutsites") return "Cut Sites";
144415
144441
  return startCase(name2);
144416
144442
  })();
144443
+ if (count2) {
144444
+ title = /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
144445
+ }
144417
144446
  return /* @__PURE__ */ React__default.createElement(
144418
144447
  Tab,
144419
144448
  {
@@ -144429,7 +144458,8 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144429
144458
  showReadOnly,
144430
144459
  showAvailability,
144431
144460
  disableSetReadOnly,
144432
- selectedAnnotationId
144461
+ selectedAnnotationId,
144462
+ PropertiesProps: props.PropertiesProps
144433
144463
  }), nameOrOverride.name && nameOrOverride))
144434
144464
  )
144435
144465
  }
@@ -144472,11 +144502,7 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
144472
144502
  )
144473
144503
  );
144474
144504
  }, "PropertiesDialog");
144475
- const Properties = compose$1(
144476
- connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
144477
- return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
144478
- })
144479
- )(PropertiesDialog);
144505
+ const Properties = withEditorProps(PropertiesDialog);
144480
144506
  const useLadders = /* @__PURE__ */ __name(() => {
144481
144507
  return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
144482
144508
  }, "useLadders");
@@ -145379,7 +145405,7 @@ const _panelMap = {
145379
145405
  pcrTool: PCRTool$1,
145380
145406
  properties: {
145381
145407
  comp: Properties,
145382
- panelSpecificPropsToSpread: ["PropertiesProps"]
145408
+ panelSpecificProps: ["PropertiesProps"]
145383
145409
  },
145384
145410
  mismatches: Mismatches$1
145385
145411
  };
package/index.umd.js CHANGED
@@ -137895,14 +137895,21 @@ ${seq.sequence}
137895
137895
  end2 = start2 - 1;
137896
137896
  start2 = oldEnd + 1;
137897
137897
  }
137898
- return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${name2 ? name2 : ""} - Start: ${isProtein2 ? (start2 + 3) / 3 : start2 + 1} End: ${isProtein2 ? (end2 + 1) / 3 : end2 + 1} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""} ${readOnly2 ? "" : annotationTypePlural === "cutsites" ? `
137898
+ const interactionInstructions = readOnly2 ? "" : annotationTypePlural === "cutsites" ? `
137899
137899
 
137900
- click --> top cut position
137901
- alt/option+click --> bottom cut position
137902
- cmd/ctrl+click --> recognition range` : `
137900
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
137901
+ INTERACTIONS:
137902
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
137903
+ click → top cut position
137904
+ alt/option+click → bottom cut position
137905
+ cmd/ctrl+click → recognition range` : `
137903
137906
 
137904
- alt/option+click --> jump row view to start/end
137905
- double click --> edit`}`;
137907
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
137908
+ INTERACTIONS:
137909
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
137910
+ alt/option+click → jump row view to start/end
137911
+ double click → edit`;
137912
+ return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${name2 ? name2 : ""} - Start: ${isProtein2 ? (start2 + 3) / 3 : start2 + 1} End: ${isProtein2 ? (end2 + 1) / 3 : end2 + 1} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""}${interactionInstructions}`;
137906
137913
  }
137907
137914
  __name(getAnnotationNameAndStartStopString, "getAnnotationNameAndStartStopString");
137908
137915
  const orfFrameToColorMap = {
@@ -144702,7 +144709,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
144702
144709
  input.click();
144703
144710
  }
144704
144711
  __name(showFileDialog, "showFileDialog");
144705
- const version = "0.8.4";
144712
+ const version = "0.8.6";
144706
144713
  const packageJson = {
144707
144714
  version
144708
144715
  };
@@ -150402,9 +150409,9 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
150402
150409
  if (!data || data.length === 0) return null;
150403
150410
  const maxVal = Math.max(...data);
150404
150411
  const barWidth = width / data.length;
150405
- return /* @__PURE__ */ React.createElement("svg", { width, height, className }, data.map((val2, i2) => {
150412
+ return /* @__PURE__ */ React$1.createElement("svg", { width, height, className }, data.map((val2, i2) => {
150406
150413
  const barHeight = val2 / maxVal * (height - 2);
150407
- return /* @__PURE__ */ React.createElement(
150414
+ return /* @__PURE__ */ React$1.createElement(
150408
150415
  "rect",
150409
150416
  {
150410
150417
  "data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
@@ -150417,7 +150424,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
150417
150424
  rx: 2
150418
150425
  }
150419
150426
  );
150420
- }), /* @__PURE__ */ React.createElement(
150427
+ }), /* @__PURE__ */ React$1.createElement(
150421
150428
  "line",
150422
150429
  {
150423
150430
  x1: 1,
@@ -150428,7 +150435,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
150428
150435
  strokeDasharray: "4,2",
150429
150436
  strokeWidth: 1
150430
150437
  }
150431
- ), /* @__PURE__ */ React.createElement(
150438
+ ), /* @__PURE__ */ React$1.createElement(
150432
150439
  "line",
150433
150440
  {
150434
150441
  x1: 0,
@@ -150450,7 +150457,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
150450
150457
  const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
150451
150458
  const radius = Math.max(8, Math.min(maxRadius, 20));
150452
150459
  const svgHeight = radius * 2 + 10;
150453
- return /* @__PURE__ */ React.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React.createElement("g", { key: idx }, /* @__PURE__ */ React.createElement(
150460
+ return /* @__PURE__ */ React$1.createElement("svg", { width, height: svgHeight, className }, data.map((d2, idx) => /* @__PURE__ */ React$1.createElement("g", { key: idx }, /* @__PURE__ */ React$1.createElement(
150454
150461
  "circle",
150455
150462
  {
150456
150463
  "data-tip": d2.group,
@@ -170058,7 +170065,7 @@ ${seqDataToCopy}\r
170058
170065
  this.commands = getCommands(this);
170059
170066
  }
170060
170067
  render() {
170061
- var _a2;
170068
+ var _a2, _b2;
170062
170069
  const {
170063
170070
  readOnly: readOnly2,
170064
170071
  annotations = {},
@@ -170069,7 +170076,8 @@ ${seqDataToCopy}\r
170069
170076
  isProtein: isProtein2,
170070
170077
  allPartTags,
170071
170078
  annotationPropertiesSelectedEntities: _annotationPropertiesSelectedEntities,
170072
- selectedAnnotationId
170079
+ selectedAnnotationId,
170080
+ PropertiesProps
170073
170081
  } = this.props;
170074
170082
  const annotationPropertiesSelectedEntities = _annotationPropertiesSelectedEntities.filter((a2) => annotations[a2.id]);
170075
170083
  const deleteAnnotation = this.props[`delete${annotationTypeUpper}`];
@@ -170081,6 +170089,7 @@ ${seqDataToCopy}\r
170081
170089
  });
170082
170090
  });
170083
170091
  const keyedPartTags = (_a2 = getKeyedTagsAndTagOptions(allPartTags)) != null ? _a2 : {};
170092
+ const additionalColumns = ((_b2 = PropertiesProps == null ? void 0 : PropertiesProps[annotationType]) == null ? void 0 : _b2.additionalColumns) || [];
170084
170093
  this.schema = {
170085
170094
  fields: [
170086
170095
  {
@@ -170166,7 +170175,8 @@ ${seqDataToCopy}\r
170166
170175
  }, "render")
170167
170176
  }
170168
170177
  ] : [],
170169
- { path: "strand", type: "number" }
170178
+ { path: "strand", type: "number" },
170179
+ ...additionalColumns
170170
170180
  ]
170171
170181
  };
170172
170182
  return /* @__PURE__ */ React$1.createElement(
@@ -170308,8 +170318,9 @@ ${seqDataToCopy}\r
170308
170318
  selectionLayer: selectionLayer2,
170309
170319
  featureLengthsToHide: featureLengthsToHide2,
170310
170320
  primerLengthsToHide: primerLengthsToHide2,
170311
- partLengthsToHide: partLengthsToHide2
170312
- }) => {
170321
+ partLengthsToHide: partLengthsToHide2,
170322
+ PropertiesProps
170323
+ }, ownProps) => {
170313
170324
  return {
170314
170325
  annotationVisibility: annotationVisibility2,
170315
170326
  selectionLayer: selectionLayer2,
@@ -170321,7 +170332,8 @@ ${seqDataToCopy}\r
170321
170332
  sequence: sequenceData2.sequence,
170322
170333
  annotations: sequenceData2[annotationType + "s"],
170323
170334
  [annotationType + "s"]: sequenceData2[annotationType + "s"],
170324
- sequenceLength: sequenceData2.sequence.length
170335
+ sequenceLength: sequenceData2.sequence.length,
170336
+ PropertiesProps: ownProps.PropertiesProps || PropertiesProps
170325
170337
  };
170326
170338
  }
170327
170339
  ),
@@ -170911,6 +170923,19 @@ ${seqDataToCopy}\r
170911
170923
  if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
170912
170924
  tabId = propertiesList[0].name || propertiesList[0];
170913
170925
  }
170926
+ const getAnnotationCount = /* @__PURE__ */ __name((name2) => {
170927
+ const annotations = props[name2] || props.sequenceData[name2];
170928
+ let count2;
170929
+ if (Array.isArray(annotations)) {
170930
+ count2 = annotations.length;
170931
+ } else if (annotations && typeof annotations === "object") {
170932
+ count2 = Object.keys(annotations).length;
170933
+ }
170934
+ if (isNumber$2(count2)) {
170935
+ return /* @__PURE__ */ React$1.createElement(Tag, { className: "tg-smallTag", round: true, style: { marginLeft: 1 } }, count2);
170936
+ }
170937
+ return null;
170938
+ }, "getAnnotationCount");
170914
170939
  const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
170915
170940
  if (annotationsToSupport2[nameOrOverride] === false) {
170916
170941
  return [];
@@ -170922,12 +170947,16 @@ ${seqDataToCopy}\r
170922
170947
  return null;
170923
170948
  }
170924
170949
  }
170925
- const title = (() => {
170950
+ const count2 = getAnnotationCount(name2);
170951
+ let title = (() => {
170926
170952
  if (nameOrOverride.Comp) return name2;
170927
170953
  if (name2 === "orfs") return "ORFs";
170928
170954
  if (name2 === "cutsites") return "Cut Sites";
170929
170955
  return startCase(name2);
170930
170956
  })();
170957
+ if (count2) {
170958
+ title = /* @__PURE__ */ React$1.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
170959
+ }
170931
170960
  return /* @__PURE__ */ React$1.createElement(
170932
170961
  Tab,
170933
170962
  {
@@ -170943,7 +170972,8 @@ ${seqDataToCopy}\r
170943
170972
  showReadOnly,
170944
170973
  showAvailability,
170945
170974
  disableSetReadOnly,
170946
- selectedAnnotationId
170975
+ selectedAnnotationId,
170976
+ PropertiesProps: props.PropertiesProps
170947
170977
  }), nameOrOverride.name && nameOrOverride))
170948
170978
  )
170949
170979
  }
@@ -170986,11 +171016,7 @@ ${seqDataToCopy}\r
170986
171016
  )
170987
171017
  );
170988
171018
  }, "PropertiesDialog");
170989
- const Properties = compose$1(
170990
- connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
170991
- return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
170992
- })
170993
- )(PropertiesDialog);
171019
+ const Properties = withEditorProps(PropertiesDialog);
170994
171020
  const useLadders = /* @__PURE__ */ __name(() => {
170995
171021
  return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
170996
171022
  }, "useLadders");
@@ -171893,7 +171919,7 @@ ${seqDataToCopy}\r
171893
171919
  pcrTool: PCRTool$1,
171894
171920
  properties: {
171895
171921
  comp: Properties,
171896
- panelSpecificPropsToSpread: ["PropertiesProps"]
171922
+ panelSpecificProps: ["PropertiesProps"]
171897
171923
  },
171898
171924
  mismatches: Mismatches$1
171899
171925
  };
package/ove.css CHANGED
@@ -10391,7 +10391,16 @@ body:not(.drag-active)
10391
10391
  0 1px 3px rgba(0, 0, 0, 0.12),
10392
10392
  0 1px 2px rgba(0, 0, 0, 0.18);
10393
10393
  }
10394
-
10394
+ .no-card .tg-card {
10395
+ border-radius: unset;
10396
+ box-shadow: none;
10397
+ padding: 0;
10398
+ margin-bottom: 0;
10399
+ background: inherit;
10400
+ }
10401
+ .bp3-dark .no-card .tg-card {
10402
+ background: inherit !important;
10403
+ }
10395
10404
  .tg-card-header {
10396
10405
  display: flex;
10397
10406
  flex-direction: row;
@@ -11790,9 +11799,6 @@ h5 {
11790
11799
  width: fit-content;
11791
11800
  }
11792
11801
 
11793
- .ve-propertiesPanel .data-table-container {
11794
- min-height: 250px;
11795
- }
11796
11802
  .ve-propertiesPanel .data-table-footer {
11797
11803
  margin-top: 5px;
11798
11804
  margin-bottom: 5px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ove",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "@teselagen/range-utils": "0.3.13",
20
20
  "@teselagen/react-list": "0.8.18",
21
21
  "@teselagen/sequence-utils": "0.3.35",
22
- "@teselagen/ui": "0.10.7",
22
+ "@teselagen/ui": "0.10.8",
23
23
  "@use-gesture/react": "10.3.0",
24
24
  "biomsa": "^0.2.4",
25
25
  "classnames": "^2.3.2",
@@ -6,6 +6,7 @@
6
6
  * @param {number} [props.height=150]
7
7
  * @param {string[]} [props.barColors]
8
8
  */
9
+ import React from 'react'
9
10
  export function BarPlot({
10
11
  data,
11
12
  width = 300,
@@ -77,7 +77,7 @@ const _panelMap = {
77
77
  pcrTool: PCRTool,
78
78
  properties: {
79
79
  comp: Properties,
80
- panelSpecificPropsToSpread: ["PropertiesProps"]
80
+ panelSpecificProps: ["PropertiesProps"]
81
81
  },
82
82
  mismatches: Mismatches
83
83
  };
@@ -68,7 +68,8 @@ const genericAnnotationProperties = ({
68
68
  allPartTags,
69
69
  annotationPropertiesSelectedEntities:
70
70
  _annotationPropertiesSelectedEntities,
71
- selectedAnnotationId
71
+ selectedAnnotationId,
72
+ PropertiesProps
72
73
  } = this.props;
73
74
  const annotationPropertiesSelectedEntities =
74
75
  _annotationPropertiesSelectedEntities.filter(a => annotations[a.id]);
@@ -87,6 +88,9 @@ const genericAnnotationProperties = ({
87
88
 
88
89
  const keyedPartTags = getKeyedTagsAndTagOptions(allPartTags) ?? {};
89
90
 
91
+ const additionalColumns =
92
+ PropertiesProps?.[annotationType]?.additionalColumns || [];
93
+
90
94
  this.schema = {
91
95
  fields: [
92
96
  {
@@ -194,7 +198,8 @@ const genericAnnotationProperties = ({
194
198
  }
195
199
  ]
196
200
  : []),
197
- { path: "strand", type: "number" }
201
+ { path: "strand", type: "number" },
202
+ ...additionalColumns
198
203
  ]
199
204
  };
200
205
 
@@ -351,15 +356,19 @@ const genericAnnotationProperties = ({
351
356
 
352
357
  return compose(
353
358
  connectToEditor(
354
- ({
355
- readOnly,
356
- annotationVisibility = {},
357
- sequenceData,
358
- selectionLayer,
359
- featureLengthsToHide,
360
- primerLengthsToHide,
361
- partLengthsToHide
362
- }) => {
359
+ (
360
+ {
361
+ readOnly,
362
+ annotationVisibility = {},
363
+ sequenceData,
364
+ selectionLayer,
365
+ featureLengthsToHide,
366
+ primerLengthsToHide,
367
+ partLengthsToHide,
368
+ PropertiesProps
369
+ },
370
+ ownProps
371
+ ) => {
363
372
  return {
364
373
  annotationVisibility,
365
374
  selectionLayer,
@@ -371,7 +380,8 @@ const genericAnnotationProperties = ({
371
380
  sequence: sequenceData.sequence,
372
381
  annotations: sequenceData[annotationType + "s"],
373
382
  [annotationType + "s"]: sequenceData[annotationType + "s"],
374
- sequenceLength: sequenceData.sequence.length
383
+ sequenceLength: sequenceData.sequence.length,
384
+ PropertiesProps: ownProps.PropertiesProps || PropertiesProps
375
385
  };
376
386
  }
377
387
  ),
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
- import { compose } from "redux";
3
- import { Tab, Tabs } from "@blueprintjs/core";
4
- import { flatMap, startCase } from "lodash-es";
2
+ import { Tab, Tabs, Tag } from "@blueprintjs/core";
3
+ import { flatMap, isNumber, startCase } from "lodash-es";
5
4
  import FeatureProperties from "./FeatureProperties";
6
5
  import GeneralProperties from "./GeneralProperties";
7
6
  import CutsiteProperties from "./CutsiteProperties";
@@ -10,13 +9,14 @@ import GenbankView from "./GenbankView";
10
9
  import TranslationProperties from "./TranslationProperties";
11
10
  import PrimerProperties from "./PrimerProperties";
12
11
  import PartProperties from "./PartProperties";
13
- import { connectToEditor } from "../../withEditorProps";
12
+ import withEditorProps from "../../withEditorProps";
14
13
  import "./style.css";
15
14
  import { userDefinedHandlersAndOpts } from "../../Editor/userDefinedHandlersAndOpts";
16
15
  import { pick } from "lodash-es";
17
16
 
18
17
  const PropertiesContainer = Comp => props => {
19
- const { additionalFooterEls, additionalHeaderEls, overrideEl, ...rest } = props;
18
+ const { additionalFooterEls, additionalHeaderEls, overrideEl, ...rest } =
19
+ props;
20
20
  return (
21
21
  <>
22
22
  {additionalHeaderEls}
@@ -73,6 +73,26 @@ export const PropertiesDialog = props => {
73
73
  tabId = propertiesList[0].name || propertiesList[0];
74
74
  }
75
75
 
76
+ // Helper to get count for each annotation type
77
+ const getAnnotationCount = name => {
78
+ // Try to get from props, fallback to 0 if not found or not array
79
+ const annotations = props[name] || props.sequenceData[name];
80
+ let count;
81
+ if (Array.isArray(annotations)) {
82
+ count = annotations.length;
83
+ } else if (annotations && typeof annotations === "object") {
84
+ count = Object.keys(annotations).length;
85
+ }
86
+ if (isNumber(count)) {
87
+ return (
88
+ <Tag className="tg-smallTag" round style={{ marginLeft: 1 }}>
89
+ {count}
90
+ </Tag>
91
+ );
92
+ }
93
+ return null;
94
+ };
95
+
76
96
  const propertiesTabs = flatMap(propertiesList, nameOrOverride => {
77
97
  if (annotationsToSupport[nameOrOverride] === false) {
78
98
  return [];
@@ -90,12 +110,21 @@ export const PropertiesDialog = props => {
90
110
  return null;
91
111
  }
92
112
  }
93
- const title = (() => {
113
+ const count = getAnnotationCount(name);
114
+ let title = (() => {
94
115
  if (nameOrOverride.Comp) return name; //just use the user supplied name because this is a custom panel
95
116
  if (name === "orfs") return "ORFs";
96
117
  if (name === "cutsites") return "Cut Sites";
97
118
  return startCase(name);
98
119
  })();
120
+ if (count) {
121
+ title = (
122
+ <div style={{ display: "flex", alignItems: "center" }}>
123
+ {title}
124
+ {count}
125
+ </div>
126
+ );
127
+ }
99
128
 
100
129
  return (
101
130
  <Tab
@@ -113,6 +142,7 @@ export const PropertiesDialog = props => {
113
142
  showAvailability,
114
143
  disableSetReadOnly,
115
144
  selectedAnnotationId,
145
+ PropertiesProps: props.PropertiesProps,
116
146
  ...(nameOrOverride.name && nameOrOverride)
117
147
  }}
118
148
  />
@@ -160,8 +190,4 @@ export const PropertiesDialog = props => {
160
190
  );
161
191
  };
162
192
 
163
- export default compose(
164
- connectToEditor(({ propertiesTool, annotationsToSupport }) => {
165
- return { propertiesTool, annotationsToSupport };
166
- })
167
- )(PropertiesDialog);
193
+ export default withEditorProps(PropertiesDialog);
@@ -45,9 +45,6 @@
45
45
  width: fit-content;
46
46
  }
47
47
 
48
- .ve-propertiesPanel .data-table-container {
49
- min-height: 250px;
50
- }
51
48
  .ve-propertiesPanel .data-table-footer {
52
49
  margin-top: 5px;
53
50
  margin-bottom: 5px;
@@ -40,22 +40,16 @@ export default function getAnnotationNameAndStartStopString(
40
40
  end = start - 1;
41
41
  start = oldEnd + 1;
42
42
  }
43
+
44
+ const interactionInstructions = readOnly
45
+ ? ""
46
+ : annotationTypePlural === "cutsites"
47
+ ? `\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n INTERACTIONS:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n click → top cut position\n alt/option+click → bottom cut position\n cmd/ctrl+click → recognition range`
48
+ : `\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n INTERACTIONS:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n alt/option+click → jump row view to start/end\n double click → edit`;
49
+
43
50
  return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${
44
51
  name ? name : ""
45
52
  } - Start: ${isProtein ? (start + 3) / 3 : start + 1} End: ${
46
53
  isProtein ? (end + 1) / 3 : end + 1
47
- } ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""} ${
48
- readOnly
49
- ? ""
50
- : annotationTypePlural === "cutsites"
51
- ? `
52
-
53
- click --> top cut position
54
- alt/option+click --> bottom cut position
55
- cmd/ctrl+click --> recognition range`
56
- : `
57
-
58
- alt/option+click --> jump row view to start/end
59
- double click --> edit`
60
- }`;
54
+ } ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""}${interactionInstructions}`;
61
55
  }