Mercurial > repos > fubar > jbrowse2
view x/static/js/6932.a37ea756.chunk.js.map @ 125:49f3d3878413 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author | fubar |
---|---|
date | Sat, 05 Oct 2024 23:58:05 +0000 |
parents | |
children |
line wrap: on
line source
{"version":3,"file":"static/js/6932.a37ea756.chunk.js","mappings":"gjBAkBA,MAAMA,GAAYC,EAAAA,EAAAA,KAAAA,EAAaC,IAAS,CACtCC,YAAa,CACXC,SAAU,WACVC,MAAOH,EAAMI,QAAQ,GACrBC,IAAKL,EAAMI,QAAQ,GACnBE,MAAON,EAAMO,QAAQC,KAAK,UAI9B,SAASC,EAAeC,GACtB,MAAMC,GAAMC,EAAAA,EAAAA,QAAuB,MACnC,OACEC,EAAAA,cAACC,IAAS,CACRC,QAASJ,EACTK,OAAQ,mCAERC,QAASC,GAAOA,EAAIC,QAAQC,WAAWC,SAAS,mBAEhDR,EAAAA,cAACS,EAAAA,EAAKC,EAAA,CAACZ,IAAKA,GAASD,IAG3B,CAEA,MA8BA,GA9BwBc,EAAAA,EAAAA,WAAS,SAC/Bd,GAEA,MAAM,QAAEe,GAAY3B,KACd,MAAE4B,EAAK,SAAEC,EAAQ,QAAEC,GAAYlB,EAErC,OACEG,EAAAA,cAACgB,EAAAA,EAAMN,EAAA,GAAKb,EAAK,CAAED,eAAgBA,IACjCI,EAAAA,cAACiB,EAAAA,EAAiB,KAChBjB,EAAAA,cAACkB,EAAAA,EAAW,CAACC,MAAO,CAAEC,OAAQ,SAC3BP,EACAE,EACCf,EAAAA,cAACqB,EAAAA,EAAU,CACTd,UAAWK,EAAQxB,YACnBkC,QAASA,KAEPP,GAAS,GAGXf,EAAAA,cAACuB,EAAAA,EAAS,OAEV,MAENvB,EAAAA,cAACwB,EAAAA,EAAO,MACPV,GAIT,I,4FCnDA,MAAM7B,GAAYC,EAAAA,EAAAA,KAAAA,CAAa,CAC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AM/E,EAAMqF,KAAKG,IAAIL,EAASC,EAAMN,GAChC9E,GAAOmF,GACTP,EAAIW,OAAOvF,EAAK,EAAG4E,EAAIW,OAAOH,EAAK,GAAG,IAExCD,GAAoB,CACtB,CAEA,OAAOP,CACT,CAEA,MAAMa,EAAqB,KAEpB,SAASC,EAAUjC,GACxB,MAAM,cAAEkC,GAAkBlC,GACpB,YAAEmC,IAAgBC,EAAAA,EAAAA,mBAAkBpC,GACpCqC,GAAQC,EAAAA,EAAAA,oBAAmBtC,GAC3BuC,GAAYC,EAAAA,EAAAA,SAAQH,EAAO,QACjC,MAAuB,gBAAhBF,GAAkCD,EAErC,IADAO,EAAAA,EAAAA,aAAYF,EAAWP,GAAsB,GAEnD,C","sources":["../../../plugins/wiggle/src/MultiLinearWiggleDisplay/components/DraggableDialog.tsx","../../../plugins/wiggle/src/MultiLinearWiggleDisplay/components/SourcesGrid.tsx","../../../plugins/wiggle/src/MultiLinearWiggleDisplay/components/SetColorDialog.tsx","../../../plugins/wiggle/src/MultiLinearWiggleDisplay/components/util.ts"],"sourcesContent":["import React, { useRef } from 'react'\nimport {\n Dialog,\n DialogTitle,\n IconButton,\n Divider,\n DialogProps,\n Paper,\n ScopedCssBaseline,\n PaperProps,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\nimport Draggable from 'react-draggable'\n\n// icons\nimport CloseIcon from '@mui/icons-material/Close'\n\nconst useStyles = makeStyles()(theme => ({\n closeButton: {\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: theme.palette.grey[500],\n },\n}))\n\nfunction PaperComponent(props: PaperProps) {\n const ref = useRef<HTMLDivElement>(null)\n return (\n <Draggable\n nodeRef={ref}\n cancel={'[class*=\"MuiDialogContent-root\"]'}\n // @ts-expect-error\n onStart={arg => arg.target?.className?.includes('MuiDialogTitle')}\n >\n <Paper ref={ref} {...props} />\n </Draggable>\n )\n}\n\nconst DraggableDialog = observer(function DraggableDialog(\n props: DialogProps & { title: string },\n) {\n const { classes } = useStyles()\n const { title, children, onClose } = props\n\n return (\n <Dialog {...props} PaperComponent={PaperComponent}>\n <ScopedCssBaseline>\n <DialogTitle style={{ cursor: 'move' }}>\n {title}\n {onClose ? (\n <IconButton\n className={classes.closeButton}\n onClick={() => {\n // @ts-expect-error\n onClose()\n }}\n >\n <CloseIcon />\n </IconButton>\n ) : null}\n </DialogTitle>\n <Divider />\n {children}\n </ScopedCssBaseline>\n </Dialog>\n )\n})\n\nexport default DraggableDialog\n","import React, { useState } from 'react'\nimport { Button } from '@mui/material'\nimport { getStr, measureGridWidth } from '@jbrowse/core/util'\nimport { DataGrid, GridColDef } from '@mui/x-data-grid'\nimport { makeStyles } from 'tss-react/mui'\nimport ColorPicker, { ColorPopover } from '@jbrowse/core/ui/ColorPicker'\nimport { SanitizedHTML } from '@jbrowse/core/ui'\n\n// locals\nimport { moveUp, moveDown } from './util'\nimport { Source } from '../../util'\n\n// icons\nimport KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp'\nimport KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown'\nimport KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'\nimport KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'\n\nconst useStyles = makeStyles()({\n cell: {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n },\n})\n\ninterface SortField {\n idx: number\n field: string | null\n}\n\nfunction SourcesGrid({\n rows,\n onChange,\n showTips,\n}: {\n rows: Source[]\n onChange: (arg: Source[]) => void\n showTips: boolean\n}) {\n const { classes } = useStyles()\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)\n const [selected, setSelected] = useState([] as string[])\n const { name: _name, color: _color, baseUri: _baseUri, ...rest } = rows[0]!\n const [widgetColor, setWidgetColor] = useState('blue')\n const [currSort, setCurrSort] = useState<SortField>({\n idx: 0,\n field: null,\n })\n\n return (\n <div>\n <Button\n disabled={!selected.length}\n onClick={event => {\n setAnchorEl(event.currentTarget)\n }}\n >\n Change color of selected items\n </Button>\n <Button\n onClick={() => {\n onChange(moveUp([...rows], selected))\n }}\n disabled={!selected.length}\n >\n <KeyboardArrowUpIcon />\n {showTips ? 'Move selected items up' : null}\n </Button>\n <Button\n onClick={() => {\n onChange(moveDown([...rows], selected))\n }}\n disabled={!selected.length}\n >\n <KeyboardArrowDownIcon />\n {showTips ? 'Move selected items down' : null}\n </Button>\n <Button\n onClick={() => {\n onChange(moveUp([...rows], selected, rows.length))\n }}\n disabled={!selected.length}\n >\n <KeyboardDoubleArrowUpIcon />\n {showTips ? 'Move selected items to top' : null}\n </Button>\n <Button\n onClick={() => {\n onChange(moveDown([...rows], selected, rows.length))\n }}\n disabled={!selected.length}\n >\n <KeyboardDoubleArrowDownIcon />\n {showTips ? 'Move selected items to bottom' : null}\n </Button>\n <ColorPopover\n anchorEl={anchorEl}\n color={widgetColor}\n onChange={c => {\n setWidgetColor(c)\n selected.forEach(id => {\n const elt = rows.find(f => f.name === id)\n if (elt) {\n elt.color = c\n }\n })\n\n onChange([...rows])\n }}\n onClose={() => {\n setAnchorEl(null)\n }}\n />\n <div style={{ height: 400, width: '100%' }}>\n <DataGrid\n getRowId={row => row.name}\n checkboxSelection\n disableRowSelectionOnClick\n onRowSelectionModelChange={arg => {\n setSelected(arg as string[])\n }}\n rows={rows}\n rowHeight={25}\n columnHeaderHeight={33}\n columns={[\n {\n field: 'color',\n headerName: 'Color',\n renderCell: params => {\n const { value, id } = params\n return (\n <ColorPicker\n color={value || 'blue'}\n onChange={c => {\n const elt = rows.find(f => f.name === id)\n if (elt) {\n elt.color = c\n }\n onChange([...rows])\n }}\n />\n )\n },\n },\n {\n field: 'name',\n headerName: 'Name',\n width: measureGridWidth(rows.map(r => r.name)),\n },\n ...Object.keys(rest).map(\n val =>\n ({\n field: val,\n renderCell: ({ value }) => (\n <div className={classes.cell}>\n <SanitizedHTML html={getStr(value)} />\n </div>\n ),\n width: measureGridWidth(\n rows.map(r => `${r[val as keyof Source]}`),\n ),\n }) satisfies GridColDef<(typeof rows)[0]>,\n ),\n ]}\n sortModel={\n [\n /* we control the sort as a controlled component using onSortModelChange */\n ]\n }\n onSortModelChange={args => {\n const sort = args[0]\n // this idx%2 flip flops the sorting order, we could inspect args\n // for sort direction asc or desc but this is just a simplified\n // thing since we are controlling sort instead of the default data\n // grid sort anyways\n const idx = (currSort.idx + 1) % 2\n const field = sort!.field || currSort.field\n setCurrSort({ idx, field })\n onChange(\n field\n ? [...rows].sort((a, b) => {\n const aa = getStr(a[field as keyof Source])\n const bb = getStr(b[field as keyof Source])\n return idx === 1\n ? aa.localeCompare(bb)\n : bb.localeCompare(aa)\n })\n : rows,\n )\n }}\n />\n </div>\n </div>\n )\n}\n\nexport default SourcesGrid\n","import React, { useState } from 'react'\nimport { Button, DialogContent, DialogActions } from '@mui/material'\nimport { makeStyles } from 'tss-react/mui'\nimport { useLocalStorage } from '@jbrowse/core/util'\nimport clone from 'clone'\n\n// locals\nimport DraggableDialog from './DraggableDialog'\nimport { Source } from '../../util'\nimport SourcesGrid from './SourcesGrid'\n\nconst useStyles = makeStyles()({\n content: {\n minWidth: 800,\n },\n})\n\nexport default function SetColorDialog({\n model,\n handleClose,\n}: {\n model: {\n sources?: Source[]\n setLayout: (s: Source[]) => void\n clearLayout: () => void\n }\n handleClose: () => void\n}) {\n const { classes } = useStyles()\n const { sources } = model\n const [currLayout, setCurrLayout] = useState(clone(sources || []))\n const [showTips, setShowTips] = useLocalStorage('multiwiggle-showTips', true)\n return (\n <DraggableDialog\n open\n onClose={handleClose}\n maxWidth=\"xl\"\n title={'Multi-wiggle color/arrangement editor'}\n >\n <DialogContent className={classes.content}>\n <Button\n variant=\"contained\"\n style={{ float: 'right' }}\n onClick={() => {\n setShowTips(!showTips)\n }}\n >\n {showTips ? 'Hide tips' : 'Show tips'}\n </Button>\n <br />\n {showTips ? (\n <>\n Helpful tips\n <ul>\n <li>You can select rows in the table with the checkboxes</li>\n <li>\n Multi-select is enabled with shift-click and control-click\n </li>\n <li>\n The \"Move selected items up/down\" can re-arrange subtracks\n </li>\n <li>\n Sorting the data grid itself can also re-arrange subtracks\n </li>\n <li>Changes are applied when you hit Submit</li>\n <li>\n You can click and drag the dialog box to move it on the screen\n </li>\n <li>\n Columns in the table can be hidden using a vertical '...' menu\n on the right side of each column\n </li>\n </ul>\n </>\n ) : null}\n <SourcesGrid\n rows={currLayout}\n onChange={setCurrLayout}\n showTips={showTips}\n />\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n type=\"submit\"\n color=\"inherit\"\n onClick={() => {\n model.clearLayout()\n setCurrLayout(model.sources || [])\n }}\n >\n Clear custom settings\n </Button>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n onClick={() => {\n handleClose()\n setCurrLayout([...(model.sources || [])])\n }}\n >\n Cancel\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={() => {\n model.setLayout(currLayout)\n handleClose()\n }}\n >\n Submit\n </Button>\n </DialogActions>\n </DraggableDialog>\n )\n}\n","import {\n getContainingTrack,\n getContainingView,\n measureText,\n} from '@jbrowse/core/util'\nimport { WiggleDisplayModel } from '../models/model'\nimport { getConf } from '@jbrowse/core/configuration'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\nexport function moveUp(arr: { name: string }[], sel: string[], by = 1) {\n const idxs = sel\n .map(l => arr.findIndex(v => v.name === l))\n .sort((a, b) => a - b)\n let lastIdx = 0\n for (const old of idxs) {\n const idx = Math.max(lastIdx, old - by)\n if (idx >= lastIdx) {\n arr.splice(idx, 0, arr.splice(old, 1)[0]!)\n }\n lastIdx = lastIdx + 1\n }\n\n return arr\n}\n\nexport function moveDown(arr: { name: string }[], sel: string[], by = 1) {\n const idxs = sel\n .map(l => arr.findIndex(v => v.name === l))\n .sort((a, b) => b - a)\n let lastIdx = arr.length - 1\n for (const old of idxs) {\n const idx = Math.min(lastIdx, old + by)\n if (idx <= lastIdx) {\n arr.splice(idx, 0, arr.splice(old, 1)[0]!)\n }\n lastIdx = lastIdx - 1\n }\n\n return arr\n}\n\nconst trackLabelFontSize = 12.8\n\nexport function getOffset(model: WiggleDisplayModel) {\n const { prefersOffset } = model\n const { trackLabels } = getContainingView(model) as LinearGenomeViewModel\n const track = getContainingTrack(model)\n const trackName = getConf(track, 'name')\n return trackLabels === 'overlapping' && !prefersOffset\n ? measureText(trackName, trackLabelFontSize) + 100\n : 10\n}\n"],"names":["useStyles","makeStyles","theme","closeButton","position","right","spacing","top","color","palette","grey","PaperComponent","props","ref","useRef","React","Draggable","nodeRef","cancel","onStart","arg","target","className","includes","Paper","_extends","observer","classes","title","children","onClose","Dialog","ScopedCssBaseline","DialogTitle","style","cursor","IconButton","onClick","CloseIcon","Divider","cell","whiteSpace","overflow","textOverflow","rows","onChange","showTips","anchorEl","setAnchorEl","useState","selected","setSelected","name","_name","_color","baseUri","_baseUri","rest","widgetColor","setWidgetColor","currSort","setCurrSort","idx","field","Button","disabled","length","event","currentTarget","moveUp","KeyboardArrowUpIcon","moveDown","KeyboardArrowDownIcon","KeyboardDoubleArrowUpIcon","KeyboardDoubleArrowDownIcon","ColorPopover","c","forEach","id","elt","find","f","height","width","DataGrid","getRowId","row","checkboxSelection","disableRowSelectionOnClick","onRowSelectionModelChange","rowHeight","columnHeaderHeight","columns","headerName","renderCell","params","value","ColorPicker","measureGridWidth","map","r","Object","keys","val","SanitizedHTML","html","getStr","sortModel","onSortModelChange","args","sort","a","b","aa","bb","localeCompare","content","minWidth","SetColorDialog","model","handleClose","sources","currLayout","setCurrLayout","clone","setShowTips","useLocalStorage","DraggableDialog","open","maxWidth","DialogContent","variant","float","SourcesGrid","DialogActions","type","clearLayout","setLayout","arr","sel","by","idxs","l","findIndex","v","lastIdx","old","Math","max","splice","min","trackLabelFontSize","getOffset","prefersOffset","trackLabels","getContainingView","track","getContainingTrack","trackName","getConf","measureText"],"sourceRoot":""}