Skip to content

Commit

Permalink
feat: add "text-all" choice to sampleTakenGuide option
Browse files Browse the repository at this point in the history
Shows the "Sample taken" text in all samples.
  • Loading branch information
tuner committed Jan 19, 2025
1 parent 84fa971 commit 1f94482
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/gui/gui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,12 @@ export function setupGui(
layoutFolder.add(layoutProps, "showLegend");
layoutFolder.add(layoutProps, "phylogenyColorScheme");
layoutFolder.add(layoutProps, "phylogenyHueOffset", 0, 360);
layoutFolder.add(layoutProps, "sampleTakenGuide", ["none", "line", "text"]);
layoutFolder.add(layoutProps, "sampleTakenGuide", [
"none",
"line",
"text",
"text-all",
]);
layoutFolder.add(layoutProps, "showRankTitles");
layoutFolder.add(layoutProps, "normalsAtPhylogenyRoot");
layoutFolder.onChange(onPatientChange);
Expand Down
3 changes: 3 additions & 0 deletions src/jellyfish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,9 @@ function drawSamples(
layoutProps.tentacleWidth,
node == sampleTakenGuidePlacement
? "all"
: node.type == NODE_TYPES.REAL_SAMPLE &&
layoutProps.sampleTakenGuide == "text-all"
? "all"
: node.type == NODE_TYPES.REAL_SAMPLE &&
layoutProps.sampleTakenGuide != "none"
? "line"
Expand Down
3 changes: 2 additions & 1 deletion src/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ export interface LayoutProperties extends BellPlotProperties {
* `"none"` for no guides,
* `"line"` for a faint dashed line in all samples,
* `"text"` same as line, but with a text label in one of the samples.
* `"text-all"` same as text, but with a text label in all samples.
*
* @default "text"
*/
sampleTakenGuide: "none" | "line" | "text";
sampleTakenGuide: "none" | "line" | "text" | "text-all";

/**
* Whether to show rank titles above the samples (if provided).
Expand Down

0 comments on commit 1f94482

Please sign in to comment.