col-browser 2.2.1 → 2.2.2
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/README.md +1 -1
- package/es/chunks/DatasetlogoWithFallback-B9WXvNCA.js +24 -0
- package/es/chunks/DatasetlogoWithFallback-B9WXvNCA.js.map +1 -0
- package/es/chunks/{Distributions-CXIEJ6e6.js → Distributions-Cwl_75VG.js} +349 -348
- package/es/chunks/{Distributions-CXIEJ6e6.js.map → Distributions-Cwl_75VG.js.map} +1 -1
- package/es/chunks/{MetricsPresentation-U_CO8JoH.js → MetricsPresentation-DKCJQOtf.js} +2 -2
- package/es/chunks/{MetricsPresentation-U_CO8JoH.js.map → MetricsPresentation-DKCJQOtf.js.map} +1 -1
- package/es/chunks/{DatasetlogoWithFallback-CbP7vRs_.js → PresentationItem-C4yZ555-.js} +243 -262
- package/es/chunks/PresentationItem-C4yZ555-.js.map +1 -0
- package/es/sourceDataset.js +57 -56
- package/es/sourceDataset.js.map +1 -1
- package/es/sourceDatasetList.js +5 -4
- package/es/sourceDatasetList.js.map +1 -1
- package/es/taxon.js +18 -12
- package/es/taxon.js.map +1 -1
- package/es/taxonDistribution.js +1 -1
- package/es/tree.js +60 -57
- package/es/tree.js.map +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +6 -0
- package/umd/col-browser.js +121 -114
- package/umd/col-browser.js.map +1 -1
- package/umd/col-browser.min.js +4 -4
- package/umd/col-browser.min.js.map +1 -1
- package/es/chunks/DatasetlogoWithFallback-CbP7vRs_.js.map +0 -1
package/umd/col-browser.js
CHANGED
|
@@ -68681,7 +68681,10 @@ html body {
|
|
|
68681
68681
|
rootTotal,
|
|
68682
68682
|
rootLoading: false,
|
|
68683
68683
|
treeData: [...this.state.treeData, ...treeData],
|
|
68684
|
-
|
|
68684
|
+
// Nothing is auto-expanded by default. Consumers open a specific root
|
|
68685
|
+
// (or deep taxon) by passing `defaultTaxonKey`/`expandedTaxonKey` —
|
|
68686
|
+
// e.g. defaultTaxonKey="CS5HF" opens Eukaryota in current COL releases.
|
|
68687
|
+
expandedKeys: [],
|
|
68685
68688
|
error: null
|
|
68686
68689
|
},
|
|
68687
68690
|
() => {
|
|
@@ -77770,6 +77773,84 @@ html body {
|
|
|
77770
77773
|
] });
|
|
77771
77774
|
}
|
|
77772
77775
|
}
|
|
77776
|
+
const styles$1 = {
|
|
77777
|
+
tip: {
|
|
77778
|
+
color: "rgba(0,0,0,.45)",
|
|
77779
|
+
marginLeft: "4px"
|
|
77780
|
+
},
|
|
77781
|
+
icon: {
|
|
77782
|
+
marginTop: "4px"
|
|
77783
|
+
}
|
|
77784
|
+
};
|
|
77785
|
+
const Help = ({ title, classes }) => {
|
|
77786
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children: title && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.tip, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title, getPopupContainer: () => document.getElementsByClassName(`catalogue-of-life`)[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$k, { className: classes.icon }) }) }) });
|
|
77787
|
+
};
|
|
77788
|
+
const Help$1 = createWithStyles(styles$1)(Help);
|
|
77789
|
+
const styles = {
|
|
77790
|
+
formItem: {
|
|
77791
|
+
paddingBottom: 0,
|
|
77792
|
+
width: "100%",
|
|
77793
|
+
clear: "both",
|
|
77794
|
+
borderBottom: "1px solid #eee",
|
|
77795
|
+
"&:last-of-type": {
|
|
77796
|
+
border: "none"
|
|
77797
|
+
},
|
|
77798
|
+
"&>div": {
|
|
77799
|
+
paddingLeft: 10,
|
|
77800
|
+
paddingRight: 10
|
|
77801
|
+
}
|
|
77802
|
+
},
|
|
77803
|
+
label: {
|
|
77804
|
+
display: "block",
|
|
77805
|
+
color: "rgba(0, 0, 0, 0.85)"
|
|
77806
|
+
},
|
|
77807
|
+
content: {
|
|
77808
|
+
wordBreak: "break-word",
|
|
77809
|
+
marginBottom: 0
|
|
77810
|
+
},
|
|
77811
|
+
noContent: {
|
|
77812
|
+
wordBreak: "break-word",
|
|
77813
|
+
color: "#bbb",
|
|
77814
|
+
marginBottom: 0
|
|
77815
|
+
},
|
|
77816
|
+
contentCol: {
|
|
77817
|
+
wordBreak: "break-word"
|
|
77818
|
+
},
|
|
77819
|
+
smallMargin: {
|
|
77820
|
+
marginBottom: 3,
|
|
77821
|
+
marginTop: 3
|
|
77822
|
+
},
|
|
77823
|
+
mediumMargin: {
|
|
77824
|
+
marginBottom: 10,
|
|
77825
|
+
marginTop: 10
|
|
77826
|
+
}
|
|
77827
|
+
};
|
|
77828
|
+
const PresentationItem = ({ label, helpText, classes, children, width, md: md2, size }) => {
|
|
77829
|
+
const getValue2 = () => {
|
|
77830
|
+
let value;
|
|
77831
|
+
if (Array.isArray(children) && children.length > 0) {
|
|
77832
|
+
value = children.map((item, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.content, children: item }, i));
|
|
77833
|
+
} else if (!Array.isArray(children) && typeof children !== "undefined") {
|
|
77834
|
+
value = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.content, children });
|
|
77835
|
+
}
|
|
77836
|
+
return value;
|
|
77837
|
+
};
|
|
77838
|
+
const medium = md2 || 8;
|
|
77839
|
+
const mediumCol2 = medium < 24 ? 24 - medium : 24;
|
|
77840
|
+
const marginSize = size === "medium" ? classes.mediumMargin : classes.smallMargin;
|
|
77841
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { className: classes.formItem, children: [
|
|
77842
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { sm: 24, md: medium, style: width < MEDIUM ? { marginBottom: 0 } : {}, className: marginSize, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("dt", { className: classes.label, children: [
|
|
77843
|
+
label,
|
|
77844
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Help$1, { title: helpText })
|
|
77845
|
+
] }) }) }),
|
|
77846
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { sm: 24, md: mediumCol2, style: width < MEDIUM ? { marginTop: 0 } : {}, className: marginSize, children: getValue2() })
|
|
77847
|
+
] });
|
|
77848
|
+
};
|
|
77849
|
+
PresentationItem.propTypes = {
|
|
77850
|
+
label: PropTypes.string.isRequired,
|
|
77851
|
+
helpText: PropTypes.object
|
|
77852
|
+
};
|
|
77853
|
+
const PresentationItem$1 = withWidth()(createWithStyles(styles)(PresentationItem));
|
|
77773
77854
|
const INFRASPECIFIC_RANKS = [
|
|
77774
77855
|
"subspecies",
|
|
77775
77856
|
"variety",
|
|
@@ -78973,7 +79054,9 @@ html body {
|
|
|
78973
79054
|
showDistributionMap,
|
|
78974
79055
|
focalTaxon,
|
|
78975
79056
|
rankOrder,
|
|
78976
|
-
gbifChecklistKey
|
|
79057
|
+
gbifChecklistKey,
|
|
79058
|
+
label,
|
|
79059
|
+
md: md2
|
|
78977
79060
|
}) => {
|
|
78978
79061
|
const mappable = data.filter(isMappable);
|
|
78979
79062
|
const baseUnmappable = data.length - mappable.length;
|
|
@@ -79014,22 +79097,16 @@ html body {
|
|
|
79014
79097
|
const gbifAvailable = !hasGbifConfigured ? false : gbifCount === null || gbifCount > 0;
|
|
79015
79098
|
const allMappableFailed = mappable.length > 0 && fetchFailures >= mappable.length;
|
|
79016
79099
|
const showMap = showDistributionMap && (mappable.length > 0 || gbifAvailable) && !(mappable.length > 0 && allMappableFailed && !gbifAvailable);
|
|
79017
|
-
if (!showMap &&
|
|
79018
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: style2, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "#888" }, children: "No occurrence data on GBIF for this taxon." }) });
|
|
79019
|
-
}
|
|
79020
|
-
if (!showMap) {
|
|
79021
|
-
if (!hasAnyRecords) return null;
|
|
79022
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: style2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ListView, { datasetKey, data }) });
|
|
79023
|
-
}
|
|
79100
|
+
if (!showMap && !hasAnyRecords) return null;
|
|
79024
79101
|
const unmappable = baseUnmappable + fetchFailures;
|
|
79025
79102
|
const showToggle = hasAnyRecords;
|
|
79026
|
-
const activeView = showToggle ? view : "map";
|
|
79027
|
-
|
|
79103
|
+
const activeView = showMap && showToggle ? view : showMap ? "map" : "list";
|
|
79104
|
+
const body = activeView === "map" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
79028
79105
|
showToggle ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
79029
79106
|
Radio.Group,
|
|
79030
79107
|
{
|
|
79031
79108
|
size: "small",
|
|
79032
|
-
value:
|
|
79109
|
+
value: view,
|
|
79033
79110
|
onChange: (e2) => setView(e2.target.value),
|
|
79034
79111
|
style: { marginBottom: 8 },
|
|
79035
79112
|
children: [
|
|
@@ -79042,28 +79119,31 @@ html body {
|
|
|
79042
79119
|
// map's top edge lines up with the "Distributions" label.
|
|
79043
79120
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: 24, marginBottom: 8 } })
|
|
79044
79121
|
),
|
|
79045
|
-
|
|
79046
|
-
|
|
79047
|
-
|
|
79048
|
-
|
|
79049
|
-
|
|
79050
|
-
|
|
79051
|
-
|
|
79052
|
-
|
|
79053
|
-
|
|
79054
|
-
|
|
79055
|
-
|
|
79056
|
-
|
|
79057
|
-
|
|
79058
|
-
|
|
79059
|
-
|
|
79060
|
-
|
|
79061
|
-
|
|
79062
|
-
|
|
79063
|
-
|
|
79064
|
-
|
|
79065
|
-
|
|
79066
|
-
|
|
79122
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79123
|
+
DistributionsMap,
|
|
79124
|
+
{
|
|
79125
|
+
records: mappable,
|
|
79126
|
+
onUnmappable: setFetchFailures,
|
|
79127
|
+
datasetKey,
|
|
79128
|
+
focalTaxon,
|
|
79129
|
+
rankOrder,
|
|
79130
|
+
gbifChecklistKey,
|
|
79131
|
+
gbifAvailable
|
|
79132
|
+
}
|
|
79133
|
+
),
|
|
79134
|
+
showToggle && unmappable > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 6 }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { onClick: () => setView("list"), style: { cursor: "pointer" }, children: [
|
|
79135
|
+
"+",
|
|
79136
|
+
unmappable,
|
|
79137
|
+
" distribution",
|
|
79138
|
+
unmappable === 1 ? "" : "s",
|
|
79139
|
+
" not on map"
|
|
79140
|
+
] }) })
|
|
79141
|
+
] }) : (
|
|
79142
|
+
// List view: either the user toggled to it, or there is no map to show.
|
|
79143
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListView, { datasetKey, data })
|
|
79144
|
+
);
|
|
79145
|
+
const content = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: style2, children: body });
|
|
79146
|
+
return label ? /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md: md2, label, children: content }) : content;
|
|
79067
79147
|
};
|
|
79068
79148
|
const rankStyle = {
|
|
79069
79149
|
color: "rgba(0, 0, 0, 0.45)",
|
|
@@ -79080,84 +79160,6 @@ html body {
|
|
|
79080
79160
|
i < data.length - 1 && " >"
|
|
79081
79161
|
] }, t2.rank))
|
|
79082
79162
|
] });
|
|
79083
|
-
const styles$1 = {
|
|
79084
|
-
tip: {
|
|
79085
|
-
color: "rgba(0,0,0,.45)",
|
|
79086
|
-
marginLeft: "4px"
|
|
79087
|
-
},
|
|
79088
|
-
icon: {
|
|
79089
|
-
marginTop: "4px"
|
|
79090
|
-
}
|
|
79091
|
-
};
|
|
79092
|
-
const Help = ({ title, classes }) => {
|
|
79093
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children: title && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.tip, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title, getPopupContainer: () => document.getElementsByClassName(`catalogue-of-life`)[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$k, { className: classes.icon }) }) }) });
|
|
79094
|
-
};
|
|
79095
|
-
const Help$1 = createWithStyles(styles$1)(Help);
|
|
79096
|
-
const styles = {
|
|
79097
|
-
formItem: {
|
|
79098
|
-
paddingBottom: 0,
|
|
79099
|
-
width: "100%",
|
|
79100
|
-
clear: "both",
|
|
79101
|
-
borderBottom: "1px solid #eee",
|
|
79102
|
-
"&:last-of-type": {
|
|
79103
|
-
border: "none"
|
|
79104
|
-
},
|
|
79105
|
-
"&>div": {
|
|
79106
|
-
paddingLeft: 10,
|
|
79107
|
-
paddingRight: 10
|
|
79108
|
-
}
|
|
79109
|
-
},
|
|
79110
|
-
label: {
|
|
79111
|
-
display: "block",
|
|
79112
|
-
color: "rgba(0, 0, 0, 0.85)"
|
|
79113
|
-
},
|
|
79114
|
-
content: {
|
|
79115
|
-
wordBreak: "break-word",
|
|
79116
|
-
marginBottom: 0
|
|
79117
|
-
},
|
|
79118
|
-
noContent: {
|
|
79119
|
-
wordBreak: "break-word",
|
|
79120
|
-
color: "#bbb",
|
|
79121
|
-
marginBottom: 0
|
|
79122
|
-
},
|
|
79123
|
-
contentCol: {
|
|
79124
|
-
wordBreak: "break-word"
|
|
79125
|
-
},
|
|
79126
|
-
smallMargin: {
|
|
79127
|
-
marginBottom: 3,
|
|
79128
|
-
marginTop: 3
|
|
79129
|
-
},
|
|
79130
|
-
mediumMargin: {
|
|
79131
|
-
marginBottom: 10,
|
|
79132
|
-
marginTop: 10
|
|
79133
|
-
}
|
|
79134
|
-
};
|
|
79135
|
-
const PresentationItem = ({ label, helpText, classes, children, width, md: md2, size }) => {
|
|
79136
|
-
const getValue2 = () => {
|
|
79137
|
-
let value;
|
|
79138
|
-
if (Array.isArray(children) && children.length > 0) {
|
|
79139
|
-
value = children.map((item, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.content, children: item }, i));
|
|
79140
|
-
} else if (!Array.isArray(children) && typeof children !== "undefined") {
|
|
79141
|
-
value = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes.content, children });
|
|
79142
|
-
}
|
|
79143
|
-
return value;
|
|
79144
|
-
};
|
|
79145
|
-
const medium = md2 || 8;
|
|
79146
|
-
const mediumCol2 = medium < 24 ? 24 - medium : 24;
|
|
79147
|
-
const marginSize = size === "medium" ? classes.mediumMargin : classes.smallMargin;
|
|
79148
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { className: classes.formItem, children: [
|
|
79149
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { sm: 24, md: medium, style: width < MEDIUM ? { marginBottom: 0 } : {}, className: marginSize, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("dt", { className: classes.label, children: [
|
|
79150
|
-
label,
|
|
79151
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Help$1, { title: helpText })
|
|
79152
|
-
] }) }) }),
|
|
79153
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { sm: 24, md: mediumCol2, style: width < MEDIUM ? { marginTop: 0 } : {}, className: marginSize, children: getValue2() })
|
|
79154
|
-
] });
|
|
79155
|
-
};
|
|
79156
|
-
PresentationItem.propTypes = {
|
|
79157
|
-
label: PropTypes.string.isRequired,
|
|
79158
|
-
helpText: PropTypes.object
|
|
79159
|
-
};
|
|
79160
|
-
const PresentationItem$1 = withWidth()(createWithStyles(styles)(PresentationItem));
|
|
79161
79163
|
const getLabel = (r2, reverse) => {
|
|
79162
79164
|
if (!reverse) {
|
|
79163
79165
|
switch (r2.type) {
|
|
@@ -87571,10 +87573,15 @@ html body {
|
|
|
87571
87573
|
datasetKey: taxon.datasetKey
|
|
87572
87574
|
}
|
|
87573
87575
|
) }),
|
|
87574
|
-
(get(info, "distributions") || showDistributionMap && gbifChecklistKey && taxon) &&
|
|
87576
|
+
(get(info, "distributions") || showDistributionMap && gbifChecklistKey && taxon) && // Distributions owns its labelled block so it can hide entirely
|
|
87577
|
+
// (label included) when there is nothing to show — including after
|
|
87578
|
+
// the async GBIF occurrence lookup comes back empty.
|
|
87579
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87575
87580
|
DistributionsTable,
|
|
87576
87581
|
{
|
|
87577
87582
|
style: { marginTop: "-3px" },
|
|
87583
|
+
label: "Distributions",
|
|
87584
|
+
md,
|
|
87578
87585
|
data: (info == null ? void 0 : info.distributions) || [],
|
|
87579
87586
|
datasetKey,
|
|
87580
87587
|
showDistributionMap,
|
|
@@ -87582,7 +87589,7 @@ html body {
|
|
|
87582
87589
|
rankOrder: rank,
|
|
87583
87590
|
gbifChecklistKey
|
|
87584
87591
|
}
|
|
87585
|
-
)
|
|
87592
|
+
),
|
|
87586
87593
|
get(taxon, "environments") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Environment(s)", children: get(taxon, "environments").join(", ") }),
|
|
87587
87594
|
get(taxon, "remarks") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Additional Data", children: taxon.remarks }),
|
|
87588
87595
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Row, { children: get(taxon, "accordingTo") && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md: md * 2, label: "According to", children: [
|