Mercurial > repos > fubar > jbrowse2
view x/static/js/3795.0386c297.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/3795.0386c297.chunk.js","mappings":"4QASA,MAAMA,GAAYC,EAAAA,EAAAA,KAAAA,CAAa,CAC7BC,MAAO,CACLC,cAAe,OACfC,OAAQ,OACRC,MAAO,EACPC,SAAU,WACVC,OAAQ,IAEVC,GAAI,CACFC,SAAU,MAuCd,GAnCsBC,EAAAA,EAAAA,WAAS,UAAU,MACvCC,EAAK,OACLC,IAKA,MAAM,QAAEC,GAAYb,IACpB,OACEc,EAAAA,cAACC,EAAAA,EAAO,CACNC,MAAI,EACJC,UAAU,MACVC,MAAOP,EAAMQ,MACVC,KAAIC,GAAQA,EAAKC,OAAOV,KACxBQ,KAAI,CAACG,EAAKC,IACTV,EAAAA,cAACW,EAAAA,EAAU,CACTC,UAAWb,EAAQL,GACnBmB,IAAK,CAACC,KAAKC,UAAUN,GAAMC,GAAKM,KAAK,OAEpCD,EAAAA,EAAAA,WAAUN,GAAK,MAGtBQ,OAAK,GAELjB,EAAAA,cAAA,OACEY,UAAWb,EAAQX,MACnB8B,MAAO,CACLC,KAAMrB,EACNsB,WAAY,SAKtB,ICxCMlC,GAAYC,EAAAA,EAAAA,KAAAA,EAAakC,IACtB,CACLC,WAAY,CACVhC,OAAQ,OACR8B,YAAYG,EAAAA,EAAAA,IAAMF,EAAMG,QAAQC,SAASC,KAAM,IAC/ClC,SAAU,WACVC,OAAQ,GACRkC,UAAW,SACXC,SAAU,UAEZC,kBAAmB,CACjBC,OAAQ,YACRvC,MAAO,OACPwC,UAAW,GAEbC,eAAgB,CACdC,MAAOZ,EAAMG,QAAQC,SAASS,cAEhCC,QAAS,CACPC,YAAa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parativeView/components/VerticalGuide.tsx","../../../plugins/linear-comparative-view/src/LinearComparativeView/components/Rubberband.tsx","../../../plugins/linear-comparative-view/src/LinearComparativeView/components/Header.tsx","../../../plugins/linear-comparative-view/src/LinearComparativeView/components/LinearComparativeView.tsx","../../../plugins/linear-comparative-view/src/LinearSyntenyView/components/LinearSyntenyView.tsx"],"sourcesContent":["import React from 'react'\nimport { Tooltip, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { stringify } from '@jbrowse/core/util'\nimport { makeStyles } from 'tss-react/mui'\nimport { LinearComparativeViewModel } from '../model'\n\ntype LCV = LinearComparativeViewModel\n\nconst useStyles = makeStyles()({\n guide: {\n pointerEvents: 'none',\n height: '100%',\n width: 1,\n position: 'absolute',\n zIndex: 10,\n },\n sm: {\n fontSize: 10,\n },\n})\n\nconst VerticalGuide = observer(function ({\n model,\n coordX,\n}: {\n model: LCV\n coordX: number\n}) {\n const { classes } = useStyles()\n return (\n <Tooltip\n open\n placement=\"top\"\n title={model.views\n .map(view => view.pxToBp(coordX))\n .map((elt, idx) => (\n <Typography\n className={classes.sm}\n key={[JSON.stringify(elt), idx].join('-')}\n >\n {stringify(elt, true)}\n </Typography>\n ))}\n arrow\n >\n <div\n className={classes.guide}\n style={{\n left: coordX,\n background: 'red',\n }}\n />\n </Tooltip>\n )\n})\n\nexport default VerticalGuide\n","import React, { useRef, useEffect, useState } from 'react'\nimport { observer } from 'mobx-react'\nimport { Popover, Typography, alpha } from '@mui/material'\nimport { makeStyles } from 'tss-react/mui'\nimport { stringify } from '@jbrowse/core/util'\nimport { Menu } from '@jbrowse/core/ui'\nimport { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\n// locals\nimport { LinearComparativeViewModel } from '../model'\nimport VerticalGuide from './VerticalGuide'\n\ntype LCV = LinearComparativeViewModel\ntype LGV = LinearGenomeViewModel\n\nconst useStyles = makeStyles()(theme => {\n return {\n rubberband: {\n height: '100%',\n background: alpha(theme.palette.tertiary.main, 0.7),\n position: 'absolute',\n zIndex: 10,\n textAlign: 'center',\n overflow: 'hidden',\n },\n rubberbandControl: {\n cursor: 'crosshair',\n width: '100%',\n minHeight: 8,\n },\n rubberbandText: {\n color: theme.palette.tertiary.contrastText,\n },\n popover: {\n mouseEvents: 'none',\n cursor: 'crosshair',\n },\n paper: {\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(1),\n },\n }\n})\n\nconst LinearComparativeRubberband = observer(function Rubberband({\n model,\n ControlComponent = <div />,\n}: {\n model: LCV\n ControlComponent?: React.ReactElement\n}) {\n const [startX, setStartX] = useState<number>()\n const [currentX, setCurrentX] = useState<number>()\n\n // clientX and clientY used for anchorPosition for menu\n // offsetX used for calculations about width of selection\n const [anchorPosition, setAnchorPosition] = useState<{\n offsetX: number\n clientX: number\n clientY: number\n }>()\n const [guideX, setGuideX] = useState<number>()\n const controlsRef = useRef<HTMLDivElement>(null)\n const rubberbandRef = useRef<HTMLDivElement>(null)\n const { classes } = useStyles()\n const mouseDragging = startX !== undefined && anchorPosition === undefined\n\n useEffect(() => {\n function computeOffsets(offsetX: number, view: LGV) {\n if (startX === undefined) {\n return\n }\n let leftPx = startX\n let rightPx = offsetX\n // handles clicking and dragging to the left\n if (rightPx < leftPx) {\n ;[leftPx, rightPx] = [rightPx, leftPx]\n }\n const leftOffset = view.pxToBp(leftPx)\n const rightOffset = view.pxToBp(rightPx)\n\n return { leftOffset, rightOffset }\n }\n\n function globalMouseMove(event: MouseEvent) {\n if (controlsRef.current && mouseDragging) {\n const relativeX =\n event.clientX - controlsRef.current.getBoundingClientRect().left\n setCurrentX(relativeX)\n }\n }\n\n function globalMouseUp(event: MouseEvent) {\n if (startX !== undefined && controlsRef.current) {\n const { clientX, clientY } = event\n const ref = controlsRef.current\n const offsetX = clientX - ref.getBoundingClientRect().left\n // as stated above, store both clientX/Y and offsetX for different\n // purposes\n setAnchorPosition({\n offsetX,\n clientX,\n clientY,\n })\n model.views.forEach(view => {\n const args = computeOffsets(offsetX, view)\n if (args) {\n const { leftOffset, rightOffset } = args\n view.setOffsets(leftOffset, rightOffset)\n }\n })\n setGuideX(undefined)\n }\n }\n if (mouseDragging) {\n window.addEventListener('mousemove', globalMouseMove)\n window.addEventListener('mouseup', globalMouseUp)\n return () => {\n window.removeEventListener('mousemove', globalMouseMove)\n window.removeEventListener('mouseup', globalMouseUp)\n }\n }\n return () => {}\n }, [startX, mouseDragging, model])\n\n useEffect(() => {\n if (\n !mouseDragging &&\n currentX !== undefined &&\n startX !== undefined &&\n Math.abs(currentX - startX) <= 3\n ) {\n handleClose()\n }\n }, [mouseDragging, currentX, startX])\n\n function mouseDown(event: React.MouseEvent<HTMLDivElement>) {\n event.preventDefault()\n event.stopPropagation()\n const relativeX =\n event.clientX -\n (event.target as HTMLDivElement).getBoundingClientRect().left\n setStartX(relativeX)\n setCurrentX(relativeX)\n }\n\n function mouseMove(event: React.MouseEvent<HTMLDivElement>) {\n const target = event.target as HTMLDivElement\n setGuideX(event.clientX - target.getBoundingClientRect().left)\n }\n\n function mouseOut() {\n setGuideX(undefined)\n model.views.forEach(view => {\n view.setOffsets(undefined, undefined)\n })\n }\n\n function handleClose() {\n setAnchorPosition(undefined)\n setStartX(undefined)\n setCurrentX(undefined)\n }\n\n const open = Boolean(anchorPosition)\n\n function handleMenuItemClick(_: unknown, callback: () => void) {\n callback()\n handleClose()\n }\n\n if (startX === undefined) {\n return (\n <>\n {guideX !== undefined ? (\n <VerticalGuide model={model} coordX={guideX} />\n ) : null}\n <div\n ref={controlsRef}\n className={classes.rubberbandControl}\n onMouseDown={mouseDown}\n onMouseOut={mouseOut}\n onMouseMove={mouseMove}\n >\n {ControlComponent}\n </div>\n </>\n )\n }\n\n const right = anchorPosition ? anchorPosition.offsetX : currentX || 0\n const left = right < startX ? right : startX\n const width = Math.abs(right - startX)\n const { views } = model\n const leftBpOffset = views.map(view => view.pxToBp(left))\n const rightBpOffset = views.map(view => view.pxToBp(left + width))\n const numOfBpSelected = views.map(view => Math.ceil(width * view.bpPerPx))\n return (\n <>\n {rubberbandRef.current ? (\n <>\n <Popover\n className={classes.popover}\n classes={{ paper: classes.paper }}\n open\n anchorEl={rubberbandRef.current}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n transformOrigin={{\n vertical: 'bottom',\n horizontal: 'right',\n }}\n keepMounted\n disableRestoreFocus\n >\n {leftBpOffset.map((l, idx) => (\n <Typography key={[JSON.stringify(l), idx, 'left'].join('-')}>\n {stringify(l, true)}\n </Typography>\n ))}\n </Popover>\n <Popover\n className={classes.popover}\n classes={{ paper: classes.paper }}\n open\n anchorEl={rubberbandRef.current}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'bottom',\n horizontal: 'left',\n }}\n keepMounted\n disableRestoreFocus\n >\n {rightBpOffset.map((l, idx) => (\n <Typography key={[JSON.stringify(l), idx, 'right'].join('-')}>\n {stringify(l, true)}\n </Typography>\n ))}\n </Popover>\n </>\n ) : null}\n <div\n ref={rubberbandRef}\n className={classes.rubberband}\n style={{ left, width }}\n >\n <Typography variant=\"h6\" className={classes.rubberbandText}>\n {numOfBpSelected.map((n, i) => (\n /* biome-ignore lint/suspicious/noArrayIndexKey: */\n <Typography key={`${n}_${i}`}>\n {`${n.toLocaleString('en-US')}bp`}\n </Typography>\n ))}\n </Typography>\n </div>\n <div\n className={classes.rubberbandControl}\n ref={controlsRef}\n onMouseDown={mouseDown}\n onMouseOut={mouseOut}\n onMouseMove={mouseMove}\n >\n {ControlComponent}\n </div>\n {anchorPosition ? (\n <Menu\n anchorReference=\"anchorPosition\"\n anchorPosition={{\n left: anchorPosition.clientX,\n top: anchorPosition.clientY,\n }}\n onMenuItemClick={handleMenuItemClick}\n open={open}\n onClose={handleClose}\n menuItems={model.rubberBandMenuItems()}\n />\n ) : null}\n </>\n )\n})\n\nexport default LinearComparativeRubberband\n","import React, { useState } from 'react'\nimport { IconButton, Typography } from '@mui/material'\nimport { makeStyles } from 'tss-react/mui'\nimport { SearchBox } from '@jbrowse/plugin-linear-genome-view'\nimport { observer } from 'mobx-react'\nimport { Menu } from '@jbrowse/core/ui'\n\n// icons\nimport MoreVertIcon from '@mui/icons-material/MoreVert'\n\n// locals\nimport { LinearComparativeViewModel } from '../model'\nimport { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'\nimport CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'\n\ntype LCV = LinearComparativeViewModel\n\nconst useStyles = makeStyles()(() => ({\n headerBar: {\n gridArea: '1/1/auto/span 2',\n display: 'flex',\n },\n spacer: {\n flexGrow: 1,\n },\n iconButton: {\n margin: 5,\n },\n bp: {\n display: 'flex',\n alignItems: 'center',\n marginLeft: 10,\n },\n searchContainer: {\n marginLeft: 5,\n },\n searchBox: {\n display: 'flex',\n },\n}))\n\nconst TrackSelector = observer(({ model }: { model: LCV }) => {\n return (\n <CascadingMenuButton\n menuItems={[\n {\n label: 'Synteny track selector',\n onClick: () => model.activateTrackSelector(),\n },\n ...model.views.map((view, idx) => ({\n label: `View ${idx + 1} track selector`,\n onClick: () => view.activateTrackSelector(),\n })),\n ]}\n >\n <TrackSelectorIcon />\n </CascadingMenuButton>\n )\n})\n\nconst Header = observer(function ({ model }: { model: LCV }) {\n const { classes } = useStyles()\n const [menuAnchorEl, setMenuAnchorEl] = useState<HTMLElement>()\n const anyShowHeaders = model.views.some(view => !view.hideHeader)\n return (\n <div className={classes.headerBar}>\n <TrackSelector model={model} />\n\n <IconButton\n onClick={event => {\n setMenuAnchorEl(event.currentTarget)\n }}\n className={classes.iconButton}\n >\n <MoreVertIcon />\n </IconButton>\n {!anyShowHeaders\n ? model.views.map(view => (\n <div key={view.id} className={classes.searchBox}>\n <div className={classes.searchContainer}>\n <SearchBox model={view} showHelp={false} />\n </div>\n <div className={classes.bp}>\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={classes.bp}\n >\n {Math.round(view.coarseTotalBp).toLocaleString('en-US')} bp\n </Typography>\n </div>\n </div>\n ))\n : null}\n\n <div className={classes.spacer} />\n\n {menuAnchorEl ? (\n <Menu\n anchorEl={menuAnchorEl}\n open\n onMenuItemClick={(_event, callback) => {\n callback()\n setMenuAnchorEl(undefined)\n }}\n menuItems={model.headerMenuItems()}\n onClose={() => {\n setMenuAnchorEl(undefined)\n }}\n />\n ) : null}\n </div>\n )\n})\n\nexport default Header\n","import React from 'react'\nimport { makeStyles } from 'tss-react/mui'\nimport { observer } from 'mobx-react'\nimport { getConf, AnyConfigurationModel } from '@jbrowse/core/configuration'\nimport { getEnv } from '@jbrowse/core/util'\nimport { ResizeHandle } from '@jbrowse/core/ui'\n\n// locals\nimport { LinearComparativeViewModel } from '../model'\nimport Rubberband from './Rubberband'\nimport Header from './Header'\n\nconst useStyles = makeStyles()(theme => ({\n container: {\n display: 'grid',\n },\n overlay: {\n zIndex: 100,\n gridArea: '1/1',\n },\n content: {\n gridArea: '1/1',\n position: 'relative',\n },\n grid: {\n display: 'grid',\n },\n relative: {\n position: 'relative',\n },\n\n // this helps keep the vertical guide inside the parent view container,\n // similar style exists in the single LGV's trackscontainer\n rubberbandContainer: {\n position: 'relative',\n overflow: 'hidden',\n },\n\n rubberbandDiv: {\n width: '100%',\n background: theme.palette.action.disabledBackground,\n height: 15,\n '&:hover': {\n background: theme.palette.action.selected,\n },\n },\n}))\n\ntype LCV = LinearComparativeViewModel\n\nconst Overlays = observer(({ model }: { model: LCV }) => {\n const { classes } = useStyles()\n return (\n <>\n {model.tracks.map(track => {\n const [display] = track.displays\n const { RenderingComponent } = display\n const trackId = getConf(track, 'trackId')\n return RenderingComponent ? (\n <div\n className={classes.overlay}\n key={trackId}\n style={{\n height: model.middleComparativeHeight,\n overflow: 'hidden',\n }}\n >\n <RenderingComponent model={display} />\n </div>\n ) : null\n })}\n </>\n )\n})\n\n// The comparative is in the middle of the views\nconst MiddleComparativeView = observer(({ model }: { model: LCV }) => {\n const { classes } = useStyles()\n const { views } = model\n const { pluginManager } = getEnv(model)\n const { ReactComponent } = pluginManager.getViewType(views[0]!.type)!\n\n return (\n <div className={classes.rubberbandContainer}>\n <Header model={model} />\n <Rubberband\n model={model}\n ControlComponent={<div className={classes.rubberbandDiv} />}\n />\n <div className={classes.container}>\n <ReactComponent model={views[0]} />\n <div className={classes.grid}>\n <Overlays model={model} />\n </div>\n <ResizeHandle\n onDrag={n =>\n model.setMiddleComparativeHeight(model.middleComparativeHeight + n)\n }\n style={{\n height: 4,\n background: '#ccc',\n }}\n />\n <ReactComponent model={views[1]} />\n </div>\n </div>\n )\n})\nconst OverlayComparativeView = observer(({ model }: { model: LCV }) => {\n const { classes } = useStyles()\n const { views } = model\n const { pluginManager } = getEnv(model)\n return (\n <div className={classes.rubberbandContainer}>\n <Header model={model} />\n <Rubberband\n model={model}\n ControlComponent={<div className={classes.rubberbandDiv} />}\n />\n\n <div className={classes.container}>\n <div className={classes.content}>\n <div className={classes.relative}>\n {views.map(view => {\n const { ReactComponent } = pluginManager.getViewType(view.type)!\n return <ReactComponent key={view.id} model={view} />\n })}\n </div>\n <Overlays model={model} />\n </div>\n </div>\n </div>\n )\n})\n\nconst LinearComparativeView = observer(function (props: {\n ExtraButtons?: React.ReactNode\n model: LCV\n}) {\n const { model } = props\n\n const middle = model.tracks.some(({ displays }) =>\n displays.some((d: { configuration: AnyConfigurationModel }) =>\n getConf(d, 'middle'),\n ),\n )\n return middle ? (\n <MiddleComparativeView {...props} />\n ) : (\n <OverlayComparativeView {...props} />\n )\n})\n\nexport default LinearComparativeView\n","import React, { lazy } from 'react'\nimport { observer } from 'mobx-react'\n\n// locals\nimport LinearComparativeViewComponent from '../../LinearComparativeView/components/LinearComparativeView'\nimport { LinearSyntenyViewModel } from '../model'\n\nconst ImportForm = lazy(() => import('./ImportForm'))\n\ntype LSV = LinearSyntenyViewModel\n\nconst LinearSyntenyView = observer(({ model }: { model: LSV }) => {\n return !model.initialized ? (\n <ImportForm model={model} />\n ) : (\n <LinearComparativeViewComponent model={model} />\n )\n})\n\nexport default LinearSyntenyView\n"],"names":["useStyles","makeStyles","guide","pointerEvents","height","width","position","zIndex","sm","fontSize","observer","model","coordX","classes","React","Tooltip","open","placement","title","views","map","view","pxToBp","elt","idx","Typography","className","key","JSON","stringify","join","arrow","style","left","background","theme","rubberband","alpha","palette","tertiary","main","textAlign","overflow","rubberbandControl","cursor","minHeight","rubberbandText","color","contrastText","popover","mouseEvents","paper","paddingLeft","spacing","paddingRight","ControlComponent","startX","setStartX","useState","currentX","setCurrentX","anchorPosition","setAnchorPosition","guideX","setGuideX","controlsRef","useRef","rubberbandRef","mouseDragging","undefined","mouseDown","event","preventDefault","stopPropagation","relativeX","clientX","target","getBoundingClientRect","mouseMove","mouseOut","forEach","setOffsets","handleClose","useEffect","globalMouseMove","current","globalMouseUp","clientY","offsetX","args","leftPx","rightPx","leftOffset","rightOffset","computeOffsets","window","addEventListener","removeEventListener","Math","abs","Boolean","VerticalGuide","ref","onMouseDown","onMouseOut","onMouseMove","right","leftBpOffset","rightBpOffset","numOfBpSelected","ceil","bpPerPx","Popover","anchorEl","anchorOrigin","vertical","horizontal","transformOrigin","keepMounted","disableRestoreFocus","l","variant","n","i","toLocaleString","Menu","anchorReference","top","onMenuItemClick","_","callback","onClose","menuItems","rubberBandMenuItems","headerBar","gridArea","display","spacer","flexGrow","iconButton","margin","bp","alignItems","marginLeft","searchContainer","searchBox","TrackSelector","CascadingMenuButton","label","onClick","activateTrackSelector","TrackSelectorIcon","menuAnchorEl","setMenuAnchorEl","anyShowHeaders","some","hideHeader","IconButton","currentTarget","MoreVertIcon","id","SearchBox","showHelp","round","coarseTotalBp","_event","headerMenuItems","container","overlay","content","grid","relative","rubberbandContainer","rubberbandDiv","action","disabledBackground","selected","Overlays","tracks","track","displays","RenderingComponent","trackId","getConf","middleComparativeHeight","MiddleComparativeView","pluginManager","getEnv","ReactComponent","getViewType","type","Header","Rubberband","ResizeHandle","onDrag","setMiddleComparativeHeight","OverlayComparativeView","props","d","ImportForm","lazy","initialized","LinearComparativeViewComponent"],"sourceRoot":""}