@teselagen/ove 0.8.6 → 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.
- package/BarPlot/index.d.ts +3 -10
- package/helperComponents/PropertiesDialog/index.d.ts +1 -3
- package/index.cjs.js +25 -12
- package/index.es.js +25 -12
- package/index.umd.js +25 -12
- package/ove.css +10 -4
- package/package.json +2 -2
- package/src/BarPlot/index.js +1 -0
- package/src/helperComponents/PropertiesDialog/index.js +34 -10
- package/src/helperComponents/PropertiesDialog/style.css +0 -3
package/BarPlot/index.d.ts
CHANGED
|
@@ -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:
|
|
2
|
+
data: any;
|
|
11
3
|
width?: number | undefined;
|
|
12
4
|
height?: number | undefined;
|
|
13
|
-
barColors
|
|
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:
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}>;
|
|
2
|
+
declare const _default: any;
|
|
5
3
|
export default _default;
|
package/index.cjs.js
CHANGED
|
@@ -116611,7 +116611,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
116611
116611
|
input.click();
|
|
116612
116612
|
}
|
|
116613
116613
|
__name(showFileDialog, "showFileDialog");
|
|
116614
|
-
const version = "0.8.
|
|
116614
|
+
const version = "0.8.6";
|
|
116615
116615
|
const packageJson = {
|
|
116616
116616
|
version
|
|
116617
116617
|
};
|
|
@@ -123913,9 +123913,9 @@ function BarPlot({
|
|
|
123913
123913
|
if (!data || data.length === 0) return null;
|
|
123914
123914
|
const maxVal = Math.max(...data);
|
|
123915
123915
|
const barWidth = width / data.length;
|
|
123916
|
-
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) => {
|
|
123917
123917
|
const barHeight = val2 / maxVal * (height - 2);
|
|
123918
|
-
return /* @__PURE__ */ React.createElement(
|
|
123918
|
+
return /* @__PURE__ */ React$1.createElement(
|
|
123919
123919
|
"rect",
|
|
123920
123920
|
{
|
|
123921
123921
|
"data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
|
|
@@ -123928,7 +123928,7 @@ function BarPlot({
|
|
|
123928
123928
|
rx: 2
|
|
123929
123929
|
}
|
|
123930
123930
|
);
|
|
123931
|
-
}), /* @__PURE__ */ React.createElement(
|
|
123931
|
+
}), /* @__PURE__ */ React$1.createElement(
|
|
123932
123932
|
"line",
|
|
123933
123933
|
{
|
|
123934
123934
|
x1: 1,
|
|
@@ -123939,7 +123939,7 @@ function BarPlot({
|
|
|
123939
123939
|
strokeDasharray: "4,2",
|
|
123940
123940
|
strokeWidth: 1
|
|
123941
123941
|
}
|
|
123942
|
-
), /* @__PURE__ */ React.createElement(
|
|
123942
|
+
), /* @__PURE__ */ React$1.createElement(
|
|
123943
123943
|
"line",
|
|
123944
123944
|
{
|
|
123945
123945
|
x1: 0,
|
|
@@ -123961,7 +123961,7 @@ function AminoAcidCirclePlot({ data, width, className }) {
|
|
|
123961
123961
|
const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
|
|
123962
123962
|
const radius = Math.max(8, Math.min(maxRadius, 20));
|
|
123963
123963
|
const svgHeight = radius * 2 + 10;
|
|
123964
|
-
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(
|
|
123965
123965
|
"circle",
|
|
123966
123966
|
{
|
|
123967
123967
|
"data-tip": d2.group,
|
|
@@ -144427,6 +144427,19 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
144427
144427
|
if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
|
|
144428
144428
|
tabId = propertiesList[0].name || propertiesList[0];
|
|
144429
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");
|
|
144430
144443
|
const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
|
|
144431
144444
|
if (annotationsToSupport2[nameOrOverride] === false) {
|
|
144432
144445
|
return [];
|
|
@@ -144438,12 +144451,16 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
144438
144451
|
return null;
|
|
144439
144452
|
}
|
|
144440
144453
|
}
|
|
144441
|
-
const
|
|
144454
|
+
const count2 = getAnnotationCount(name2);
|
|
144455
|
+
let title = (() => {
|
|
144442
144456
|
if (nameOrOverride.Comp) return name2;
|
|
144443
144457
|
if (name2 === "orfs") return "ORFs";
|
|
144444
144458
|
if (name2 === "cutsites") return "Cut Sites";
|
|
144445
144459
|
return startCase(name2);
|
|
144446
144460
|
})();
|
|
144461
|
+
if (count2) {
|
|
144462
|
+
title = /* @__PURE__ */ React$1.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
|
|
144463
|
+
}
|
|
144447
144464
|
return /* @__PURE__ */ React$1.createElement(
|
|
144448
144465
|
core.Tab,
|
|
144449
144466
|
{
|
|
@@ -144503,11 +144520,7 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
144503
144520
|
)
|
|
144504
144521
|
);
|
|
144505
144522
|
}, "PropertiesDialog");
|
|
144506
|
-
const Properties =
|
|
144507
|
-
connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
|
|
144508
|
-
return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
|
|
144509
|
-
})
|
|
144510
|
-
)(PropertiesDialog);
|
|
144523
|
+
const Properties = withEditorProps(PropertiesDialog);
|
|
144511
144524
|
const useLadders = /* @__PURE__ */ __name(() => {
|
|
144512
144525
|
return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
|
|
144513
144526
|
}, "useLadders");
|
package/index.es.js
CHANGED
|
@@ -116593,7 +116593,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
116593
116593
|
input.click();
|
|
116594
116594
|
}
|
|
116595
116595
|
__name(showFileDialog, "showFileDialog");
|
|
116596
|
-
const version = "0.8.
|
|
116596
|
+
const version = "0.8.6";
|
|
116597
116597
|
const packageJson = {
|
|
116598
116598
|
version
|
|
116599
116599
|
};
|
|
@@ -123895,9 +123895,9 @@ function BarPlot({
|
|
|
123895
123895
|
if (!data || data.length === 0) return null;
|
|
123896
123896
|
const maxVal = Math.max(...data);
|
|
123897
123897
|
const barWidth = width / data.length;
|
|
123898
|
-
return /* @__PURE__ */
|
|
123898
|
+
return /* @__PURE__ */ React__default.createElement("svg", { width, height, className }, data.map((val2, i) => {
|
|
123899
123899
|
const barHeight = val2 / maxVal * (height - 2);
|
|
123900
|
-
return /* @__PURE__ */
|
|
123900
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
123901
123901
|
"rect",
|
|
123902
123902
|
{
|
|
123903
123903
|
"data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
|
|
@@ -123910,7 +123910,7 @@ function BarPlot({
|
|
|
123910
123910
|
rx: 2
|
|
123911
123911
|
}
|
|
123912
123912
|
);
|
|
123913
|
-
}), /* @__PURE__ */
|
|
123913
|
+
}), /* @__PURE__ */ React__default.createElement(
|
|
123914
123914
|
"line",
|
|
123915
123915
|
{
|
|
123916
123916
|
x1: 1,
|
|
@@ -123921,7 +123921,7 @@ function BarPlot({
|
|
|
123921
123921
|
strokeDasharray: "4,2",
|
|
123922
123922
|
strokeWidth: 1
|
|
123923
123923
|
}
|
|
123924
|
-
), /* @__PURE__ */
|
|
123924
|
+
), /* @__PURE__ */ React__default.createElement(
|
|
123925
123925
|
"line",
|
|
123926
123926
|
{
|
|
123927
123927
|
x1: 0,
|
|
@@ -123943,7 +123943,7 @@ function AminoAcidCirclePlot({ data, width, className }) {
|
|
|
123943
123943
|
const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
|
|
123944
123944
|
const radius = Math.max(8, Math.min(maxRadius, 20));
|
|
123945
123945
|
const svgHeight = radius * 2 + 10;
|
|
123946
|
-
return /* @__PURE__ */
|
|
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(
|
|
123947
123947
|
"circle",
|
|
123948
123948
|
{
|
|
123949
123949
|
"data-tip": d2.group,
|
|
@@ -144409,6 +144409,19 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
144409
144409
|
if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
|
|
144410
144410
|
tabId = propertiesList[0].name || propertiesList[0];
|
|
144411
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");
|
|
144412
144425
|
const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
|
|
144413
144426
|
if (annotationsToSupport2[nameOrOverride] === false) {
|
|
144414
144427
|
return [];
|
|
@@ -144420,12 +144433,16 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
144420
144433
|
return null;
|
|
144421
144434
|
}
|
|
144422
144435
|
}
|
|
144423
|
-
const
|
|
144436
|
+
const count2 = getAnnotationCount(name2);
|
|
144437
|
+
let title = (() => {
|
|
144424
144438
|
if (nameOrOverride.Comp) return name2;
|
|
144425
144439
|
if (name2 === "orfs") return "ORFs";
|
|
144426
144440
|
if (name2 === "cutsites") return "Cut Sites";
|
|
144427
144441
|
return startCase(name2);
|
|
144428
144442
|
})();
|
|
144443
|
+
if (count2) {
|
|
144444
|
+
title = /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
|
|
144445
|
+
}
|
|
144429
144446
|
return /* @__PURE__ */ React__default.createElement(
|
|
144430
144447
|
Tab,
|
|
144431
144448
|
{
|
|
@@ -144485,11 +144502,7 @@ const PropertiesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
144485
144502
|
)
|
|
144486
144503
|
);
|
|
144487
144504
|
}, "PropertiesDialog");
|
|
144488
|
-
const Properties =
|
|
144489
|
-
connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
|
|
144490
|
-
return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
|
|
144491
|
-
})
|
|
144492
|
-
)(PropertiesDialog);
|
|
144505
|
+
const Properties = withEditorProps(PropertiesDialog);
|
|
144493
144506
|
const useLadders = /* @__PURE__ */ __name(() => {
|
|
144494
144507
|
return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
|
|
144495
144508
|
}, "useLadders");
|
package/index.umd.js
CHANGED
|
@@ -144709,7 +144709,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
144709
144709
|
input.click();
|
|
144710
144710
|
}
|
|
144711
144711
|
__name(showFileDialog, "showFileDialog");
|
|
144712
|
-
const version = "0.8.
|
|
144712
|
+
const version = "0.8.6";
|
|
144713
144713
|
const packageJson = {
|
|
144714
144714
|
version
|
|
144715
144715
|
};
|
|
@@ -150409,9 +150409,9 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
150409
150409
|
if (!data || data.length === 0) return null;
|
|
150410
150410
|
const maxVal = Math.max(...data);
|
|
150411
150411
|
const barWidth = width / data.length;
|
|
150412
|
-
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) => {
|
|
150413
150413
|
const barHeight = val2 / maxVal * (height - 2);
|
|
150414
|
-
return /* @__PURE__ */ React.createElement(
|
|
150414
|
+
return /* @__PURE__ */ React$1.createElement(
|
|
150415
150415
|
"rect",
|
|
150416
150416
|
{
|
|
150417
150417
|
"data-tip": `${val2 == null ? void 0 : val2.toFixed(1)}%`,
|
|
@@ -150424,7 +150424,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
150424
150424
|
rx: 2
|
|
150425
150425
|
}
|
|
150426
150426
|
);
|
|
150427
|
-
}), /* @__PURE__ */ React.createElement(
|
|
150427
|
+
}), /* @__PURE__ */ React$1.createElement(
|
|
150428
150428
|
"line",
|
|
150429
150429
|
{
|
|
150430
150430
|
x1: 1,
|
|
@@ -150435,7 +150435,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
150435
150435
|
strokeDasharray: "4,2",
|
|
150436
150436
|
strokeWidth: 1
|
|
150437
150437
|
}
|
|
150438
|
-
), /* @__PURE__ */ React.createElement(
|
|
150438
|
+
), /* @__PURE__ */ React$1.createElement(
|
|
150439
150439
|
"line",
|
|
150440
150440
|
{
|
|
150441
150441
|
x1: 0,
|
|
@@ -150457,7 +150457,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
150457
150457
|
const maxRadius = spacing / 2 - 2 > 0 ? spacing / 2 - 2 : 8;
|
|
150458
150458
|
const radius = Math.max(8, Math.min(maxRadius, 20));
|
|
150459
150459
|
const svgHeight = radius * 2 + 10;
|
|
150460
|
-
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(
|
|
150461
150461
|
"circle",
|
|
150462
150462
|
{
|
|
150463
150463
|
"data-tip": d2.group,
|
|
@@ -170923,6 +170923,19 @@ ${seqDataToCopy}\r
|
|
|
170923
170923
|
if (propertiesList.map((nameOrOverride) => nameOrOverride.name || nameOrOverride).indexOf(tabId) === -1) {
|
|
170924
170924
|
tabId = propertiesList[0].name || propertiesList[0];
|
|
170925
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");
|
|
170926
170939
|
const propertiesTabs = flatMap(propertiesList, (nameOrOverride) => {
|
|
170927
170940
|
if (annotationsToSupport2[nameOrOverride] === false) {
|
|
170928
170941
|
return [];
|
|
@@ -170934,12 +170947,16 @@ ${seqDataToCopy}\r
|
|
|
170934
170947
|
return null;
|
|
170935
170948
|
}
|
|
170936
170949
|
}
|
|
170937
|
-
const
|
|
170950
|
+
const count2 = getAnnotationCount(name2);
|
|
170951
|
+
let title = (() => {
|
|
170938
170952
|
if (nameOrOverride.Comp) return name2;
|
|
170939
170953
|
if (name2 === "orfs") return "ORFs";
|
|
170940
170954
|
if (name2 === "cutsites") return "Cut Sites";
|
|
170941
170955
|
return startCase(name2);
|
|
170942
170956
|
})();
|
|
170957
|
+
if (count2) {
|
|
170958
|
+
title = /* @__PURE__ */ React$1.createElement("div", { style: { display: "flex", alignItems: "center" } }, title, count2);
|
|
170959
|
+
}
|
|
170943
170960
|
return /* @__PURE__ */ React$1.createElement(
|
|
170944
170961
|
Tab,
|
|
170945
170962
|
{
|
|
@@ -170999,11 +171016,7 @@ ${seqDataToCopy}\r
|
|
|
170999
171016
|
)
|
|
171000
171017
|
);
|
|
171001
171018
|
}, "PropertiesDialog");
|
|
171002
|
-
const Properties =
|
|
171003
|
-
connectToEditor(({ propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 }) => {
|
|
171004
|
-
return { propertiesTool: propertiesTool2, annotationsToSupport: annotationsToSupport2 };
|
|
171005
|
-
})
|
|
171006
|
-
)(PropertiesDialog);
|
|
171019
|
+
const Properties = withEditorProps(PropertiesDialog);
|
|
171007
171020
|
const useLadders = /* @__PURE__ */ __name(() => {
|
|
171008
171021
|
return useLocalStorageState("tg-additional-ladder", { defaultValue: [] });
|
|
171009
171022
|
}, "useLadders");
|
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.
|
|
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.
|
|
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",
|
package/src/BarPlot/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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,7 +9,7 @@ import GenbankView from "./GenbankView";
|
|
|
10
9
|
import TranslationProperties from "./TranslationProperties";
|
|
11
10
|
import PrimerProperties from "./PrimerProperties";
|
|
12
11
|
import PartProperties from "./PartProperties";
|
|
13
|
-
import
|
|
12
|
+
import withEditorProps from "../../withEditorProps";
|
|
14
13
|
import "./style.css";
|
|
15
14
|
import { userDefinedHandlersAndOpts } from "../../Editor/userDefinedHandlersAndOpts";
|
|
16
15
|
import { pick } from "lodash-es";
|
|
@@ -74,6 +73,26 @@ export const PropertiesDialog = props => {
|
|
|
74
73
|
tabId = propertiesList[0].name || propertiesList[0];
|
|
75
74
|
}
|
|
76
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
|
+
|
|
77
96
|
const propertiesTabs = flatMap(propertiesList, nameOrOverride => {
|
|
78
97
|
if (annotationsToSupport[nameOrOverride] === false) {
|
|
79
98
|
return [];
|
|
@@ -91,12 +110,21 @@ export const PropertiesDialog = props => {
|
|
|
91
110
|
return null;
|
|
92
111
|
}
|
|
93
112
|
}
|
|
94
|
-
const
|
|
113
|
+
const count = getAnnotationCount(name);
|
|
114
|
+
let title = (() => {
|
|
95
115
|
if (nameOrOverride.Comp) return name; //just use the user supplied name because this is a custom panel
|
|
96
116
|
if (name === "orfs") return "ORFs";
|
|
97
117
|
if (name === "cutsites") return "Cut Sites";
|
|
98
118
|
return startCase(name);
|
|
99
119
|
})();
|
|
120
|
+
if (count) {
|
|
121
|
+
title = (
|
|
122
|
+
<div style={{ display: "flex", alignItems: "center" }}>
|
|
123
|
+
{title}
|
|
124
|
+
{count}
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
100
128
|
|
|
101
129
|
return (
|
|
102
130
|
<Tab
|
|
@@ -162,8 +190,4 @@ export const PropertiesDialog = props => {
|
|
|
162
190
|
);
|
|
163
191
|
};
|
|
164
192
|
|
|
165
|
-
export default
|
|
166
|
-
connectToEditor(({ propertiesTool, annotationsToSupport }) => {
|
|
167
|
-
return { propertiesTool, annotationsToSupport };
|
|
168
|
-
})
|
|
169
|
-
)(PropertiesDialog);
|
|
193
|
+
export default withEditorProps(PropertiesDialog);
|