UNPKG

@jbrowse/plugin-wiggle

Version:

JBrowse 2 wiggle adapters, tracks, etc.

32 lines (31 loc) 3.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const ui_1 = require("@jbrowse/core/ui"); const ColorPicker_1 = require("@jbrowse/core/ui/ColorPicker"); const material_1 = require("@mui/material"); const mobx_react_1 = require("mobx-react"); const SetColorDialog = (0, mobx_react_1.observer)(function SetColorDialog({ model, handleClose, }) { const [posneg, setPosNeg] = (0, react_1.useState)(false); return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Set color", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Select either an overall color, or the positive/negative colors. Note that density renderers only work properly with positive/negative colors" }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { checked: !posneg, onClick: () => { setPosNeg(false); }, control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: "Overall color" }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { checked: posneg, onClick: () => { setPosNeg(true); }, control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: "Positive/negative color" }), posneg ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Positive color" }), (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: model.posColor || 'black', onChange: event => { model.setPosColor(event); model.setColor(undefined); } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Negative color" }), (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: model.negColor || 'black', onChange: event => { model.setNegColor(event); model.setColor(undefined); } })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Overall color" }), (0, jsx_runtime_1.jsx)(ColorPicker_1.ColorPicker, { color: model.color || 'black', onChange: event => { model.setColor(event); } })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => { model.setPosColor(undefined); model.setNegColor(undefined); model.setColor(undefined); }, color: "secondary", variant: "contained", children: "Restore default" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", onClick: () => { handleClose(); }, children: "Submit" })] })] })); }); exports.default = SetColorDialog;