@rcsb/rcsb-saguaro-app 6.2.2 → 6.2.4

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.
@@ -630,7 +630,8 @@
630
630
  "type": "METAL_COORDINATION",
631
631
  "display": "bond",
632
632
  "color": "#aaaada",
633
- "title": "METAL COORDINATION"
633
+ "title": "METAL COORDINATION",
634
+ "ignore": true
634
635
  }, {
635
636
  "type": "COVALENT_BOND",
636
637
  "display": "bond",
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  export declare class MountableComponent {
3
- private readonly element;
3
+ private static readonly ROOT;
4
4
  private root;
5
5
  constructor(element: HTMLElement);
6
6
  render(node: ReactNode): void;
@@ -1,8 +1,12 @@
1
1
  import { createRoot } from "react-dom/client";
2
2
  export class MountableComponent {
3
3
  constructor(element) {
4
- this.element = element;
5
- this.root = createRoot(this.element);
4
+ var _a;
5
+ if (MountableComponent.ROOT.has(element.id)) {
6
+ (_a = MountableComponent.ROOT.get(element.id)) === null || _a === void 0 ? void 0 : _a.unmount();
7
+ }
8
+ this.root = createRoot(element);
9
+ MountableComponent.ROOT.set(element.id, this.root);
6
10
  }
7
11
  render(node) {
8
12
  this.unmount();
@@ -12,3 +16,4 @@ export class MountableComponent {
12
16
  this.root.render(undefined);
13
17
  }
14
18
  }
19
+ MountableComponent.ROOT = new Map();
@@ -82,24 +82,56 @@ export const TAXONOMY_COUNT_FACET = {
82
82
  title: "Number of Source Taxonomies",
83
83
  attributeName: "TAXONOMY_COUNT_FACET",
84
84
  attribute: RcsbSearchMetadata.RcsbPolymerEntity.RcsbSourceTaxonomyCount.path,
85
- chartType: ChartType.histogram,
86
- contentType: "number",
87
- chartConfig: {
88
- histogramBinIncrement: 0,
89
- tickFormat: {
90
- domAxis: (t) => {
91
- if (t.toString().includes('.'))
92
- return '';
93
- return t.toString();
94
- }
95
- },
96
- chartDisplayConfig: {
97
- constHeight: 225
85
+ chartType: ChartType.barplot,
86
+ contentType: "string",
87
+ facetConfig: {
88
+ facetTransform: (bucket) => {
89
+ const out = [];
90
+ const wt = bucket.find(b => parseInt(b.label.toString()) == 1);
91
+ if (wt)
92
+ out.push({
93
+ label: "Single",
94
+ labelPath: ["Single"],
95
+ population: wt.population
96
+ });
97
+ const synthetic = bucket.find(b => parseInt(b.label.toString()) == 0);
98
+ if (synthetic)
99
+ out.push({
100
+ label: "None",
101
+ labelPath: ["None"],
102
+ population: synthetic.population
103
+ });
104
+ const chimeric = bucket.filter(b => parseInt(b.label.toString()) > 1);
105
+ if ((chimeric === null || chimeric === void 0 ? void 0 : chimeric.length) > 0)
106
+ out.push({
107
+ label: "Multiple",
108
+ labelPath: ["Multiple"],
109
+ population: chimeric.reduce((c, p) => c + p.population, 0)
110
+ });
111
+ return out;
98
112
  },
99
- domainMinValue: 0,
100
- axisLabel: "Taxonomy count",
101
- tooltipText: (d) => {
102
- return `Taxonomy count ${d.x}`;
113
+ bucketClickSearchQuery: (datum, data, e) => {
114
+ if (datum.x == "Single")
115
+ return buildAttributeQuery({
116
+ attribute: TAXONOMY_COUNT_FACET.attribute,
117
+ value: 1,
118
+ operator: Operator.Equals,
119
+ service: Service.Text
120
+ });
121
+ else if (datum.x == "None")
122
+ return buildAttributeQuery({
123
+ attribute: TAXONOMY_COUNT_FACET.attribute,
124
+ value: 0,
125
+ operator: Operator.Equals,
126
+ service: Service.Text
127
+ });
128
+ else
129
+ return buildAttributeQuery({
130
+ attribute: TAXONOMY_COUNT_FACET.attribute,
131
+ value: 1,
132
+ operator: Operator.Greater,
133
+ service: Service.Text
134
+ });
103
135
  }
104
136
  },
105
137
  facet: {
@@ -630,7 +630,8 @@
630
630
  "type": "METAL_COORDINATION",
631
631
  "display": "bond",
632
632
  "color": "#aaaada",
633
- "title": "METAL COORDINATION"
633
+ "title": "METAL COORDINATION",
634
+ "ignore": true
634
635
  }, {
635
636
  "type": "COVALENT_BOND",
636
637
  "display": "bond",
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  export declare class MountableComponent {
3
- private readonly element;
3
+ private static readonly ROOT;
4
4
  private root;
5
5
  constructor(element: HTMLElement);
6
6
  render(node: ReactNode): void;
@@ -4,8 +4,12 @@ exports.MountableComponent = void 0;
4
4
  const client_1 = require("react-dom/client");
5
5
  class MountableComponent {
6
6
  constructor(element) {
7
- this.element = element;
8
- this.root = (0, client_1.createRoot)(this.element);
7
+ var _a;
8
+ if (MountableComponent.ROOT.has(element.id)) {
9
+ (_a = MountableComponent.ROOT.get(element.id)) === null || _a === void 0 ? void 0 : _a.unmount();
10
+ }
11
+ this.root = (0, client_1.createRoot)(element);
12
+ MountableComponent.ROOT.set(element.id, this.root);
9
13
  }
10
14
  render(node) {
11
15
  this.unmount();
@@ -16,3 +20,4 @@ class MountableComponent {
16
20
  }
17
21
  }
18
22
  exports.MountableComponent = MountableComponent;
23
+ MountableComponent.ROOT = new Map();
@@ -85,24 +85,56 @@ exports.TAXONOMY_COUNT_FACET = {
85
85
  title: "Number of Source Taxonomies",
86
86
  attributeName: "TAXONOMY_COUNT_FACET",
87
87
  attribute: SearchMetadata_1.RcsbSearchMetadata.RcsbPolymerEntity.RcsbSourceTaxonomyCount.path,
88
- chartType: ChartConfigInterface_1.ChartType.histogram,
89
- contentType: "number",
90
- chartConfig: {
91
- histogramBinIncrement: 0,
92
- tickFormat: {
93
- domAxis: (t) => {
94
- if (t.toString().includes('.'))
95
- return '';
96
- return t.toString();
97
- }
98
- },
99
- chartDisplayConfig: {
100
- constHeight: 225
88
+ chartType: ChartConfigInterface_1.ChartType.barplot,
89
+ contentType: "string",
90
+ facetConfig: {
91
+ facetTransform: (bucket) => {
92
+ const out = [];
93
+ const wt = bucket.find(b => parseInt(b.label.toString()) == 1);
94
+ if (wt)
95
+ out.push({
96
+ label: "Single",
97
+ labelPath: ["Single"],
98
+ population: wt.population
99
+ });
100
+ const synthetic = bucket.find(b => parseInt(b.label.toString()) == 0);
101
+ if (synthetic)
102
+ out.push({
103
+ label: "None",
104
+ labelPath: ["None"],
105
+ population: synthetic.population
106
+ });
107
+ const chimeric = bucket.filter(b => parseInt(b.label.toString()) > 1);
108
+ if ((chimeric === null || chimeric === void 0 ? void 0 : chimeric.length) > 0)
109
+ out.push({
110
+ label: "Multiple",
111
+ labelPath: ["Multiple"],
112
+ population: chimeric.reduce((c, p) => c + p.population, 0)
113
+ });
114
+ return out;
101
115
  },
102
- domainMinValue: 0,
103
- axisLabel: "Taxonomy count",
104
- tooltipText: (d) => {
105
- return `Taxonomy count ${d.x}`;
116
+ bucketClickSearchQuery: (datum, data, e) => {
117
+ if (datum.x == "Single")
118
+ return (0, SearchQueryTools_1.buildAttributeQuery)({
119
+ attribute: exports.TAXONOMY_COUNT_FACET.attribute,
120
+ value: 1,
121
+ operator: SearchEnums_1.Operator.Equals,
122
+ service: SearchEnums_1.Service.Text
123
+ });
124
+ else if (datum.x == "None")
125
+ return (0, SearchQueryTools_1.buildAttributeQuery)({
126
+ attribute: exports.TAXONOMY_COUNT_FACET.attribute,
127
+ value: 0,
128
+ operator: SearchEnums_1.Operator.Equals,
129
+ service: SearchEnums_1.Service.Text
130
+ });
131
+ else
132
+ return (0, SearchQueryTools_1.buildAttributeQuery)({
133
+ attribute: exports.TAXONOMY_COUNT_FACET.attribute,
134
+ value: 1,
135
+ operator: SearchEnums_1.Operator.Greater,
136
+ service: SearchEnums_1.Service.Text
137
+ });
106
138
  }
107
139
  },
108
140
  facet: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcsb/rcsb-saguaro-app",
3
- "version": "6.2.2",
3
+ "version": "6.2.4",
4
4
  "description": "RCSB 1D Saguaro Web App",
5
5
  "main": "build/app.js",
6
6
  "files": [