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

Tree: Allow customizing info panel entries #1729

Open
victorlin opened this issue Nov 17, 2023 · 2 comments
Open

Tree: Allow customizing info panel entries #1729

victorlin opened this issue Nov 17, 2023 · 2 comments
Labels
enhancement New feature or request source: discussion forum Issue mentioned on Nextstrain Discussions

Comments

@victorlin
Copy link
Member

victorlin commented Nov 17, 2023

Context

Currently this is hardcoded:

  • For hover (except for one entry that changes with the Color By)

    {selectedNode.type === "tip" ? (
    <>
    <StrainName name={node.name}/>
    <VaccineInfo node={node} t={t}/>
    <TipMutations node={node} t={t}/>
    <BranchLength node={node} t={t}/>
    <ColorBy node={node} colorBy={colorBy} colorByConfidence={colorByConfidence} colorScale={colorScale} colorings={colorings}/>
    <AttributionInfo node={node}/>
    <Comment>{t("Click on tip to display more info")}</Comment>
    </>
    ) : (
    <>
    <BranchDescendents node={node} t={t}/>
    <BranchMutations node={node} geneSortFn={geneSortFn} observedMutations={observedMutations} t={t}/>
    <BranchLength node={node} t={t}/>
    <ColorBy node={node} colorBy={colorBy} colorByConfidence={colorByConfidence} colorScale={colorScale} colorings={colorings}/>
    <Comment>
    {idxOfInViewRootNode === node.arrayIdx ? t('Click to zoom out to parent clade') : t('Click to zoom into clade')}
    </Comment>
    <Comment>{t("Shift + Click to display more info")}</Comment>
    </>
    )}

  • For click

    <table>
    <tbody>
    {!isTip && item(t("Number of terminal tips"), node.fullTipCount)}
    {isTip && <VaccineInfo node={node} t={t}/>}
    <SampleDate isTerminal={isTerminal} node={node} t={t}/>
    {!isTip && item("Node name", node.name)}
    {isTip && <PublicationInfo node={node} t={t}/>}
    {getTraitsToDisplay(node).map((trait) => (
    <Trait node={node} trait={trait} colorings={colorings} key={trait} isTerminal={isTerminal}/>
    ))}
    {isTip && <AccessionAndUrl node={node}/>}
    {item("", "")}
    </tbody>
    </table>
    <MutationTable node={node} geneSortFn={geneSortFn} isTip={isTip} observedMutations={observedMutations}/>

Description

Allow customization of all entries in the dataset JSON.

Mentions

@victorlin victorlin added the enhancement New feature or request label Nov 17, 2023
@victorlin victorlin added the source: discussion forum Issue mentioned on Nextstrain Discussions label Oct 31, 2024
@jameshadfield
Copy link
Member

Allow customization of all entries in the dataset JSON.

Can someone expand on this? (It came up again on a call with CDC this morning.)

The on-hover box shows a subset of information to keep it a manageable size - is the desire to customise what appears in this box? If so, should these customisations override the defaults or be added above/below/between them?

The on-click box/modal shows all the information (as it can be scrolled). Is the desire to allow the order to be customised here? If so, should it just affect the ordering of the node-attrs (code here) or should one also be able to change the order of where strain/sample-date etc appear?

@emmahodcroft
Copy link
Member

My 2c:

My main interest would be in customizing the on-hover box -- often we are always interested in country, for example, no matter what colour value is shown (esp if exploring muts)

  • If it wouldn't impede Auspice functionality explicitly we could let people overload the on-hover box if they want (at their own loss of visibility) - hopefully they will make the right choice and only add a couple of extra fields/change order?
  • The on-click box I'd suggest allowing re-ordering of node-attrs - but it would be helpful to know if people really want to move (or remove?) things like the muts lists and strain name - I personally would not (I'm happy with the on-click box as-is)

@victorlin victorlin changed the title Tree: Add ability to customize tip/branch hover panel entries Tree: Allow customizing info panel entries Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request source: discussion forum Issue mentioned on Nextstrain Discussions
Projects
None yet
Development

No branches or pull requests

3 participants