synapse-react-client 4.0.22 → 4.0.24
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/SWC.index.js +1 -1
- package/dist/assets/icons/GeneticsIcon.d.ts +3 -0
- package/dist/assets/icons/GeneticsIcon.d.ts.map +1 -0
- package/dist/assets/icons/GeneticsIcon.js +14 -0
- package/dist/assets/icons/GeneticsIcon.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +49 -32
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts +18 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js +112 -0
- package/dist/components/GenericCard/DuoTermTags/DuoTermTags.js.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts +31 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.d.ts.map +1 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js +198 -0
- package/dist/components/GenericCard/DuoTermTags/duoTerms.js.map +1 -0
- package/dist/components/GenericCard/SynapseCardLabel.d.ts.map +1 -1
- package/dist/components/GenericCard/SynapseCardLabel.js +4 -8
- package/dist/components/GenericCard/SynapseCardLabel.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +6 -0
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +168 -153
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +19 -18
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/Plot/SynapsePlot.d.ts +4 -0
- package/dist/components/Plot/SynapsePlot.d.ts.map +1 -1
- package/dist/components/Plot/SynapsePlot.js +57 -44
- package/dist/components/Plot/SynapsePlot.js.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts +21 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationContext.js.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts +10 -0
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.d.ts.map +1 -1
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js +65 -59
- package/dist/components/QueryVisualizationWrapper/QueryVisualizationWrapper.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +2 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js +77 -34
- package/dist/components/QueryWrapperPlotNav/QueryWrapperSynapsePlot.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts +33 -6
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +93 -55
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts +3 -0
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js +39 -37
- package/dist/components/SearchQueryWrapper/SearchQueryWrapper.js.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts +3 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js +5 -0
- package/dist/components/SearchQueryWrapperPlotNav/SearchQueryWrapperPlotNav.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts +7 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +87 -51
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +0 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +1 -0
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +31 -22
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js +34 -20
- package/dist/components/entity/page/title_bar/EntityTitleBarVersionInfo.js.map +1 -1
- package/dist/components/favorites/FavoriteButton.d.ts +1 -0
- package/dist/components/favorites/FavoriteButton.d.ts.map +1 -1
- package/dist/components/favorites/FavoriteButton.js +8 -8
- package/dist/components/favorites/FavoriteButton.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.d.ts +8 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +50 -20
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/menu/DropdownMenu.d.ts +1 -0
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +24 -24
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/FacetNavPanel.js +59 -49
- package/dist/components/widgets/facet-nav/FacetNavPanel.js.map +1 -1
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts +25 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.d.ts.map +1 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js +40 -0
- package/dist/components/widgets/facet-nav/FacetValueChip.js.map +1 -0
- package/dist/components/widgets/facet-nav/PlotsContainer.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/PlotsContainer.js +8 -2
- package/dist/components/widgets/facet-nav/PlotsContainer.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts +10 -5
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js +10 -17
- package/dist/components/widgets/facet-nav/SelectionCriteriaPill.js.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.d.ts.map +1 -1
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js +11 -10
- package/dist/components/widgets/facet-nav/SelectionCriteriaPills.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js +70 -54
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilter.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts +2 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js +17 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterOption.js.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts +2 -0
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.d.ts.map +1 -1
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js +7 -7
- package/dist/components/widgets/query-filter/EnumFacetFilter/EnumFacetFilterUI.js.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.d.ts.map +1 -1
- package/dist/features/curator/dashboard/components/CurationTaskCard.js +99 -45
- package/dist/features/curator/dashboard/components/CurationTaskCard.js.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js +174 -149
- package/dist/features/entity/metadata-task/components/CreateOrUpdateCurationTaskDialog.js.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.d.ts +6 -0
- package/dist/features/entity/metadata-task/utils/constants.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/constants.js +19 -2
- package/dist/features/entity/metadata-task/utils/constants.js.map +1 -1
- package/dist/style/components/_total-query-results.scss +10 -34
- package/dist/style/components/facet_nav/_facet-nav-panel.scss +11 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.d.ts.map +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js +1 -1
- package/dist/synapse-queries/curation/task/useCurationTask.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -3,71 +3,84 @@ import { parseEntityIdFromSqlStatement as e } from "../../utils/functions/SqlFun
|
|
|
3
3
|
import "../../utils/index.js";
|
|
4
4
|
import { useGetFullTableQueryResults as t } from "../../synapse-queries/entity/useGetQueryResultBundle.js";
|
|
5
5
|
import "../../synapse-queries/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { unCamelCase as n } from "../../utils/functions/unCamelCase.js";
|
|
7
|
+
import { Plot as r } from "./Plot.js";
|
|
7
8
|
import './SynapsePlot.css';/* empty css */
|
|
8
9
|
import "react";
|
|
9
|
-
import { Skeleton as
|
|
10
|
-
import { Fragment as
|
|
10
|
+
import { Skeleton as i } from "@mui/material";
|
|
11
|
+
import { Fragment as a, jsx as o } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/Plot/SynapsePlot.tsx
|
|
12
|
-
var
|
|
13
|
-
let { query:
|
|
13
|
+
var s = (s) => {
|
|
14
|
+
let { query: c } = s.synapsePlotWidgetParams, { selectedFacets: l, additionalFilters: u, onCustomPlotClick: d, queryContext: f } = s.customPlotParams ?? {}, { data: p, isLoading: m } = t({
|
|
14
15
|
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest",
|
|
15
16
|
partMask: 1,
|
|
16
|
-
entityId: e(
|
|
17
|
+
entityId: e(c),
|
|
17
18
|
query: {
|
|
18
|
-
sql:
|
|
19
|
-
selectedFacets:
|
|
20
|
-
additionalFilters:
|
|
19
|
+
sql: c,
|
|
20
|
+
selectedFacets: l,
|
|
21
|
+
additionalFilters: u
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
|
-
if (
|
|
24
|
+
if (m) return /* @__PURE__ */ o(i, {
|
|
24
25
|
width: "100%",
|
|
25
26
|
height: "200px"
|
|
26
27
|
});
|
|
27
|
-
if (!
|
|
28
|
-
let { title:
|
|
29
|
-
showlegend:
|
|
30
|
-
title:
|
|
31
|
-
barmode:
|
|
28
|
+
if (!p) return /* @__PURE__ */ o(a, {});
|
|
29
|
+
let { title: h, xtitle: g, ytitle: _, type: v, xaxistype: y, showlegend: b, barmode: x, horizontal: S, displayModeBar: C, hoverinfo: w, hideYAxisTickLabels: T, hideXAxisTickLabels: E, footnote: D } = s.synapsePlotWidgetParams, O = { displayModeBar: C }, k = {
|
|
30
|
+
showlegend: b,
|
|
31
|
+
title: h,
|
|
32
|
+
barmode: x,
|
|
33
|
+
...D && { margin: { b: 40 } }
|
|
32
34
|
};
|
|
33
|
-
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
(g || E) && (k.xaxis = {
|
|
36
|
+
...g && { title: g },
|
|
37
|
+
...E && { showticklabels: !1 }
|
|
38
|
+
}), y && (k.xaxis = {
|
|
39
|
+
...k.xaxis,
|
|
40
|
+
type: y
|
|
41
|
+
}), (_ || T) && (k.yaxis = {
|
|
42
|
+
..._ && { title: _ },
|
|
43
|
+
...T && { showticklabels: !1 }
|
|
44
|
+
});
|
|
45
|
+
let A = [], j = S ? "h" : "v", M = p.queryResult?.queryResults.headers ?? [], N = p.queryResult?.queryResults.rows ?? [];
|
|
46
|
+
if (M.length == 0 || N.length == 0) return /* @__PURE__ */ o(a, {});
|
|
47
|
+
for (let e = 0; e < M.length - 1; e += 1) {
|
|
48
|
+
let t = M[e + 1].name, r = n(t.replace(/_/g, " ")), i = v === "bar" ? S ? `<b>%{y}</b><br>${r}: %{x:,}<extra></extra>` : `<b>%{x}</b><br>${r}: %{y:,}<extra></extra>` : void 0;
|
|
49
|
+
A[e] = {
|
|
50
|
+
orientation: j,
|
|
51
|
+
name: t,
|
|
52
|
+
type: v,
|
|
53
|
+
x: [],
|
|
54
|
+
y: [],
|
|
55
|
+
customdata: [],
|
|
56
|
+
...i !== void 0 && { hovertemplate: i },
|
|
57
|
+
...w !== void 0 && { hoverinfo: w }
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
for (let e of N) for (let t = 1; t < e.values.length; t += 1) {
|
|
61
|
+
let n = e.values, r = A[t - 1].x, i = A[t - 1].y, a = A[t - 1].customdata;
|
|
62
|
+
r.push(S ? n[t] : n[0]), i.push(S ? n[0] : n[t]), a.push(JSON.stringify(e));
|
|
51
63
|
}
|
|
52
|
-
let
|
|
53
|
-
return
|
|
54
|
-
|
|
64
|
+
let P;
|
|
65
|
+
return d && (P = (e) => {
|
|
66
|
+
d({
|
|
55
67
|
row: JSON.parse(e.points[0].customdata),
|
|
56
|
-
queryContext:
|
|
68
|
+
queryContext: f
|
|
57
69
|
});
|
|
58
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ o(r, {
|
|
59
71
|
style: {
|
|
60
72
|
width: "100%",
|
|
61
73
|
height: "450px"
|
|
62
74
|
},
|
|
63
|
-
className:
|
|
64
|
-
layout:
|
|
65
|
-
data:
|
|
66
|
-
config:
|
|
67
|
-
onClick:
|
|
75
|
+
className: P ? "SynapsePlot--clickable" : void 0,
|
|
76
|
+
layout: k,
|
|
77
|
+
data: A,
|
|
78
|
+
config: O,
|
|
79
|
+
onClick: P,
|
|
80
|
+
useResizeHandler: !0
|
|
68
81
|
});
|
|
69
82
|
};
|
|
70
83
|
//#endregion
|
|
71
|
-
export {
|
|
84
|
+
export { s as SynapsePlot, s as default };
|
|
72
85
|
|
|
73
86
|
//# sourceMappingURL=SynapsePlot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynapsePlot.js","names":[],"sources":["../../../src/components/Plot/SynapsePlot.tsx"],"sourcesContent":["import React from 'react'\nimport { useGetFullTableQueryResults } from '@/synapse-queries'\nimport { SynapseConstants } from '@/utils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport { Skeleton } from '@mui/material'\nimport {\n FacetColumnRequest,\n QueryBundleRequest,\n QueryFilter,\n Row,\n} from '@sage-bionetworks/synapse-types'\nimport Plotly, { AxisType, PlotType } from 'plotly.js-basic-dist'\nimport { QueryContextType } from '../QueryContext'\nimport { QueryWrapperSynapsePlotRowClickEvent } from '../QueryWrapperPlotNav/QueryWrapperSynapsePlot'\nimport Plot from './Plot'\nimport './SynapsePlot.scss'\n\nexport type SynapsePlotWidgetParams = {\n query: string //sql string\n title?: string //plot title\n xtitle?: Plotly.LayoutAxis['title'] // x-axis title\n ytitle?: Plotly.LayoutAxis['title'] // y-axis title\n type: PlotType\n xaxistype?: AxisType\n showlegend?: Plotly.Layout['showlegend'] // sets the legend visibility\n horizontal?: boolean // sets the if a bar chart should be horizontal or vertical\n barmode?: Plotly.Layout['barmode'] // Plotly barmode\n displayModeBar?: Plotly.Config['displayModeBar'] // sets the modebar visibility\n hoverinfo?: Plotly.PlotData['hoverinfo'] // sets the hover info\n}\n\n// QueryWrapperPlotNav customPlot parameters, undefined otherwise\nexport type QueryWrapperPlotNavCustomPlotParams = {\n selectedFacets: FacetColumnRequest[]\n additionalFilters: QueryFilter[]\n onCustomPlotClick?: (event: QueryWrapperSynapsePlotRowClickEvent) => void\n queryContext?: QueryContextType\n}\nexport type SynapsePlotProps = {\n synapsePlotWidgetParams: SynapsePlotWidgetParams\n customPlotParams?: QueryWrapperPlotNavCustomPlotParams\n}\n\nexport const SynapsePlot = (props: SynapsePlotProps): React.ReactNode => {\n const { query } = props.synapsePlotWidgetParams\n const { selectedFacets, additionalFilters, onCustomPlotClick, queryContext } =\n props.customPlotParams ?? {}\n const queryRequest: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n partMask: SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n entityId: parseEntityIdFromSqlStatement(query),\n query: {\n sql: query,\n selectedFacets,\n additionalFilters,\n },\n }\n const { data: queryData, isLoading } =\n useGetFullTableQueryResults(queryRequest)\n if (isLoading) {\n return <Skeleton width={'100%'} height={'200px'} />\n }\n if (!queryData) {\n return <></>\n }\n\n const {\n title,\n xtitle,\n ytitle,\n type,\n xaxistype,\n showlegend,\n barmode,\n horizontal,\n displayModeBar,\n hoverinfo,\n } = props.synapsePlotWidgetParams\n\n const config: Partial<Plotly.Config> = {\n displayModeBar,\n }\n const layout: Partial<Plotly.Layout> = {\n showlegend: showlegend,\n title,\n barmode: barmode,\n }\n if (xtitle) {\n layout.xaxis = {\n title: xtitle,\n }\n }\n if (xaxistype) {\n layout.xaxis = {\n ...layout.xaxis,\n type: xaxistype,\n }\n }\n if (ytitle) {\n layout.yaxis = {\n title: ytitle,\n }\n }\n // init plot_data\n const plotData: Partial<Plotly.PlotData>[] = []\n const orientation = horizontal ? 'h' : 'v'\n const headers = queryData.queryResult?.queryResults.headers ?? []\n const rows = queryData.queryResult?.queryResults.rows ?? []\n if (headers.length == 0 || rows.length == 0) {\n return <></>\n }\n for (let i = 0; i < headers.length - 1; i += 1) {\n // make an entry for each set of data points\n plotData[i] = {\n orientation,\n name:
|
|
1
|
+
{"version":3,"file":"SynapsePlot.js","names":[],"sources":["../../../src/components/Plot/SynapsePlot.tsx"],"sourcesContent":["import React from 'react'\nimport { useGetFullTableQueryResults } from '@/synapse-queries'\nimport { SynapseConstants } from '@/utils'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport { Skeleton } from '@mui/material'\nimport {\n FacetColumnRequest,\n QueryBundleRequest,\n QueryFilter,\n Row,\n} from '@sage-bionetworks/synapse-types'\nimport Plotly, { AxisType, PlotType } from 'plotly.js-basic-dist'\nimport { QueryContextType } from '../QueryContext'\nimport { QueryWrapperSynapsePlotRowClickEvent } from '../QueryWrapperPlotNav/QueryWrapperSynapsePlot'\nimport Plot from './Plot'\nimport { unCamelCase } from '@/utils/functions/unCamelCase'\nimport './SynapsePlot.scss'\n\nexport type SynapsePlotWidgetParams = {\n query: string //sql string\n title?: string //plot title\n xtitle?: Plotly.LayoutAxis['title'] // x-axis title\n ytitle?: Plotly.LayoutAxis['title'] // y-axis title\n type: PlotType\n xaxistype?: AxisType\n showlegend?: Plotly.Layout['showlegend'] // sets the legend visibility\n horizontal?: boolean // sets the if a bar chart should be horizontal or vertical\n barmode?: Plotly.Layout['barmode'] // Plotly barmode\n displayModeBar?: Plotly.Config['displayModeBar'] // sets the modebar visibility\n hoverinfo?: Plotly.PlotData['hoverinfo'] // sets the hover info\n hideYAxisTickLabels?: boolean // hides the y-axis tick labels\n hideXAxisTickLabels?: boolean // hides the x-axis tick labels\n footnote?: string // optional text displayed below the plot\n fullWidth?: boolean // forces the plot to take up the full container width\n}\n\n// QueryWrapperPlotNav customPlot parameters, undefined otherwise\nexport type QueryWrapperPlotNavCustomPlotParams = {\n selectedFacets: FacetColumnRequest[]\n additionalFilters: QueryFilter[]\n onCustomPlotClick?: (event: QueryWrapperSynapsePlotRowClickEvent) => void\n queryContext?: QueryContextType\n}\nexport type SynapsePlotProps = {\n synapsePlotWidgetParams: SynapsePlotWidgetParams\n customPlotParams?: QueryWrapperPlotNavCustomPlotParams\n}\n\nexport const SynapsePlot = (props: SynapsePlotProps): React.ReactNode => {\n const { query } = props.synapsePlotWidgetParams\n const { selectedFacets, additionalFilters, onCustomPlotClick, queryContext } =\n props.customPlotParams ?? {}\n const queryRequest: QueryBundleRequest = {\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n partMask: SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n entityId: parseEntityIdFromSqlStatement(query),\n query: {\n sql: query,\n selectedFacets,\n additionalFilters,\n },\n }\n const { data: queryData, isLoading } =\n useGetFullTableQueryResults(queryRequest)\n\n if (isLoading) {\n return <Skeleton width={'100%'} height={'200px'} />\n }\n if (!queryData) {\n return <></>\n }\n\n const {\n title,\n xtitle,\n ytitle,\n type,\n xaxistype,\n showlegend,\n barmode,\n horizontal,\n displayModeBar,\n hoverinfo,\n hideYAxisTickLabels,\n hideXAxisTickLabels,\n footnote,\n } = props.synapsePlotWidgetParams\n\n const config: Partial<Plotly.Config> = {\n displayModeBar,\n }\n const layout: Partial<Plotly.Layout> = {\n showlegend: showlegend,\n title,\n barmode: barmode,\n ...(footnote && { margin: { b: 40 } }),\n }\n if (xtitle || hideXAxisTickLabels) {\n layout.xaxis = {\n ...(xtitle && { title: xtitle }),\n ...(hideXAxisTickLabels && { showticklabels: false }),\n }\n }\n if (xaxistype) {\n layout.xaxis = {\n ...layout.xaxis,\n type: xaxistype,\n }\n }\n if (ytitle || hideYAxisTickLabels) {\n layout.yaxis = {\n ...(ytitle && { title: ytitle }),\n ...(hideYAxisTickLabels && { showticklabels: false }),\n }\n }\n // init plot_data\n const plotData: Partial<Plotly.PlotData>[] = []\n const orientation = horizontal ? 'h' : 'v'\n const headers = queryData.queryResult?.queryResults.headers ?? []\n const rows = queryData.queryResult?.queryResults.rows ?? []\n if (headers.length == 0 || rows.length == 0) {\n return <></>\n }\n for (let i = 0; i < headers.length - 1; i += 1) {\n // make an entry for each set of data points\n const valueColumnName = headers[i + 1].name\n const friendlyColumnName = unCamelCase(valueColumnName.replace(/_/g, ' '))\n const hovertemplate =\n type === 'bar'\n ? horizontal\n ? `<b>%{y}</b><br>${friendlyColumnName}: %{x:,}<extra></extra>`\n : `<b>%{x}</b><br>${friendlyColumnName}: %{y:,}<extra></extra>`\n : undefined\n plotData[i] = {\n orientation,\n name: valueColumnName,\n type: type,\n x: [],\n y: [],\n customdata: [],\n ...(hovertemplate !== undefined && { hovertemplate }),\n ...(hoverinfo !== undefined && { hoverinfo }),\n }\n }\n // grab all the data\n for (const row of rows) {\n for (let j = 1; j < row.values.length; j += 1) {\n // create pairs of data\n const rowValues = row.values\n const xArray = plotData[j - 1].x as Plotly.Datum[]\n const yArray = plotData[j - 1].y as Plotly.Datum[]\n const customdata = plotData[j - 1].customdata as Plotly.Datum[]\n\n xArray.push(horizontal ? rowValues[j] : rowValues[0])\n yArray.push(horizontal ? rowValues[0] : rowValues[j])\n customdata.push(JSON.stringify(row))\n }\n }\n let onPlotClick:\n | ((event: Readonly<Plotly.PlotMouseEvent>) => void)\n | undefined\n if (onCustomPlotClick) {\n onPlotClick = eventData => {\n const selectedRow = JSON.parse(\n eventData.points[0].customdata as string,\n ) as Row\n onCustomPlotClick({\n row: selectedRow,\n queryContext,\n })\n }\n }\n\n return (\n <Plot\n style={{ width: '100%', height: '450px' }}\n className={onPlotClick ? 'SynapsePlot--clickable' : undefined}\n layout={layout}\n data={plotData}\n config={config}\n onClick={onPlotClick}\n useResizeHandler={true}\n />\n )\n}\n\nexport default SynapsePlot\n"],"mappings":";;;;;;;;;;;;AAgDA,IAAa,KAAe,MAA6C;CACvE,IAAM,EAAE,aAAU,EAAM,yBAClB,EAAE,mBAAgB,sBAAmB,sBAAmB,oBAC5D,EAAM,oBAAoB,CAAC,GAWvB,EAAE,MAAM,GAAW,iBACvB,EAA4B;EAV5B,cAAc;EACd,UAAU;EACV,UAAU,EAA8B,CAAK;EAC7C,OAAO;GACL,KAAK;GACL;GACA;EACF;CAG4B,CAAY;CAE1C,IAAI,GACF,OAAO,kBAAC,GAAD;EAAU,OAAO;EAAQ,QAAQ;CAAU,CAAA;CAEpD,IAAI,CAAC,GACH,OAAO,kBAAA,GAAA,CAAI,CAAA;CAGb,IAAM,EACJ,UACA,WACA,WACA,SACA,cACA,eACA,YACA,eACA,mBACA,cACA,wBACA,wBACA,gBACE,EAAM,yBAEJ,IAAiC,EACrC,kBACF,GACM,IAAiC;EACzB;EACZ;EACS;EACT,GAAI,KAAY,EAAE,QAAQ,EAAE,GAAG,GAAG,EAAE;CACtC;CAaA,CAZI,KAAU,OACZ,EAAO,QAAQ;EACb,GAAI,KAAU,EAAE,OAAO,EAAO;EAC9B,GAAI,KAAuB,EAAE,gBAAgB,GAAM;CACrD,IAEE,MACF,EAAO,QAAQ;EACb,GAAG,EAAO;EACV,MAAM;CACR,KAEE,KAAU,OACZ,EAAO,QAAQ;EACb,GAAI,KAAU,EAAE,OAAO,EAAO;EAC9B,GAAI,KAAuB,EAAE,gBAAgB,GAAM;CACrD;CAGF,IAAM,IAAuC,CAAC,GACxC,IAAc,IAAa,MAAM,KACjC,IAAU,EAAU,aAAa,aAAa,WAAW,CAAC,GAC1D,IAAO,EAAU,aAAa,aAAa,QAAQ,CAAC;CAC1D,IAAI,EAAQ,UAA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ch, PropsWithChildren, ReactNode, SetStateAction } from 'react';
|
|
4
4
|
import { ExternalAnalysisPlatform } from '../SynapseTable/export/ExternalAnalysisPlatformsConstants';
|
|
5
|
+
/**
|
|
6
|
+
* Structured rendering for a single facet value, returned by `renderFacetValue`.
|
|
7
|
+
* Consumers (the facet sidebar, active-filter pills) render this through the
|
|
8
|
+
* shared `FacetValueChip`, so styling, tooltip, and the remove affordance stay
|
|
9
|
+
* consistent and live in one place rather than in each renderer.
|
|
10
|
+
*/
|
|
11
|
+
export type RenderedFacetValueChip = {
|
|
12
|
+
/** The chip label. */
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
/** Optional tooltip content. */
|
|
15
|
+
tooltipTitle?: ReactNode;
|
|
16
|
+
/** Optional leading icon. */
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
};
|
|
5
19
|
export type QueryVisualizationContextType = {
|
|
6
20
|
columnsToShowInTable: string[];
|
|
7
21
|
setColumnsToShowInTable: (newState: string[]) => void;
|
|
@@ -15,6 +29,13 @@ export type QueryVisualizationContextType = {
|
|
|
15
29
|
getHelpText: (columnName: string, jsonPath?: string) => string | undefined;
|
|
16
30
|
/** Given a cell value and a column type, returns the displayed value for the data */
|
|
17
31
|
getDisplayValue: (value: string, columnType: ColumnType) => string;
|
|
32
|
+
/**
|
|
33
|
+
* Optional custom renderer for enumeration facet values, keyed by column. When
|
|
34
|
+
* it returns structured content for a (columnName, value), that content is
|
|
35
|
+
* rendered as a chip in the facet filter and the active-filter ("selected
|
|
36
|
+
* criteria") pills. Returning undefined falls back to the plain text label.
|
|
37
|
+
*/
|
|
38
|
+
renderFacetValue?: (columnName: string, value: string) => RenderedFacetValueChip | undefined;
|
|
18
39
|
/** React node to display in place of cards/table when there are no results. */
|
|
19
40
|
NoContentPlaceholder: () => ReactNode;
|
|
20
41
|
/** The set of external analysis platforms where this component allows users to export data. If this list is empty, then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryVisualizationContext.d.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AA;IACrD,oBAAoB,EAAE,OAAO,CAAA;IAC7B,gGAAgG;IAChG,8BAA8B,EAAE,OAAO,CAAA;IACvC,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,wBAAwB,EAAE,OAAO,CAAA;IACjC,2BAA2B,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9D,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,mBAAmB,EAAE,OAAO,CAAA;IAC5B,sBAAsB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACzD,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;CAChD,CAAA;AACD;;GAEG;AACH,eAAO,MAAM,yBAAyB,0DAE1B,CAAA;AACZ,MAAM,MAAM,sCAAsC,GAAG,iBAAiB,CAAC;IACrE,yBAAyB,EAAE,6BAA6B,CAAA;CACzD,CAAC,CAAA;AACF;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAAI,0CAG/C,sCAAsC,KAAG,KAAK,CAAC,SAMjD,CAAA;AAED,wBAAgB,4BAA4B,IAAI,6BAA6B,CAQ5E;AAED,eAAO,MAAM,iCAAiC,2DACV,CAAA"}
|
|
1
|
+
{"version":3,"file":"QueryVisualizationContext.d.ts","sourceRoot":"","sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAEL,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,cAAc,EAEf,MAAM,OAAO,CAAA;AACd,OAAO,EAAE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xB,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACrD,oBAAoB,EAAE,OAAO,CAAA;IAC7B,gGAAgG;IAChG,8BAA8B,EAAE,OAAO,CAAA;IACvC,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,wBAAwB,EAAE,OAAO,CAAA;IACjC,2BAA2B,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9D,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,mBAAmB,EAAE,OAAO,CAAA;IAC5B,sBAAsB,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IACzD,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;CAChD,CAAA;AACD;;GAEG;AACH,eAAO,MAAM,yBAAyB,0DAE1B,CAAA;AACZ,MAAM,MAAM,sCAAsC,GAAG,iBAAiB,CAAC;IACrE,yBAAyB,EAAE,6BAA6B,CAAA;CACzD,CAAC,CAAA;AACF;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAAI,0CAG/C,sCAAsC,KAAG,KAAK,CAAC,SAMjD,CAAA;AAED,wBAAgB,4BAA4B,IAAI,6BAA6B,CAQ5E;AAED,eAAO,MAAM,iCAAiC,2DACV,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryVisualizationContext.js","names":[],"sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationContext.tsx"],"sourcesContent":["import React from 'react'\nimport { ColumnType } from '@sage-bionetworks/synapse-types'\nimport {\n createContext,\n Dispatch,\n PropsWithChildren,\n ReactNode,\n SetStateAction,\n useContext,\n} from 'react'\nimport { ExternalAnalysisPlatform } from '../SynapseTable/export/ExternalAnalysisPlatformsConstants'\n\nexport type QueryVisualizationContextType = {\n columnsToShowInTable: string[]\n setColumnsToShowInTable: (newState: string[]) => void\n rgbIndex?: number\n unitDescription: string\n /** Whether to show when the table or view was last updated. */\n showLastUpdatedOn?: boolean\n /** Given a column name, return the display name for the column */\n getColumnDisplayName: (columnName: string, jsonPath?: string) => string\n /** Given a column name or JSON facet, return the configured help text */\n getHelpText: (columnName: string, jsonPath?: string) => string | undefined\n /** Given a cell value and a column type, returns the displayed value for the data */\n getDisplayValue: (value: string, columnType: ColumnType) => string\n /** React node to display in place of cards/table when there are no results. */\n NoContentPlaceholder: () => ReactNode\n /** The set of external analysis platforms where this component allows users to export data. If this list is empty, then\n * controls will not be shown. */\n enabledExternalAnalysisPlatforms: ExternalAnalysisPlatform[]\n /** If true, a dialog guiding the user through exporting table query data to an external platform is shown. If this\n * is true, enabledExternalAnalysisPlatforms must be non-empty */\n isShowingExportToAnalysisPlatformModal: boolean\n /** Allows toggling isShowingExportToAnalysisPlatformModal */\n setIsShowingExportToAnalysisPlatformModal: Dispatch<SetStateAction<boolean>>\n showFacetFilter: boolean\n setShowFacetFilter: Dispatch<SetStateAction<boolean>>\n hideSearchBarControl: boolean\n /** When true, the text matches filter pill is shown but cannot be removed. Defaults to true. */\n lockTextMatchesQueryFilterPill: boolean\n showSearchBar: boolean\n setShowSearchBar: Dispatch<SetStateAction<boolean>>\n showDownloadConfirmation: boolean\n setShowDownloadConfirmation: Dispatch<SetStateAction<boolean>>\n showSqlEditor: boolean\n setShowSqlEditor: Dispatch<SetStateAction<boolean>>\n showCopyToClipboard: boolean\n setShowCopyToClipboard: Dispatch<SetStateAction<boolean>>\n showPlots: boolean\n setShowPlots: Dispatch<SetStateAction<boolean>>\n}\n/**\n * This must be exported to use the context in class components.\n */\nexport const QueryVisualizationContext = createContext<\n QueryVisualizationContextType | undefined\n>(undefined)\nexport type QueryVisualizationContextProviderProps = PropsWithChildren<{\n queryVisualizationContext: QueryVisualizationContextType\n}>\n/**\n * Provides fields and functions related to visualizing a Synapse table query. For actual query data, see QueryContextProvider.\n */\nexport const QueryVisualizationContextProvider = ({\n children,\n queryVisualizationContext,\n}: QueryVisualizationContextProviderProps): React.ReactNode => {\n return (\n <QueryVisualizationContext.Provider value={queryVisualizationContext}>\n {children}\n </QueryVisualizationContext.Provider>\n )\n}\n\nexport function useQueryVisualizationContext(): QueryVisualizationContextType {\n const context = useContext(QueryVisualizationContext)\n if (context === undefined) {\n throw new Error(\n 'useQueryVisualizationContext must be used within a QueryVisualizationWrapper',\n )\n }\n return context\n}\n\nexport const QueryVisualizationContextConsumer =\n QueryVisualizationContext.Consumer\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"QueryVisualizationContext.js","names":[],"sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationContext.tsx"],"sourcesContent":["import React from 'react'\nimport { ColumnType } from '@sage-bionetworks/synapse-types'\nimport {\n createContext,\n Dispatch,\n PropsWithChildren,\n ReactNode,\n SetStateAction,\n useContext,\n} from 'react'\nimport { ExternalAnalysisPlatform } from '../SynapseTable/export/ExternalAnalysisPlatformsConstants'\n\n/**\n * Structured rendering for a single facet value, returned by `renderFacetValue`.\n * Consumers (the facet sidebar, active-filter pills) render this through the\n * shared `FacetValueChip`, so styling, tooltip, and the remove affordance stay\n * consistent and live in one place rather than in each renderer.\n */\nexport type RenderedFacetValueChip = {\n /** The chip label. */\n label: ReactNode\n /** Optional tooltip content. */\n tooltipTitle?: ReactNode\n /** Optional leading icon. */\n icon?: ReactNode\n}\n\nexport type QueryVisualizationContextType = {\n columnsToShowInTable: string[]\n setColumnsToShowInTable: (newState: string[]) => void\n rgbIndex?: number\n unitDescription: string\n /** Whether to show when the table or view was last updated. */\n showLastUpdatedOn?: boolean\n /** Given a column name, return the display name for the column */\n getColumnDisplayName: (columnName: string, jsonPath?: string) => string\n /** Given a column name or JSON facet, return the configured help text */\n getHelpText: (columnName: string, jsonPath?: string) => string | undefined\n /** Given a cell value and a column type, returns the displayed value for the data */\n getDisplayValue: (value: string, columnType: ColumnType) => string\n /**\n * Optional custom renderer for enumeration facet values, keyed by column. When\n * it returns structured content for a (columnName, value), that content is\n * rendered as a chip in the facet filter and the active-filter (\"selected\n * criteria\") pills. Returning undefined falls back to the plain text label.\n */\n renderFacetValue?: (\n columnName: string,\n value: string,\n ) => RenderedFacetValueChip | undefined\n /** React node to display in place of cards/table when there are no results. */\n NoContentPlaceholder: () => ReactNode\n /** The set of external analysis platforms where this component allows users to export data. If this list is empty, then\n * controls will not be shown. */\n enabledExternalAnalysisPlatforms: ExternalAnalysisPlatform[]\n /** If true, a dialog guiding the user through exporting table query data to an external platform is shown. If this\n * is true, enabledExternalAnalysisPlatforms must be non-empty */\n isShowingExportToAnalysisPlatformModal: boolean\n /** Allows toggling isShowingExportToAnalysisPlatformModal */\n setIsShowingExportToAnalysisPlatformModal: Dispatch<SetStateAction<boolean>>\n showFacetFilter: boolean\n setShowFacetFilter: Dispatch<SetStateAction<boolean>>\n hideSearchBarControl: boolean\n /** When true, the text matches filter pill is shown but cannot be removed. Defaults to true. */\n lockTextMatchesQueryFilterPill: boolean\n showSearchBar: boolean\n setShowSearchBar: Dispatch<SetStateAction<boolean>>\n showDownloadConfirmation: boolean\n setShowDownloadConfirmation: Dispatch<SetStateAction<boolean>>\n showSqlEditor: boolean\n setShowSqlEditor: Dispatch<SetStateAction<boolean>>\n showCopyToClipboard: boolean\n setShowCopyToClipboard: Dispatch<SetStateAction<boolean>>\n showPlots: boolean\n setShowPlots: Dispatch<SetStateAction<boolean>>\n}\n/**\n * This must be exported to use the context in class components.\n */\nexport const QueryVisualizationContext = createContext<\n QueryVisualizationContextType | undefined\n>(undefined)\nexport type QueryVisualizationContextProviderProps = PropsWithChildren<{\n queryVisualizationContext: QueryVisualizationContextType\n}>\n/**\n * Provides fields and functions related to visualizing a Synapse table query. For actual query data, see QueryContextProvider.\n */\nexport const QueryVisualizationContextProvider = ({\n children,\n queryVisualizationContext,\n}: QueryVisualizationContextProviderProps): React.ReactNode => {\n return (\n <QueryVisualizationContext.Provider value={queryVisualizationContext}>\n {children}\n </QueryVisualizationContext.Provider>\n )\n}\n\nexport function useQueryVisualizationContext(): QueryVisualizationContextType {\n const context = useContext(QueryVisualizationContext)\n if (context === undefined) {\n throw new Error(\n 'useQueryVisualizationContext must be used within a QueryVisualizationWrapper',\n )\n }\n return context\n}\n\nexport const QueryVisualizationContextConsumer =\n QueryVisualizationContext.Consumer\n"],"mappings":";;;AA+EA,IAAa,IAA4B,EAEvC,KAAA,CAAS,GAOE,KAAqC,EAChD,aACA,mCAGE,kBAAC,EAA0B,UAA3B;CAAoC,OAAO;CACxC;AACiC,CAAA;AAIxC,SAAgB,IAA8D;CAC5E,IAAM,IAAU,EAAW,CAAyB;CACpD,IAAI,MAAY,KAAA,GACd,MAAU,MACR,8EACF;CAEF,OAAO;AACT;AAEA,IAAa,IACX,EAA0B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { NoContentPlaceholderType } from '../SynapseTable/NoContentPlaceholderType';
|
|
3
3
|
import { ExternalAnalysisPlatform } from '../SynapseTable/export/ExternalAnalysisPlatformsConstants';
|
|
4
|
+
import { RenderedFacetValueChip } from './QueryVisualizationContext';
|
|
4
5
|
type ColumnOrFacetHelpConfig = {
|
|
5
6
|
/** Text that describes the column or facet */
|
|
6
7
|
helpText: string;
|
|
@@ -16,6 +17,15 @@ export type QueryVisualizationWrapperProps = {
|
|
|
16
17
|
unitDescription?: string;
|
|
17
18
|
/** Mapping from column name to the name that should be shown for the column */
|
|
18
19
|
columnAliases?: Record<string, string>;
|
|
20
|
+
/** Optional custom renderer for enumeration facet values (see context). */
|
|
21
|
+
renderFacetValue?: (columnName: string, value: string) => RenderedFacetValueChip | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Column name of a STRING_LIST of Data Use Ontology (DUO) values. When set,
|
|
24
|
+
* that column's facet values and active-filter pills are automatically
|
|
25
|
+
* rendered as DUO tags, so portals don't need to supply their own
|
|
26
|
+
* `renderFacetValue` handler. An explicit `renderFacetValue` takes precedence.
|
|
27
|
+
*/
|
|
28
|
+
dataUseModifiersColumnName?: string;
|
|
19
29
|
visibleColumnCount?: number;
|
|
20
30
|
hiddenColumns?: string[];
|
|
21
31
|
defaultShowPlots?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryVisualizationWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAA6C,MAAM,OAAO,CAAA;AAI5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAA;
|
|
1
|
+
{"version":3,"file":"QueryVisualizationWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAA6C,MAAM,OAAO,CAAA;AAI5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAA;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAA;AAGpG,OAAO,EAGL,sBAAsB,EACvB,MAAM,6BAA6B,CAAA;AAKpC,KAAK,uBAAuB,GAAG;IAC7B,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uGAAuG;IACvG,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,KACV,sBAAsB,GAAG,SAAS,CAAA;IACvC;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,gGAAgG;IAChG,8BAA8B,CAAC,EAAE,OAAO,CAAA;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,6BAA6B;IAC7B,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;IACnD,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAA;IACjC;mEAC+D;IAC/D,kCAAkC,CAAC,EAAE,MAAM,CAAA;IAC3C,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,uBAAuB,EAAE,CAAA;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;gDAC4C;IAC5C,gCAAgC,CAAC,EAAE,wBAAwB,EAAE,CAAA;IAC7D,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,2CAmOtC"}
|
|
@@ -4,103 +4,109 @@ import "../QueryContext/index.js";
|
|
|
4
4
|
import { getDisplayValue as n } from "../../utils/functions/getDataFromFromStorage.js";
|
|
5
5
|
import { unCamelCase as r } from "../../utils/functions/unCamelCase.js";
|
|
6
6
|
import { useGetQueryMetadata as i } from "../QueryWrapper/useGetQueryMetadata.js";
|
|
7
|
-
import { NoContentPlaceholderType as
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { NoContentPlaceholderType as ee } from "../SynapseTable/NoContentPlaceholderType.js";
|
|
8
|
+
import a from "./NoContentPlaceholder.js";
|
|
9
|
+
import { createDuoFacetValueRenderer as o } from "../GenericCard/DuoTermTags/DuoTermTags.js";
|
|
10
|
+
import { QueryVisualizationContextProvider as te } from "./QueryVisualizationContext.js";
|
|
11
|
+
import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
12
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
13
|
+
import { useQuery as ne } from "@tanstack/react-query";
|
|
13
14
|
import { useDeepCompareMemoize as f } from "use-deep-compare-effect";
|
|
14
15
|
//#region src/components/QueryVisualizationWrapper/QueryVisualizationWrapper.tsx
|
|
15
16
|
var p = [];
|
|
16
17
|
function m(m) {
|
|
17
|
-
let { noContentPlaceholderType: h =
|
|
18
|
-
|
|
18
|
+
let { noContentPlaceholderType: h = ee.INTERACTIVE, defaultShowSearchBar: g = !1, defaultShowPlots: _ = !0, hideCopyToClipboard: v = !1, hideSearchBarControl: y = !1, lockTextMatchesQueryFilterPill: b = !0, unitDescription: x = "result", helpConfiguration: S, hasCustomPlots: C = !1, visibleColumnCount: w = Infinity, enabledExternalAnalysisPlatforms: T = p } = m, E = l(() => m.columnAliases ?? {}, [m.columnAliases]), D = l(() => {
|
|
19
|
+
if (m.renderFacetValue) return m.renderFacetValue;
|
|
20
|
+
if (m.dataUseModifiersColumnName) return o(m.dataUseModifiersColumnName);
|
|
21
|
+
}, [m.renderFacetValue, m.dataUseModifiersColumnName]), { getCurrentQueryRequest: O, hasFacetedSelectColumn: k, hasResettableFilters: A, rowDataQueryOptions: j } = t(), { data: M } = i(), { data: N } = ne({
|
|
22
|
+
...j,
|
|
19
23
|
select: (e) => e.responseBody?.queryResult?.queryResults.headers,
|
|
20
24
|
placeholderData: (e) => e
|
|
21
|
-
}), { data:
|
|
25
|
+
}), { data: re } = i({
|
|
22
26
|
select: (e) => e.responseBody?.selectColumns,
|
|
23
27
|
placeholderData: (e) => e
|
|
24
|
-
}),
|
|
25
|
-
|
|
28
|
+
}), P = f(N ?? re ?? []), [F, ie] = u(!1), [I, L] = u(_), [R, z] = u(!v), [B, V] = u(!0), [H, U, W, G] = e(g && !y, !1), [K, q] = u(!1), [J, Y] = u([]), ae = l(() => O(), [O]), X = f(m.hiddenColumns ?? []);
|
|
29
|
+
c(() => {
|
|
26
30
|
let e = new Set(X);
|
|
27
|
-
|
|
31
|
+
Y(P.filter((t) => !e.has(t.name)).slice(0, w).map((e) => e.name));
|
|
28
32
|
}, [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
P,
|
|
34
|
+
ae.query.sql,
|
|
35
|
+
w,
|
|
32
36
|
X
|
|
33
37
|
]);
|
|
34
38
|
let Z = s((e, t) => {
|
|
35
39
|
let n = typeof localStorage < "u" && localStorage.getItem("force-display-original-column-names") === "true";
|
|
36
40
|
if (!e || n && !t) return e;
|
|
37
|
-
if (
|
|
41
|
+
if (E[e]) return E[e];
|
|
38
42
|
if (t) {
|
|
39
|
-
let n =
|
|
43
|
+
let n = M?.columnModels?.find((t) => t.name === e);
|
|
40
44
|
if (n?.jsonSubColumns) {
|
|
41
45
|
let e = n.jsonSubColumns.find((e) => e.jsonPath === t);
|
|
42
46
|
if (e) return e.name;
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
return r(e);
|
|
46
|
-
}, [
|
|
47
|
-
if (Array.isArray(
|
|
48
|
-
}, [
|
|
50
|
+
}, [E, M?.columnModels]), Q = s((e, t) => {
|
|
51
|
+
if (Array.isArray(S)) return S.find((n) => n.columnName === e && n.jsonPath === t)?.helpText;
|
|
52
|
+
}, [S]), $ = s(() => /* @__PURE__ */ d(a, {
|
|
49
53
|
type: h,
|
|
50
|
-
hasResettableFilters:
|
|
51
|
-
}), [h,
|
|
52
|
-
columnsToShowInTable:
|
|
53
|
-
setColumnsToShowInTable:
|
|
54
|
+
hasResettableFilters: A
|
|
55
|
+
}), [h, A]), oe = l(() => ({
|
|
56
|
+
columnsToShowInTable: J,
|
|
57
|
+
setColumnsToShowInTable: Y,
|
|
54
58
|
rgbIndex: m.rgbIndex,
|
|
55
|
-
unitDescription:
|
|
59
|
+
unitDescription: x,
|
|
56
60
|
showLastUpdatedOn: m.showLastUpdatedOn,
|
|
57
61
|
getColumnDisplayName: Z,
|
|
58
62
|
getDisplayValue: n,
|
|
63
|
+
renderFacetValue: D,
|
|
59
64
|
getHelpText: Q,
|
|
60
65
|
NoContentPlaceholder: $,
|
|
61
|
-
isShowingExportToAnalysisPlatformModal:
|
|
62
|
-
setIsShowingExportToAnalysisPlatformModal:
|
|
63
|
-
showFacetFilter:
|
|
64
|
-
setShowFacetFilter:
|
|
65
|
-
hideSearchBarControl:
|
|
66
|
-
lockTextMatchesQueryFilterPill:
|
|
67
|
-
showSearchBar:
|
|
68
|
-
setShowSearchBar:
|
|
69
|
-
showDownloadConfirmation:
|
|
70
|
-
setShowDownloadConfirmation:
|
|
71
|
-
showSqlEditor:
|
|
72
|
-
setShowSqlEditor:
|
|
73
|
-
showPlots:
|
|
74
|
-
setShowPlots:
|
|
75
|
-
showCopyToClipboard:
|
|
76
|
-
setShowCopyToClipboard:
|
|
77
|
-
enabledExternalAnalysisPlatforms:
|
|
66
|
+
isShowingExportToAnalysisPlatformModal: K,
|
|
67
|
+
setIsShowingExportToAnalysisPlatformModal: q,
|
|
68
|
+
showFacetFilter: k ? B : !1,
|
|
69
|
+
setShowFacetFilter: V,
|
|
70
|
+
hideSearchBarControl: y,
|
|
71
|
+
lockTextMatchesQueryFilterPill: b,
|
|
72
|
+
showSearchBar: H,
|
|
73
|
+
setShowSearchBar: U,
|
|
74
|
+
showDownloadConfirmation: W,
|
|
75
|
+
setShowDownloadConfirmation: G,
|
|
76
|
+
showSqlEditor: F,
|
|
77
|
+
setShowSqlEditor: ie,
|
|
78
|
+
showPlots: C || k ? I : !1,
|
|
79
|
+
setShowPlots: L,
|
|
80
|
+
showCopyToClipboard: R,
|
|
81
|
+
setShowCopyToClipboard: z,
|
|
82
|
+
enabledExternalAnalysisPlatforms: T
|
|
78
83
|
}), [
|
|
79
84
|
$,
|
|
80
85
|
Z,
|
|
81
86
|
Q,
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
k,
|
|
88
|
+
K,
|
|
84
89
|
m.rgbIndex,
|
|
85
90
|
m.showLastUpdatedOn,
|
|
91
|
+
D,
|
|
92
|
+
G,
|
|
93
|
+
U,
|
|
94
|
+
R,
|
|
86
95
|
W,
|
|
96
|
+
B,
|
|
97
|
+
I,
|
|
87
98
|
H,
|
|
88
|
-
L,
|
|
89
|
-
U,
|
|
90
|
-
z,
|
|
91
99
|
F,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
queryVisualizationContext: ie,
|
|
103
|
-
children: ae
|
|
100
|
+
x,
|
|
101
|
+
J,
|
|
102
|
+
C,
|
|
103
|
+
T,
|
|
104
|
+
y,
|
|
105
|
+
b
|
|
106
|
+
]), { children: se } = m;
|
|
107
|
+
return /* @__PURE__ */ d(te, {
|
|
108
|
+
queryVisualizationContext: oe,
|
|
109
|
+
children: se
|
|
104
110
|
});
|
|
105
111
|
}
|
|
106
112
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryVisualizationWrapper.js","names":[],"sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationWrapper.tsx"],"sourcesContent":["import { getDisplayValue } from '@/utils/functions/getDataFromFromStorage'\nimport { unCamelCase } from '@/utils/functions/unCamelCase'\nimport useMutuallyExclusiveState from '@/utils/hooks/useMutuallyExclusiveState'\nimport { useQuery } from '@tanstack/react-query'\nimport { ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { useDeepCompareMemoize } from 'use-deep-compare-effect'\nimport { useQueryContext } from '../QueryContext'\nimport { useGetQueryMetadata } from '../QueryWrapper/useGetQueryMetadata'\nimport { NoContentPlaceholderType } from '../SynapseTable/NoContentPlaceholderType'\nimport { ExternalAnalysisPlatform } from '../SynapseTable/export/ExternalAnalysisPlatformsConstants'\nimport NoContentPlaceholderComponent from './NoContentPlaceholder'\nimport {\n QueryVisualizationContextProvider,\n QueryVisualizationContextType,\n} from './QueryVisualizationContext'\n\n// By default, show no external analysis platforms.\nconst DEFAULT_ENABLED_ANALYSIS_PLATFORMS: ExternalAnalysisPlatform[] = []\n\ntype ColumnOrFacetHelpConfig = {\n /** Text that describes the column or facet */\n helpText: string\n /** The name of the column for which the markdown applies */\n columnName: string\n /** The JSON path matching a described JSON Column facet */\n jsonPath?: string\n}\n\nexport type QueryVisualizationWrapperProps = {\n children: ReactNode | ReactNode[]\n rgbIndex?: number\n /** The singular word to use to describe a what a row represents (e.g. \"file\"). Defaults to \"result\" */\n unitDescription?: string\n /** Mapping from column name to the name that should be shown for the column */\n columnAliases?: Record<string, string>\n visibleColumnCount?: number\n hiddenColumns?: string[]\n defaultShowPlots?: boolean\n hideCopyToClipboard?: boolean\n hideSearchBarControl?: boolean\n /** When true, the text matches filter pill is shown but cannot be removed. Defaults to true. */\n lockTextMatchesQueryFilterPill?: boolean\n defaultShowSearchBar?: boolean\n showLastUpdatedOn?: boolean\n /** Default is INTERACTIVE */\n noContentPlaceholderType?: NoContentPlaceholderType\n isRowSelectionVisible?: boolean\n /** The set of columns that defines a uniqueness constraint on the table for the purposes of filtering based on row selection.\n * Note that Synapse tables have no internal concept of a primary key.\n */\n rowSelectionPrimaryKey?: string[]\n /** Look for additional filters using the given key. If not provided, the entity ID will be used.\n * @deprecated - configure the filter before passing a query */\n additionalFiltersSessionStorageKey?: string\n /** Configuration to add a help popover to each corresponding column header */\n helpConfiguration?: ColumnOrFacetHelpConfig[]\n hasCustomPlots?: boolean\n /** The set of external analysis platform to which the UI will support exporting data.\n * @default [] (no platforms are enabled) */\n enabledExternalAnalysisPlatforms?: ExternalAnalysisPlatform[]\n hideVisualizationsControl?: boolean\n}\n\n/**\n * QueryVisualizationWrapper manages UI state for components that query tables in Synapse. That state can be accessed\n * or updated using QueryVisualizationContext. A QueryVisualizationWrapper must be used within a QueryWrapper.\n */\nexport function QueryVisualizationWrapper(\n props: QueryVisualizationWrapperProps,\n) {\n const {\n noContentPlaceholderType = NoContentPlaceholderType.INTERACTIVE,\n defaultShowSearchBar = false,\n defaultShowPlots = true,\n hideCopyToClipboard = false,\n hideSearchBarControl = false,\n lockTextMatchesQueryFilterPill = true,\n unitDescription = 'result',\n helpConfiguration,\n hasCustomPlots = false,\n visibleColumnCount = Infinity,\n enabledExternalAnalysisPlatforms = DEFAULT_ENABLED_ANALYSIS_PLATFORMS,\n } = props\n\n const columnAliases = useMemo(\n () => props.columnAliases ?? {},\n [props.columnAliases],\n )\n\n const {\n getCurrentQueryRequest,\n hasFacetedSelectColumn,\n hasResettableFilters,\n rowDataQueryOptions,\n } = useQueryContext()\n const { data: queryMetadata } = useGetQueryMetadata()\n\n // Get the selectColumns from either query so that creating the context isn't bottlenecked by one or the other\n // Use the previous result as placeholder data so we don't reset the selectColumns unless they have actually changed.\n const { data: selectColumnsFromRowData } = useQuery({\n ...rowDataQueryOptions,\n select: data => data.responseBody?.queryResult?.queryResults.headers,\n placeholderData: prevData => prevData,\n })\n const { data: selectColumnsFromMetadata } = useGetQueryMetadata({\n select: data => data.responseBody?.selectColumns,\n placeholderData: prevData => prevData,\n })\n // We deep-compare-memoize the selectColumns so we don't reset visible columns if the reference changes, but not the contents (e.g. on page change)\n const selectColumns = useDeepCompareMemoize(\n selectColumnsFromRowData ?? selectColumnsFromMetadata ?? [],\n )\n\n const [showSqlEditor, setShowSqlEditor] = useState(false)\n const [showPlots, setShowPlots] = useState(defaultShowPlots)\n const [showCopyToClipboard, setShowCopyToClipboard] =\n useState(!hideCopyToClipboard)\n const [showFacetFilter, setShowFacetFilter] = useState(true)\n\n // The search bar and download confirmation should not be shown at the same time.\n const [\n showSearchBar,\n setShowSearchBar,\n showDownloadConfirmation,\n setShowDownloadConfirmation,\n ] = useMutuallyExclusiveState(\n defaultShowSearchBar && !hideSearchBarControl,\n false,\n )\n\n const [\n isShowingExportToAnalysisPlatformModal,\n setIsShowingExportToAnalysisPlatformModal,\n ] = useState<boolean>(false)\n\n const [visibleColumns, setVisibleColumns] = useState<string[]>([])\n\n const lastQueryRequest = useMemo(\n () => getCurrentQueryRequest(),\n [getCurrentQueryRequest],\n )\n\n // Deep-compare-memoize so callers passing a fresh array literal\n // (e.g. `hiddenColumns={['topic']}`) don't reset visible columns on every\n // parent render.\n const hiddenColumns = useDeepCompareMemoize(props.hiddenColumns ?? [])\n useEffect(() => {\n // SWC-6030: If sql changes, reset what columns are visible\n const hidden = new Set(hiddenColumns)\n setVisibleColumns(\n selectColumns\n .filter(el => !hidden.has(el.name))\n .slice(0, visibleColumnCount)\n .map(el => el.name),\n )\n }, [\n selectColumns,\n lastQueryRequest.query.sql,\n visibleColumnCount,\n hiddenColumns,\n ])\n\n const getColumnDisplayName = useCallback(\n (columnName: string, jsonPath?: string) => {\n // SWC-5982: if force-display-original-column-names is set, then just return the string\n const forceDisplayOriginalColumnName =\n typeof localStorage !== 'undefined' &&\n localStorage.getItem('force-display-original-column-names') === 'true'\n\n if (!columnName || (forceDisplayOriginalColumnName && !jsonPath)) {\n return columnName\n }\n if (columnAliases[columnName]) {\n return columnAliases[columnName]\n }\n if (jsonPath) {\n const columnModel = queryMetadata?.columnModels?.find(\n cm => cm.name === columnName,\n )\n if (columnModel?.jsonSubColumns) {\n const jsonSubColumn = columnModel.jsonSubColumns.find(\n jsc => jsc.jsonPath === jsonPath,\n )\n if (jsonSubColumn) {\n return jsonSubColumn.name\n }\n }\n }\n return unCamelCase(columnName)\n },\n [columnAliases, queryMetadata?.columnModels],\n )\n\n const getHelpText = useCallback(\n (columnName: string, jsonPath?: string): string | undefined => {\n if (Array.isArray(helpConfiguration)) {\n const helpConfig = helpConfiguration.find(\n config =>\n config.columnName === columnName && config.jsonPath === jsonPath,\n )\n return helpConfig?.helpText\n }\n return undefined\n },\n [helpConfiguration],\n )\n\n const NoContentPlaceholder = useCallback(\n () => (\n <NoContentPlaceholderComponent\n type={noContentPlaceholderType}\n hasResettableFilters={hasResettableFilters}\n />\n ),\n [noContentPlaceholderType, hasResettableFilters],\n )\n\n const context: QueryVisualizationContextType = useMemo(\n () => ({\n columnsToShowInTable: visibleColumns,\n setColumnsToShowInTable: setVisibleColumns,\n rgbIndex: props.rgbIndex,\n unitDescription: unitDescription,\n showLastUpdatedOn: props.showLastUpdatedOn,\n getColumnDisplayName,\n getDisplayValue,\n getHelpText,\n NoContentPlaceholder,\n isShowingExportToAnalysisPlatformModal:\n isShowingExportToAnalysisPlatformModal,\n setIsShowingExportToAnalysisPlatformModal:\n setIsShowingExportToAnalysisPlatformModal,\n showFacetFilter: hasFacetedSelectColumn ? showFacetFilter : false,\n setShowFacetFilter,\n hideSearchBarControl,\n lockTextMatchesQueryFilterPill,\n showSearchBar,\n setShowSearchBar,\n showDownloadConfirmation,\n setShowDownloadConfirmation,\n showSqlEditor,\n setShowSqlEditor,\n showPlots: hasCustomPlots || hasFacetedSelectColumn ? showPlots : false,\n setShowPlots,\n showCopyToClipboard,\n setShowCopyToClipboard,\n enabledExternalAnalysisPlatforms,\n }),\n [\n NoContentPlaceholder,\n getColumnDisplayName,\n getHelpText,\n hasFacetedSelectColumn,\n isShowingExportToAnalysisPlatformModal,\n props.rgbIndex,\n props.showLastUpdatedOn,\n setShowDownloadConfirmation,\n setShowSearchBar,\n showCopyToClipboard,\n showDownloadConfirmation,\n showFacetFilter,\n showPlots,\n showSearchBar,\n showSqlEditor,\n unitDescription,\n visibleColumns,\n hasCustomPlots,\n enabledExternalAnalysisPlatforms,\n hideSearchBarControl,\n lockTextMatchesQueryFilterPill,\n ],\n )\n /**\n * Render the children without any formatting\n */\n const { children } = props\n return (\n <QueryVisualizationContextProvider queryVisualizationContext={context}>\n {children}\n </QueryVisualizationContextProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAM,IAAiE,CAAC;AAkDxE,SAAgB,EACd,GACA;CACA,IAAM,EACJ,8BAA2B,EAAyB,aACpD,0BAAuB,IACvB,sBAAmB,IACnB,0BAAsB,IACtB,0BAAuB,IACvB,oCAAiC,IACjC,qBAAkB,UAClB,sBACA,oBAAiB,IACjB,wBAAqB,UACrB,sCAAmC,MACjC,GAEE,IAAgB,QACd,EAAM,iBAAiB,CAAC,GAC9B,CAAC,EAAM,aAAa,CACtB,GAEM,EACJ,2BACA,2BACA,yBACA,2BACE,EAAgB,GACd,EAAE,MAAM,MAAkB,EAAoB,GAI9C,EAAE,MAAM,MAA6B,EAAS;EAClD,GAAG;EACH,SAAQ,MAAQ,EAAK,cAAc,aAAa,aAAa;EAC7D,kBAAiB,MAAY;CAC/B,CAAC,GACK,EAAE,MAAM,MAA8B,EAAoB;EAC9D,SAAQ,MAAQ,EAAK,cAAc;EACnC,kBAAiB,MAAY;CAC/B,CAAC,GAEK,IAAgB,EACpB,KAA4B,KAA6B,CAAC,CAC5D,GAEM,CAAC,GAAe,MAAoB,EAAS,EAAK,GAClD,CAAC,GAAW,KAAgB,EAAS,CAAgB,GACrD,CAAC,GAAqB,KAC1B,EAAS,CAAC,EAAmB,GACzB,CAAC,GAAiB,KAAsB,EAAS,EAAI,GAGrD,CACJ,GACA,GACA,GACA,KACE,EACF,KAAwB,CAAC,GACzB,EACF,GAEM,CACJ,GACA,KACE,EAAkB,EAAK,GAErB,CAAC,GAAgB,KAAqB,EAAmB,CAAC,CAAC,GAE3D,IAAmB,QACjB,EAAuB,GAC7B,CAAC,CAAsB,CACzB,GAKM,IAAgB,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;EAClE;EACA;EACA;EACA;CACF,IACA;EACE;EACA;EACA;EACA;EACA;EACA,EAAM;EACN,EAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF,GAIM,EAAE,iBAAa;CACrB,OACE,kBAAC,IAAD;EAAmC,2BAA2B;EAC3D;CACgC,CAAA;AAEvC"}
|
|
1
|
+
{"version":3,"file":"QueryVisualizationWrapper.js","names":[],"sources":["../../../src/components/QueryVisualizationWrapper/QueryVisualizationWrapper.tsx"],"sourcesContent":["import { getDisplayValue } from '@/utils/functions/getDataFromFromStorage'\nimport { unCamelCase } from '@/utils/functions/unCamelCase'\nimport useMutuallyExclusiveState from '@/utils/hooks/useMutuallyExclusiveState'\nimport { useQuery } from '@tanstack/react-query'\nimport { ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { useDeepCompareMemoize } from 'use-deep-compare-effect'\nimport { useQueryContext } from '../QueryContext'\nimport { useGetQueryMetadata } from '../QueryWrapper/useGetQueryMetadata'\nimport { NoContentPlaceholderType } from '../SynapseTable/NoContentPlaceholderType'\nimport { ExternalAnalysisPlatform } from '../SynapseTable/export/ExternalAnalysisPlatformsConstants'\nimport NoContentPlaceholderComponent from './NoContentPlaceholder'\nimport { createDuoFacetValueRenderer } from '../GenericCard/DuoTermTags/DuoTermTags'\nimport {\n QueryVisualizationContextProvider,\n QueryVisualizationContextType,\n RenderedFacetValueChip,\n} from './QueryVisualizationContext'\n\n// By default, show no external analysis platforms.\nconst DEFAULT_ENABLED_ANALYSIS_PLATFORMS: ExternalAnalysisPlatform[] = []\n\ntype ColumnOrFacetHelpConfig = {\n /** Text that describes the column or facet */\n helpText: string\n /** The name of the column for which the markdown applies */\n columnName: string\n /** The JSON path matching a described JSON Column facet */\n jsonPath?: string\n}\n\nexport type QueryVisualizationWrapperProps = {\n children: ReactNode | ReactNode[]\n rgbIndex?: number\n /** The singular word to use to describe a what a row represents (e.g. \"file\"). Defaults to \"result\" */\n unitDescription?: string\n /** Mapping from column name to the name that should be shown for the column */\n columnAliases?: Record<string, string>\n /** Optional custom renderer for enumeration facet values (see context). */\n renderFacetValue?: (\n columnName: string,\n value: string,\n ) => RenderedFacetValueChip | undefined\n /**\n * Column name of a STRING_LIST of Data Use Ontology (DUO) values. When set,\n * that column's facet values and active-filter pills are automatically\n * rendered as DUO tags, so portals don't need to supply their own\n * `renderFacetValue` handler. An explicit `renderFacetValue` takes precedence.\n */\n dataUseModifiersColumnName?: string\n visibleColumnCount?: number\n hiddenColumns?: string[]\n defaultShowPlots?: boolean\n hideCopyToClipboard?: boolean\n hideSearchBarControl?: boolean\n /** When true, the text matches filter pill is shown but cannot be removed. Defaults to true. */\n lockTextMatchesQueryFilterPill?: boolean\n defaultShowSearchBar?: boolean\n showLastUpdatedOn?: boolean\n /** Default is INTERACTIVE */\n noContentPlaceholderType?: NoContentPlaceholderType\n isRowSelectionVisible?: boolean\n /** The set of columns that defines a uniqueness constraint on the table for the purposes of filtering based on row selection.\n * Note that Synapse tables have no internal concept of a primary key.\n */\n rowSelectionPrimaryKey?: string[]\n /** Look for additional filters using the given key. If not provided, the entity ID will be used.\n * @deprecated - configure the filter before passing a query */\n additionalFiltersSessionStorageKey?: string\n /** Configuration to add a help popover to each corresponding column header */\n helpConfiguration?: ColumnOrFacetHelpConfig[]\n hasCustomPlots?: boolean\n /** The set of external analysis platform to which the UI will support exporting data.\n * @default [] (no platforms are enabled) */\n enabledExternalAnalysisPlatforms?: ExternalAnalysisPlatform[]\n hideVisualizationsControl?: boolean\n}\n\n/**\n * QueryVisualizationWrapper manages UI state for components that query tables in Synapse. That state can be accessed\n * or updated using QueryVisualizationContext. A QueryVisualizationWrapper must be used within a QueryWrapper.\n */\nexport function QueryVisualizationWrapper(\n props: QueryVisualizationWrapperProps,\n) {\n const {\n noContentPlaceholderType = NoContentPlaceholderType.INTERACTIVE,\n defaultShowSearchBar = false,\n defaultShowPlots = true,\n hideCopyToClipboard = false,\n hideSearchBarControl = false,\n lockTextMatchesQueryFilterPill = true,\n unitDescription = 'result',\n helpConfiguration,\n hasCustomPlots = false,\n visibleColumnCount = Infinity,\n enabledExternalAnalysisPlatforms = DEFAULT_ENABLED_ANALYSIS_PLATFORMS,\n } = props\n\n const columnAliases = useMemo(\n () => props.columnAliases ?? {},\n [props.columnAliases],\n )\n\n // An explicit renderFacetValue wins; otherwise, if a DUO column is declared,\n // render that column's facet values and pills as DUO tags automatically.\n const renderFacetValue = useMemo(() => {\n if (props.renderFacetValue) {\n return props.renderFacetValue\n }\n if (props.dataUseModifiersColumnName) {\n return createDuoFacetValueRenderer(props.dataUseModifiersColumnName)\n }\n return undefined\n }, [props.renderFacetValue, props.dataUseModifiersColumnName])\n\n const {\n getCurrentQueryRequest,\n hasFacetedSelectColumn,\n hasResettableFilters,\n rowDataQueryOptions,\n } = useQueryContext()\n const { data: queryMetadata } = useGetQueryMetadata()\n\n // Get the selectColumns from either query so that creating the context isn't bottlenecked by one or the other\n // Use the previous result as placeholder data so we don't reset the selectColumns unless they have actually changed.\n const { data: selectColumnsFromRowData } = useQuery({\n ...rowDataQueryOptions,\n select: data => data.responseBody?.queryResult?.queryResults.headers,\n placeholderData: prevData => prevData,\n })\n const { data: selectColumnsFromMetadata } = useGetQueryMetadata({\n select: data => data.responseBody?.selectColumns,\n placeholderData: prevData => prevData,\n })\n // We deep-compare-memoize the selectColumns so we don't reset visible columns if the reference changes, but not the contents (e.g. on page change)\n const selectColumns = useDeepCompareMemoize(\n selectColumnsFromRowData ?? selectColumnsFromMetadata ?? [],\n )\n\n const [showSqlEditor, setShowSqlEditor] = useState(false)\n const [showPlots, setShowPlots] = useState(defaultShowPlots)\n const [showCopyToClipboard, setShowCopyToClipboard] =\n useState(!hideCopyToClipboard)\n const [showFacetFilter, setShowFacetFilter] = useState(true)\n\n // The search bar and download confirmation should not be shown at the same time.\n const [\n showSearchBar,\n setShowSearchBar,\n showDownloadConfirmation,\n setShowDownloadConfirmation,\n ] = useMutuallyExclusiveState(\n defaultShowSearchBar && !hideSearchBarControl,\n false,\n )\n\n const [\n isShowingExportToAnalysisPlatformModal,\n setIsShowingExportToAnalysisPlatformModal,\n ] = useState<boolean>(false)\n\n const [visibleColumns, setVisibleColumns] = useState<string[]>([])\n\n const lastQueryRequest = useMemo(\n () => getCurrentQueryRequest(),\n [getCurrentQueryRequest],\n )\n\n // Deep-compare-memoize so callers passing a fresh array literal\n // (e.g. `hiddenColumns={['topic']}`) don't reset visible columns on every\n // parent render.\n const hiddenColumns = useDeepCompareMemoize(props.hiddenColumns ?? [])\n useEffect(() => {\n // SWC-6030: If sql changes, reset what columns are visible\n const hidden = new Set(hiddenColumns)\n setVisibleColumns(\n selectColumns\n .filter(el => !hidden.has(el.name))\n .slice(0, visibleColumnCount)\n .map(el => el.name),\n )\n }, [\n selectColumns,\n lastQueryRequest.query.sql,\n visibleColumnCount,\n hiddenColumns,\n ])\n\n const getColumnDisplayName = useCallback(\n (columnName: string, jsonPath?: string) => {\n // SWC-5982: if force-display-original-column-names is set, then just return the string\n const forceDisplayOriginalColumnName =\n typeof localStorage !== 'undefined' &&\n localStorage.getItem('force-display-original-column-names') === 'true'\n\n if (!columnName || (forceDisplayOriginalColumnName && !jsonPath)) {\n return columnName\n }\n if (columnAliases[columnName]) {\n return columnAliases[columnName]\n }\n if (jsonPath) {\n const columnModel = queryMetadata?.columnModels?.find(\n cm => cm.name === columnName,\n )\n if (columnModel?.jsonSubColumns) {\n const jsonSubColumn = columnModel.jsonSubColumns.find(\n jsc => jsc.jsonPath === jsonPath,\n )\n if (jsonSubColumn) {\n return jsonSubColumn.name\n }\n }\n }\n return unCamelCase(columnName)\n },\n [columnAliases, queryMetadata?.columnModels],\n )\n\n const getHelpText = useCallback(\n (columnName: string, jsonPath?: string): string | undefined => {\n if (Array.isArray(helpConfiguration)) {\n const helpConfig = helpConfiguration.find(\n config =>\n config.columnName === columnName && config.jsonPath === jsonPath,\n )\n return helpConfig?.helpText\n }\n return undefined\n },\n [helpConfiguration],\n )\n\n const NoContentPlaceholder = useCallback(\n () => (\n <NoContentPlaceholderComponent\n type={noContentPlaceholderType}\n hasResettableFilters={hasResettableFilters}\n />\n ),\n [noContentPlaceholderType, hasResettableFilters],\n )\n\n const context: QueryVisualizationContextType = useMemo(\n () => ({\n columnsToShowInTable: visibleColumns,\n setColumnsToShowInTable: setVisibleColumns,\n rgbIndex: props.rgbIndex,\n unitDescription: unitDescription,\n showLastUpdatedOn: props.showLastUpdatedOn,\n getColumnDisplayName,\n getDisplayValue,\n renderFacetValue,\n getHelpText,\n NoContentPlaceholder,\n isShowingExportToAnalysisPlatformModal:\n isShowingExportToAnalysisPlatformModal,\n setIsShowingExportToAnalysisPlatformModal:\n setIsShowingExportToAnalysisPlatformModal,\n showFacetFilter: hasFacetedSelectColumn ? showFacetFilter : false,\n setShowFacetFilter,\n hideSearchBarControl,\n lockTextMatchesQueryFilterPill,\n showSearchBar,\n setShowSearchBar,\n showDownloadConfirmation,\n setShowDownloadConfirmation,\n showSqlEditor,\n setShowSqlEditor,\n showPlots: hasCustomPlots || hasFacetedSelectColumn ? showPlots : false,\n setShowPlots,\n showCopyToClipboard,\n setShowCopyToClipboard,\n enabledExternalAnalysisPlatforms,\n }),\n [\n NoContentPlaceholder,\n getColumnDisplayName,\n getHelpText,\n hasFacetedSelectColumn,\n isShowingExportToAnalysisPlatformModal,\n props.rgbIndex,\n props.showLastUpdatedOn,\n renderFacetValue,\n setShowDownloadConfirmation,\n setShowSearchBar,\n showCopyToClipboard,\n showDownloadConfirmation,\n showFacetFilter,\n showPlots,\n showSearchBar,\n showSqlEditor,\n unitDescription,\n visibleColumns,\n hasCustomPlots,\n enabledExternalAnalysisPlatforms,\n hideSearchBarControl,\n lockTextMatchesQueryFilterPill,\n ],\n )\n /**\n * Render the children without any formatting\n */\n const { children } = props\n return (\n <QueryVisualizationContextProvider queryVisualizationContext={context}>\n {children}\n </QueryVisualizationContextProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;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A;EACA,EAAM;EACN,EAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CACF,GAIM,EAAE,iBAAa;CACrB,OACE,kBAAC,IAAD;EAAmC,2BAA2B;EAC3D;CACgC,CAAA;AAEvC"}
|
|
@@ -38,7 +38,7 @@ type QueryWrapperPlotNavOwnProps = {
|
|
|
38
38
|
onViewSharingSettingsClicked?: (benefactorId: string) => void;
|
|
39
39
|
initialLimit?: number;
|
|
40
40
|
hideTopLevelControls?: boolean;
|
|
41
|
-
} & Omit<TopLevelControlsProps, 'entityId'> & Pick<QueryWrapperPlotNavCustomPlotParams, 'onCustomPlotClick'> & Pick<QueryWrapperProps, 'isRowSelectionVisible' | 'rowSelectionPrimaryKey' | 'isRowSelectionUIFloating' | 'fileIdColumnName' | 'fileNameColumnName' | 'fileVersionColumnName'> & Pick<QueryVisualizationWrapperProps, 'defaultShowPlots' | 'visibleColumnCount' | 'hiddenColumns' | 'columnAliases' | 'rgbIndex' | 'showLastUpdatedOn' | 'noContentPlaceholderType' | 'unitDescription' | 'additionalFiltersSessionStorageKey' | 'helpConfiguration' | 'hideCopyToClipboard' | 'hideSearchBarControl' | 'hideVisualizationsControl' | 'enabledExternalAnalysisPlatforms' | 'lockTextMatchesQueryFilterPill'> & Pick<QueryContextType, 'combineRangeFacetConfig'>;
|
|
41
|
+
} & Omit<TopLevelControlsProps, 'entityId'> & Pick<QueryWrapperPlotNavCustomPlotParams, 'onCustomPlotClick'> & Pick<QueryWrapperProps, 'isRowSelectionVisible' | 'rowSelectionPrimaryKey' | 'isRowSelectionUIFloating' | 'fileIdColumnName' | 'fileNameColumnName' | 'fileVersionColumnName'> & Pick<QueryVisualizationWrapperProps, 'defaultShowPlots' | 'visibleColumnCount' | 'hiddenColumns' | 'columnAliases' | 'renderFacetValue' | 'rgbIndex' | 'showLastUpdatedOn' | 'noContentPlaceholderType' | 'unitDescription' | 'additionalFiltersSessionStorageKey' | 'helpConfiguration' | 'hideCopyToClipboard' | 'hideSearchBarControl' | 'hideVisualizationsControl' | 'enabledExternalAnalysisPlatforms' | 'lockTextMatchesQueryFilterPill'> & Pick<QueryContextType, 'combineRangeFacetConfig'>;
|
|
42
42
|
export type QueryWrapperPlotNavProps = QueryOrDeprecatedSearchParams & PlotsContainerProps & QueryWrapperPlotNavOwnProps;
|
|
43
43
|
export type QueryWrapperPlotNavContentsProps = Pick<QueryWrapperPlotNavProps, 'tableConfiguration' | 'name' | 'cardConfiguration' | 'facetsToPlot' | 'availableFacets' | 'initialExpandedFacetControls' | 'hideDownload' | 'hideQueryCount' | 'hideSqlEditorControl' | 'hideVisualizationsControl' | 'searchConfiguration' | 'enabledExternalAnalysisPlatforms' | 'cavaticaConnectAccountURL' | 'customControls' | 'customPlots' | 'fileIdColumnName' | 'fileNameColumnName' | 'fileVersionColumnName' | 'initialLimit' | 'initialPlotTypeByFacetColumnName' | 'hideTopLevelControls'> & {
|
|
44
44
|
isFullTextSearchEnabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryWrapperPlotNav.d.ts","sourceRoot":"","sources":["../../../src/components/QueryWrapperPlotNav/QueryWrapperPlotNav.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAA;AAiBlG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAItE,OAAO,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAGL,8BAA8B,EAC/B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAAgB,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAyB,EACvB,qBAAqB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2BAA2B,GAC3B,kCAAkC,GAClC,gCAAgC,CACnC,GACD,IAAI,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;AAEnD,MAAM,MAAM,wBAAwB,GAAG,6BAA6B,GAClE,mBAAmB,GACnB,2BAA2B,CAAA;AAE7B,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,wBAAwB,EACtB,oBAAoB,GACpB,MAAM,GACN,mBAAmB,GACnB,cAAc,GACd,iBAAiB,GACjB,8BAA8B,GAC9B,cAAc,GACd,gBAAgB,GAChB,sBAAsB,GACtB,2BAA2B,GAC3B,qBAAqB,GACrB,kCAAkC,GAClC,2BAA2B,GAC3B,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,GACd,kCAAkC,GAClC,sBAAsB,CACzB,GAAG;IACF,uBAAuB,EAAE,OAAO,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,2CAsJxC;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA0H1E"}
|
|
@@ -135,6 +135,8 @@ function z(r) {
|
|
|
135
135
|
unitDescription: p,
|
|
136
136
|
rgbIndex: r.rgbIndex,
|
|
137
137
|
columnAliases: r.columnAliases,
|
|
138
|
+
renderFacetValue: r.renderFacetValue,
|
|
139
|
+
dataUseModifiersColumnName: r.cardConfiguration?.genericCardSchema?.dataUseModifiersColumnName,
|
|
138
140
|
helpConfiguration: h,
|
|
139
141
|
visibleColumnCount: r.visibleColumnCount,
|
|
140
142
|
hiddenColumns: r.hiddenColumns,
|