taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
27 lines (26 loc) • 1.19 kB
JavaScript
import { jsxs as s, jsx as t } from "react/jsx-runtime";
import { B as l } from "./BaseCard-CrWzwjYv.js";
import { useState as p } from "react";
import { u as c, T as h } from "./JBrowsePanel-uJIA-L6s.js";
import { F as d } from "./FormControlLabel-CwjOxa71.js";
import { C as u } from "./Checkbox-BG4jcGUl.js";
import { D as f } from "./DataGrid-DA9cZ2dC.js";
function C({ rows: e, columns: o }) {
const [n, a] = p(!1), m = o.map((r) => c.measureGridWidth(e.map((i) => i[r.field])));
return e.length ? s("div", { children: [t(d, { label: t(h, { variant: "body2", children: "Show options" }), control: t(u, { checked: n, onChange: (r) => {
a(r.target.checked);
} }) }), t(f, { rowHeight: 25, hideFooter: e.length < 100, rows: e, showToolbar: n, columns: o.map((r, i) => ({
...r,
width: m[i]
})) })] }) : null;
}
function j({ data: e, fields: o, title: n }) {
return e.length ? t(l, { title: n, children: t(C, { rows: e.map((a, m) => ({
id: m,
...Object.fromEntries(a.split("|").map((r, i) => [o[i], r]))
})), columns: o.map((a) => ({ field: a })) }) }) : null;
}
export {
j as default
};
//# sourceMappingURL=VariantConsequenceDataGrid-dh1jT-Zu.js.map