Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrthoMCL - Custom tree-table for OrthoGroup page #904

Merged
merged 162 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 142 commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
7ac2d3e
made a start - WIP
bobular Mar 1, 2024
2f4bc1f
re-render sequence table with Mesa
bobular Mar 4, 2024
4340f10
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Mar 4, 2024
3498348
tweak comments
bobular Mar 4, 2024
dc1731f
WIP
bobular Mar 4, 2024
785a9ed
loosely wire in TreeTable and get shimmimg working
bobular Mar 5, 2024
8c3d330
add patristic and basic type support
bobular Mar 5, 2024
adb464a
made a start with controlling table row height but should investigate…
bobular Mar 8, 2024
f215762
added Mesa table tooltips for td contents when in 'inline' mode (basi…
bobular Mar 8, 2024
1abea4b
use Mesa's inline option and tidy up
bobular Mar 8, 2024
ded7a66
Revert "added Mesa table tooltips for td contents when in 'inline' mo…
bobular Mar 8, 2024
a7c0e1b
remove placeholder td title
bobular Mar 8, 2024
a19369e
restore whitespace in DataCell.tsx
bobular Mar 8, 2024
5c04215
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Mar 8, 2024
5f908bd
upgrade tidytree and use new interactive option
bobular Mar 15, 2024
89d17a7
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Mar 15, 2024
ea9283d
table and tree order are the same
bobular Mar 15, 2024
76bfe05
added basic checkboxes
bobular Mar 15, 2024
cdc9d49
WIP clustal form
bobular Mar 19, 2024
1495c07
that's hopefully clustal sorted - but can't test with local ortho-site
bobular Mar 19, 2024
57f6a10
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Mar 20, 2024
8831695
improve 'must select two proteins' verbiage
bobular Mar 20, 2024
5c896a0
de-complicate .DataTable margin-bottom override
bobular Mar 20, 2024
fd446f8
rename TreeResponse to GroupTreeResponse
bobular Mar 20, 2024
a36c6ad
add PFam domain architecture column
bobular Mar 20, 2024
f489066
ugly search working as a demo on description column
bobular Mar 20, 2024
c06178d
add warning banner for data issue and tweak pfam column heading
bobular Mar 25, 2024
2599155
used RealTimeSearchBox and made regexps safer and reorganised so we c…
bobular Mar 25, 2024
7668085
more memo and remove some commented code
bobular Mar 25, 2024
95ac689
add tree filtering
bobular Mar 25, 2024
0a15ccb
tree highlighting works with filtering now, dependency issues fixed
bobular Mar 25, 2024
0c8639b
add core/peripheral filtering
bobular Mar 25, 2024
f137fa2
added pfam legend - needs wiring still
bobular Mar 25, 2024
b4e30ed
wired up pfam checkboxes to table search
bobular Mar 25, 2024
c97bcc1
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Mar 26, 2024
0599d1b
added the row count
bobular Mar 26, 2024
6bef0de
conditionally render pfam legend and add heading
bobular Mar 26, 2024
4f1e80e
Remove vert scrollbar from tidytree table
dmfalke Mar 27, 2024
8a27952
Merge branch 'main' into orthogroup-tree-table
bobular May 29, 2024
c0cb043
remove code that collapsed the main section of the orthogroup page
bobular May 29, 2024
3e47e2c
no longer request trees for 1 or 2 sequences; fix RowCounter props ch…
bobular May 29, 2024
40eacc1
fudge to sort table based on dodgy colon-containing full_ids
bobular Jun 4, 2024
8ff24e2
make tree darker and make tree/table check more robust
bobular Jun 6, 2024
fcdddbd
provide PFam descriptions in domain cartoon tooltips
bobular Jun 6, 2024
032c479
sort out row counts
bobular Jun 6, 2024
9f3d563
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Jun 6, 2024
7bf58f4
add better console logging for tree/table mismatches
bobular Jun 11, 2024
e6904a1
made tree-table comparison for console more robust
bobular Jun 11, 2024
06f4959
add inlineUseTooltips options prop but not working fully yet
bobular Jun 19, 2024
9ecec3d
attempted better handling of very large groups
bobular Jun 19, 2024
30da70a
looks good now
bobular Jun 21, 2024
443528c
removed full_id column (from display only) and added Accession aka se…
bobular Jun 24, 2024
e7abcb9
Merge pull request #1115 from VEuPathDB/mesa-inline-changes
bobular Jun 24, 2024
9567b62
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
dmfalke Jun 28, 2024
5de59a6
Use flex for label to allow for block children
dmfalke Jun 28, 2024
2e33989
Use SelectList for Pfam filter
dmfalke Jun 28, 2024
f33f711
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Jul 2, 2024
5e04d5f
Explicit empty PFam legend
bobular Jul 2, 2024
5a49184
Merge branch 'main' into orthogroup-tree-table
bobular Jul 2, 2024
5cf07bf
Use similar style for core/peripheral filter
dmfalke Jul 12, 2024
0cbb71d
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
dmfalke Jul 12, 2024
592ef2d
Merge branch 'orthogroup-tree-table' into orthogroup-tree-table__pfam…
dmfalke Jul 12, 2024
b316022
Add species filter to protein table
dmfalke Jul 16, 2024
a422072
prevent overflow in SelectTree button with many items selected; also …
bobular Jul 17, 2024
c50a85e
add shouldOnlyUpdateOnClose option to SelectTree
bobular Jul 17, 2024
96056a2
remove some unused imports
bobular Jul 17, 2024
8c05b0c
add MAX_SEQUENCES_FOR_TREE logic
bobular Jul 17, 2024
0620543
selected row highlighting
bobular Jul 17, 2024
871583e
tone down the row background color
bobular Jul 17, 2024
f00a872
Merge pull request #1140 from VEuPathDB/orthogroup-tree-table__pfam-f…
bobular Jul 18, 2024
6d50fca
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Jul 18, 2024
11deb34
don't indent search bar and filters
bobular Jul 19, 2024
a718914
add instantUpdate option to SelectList
bobular Jul 19, 2024
d168e75
Merge remote-tracking branch 'origin/orthogroup-tree-table' into orth…
bobular Jul 19, 2024
9c5ff46
revert taxon filter to instant-update
bobular Jul 19, 2024
de9d761
instantUpdate for core/peripheral filter
bobular Jul 19, 2024
9281471
Pfam architectures are now scaled by protein length
bobular Jul 19, 2024
789629b
removed core-only filter for larger groups
bobular Jul 19, 2024
209fd02
improved table sort and filter performance - added comments about fur…
bobular Aug 1, 2024
3874c5a
rename shouldOnlyUpdateOnClose to instantUpdate
bobular Aug 2, 2024
d45f975
remove an effect
bobular Aug 2, 2024
f9a19b7
Merge remote-tracking branch 'origin/orthogroup-tree-table' into orth…
bobular Aug 2, 2024
eb238e5
missed a setSelected and dependency
bobular Aug 2, 2024
66e13f2
final tweaks to button label behaviour
bobular Aug 2, 2024
969db0d
Merge pull request #1144 from VEuPathDB/ortho-instant-filters
bobular Aug 2, 2024
febb312
add reset button, revisit filter button layout
bobular Aug 3, 2024
58711a0
placeholder wrapper for image next to group stats
bobular Aug 9, 2024
5e310a1
restore the buttonless phyletic distribution
bobular Aug 9, 2024
700e277
improved comment/documentation
bobular Aug 9, 2024
3c75ebd
Merge pull request #1171 from VEuPathDB/ortho-restore-phyletic-section
bobular Aug 13, 2024
46d8b26
merge origin/main and resolve conflicts
bobular Aug 14, 2024
39da8f7
Merge branch 'orthogroup-tree-table' into ortho-stats-wrapper
bobular Aug 14, 2024
8c8f3a3
Adding update evalue histogram
Aug 15, 2024
704acd0
Merge remote-tracking branch 'origin/orthogroup-tree-table' into orth…
bobular Aug 16, 2024
15f0df3
static histogram image now shows, with elaborate width-setting for ca…
bobular Aug 16, 2024
eff237e
make caption rendering smoother - no horizontal shifting of the figure
bobular Aug 16, 2024
144c838
moved png file again
bobular Aug 16, 2024
65b065d
simplified to hardcoded dimensions
bobular Aug 16, 2024
0452f8d
Merge branch 'main' into orthogroup-tree-table
dmfalke Aug 21, 2024
9e6d939
Address typescript errors
dmfalke Aug 21, 2024
3a68137
Merge pull request #1169 from VEuPathDB/ortho-stats-wrapper
bobular Aug 27, 2024
7508ad7
remove taxon_abbrev column
bobular Aug 28, 2024
7f758f4
rename Taxon column to Clade
bobular Aug 28, 2024
0eb1a70
rename Species filter button to Organism
bobular Aug 28, 2024
c368e92
improve filter button layout, especially when buttons have expanded c…
bobular Aug 28, 2024
dd0c40a
fix Omit prop typo that wasn't detected because only consumer so far …
bobular Aug 29, 2024
d3f421b
main proteins table now has fully-fledged search box with column sele…
bobular Aug 29, 2024
6f0cad6
moved styling to .scss file
bobular Aug 29, 2024
0e09962
revert column changes now that model is updated OrthoMCLModel#5
bobular Aug 30, 2024
dacbd81
Merge pull request #1194 from VEuPathDB/ortho-table-tweaks
bobular Aug 30, 2024
4cce0b1
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
bobular Aug 30, 2024
c02d237
added new WDK record scope - record-collapsed
bobular Sep 7, 2024
5121654
added Dave's suggestions
bobular Sep 25, 2024
8b79cb6
Merge pull request #1199 from VEuPathDB/wdk-record-collapsed-scope
bobular Sep 25, 2024
506dd66
merge in npm action change
bobular Sep 25, 2024
07934e8
cherry picking missed this line
bobular Sep 26, 2024
85dc60e
Orthogroup tree table perf (#1233)
dmfalke Oct 18, 2024
d79d21c
Only call anchorNode.scrollIntoView() if the position has changed
dmfalke Oct 22, 2024
083d7e6
Update note to handle MIN_SEQUENCES_FOR_TREE
dmfalke Oct 22, 2024
fa46c14
useDeferredValue partially working
bobular Oct 22, 2024
4b73e5a
onSpeciesSelected wasn't stable, is now
bobular Oct 23, 2024
981507f
replace debouncing with deferred value for CheckboxTree searchTerm
bobular Oct 23, 2024
b1c0891
tidy up
bobular Oct 23, 2024
09d935b
new useDeferredState hook
bobular Oct 24, 2024
4638fed
Use fixed dimensions for organism filter of protein table
dmfalke Oct 24, 2024
8b024bc
Merge pull request #1243 from VEuPathDB/orthogroup-tree-table__useDef…
bobular Oct 24, 2024
355d5a4
the very basics
bobular Oct 28, 2024
f5ee686
straw man ready
bobular Oct 28, 2024
fccec4c
forgot the reset button
bobular Oct 28, 2024
ca400d5
DRYed up a bit
bobular Oct 28, 2024
ab88a2a
fixed the edge case as described in PR, improved search box responsiv…
bobular Oct 29, 2024
2f60de7
text search field selectors now more responsive
bobular Oct 29, 2024
72e4740
added asterisk and improved filter positioning
bobular Oct 31, 2024
c22b905
fixed broken logic with corePeripheral filter
bobular Oct 31, 2024
f6f9153
memoized rowsByAccession and mesaState and fixed some logic errors
bobular Oct 31, 2024
337348e
memoize treeProps just for tidiness
bobular Oct 31, 2024
2520735
replaced the key hack with ref approach
bobular Oct 31, 2024
07a9a6d
Merge pull request #1252 from VEuPathDB/orthogroup-tree-table__protei…
bobular Oct 31, 2024
4e825c0
Orthogroup tree table - tooltips (#1253)
dmfalke Oct 31, 2024
5e04a76
new warning added, no new component, sorry
bobular Nov 1, 2024
bbd65ea
improved tree error warning with link to contact form
bobular Nov 1, 2024
564f453
use display names in SelectList button labels
bobular Nov 1, 2024
6907790
standardised search behaviour with help text
bobular Nov 1, 2024
5bd7d1c
fixed broken protein popover with useImperativeHandle deps array
bobular Nov 1, 2024
494e55d
Merge remote-tracking branch 'origin/orthogroup-tree-table' into orth…
bobular Nov 1, 2024
25def36
protein filter and paged table interaction fixed
bobular Nov 1, 2024
075fff3
fixed label display issue in EDA
bobular Nov 2, 2024
470ff89
Convert to function component with simple debounce logic using setTim…
dmfalke Nov 2, 2024
07a8363
Make callbacks stable across renders
dmfalke Nov 2, 2024
0c382ac
Merge remote-tracking branch 'origin/orthogroup-tree-table' into orth…
bobular Nov 5, 2024
997837d
target _blank
bobular Nov 5, 2024
2e76120
fix import path
bobular Nov 5, 2024
6b8f7f4
show table for 1 or 2 protein groups, not the error. Changes to Check…
bobular Nov 5, 2024
5deced2
changes to CheckboxList/SelectList generics 2 of 2
bobular Nov 5, 2024
4557b84
reset button also cancels text search
bobular Nov 5, 2024
2fa75aa
error banner was showing instead of loading spinner for large groups,…
bobular Nov 5, 2024
7ef7b0e
use const for min seqs in tree
bobular Nov 6, 2024
d24c342
Merge pull request #1259 from VEuPathDB/orthogroup-tree-table__1254-f…
bobular Nov 6, 2024
81ed37c
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
dmfalke Nov 7, 2024
655c269
Remove style override that is no longer necessary
dmfalke Nov 7, 2024
4a83f7d
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
dmfalke Nov 10, 2024
8abb5d6
Merge remote-tracking branch 'origin/main' into orthogroup-tree-table
dmfalke Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/npm-publish-sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

name: NPM Publish Sites
on:
release:
types:
- published
push:
tags:
- v*

jobs:
# Gather the names of the sites directories and store it as an output variable
Expand Down Expand Up @@ -51,15 +51,11 @@ jobs:
elif [[ "$git_tag" =~ ^[0-9]+\.[0-9]+\.[0-9]+-([a-zA-Z0-9]+)(\.[0-9]+)*$ ]]; then
npm_tag="${BASH_REMATCH[1]}"
echo "npm_tag=$npm_tag" >> $GITHUB_ENV
# if prerelease is checked, use "prerelease" for the npm tag
elif ${{ github.event.release.prerelease }}; then
echo "npm_tag=prerelease" >> $GITHUB_ENV
# or fall back to 'latest' just in case
else
echo "npm_tag=latest" >> $GITHUB_ENV
fi
- uses: JS-DevTools/npm-publish@v2
if: ${{ startsWith(github.event.release.tag_name, 'v') }}
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ typings/

# dotenv environment variables file
.env
.env~
.env.test
.env.test~
.env.local
.env.local~

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
2 changes: 1 addition & 1 deletion packages/libs/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"react-spring": "^9.7.1",
"react-transition-group": "^4.4.1",
"shape2geohash": "^1.2.5",
"tidytree": "github:d-callan/TidyTree"
"tidytree": "https://github.com/d-callan/TidyTree.git#commit=9063e2df3d93c72743702a6d8f43169a1461e5b0"
},
"files": [
"lib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface SelectedRangeControlProps
enforceBounds?: boolean;
/** show a clear button, optional, default is true */
showClearButton?: boolean;
/** display 'inclusive' after the from/to inputs */
inclusive?: boolean;
}

export default function SelectedRangeControl({
Expand All @@ -33,6 +35,7 @@ export default function SelectedRangeControl({
enforceBounds = false,
showClearButton = true,
containerStyles,
inclusive = false,
}: SelectedRangeControlProps) {
const validator = enforceBounds
? undefined
Expand Down Expand Up @@ -67,6 +70,7 @@ export default function SelectedRangeControl({
showClearButton={showClearButton}
containerStyles={containerStyles}
validator={validator}
inclusive={inclusive}
/>
) : (
<NumberRangeInput
Expand All @@ -77,6 +81,7 @@ export default function SelectedRangeControl({
showClearButton={showClearButton}
containerStyles={containerStyles}
validator={validator}
inclusive={inclusive}
/>
)}
</LabelledGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useLayoutEffect, useRef } from 'react';
import { CSSProperties, useEffect, useLayoutEffect, useRef } from 'react';
import { TidyTree as TidyTreeJS } from 'tidytree';

export interface HorizontalDendrogramProps {
Expand All @@ -19,6 +19,7 @@ export interface HorizontalDendrogramProps {
for now just default to all zero margins (left-most edges
*/
margin?: [number, number, number, number];
interactive?: boolean;
};

/// The remaining props are handled with a redraw: ///
Expand All @@ -31,10 +32,21 @@ export interface HorizontalDendrogramProps {
* width of tree in pixels
*/
width: number;
/**
* hopefully temporary prop that we can get rid of when we understand the
* horizontal layout behaviour of the tree (with respect to number of nodes)
* which will come with testing with more examples. Defaults to 1.0
* update: possibly wasn't needed in the end!
*/
hStretch?: number;
/**
* number of pixels height taken per leaf
*/
rowHeight: number;
/**
* CSS styles for the container div
*/
containerStyles?: CSSProperties;
/**
* which leaf nodes to highlight
*/
Expand All @@ -43,6 +55,10 @@ export interface HorizontalDendrogramProps {
* highlight whole subtrees ('monophyletic') or just leaves ('none')
*/
highlightMode?: 'monophyletic' | 'none';
/**
* highlight color (optional - default is tidytree's yellow/orange)
*/
highlightColor?: string;
}

/**
Expand All @@ -57,9 +73,12 @@ export function HorizontalDendrogram({
leafCount,
rowHeight,
width,
options: { ruler = false, margin = [0, 0, 0, 0] },
options: { ruler = false, margin = [0, 0, 0, 0], interactive = true },
highlightedNodeIds,
highlightMode,
highlightColor,
hStretch = 1.0,
containerStyles,
}: HorizontalDendrogramProps) {
const containerRef = useRef<HTMLDivElement>(null);
const tidyTreeRef = useRef<TidyTreeJS>();
Expand All @@ -80,13 +99,15 @@ export function HorizontalDendrogram({
equidistantLeaves: true,
ruler,
margin,
hStretch,
animation: 0, // it's naff and it reveals edge lengths/weights momentarily
interactive,
});
tidyTreeRef.current = instance;
return function cleanup() {
instance.destroy();
};
}, [data, ruler, margin]);
}, [data, ruler, margin, hStretch, interactive, containerRef]);

// redraw when the container size changes
// useLayoutEffect ensures that the redraw is not called for brand new TidyTreeJS objects
Expand All @@ -106,19 +127,23 @@ export function HorizontalDendrogram({
tidyTreeRef.current.setColorOptions({
nodeColorMode: 'predicate',
branchColorMode: highlightMode ?? 'none',
highlightColor: highlightColor,
leavesOnly: true,
predicate: (node) => highlightedNodeIds.includes(node.__data__.data.id),
defaultBranchColor: '#333',
});
// no redraw needed, setColorOptions does it
}
}, [highlightedNodeIds, highlightMode, tidyTreeRef]);
}, [highlightedNodeIds, highlightMode, tidyTreeRef, data]);
// `data` not used in effect but needed to trigger recoloring

const containerHeight = leafCount * rowHeight;
return (
<div
style={{
width: width + 'px',
height: containerHeight + 'px',
...containerStyles,
}}
ref={containerRef}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.TreeTable {
--tree-table-row-height: 1em;
tr {
height: var(--tree-table-row-height);
}
}
99 changes: 58 additions & 41 deletions packages/libs/components/src/components/tidytree/TreeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ import {
} from '../../components/tidytree/HorizontalDendrogram';
import Mesa from '@veupathdb/coreui/lib/components/Mesa';
import { MesaStateProps } from '../../../../coreui/lib/components/Mesa/types';
import { css as classNameStyle, cx } from '@emotion/css';
import { css as globalStyle, Global } from '@emotion/react';

import './TreeTable.scss';

export interface TreeTableProps<RowType> {
/**
* number of pixels vertical space for each row of the table and tree
* (for the table this is a minimum height, so make sure table content doesn't wrap)
* required; no default; minimum seems to be 42; suggested value: 45
*/
rowHeight: number;
/**
* number of pixels max width for table columns; defaults to 200
*/
maxColumnWidth?: number;
/**
* data and options for the tree
*/
Expand All @@ -25,8 +30,18 @@ export interface TreeTableProps<RowType> {
* data and options for the table
*/
tableProps: MesaStateProps<RowType>;
/**
* hide the tree (but keep its horizontal space); default = false
*/
hideTree?: boolean;
/**
* Passed as children to the `Mesa` component
*/
children?: React.ReactNode;
}

const margin: [number, number, number, number] = [0, 10, 0, 10];

/**
* main props are
* data: string; // Newick format tree
Expand All @@ -42,50 +57,52 @@ export interface TreeTableProps<RowType> {
* - allow additional Mesa props and options to be passed
*/
export default function TreeTable<RowType>(props: TreeTableProps<RowType>) {
const { rowHeight } = props;
const { rows } = props.tableProps;

const rowStyleClassName = useMemo(
() =>
cx(
classNameStyle({
height: rowHeight + 'px',
background: 'yellow',
})
),
[rowHeight]
);
const { rowHeight, maxColumnWidth = 200, hideTree = false, children } = props;
const { rows, filteredRows } = props.tableProps;

// tableState is just the tableProps with an extra CSS class
// to make sure the height is consistent with the tree
const tableState: MesaStateProps<RowType> = {
...props.tableProps,
options: {
...props.tableProps.options,
deriveRowClassName: (_) => rowStyleClassName,
},
};

return (
<div
style={{ display: 'flex', alignItems: 'flex-end', flexDirection: 'row' }}
>
const tableState: MesaStateProps<RowType> = useMemo(() => {
const tree = hideTree ? null : (
<HorizontalDendrogram
{...props.treeProps}
rowHeight={rowHeight}
leafCount={rows.length}
options={{ margin: [0, 10, 0, 10] }}
leafCount={filteredRows?.length ?? rows.length}
options={{ margin, interactive: false }}
/>
<>
<Global
styles={globalStyle`
.DataTable {
margin-bottom: 0px !important;
}
`}
/>
<Mesa state={tableState} />
</>
</div>
);
);

return {
...props.tableProps,
options: {
...props.tableProps.options,
className: 'TreeTable',
style: {
'--tree-table-row-height': rowHeight + 'px',
} as React.CSSProperties,
inline: true,
// TO DO: explore event delegation to avoid each tooltip having handlers
// replace inline mode's inline styling with emotion classes
inlineUseTooltips: true,
inlineMaxHeight: `${rowHeight}px`,
inlineMaxWidth: `${maxColumnWidth}px`,
marginContent: tree,
},
};
}, [
filteredRows?.length,
hideTree,
maxColumnWidth,
props.tableProps,
props.treeProps,
rowHeight,
rows.length,
]);

// if `hideTree` is used more dynamically than at present
// (for example if the user sorts the table)
// then the table container styling will need
// { marginLeft: hideTree ? props.treeProps.width : 0 }
// to stop the table jumping around horizontally
return <Mesa state={tableState} children={children} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface ColorOptions {
branchColorMode: 'monophyletic' | 'none';
highlightColor?: string;
defaultNodeColor?: string;
defaultBranchColor?: string;
}

declare module 'tidytree' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export type BaseProps<M extends NumberOrDateRange> = {
disabled?: boolean;
/** specify the height of the input element */
inputHeight?: number;
/** add 'inclusive' text after the second range box */
inclusive?: boolean;
};

export type NumberRangeInputProps = BaseProps<NumberRange> & { step?: number };
Expand Down Expand Up @@ -89,6 +91,7 @@ function BaseInput({
// add disabled prop to disable input fields
disabled = false,
inputHeight,
inclusive = false,
...props
}: BaseInputProps) {
if (validator && required)
Expand Down Expand Up @@ -268,6 +271,23 @@ function BaseInput({
inputHeight={inputHeight}
/>
)}
{inclusive && (
<div style={{ display: 'flex', flexDirection: 'row' }}>
{/* change margin */}
<div
style={{
margin: 'auto 10px',
}}
>
<Typography
variant="button"
style={{ color: disabled ? MEDIUM_GRAY : DARKEST_GRAY }}
>
inclusive
</Typography>
</div>
</div>
)}
{showClearButton && (
<Button
type={'outlined'}
Expand Down
Loading