UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

18 lines (17 loc) 1.47 kB
import { jsxs as m, jsx as o } from "react/jsx-runtime"; import { useState as u } from "react"; import { a as b, D as f, T as t, c as d, d as M, B as S } from "./JBrowsePanel-uJIA-L6s.js"; function v(N) { const { model: a, handleClose: i } = N, { minScore: l, maxScore: s, scaleType: h } = a, [e, g] = u(`${l !== Number.MIN_VALUE ? l : ""}`), [r, x] = u(`${s !== Number.MAX_VALUE ? s : ""}`), c = e !== "" && r !== "" && !Number.isNaN(+e) && !Number.isNaN(+r) ? +r > +e : !0, p = h === "log" && e !== "" && !Number.isNaN(+e) ? +e > 0 : !0; return m(b.Dialog, { open: !0, onClose: i, title: "Set min/max score for track", children: [m(f, { children: [o(t, { children: "Enter min/max score: " }), c ? null : o(t, { color: "error", children: "Max is greater than or equal to min" }), p ? null : o(t, { color: "error", children: "Min score should be greater than 0 for log scale" }), o(d, { value: e, onChange: (n) => { g(n.target.value); }, placeholder: "Enter min score" }), o(d, { value: r, onChange: (n) => { x(n.target.value); }, placeholder: "Enter max score" })] }), o(M, { children: o(S, { variant: "contained", color: "primary", type: "submit", style: { marginLeft: 20 }, disabled: !c, onClick: () => { a.setMinScore(e !== "" && !Number.isNaN(+e) ? +e : void 0), a.setMaxScore(r !== "" && !Number.isNaN(+r) ? +r : void 0), i(); }, children: "Submit" }) })] }); } export { v as default }; //# sourceMappingURL=SetMinMaxDialog-Ds3V621j.js.map